dimanche 7 janvier 2018

C++Design Pattern example using game logic with console application

I have a great amount of resources involving design patterns for C++. I have a few Udemy Courses, and many books. My problem is I'm not finding any tutorials on design patterns (with source code) involving game development. I was hoping someone knows of a tutorial/project with full source code, implementing all (if not most) of Modern GoF design patterns in a mock console application, emulating how it all would work.

Building design patterns for Graphics, Input, Entities, AI behaviors, ect. But to make it easy just display std::count statement's showing how it all can link together.

With the massive amount of resources and books (I don't like the game patterns book) I got a better grasp on them in a general implementation. But applying this to a simple game engine (better yet a mock Console Engine) is where I freeze up.

I've searched for something that would please all my requirements, but I just can't find anything like this. Which surprises me, because I would think as a time savior on code, and making it easy for followers, this would be a great way of teaching.

Of the patterns (I still need my hand held) I have the hardest time understanding how someone would implement component systems. I'm perhaps not searching for the right keywords for this, but most of the time no implementation is provided and just description. What I gather is this would be how you could assign for example "Special Enhancements" to an object without writing more code and easily remove it. I've seen talk about having GraphicsComponent, InputComponent, SoundComponent, ect for just about everything, which makes me think ether this design is totally different than the patterns or they used the patterns to create the Components to be able to attach them. From what I can tell you often see this talked about a lot with the Composite design (at least I see it brought up during this topic a lot)

I have 3 books specifically about games and implementing design patterns. SFML Game Development by example, Mastering Game Development by example, and Game Development and Best Practices. I have finished the 1st one from start to finish. Although from all the other resources, the way they implement the designs from what I have seen, seems way more complex. I still am not even 100% how they retrieve input just reading from a text file in that book. Which is why a mock console engine, just founds perfect to me. The mastering book is basically the same as the first book mentioned, with the addition of OpenGL special effects.

Best Practices seemed great, it even named the sections of the engine by Design Pattern. The problem with this, was the engine was giant involving OpenGL and the book gave simple snippets that once again did not benefit me. They didn't talk about building the engine, as the engine was rather big to begin with and was specifically about adding the design patterns.

I am going to read Practical C++ Design by Adam B. Singer. I've just been holding off because I had some problem with QT Creator (finally corrected). It looks like a winner, but I just wanted to see if anyone could direct me to something related to my "Dream tutorial." After that I plan to go through Clean Code 2nd Edition. There are some C# ones that look rather good as well, and after looking at the examples the code looks pretty easy to translate to C++

Other then that I'll have to take my resources and just work on applying them all myself in a "Mock Console Engine." If anyone can't help with my request, perhaps narrowing the sequence of what to use for what section and order of how I could do this all using a majority of the patterns.

Thanks, Have a great weekend!

Aucun commentaire:

Enregistrer un commentaire