6 ms·
Game Programming Patterns
- tydok 9y agoI use extensively in my projects the Component decoupling pattern: http://gameprogrammingpatterns.com/component.html http://gameprogrammingpatterns.com/component.html The Observer and Mediator patterns can then be used for wiring components.
- xiaoma 9y agoNice sales page.
- theprotocol 9y agoIt's readable for free (scroll down a bit). I read a bit of it and it's actually very enjoyable.
- xiaoma 9y agoThat makes it an even nicer sales page.
- maaaats 9y agoWow, the free web version looks great. Will give it a read, as all my game projects ends up with me reinventing a game engine or getting stuck with some dataflow that should be a solved problem with a cleaner solution. Like the landing page as well, very clean and to the point.
- HiroshiSan 9y agoWill this book teach me to code videogames? If not where can I learn that before reading this book?
- snowcrshd 9y agoI think this book is better suited to people that have already written a few games. It mostly talks about common patterns that arise during gamedev and how to work with them. IIRC, it shows trade-offs of different approaches. I suggest starting out with Love2d [1]. Docs are good, community is great, lots of tutorials online. There's this guy writing a tutorial series [2] on creating a game with Love2D. Not finished yet, but it is awesome! I think that would be a good place to start. I hope this helps. [1] https://love2d.org https://love2d.org [2] https://github.com/SSYGEA/blog/issues/11 https://github.com/SSYGEA/blog/issues/11
- amelius 9y agoAlso check out the Graphics Gems series.
- jackmott 9y agohandmade hero series of videos might be your best bet. prepare to put in a lot of time!
- NortySpock 9y agoI was just watching a code challenge where a guy tried to make the game of Snake in 15 minutes (it took him 30 minutes.) That introduced me to the P5 JavaScript library, and with that I was able to get up and running with just a web browser, an index.html page, and a script.js file. I'm almost done with my clone of Snake, and after that I think I'd like to try a top-down shooter. I'm thinking of a simple runaway-from-zombies game. Anyways the channel was The Coding Train on Youtube: https://www.youtube.com/watch?v=AaGK-fj-BAM https://www.youtube.com/watch?v=AaGK-fj-BAM Man, it's good to get back to fun side projects!
- felipemnoa 9y agoStart by learning OpenGL. Two resources I would start with are the OpenGL Red Book [1] and NeHe [2] tutorials. The OpenGL Red Book has everything a beginner needs to know about OpenGL and NeHe is a bunch of tutorials that you can study to learn more about the concepts. If you search around the web you should be able to find NeHe examples in your programming language of preference. [1] http://www.opengl-redbook.com/ http://www.opengl-redbook.com/ [2]http://nehe.gamedev.net/ http://nehe.gamedev.net/
- maaaats 9y agoThats way too much complexity to get into game programming. Just start with something where you can draw shapes and images to some canvas, and make it interactive. No need to start with 3d, and at least not the low level 3d stuff. Then you will never actually end up creating something.
- khedoros1 9y agoAgreed. I'm currently teaching myself OpenGL, but only after getting pretty comfortable with using SDL and SFML for 2D graphics (drawing directly to a buffer in SDL, and using SFML to draw textured shapes, sprites, and such). 3D has a whole ton of boilerplate; it's better to start with something a little simpler to experiment with some patterns.
- khedoros1 9y agoI've been using this site and finding it very useful: http://www.opengl-tutorial.org/ http://www.opengl-tutorial.org/ It does a good job explaining how to use OpenGL in the shader pipeline, instead of the legacy fixed pipeline, while also providing a lot of the annoying setup code (initializing the libraries and setting options, loading, compiling, and linking shaders, etc).
- partycoder 9y agonehe tutorials are extremely dated by now, targetting old versions of OpenGL. By no means start with NeHe's tutorials. The tutorials will compile and render stuff in the screen, but learning this in 2017 will do no good as all those APIs are now deprecated and I wouldn't be surprised if drivers start removing OpenGL 1. You should be learning OpenGL 3+ or Vulkan.
- netgusto 9y agoThis is from the same fine gentleman that gives us http://www.craftinginterpreters.com/ http://www.craftinginterpreters.com/ Thank you so much for your work.
- kgabis 9y agoGreat book. I recommend buying a paper/ebook version to support the author. His writing style is very concise and funny so it's easy to follow and it reads very fast. The only thing I didn't like is that for code examples he uses C++ with unnecessary classes where vanilla C functions would've been sufficient, but I understand his reasoning for doing so ("It is the lingua franca of the industry"). Does anyone have any recommendations for other books about game engine design?
- shadowmint 9y agoI don't know. I have such mixed feelings about this; it's free... but, I don't actually think it's... good? I mean, it's well written, and it has examples that try to tie it into practical examples, and thats good, but there are just lots of little technical details that I find are slightly off. For example, a considerable amount of time is devote to showing that the 'observer' pattern isn't a bad idea. ...but, although its not always a bad idea, there are a number of people (see [1]) who have comprehensively covered why it is troublesome. On the prototype pattern: > With all of these options, I honestly can’t say I’ve found a case where I felt the Prototype design pattern was the best answer. Maybe your experience will be different, but for now let’s put that away and talk about something else: prototypes as a language paradigm. ...what? Then why did you bring it up at all? Each of the chapters is really long, covering what is really quite basic material mixed in with some kind of questionable content and some examples... but no actual working code to show how to use the examples. I like https://en.wikipedia.org/wiki/Software_design_pattern https://en.wikipedia.org/wiki/Software_design_pattern ...I'd like this too, if it was just... I don't know. Slightly more technically sharp and less rambling? Surely you could cut down the discussion slightly, show a practical example of where each pattern is actually useful that actually compiles, and just drop any patterns that... aren't useful, and you'd have an excellent book. [1] - https://infoscience.epfl.ch/record/148043/files/DeprecatingObserversTR2010.pdf https://infoscience.epfl.ch/record/148043/files/DeprecatingO...
- aidos 9y agoMaybe it depends on your experience / field? I don't do C++ or games programming generally so for me it was amazing. I'd actually go so far as to say it's one of my favourite technical books of all time. The style is great and I went away with lots to think about. So for anyone that's thinking of giving it a miss based on my parents comment - I'd recommend you read it yourself (it's free) to make your own judgement.
- zimzim 9y ago>On the prototype pattern: >... >..what? Then why did you bring it up at all? From the intro: "Prototyping — slapping together code that’s just barely functional enough to answer a design question — is a perfectly legitimate programming practice. There is a very large caveat, though. If you write throwaway code, you must ensure you’re able to throw it away." Prototyping — coding without architecture in mind? I dont find it relevant to his book.
- wheresvic1 9y agoWhat did you use to generate the web version of the book?
- msangi 9y agoHave a look at the author's blog and at the book repository on GitHub http://journal.stuffwithstuff.com/category/book/ http://journal.stuffwithstuff.com/category/book/ https://github.com/munificent/game-programming-patterns https://github.com/munificent/game-programming-patterns
- seibelj 9y agoThis is an excellent programming book, even if you don't intend to make games. Highly recommend
- yoodenvranx 9y agoYes, the "game" part of the title is slightly misleading. I have never touched any game related code and I still found the book very helpful.
- gravypod 9y agoI had to come here after reading up to the "Command" interface idea. This book has a lot of things that look good on a 3 to 4 element case but, when scaled up, will become unwieldy. Adding all of this complexity to button clicks does not sound very intuitive. The original if statement wasn't either but the Command interface wasn't a good replacement. I've always liked using event systems for handling actions like this. C++ would probably be a great language to implement a fast priority based, cancellable, and event system. For something along the lines of what I'm talking about see [1]. It's not perfect (you need a dispatcher for every event) but it still better captures the idea that "Something happens and it triggers N many actions". Maybe it's just different style. Maybe it's just different ways of thinking about the problem. Maybe it's just that I'm not a gamedev and I work in a different sector. [1] - https://codereview.stackexchange.com/questions/118628/c14-event-system https://codereview.stackexchange.com/questions/118628/c14-ev...
- ghusbands 9y agoGiven that the book talks about it being used for controller buttons and for undoable actions in strategy games and editors, performance is not a significant concern and event-dispatchers are insufficient. Your comment is not particularly on-topic.
- gravypod 9y ago> Given that the book talks about it being used for controller buttons and for undoable actions in strategy games and editors The state should be managed by a UI object if you're talking about calling up UIs. The key presses will be subscribed to in that object and, when the event is triggered, the UI object takes over. Then the button is clicked again the UI object can undo whatever state it has created. > performance is not a significant concern Performance isn't my concern. My concern is that you've created 6 new classes to handle 5 button clicks. That sort of class bloating makes it very difficulty to enter the code base (lots of unneeded wrappers for actions). It also decouples the action from the object that the action is built for. This spreading doesn't make sense to me. The UI object should handle all things UI. The player's object should handle all things player. A Command object shouldn't be extended by 10 other objects who all touch different objects doing different things. > event-dispatchers are insufficient Why? > Your comment is not particularly on-topic. It is. I am talking about how I only got a few pages in and found it to be promoting patterns I'd consider harmful which either use an abstraction that doesn't fit the problem, or do things that make it very hard to enter a new code base.
- justinhj 9y agoI jumped into a few topics at random and this seems like a good book, definitely filled the void it intended too. When I was getting into game programming in the early 90s there was literally nothing for me in the book store specifically about game programming.
- partycoder 9y ago"What is software architecture". Just skip all that part and refer to ISO/IEC 42010 instead. This description of software architecture is the equivalent of the Industrial Revolution description from Adam Sandler's movie "Billy Madison". In fact, 99% of people speaking about software architecture haven't even bothered to read the actual definition of it. I read this book some years ago: https://www.amazon.com/3-0-Design-Patterns-Real-World-Problems/dp/059652773X https://www.amazon.com/3-0-Design-Patterns-Real-World-Proble... , it's rather dated now (from 2008, targetting C# 3.0), but illustrates patterns well with clear, concise and self-contained code and a more general approach.
- IE6 9y agoSomewhat related - are there similar resources for other other kinds of software?