Live data from Hacker News

“Game Programming Patterns” is now finished

gameprogrammingpatterns.com

61–70 of 75 posts

Re: “Game Programming Patterns” is now finished

#61
post #3

Thanks so much for all of this. It's extremely well put together. I'm still trying to figure out the optimal way to organize every part of a Dwarf Fortress-style simulation (but multi-threaded of course), and I feel like I'm reinventing the wheel somewhat poorly. Component-based design is an important part of that, but there are still so many hairy problems to solve. These are problems which most games don't encounte…

Something you can do with components if you set some strict restrictions is do static or runtime analysis to determine which sets of components are disjoint in terms of systems that access them. For example, if the combat system only needs access to combat components, and the builder system needs pathing and inventory components, then those two systems can run completely in parallel.

One place this is likely to break down is the transform (position) component, but one strategy for that is to differentiate between read-only and write access. Lots of systems need to know where things are (const access) but few need to change where things are (write access). All the systems that can deal with const access can still run in parallel.

The trick here is you have to strictly enforce all this. You CAN'T have a method for getting an arbitrary component from an entity, and this may drive you nuts. Instead you have to have each system specify ahead of time exactly what components it needs and how it uses them, and then hand them those components, and only those components. As soon as you let someone write "entity->GetComponent(Physics)" in leaf code, you've lost your ability to analyse the dependency tree.

For a lot of games, the other problem you're going to run into is that one or two systems are going to take up most of your time and every other system is just going to sit around waiting for those anyway. Usually those are physics and rendering. Which you might be happily avoiding by making a dwarf fortress style game!

I have a coworker who's got a "toy" engine at home that does all this and some other fairly amazing tricks. He says he's going to open source it, still waiting on that. Sorry for this pointless tease, just wishing he'd hurry up out loud.

Re: “Game Programming Patterns” is now finished

#64

Bob, if you're lurking this thread: Congrats. Any idea when I'll be able to buy it? Like the other free-online-first books I've read, I've gotten enough value from it that I'd like to thank you by paying for it.

> Any idea when I'll be able to buy it? As soon as possible! Unfortunately, I don't know how long that will be. I'm going to be typesetting it myself with lots of love using InDesign. I hope the final result will be a really nice book, but it could take me a while. Still, I plan to work on it every single day, so maybe it will go quickly. > I've gotten enough value from it that I'd like to thank you by paying for it.…

this is where marketplaces like fiverr.com really prove their value - you could pay a couple of people 20 bucks each to do a 90% job of typesetting and you could finish it up later.

YMMV - but you dont have a lot to lose. You could be surprised by the time you save.

Re: “Game Programming Patterns” is now finished

#65

Bob, if you're lurking this thread: Congrats. Any idea when I'll be able to buy it? Like the other free-online-first books I've read, I've gotten enough value from it that I'd like to thank you by paying for it.

> Any idea when I'll be able to buy it? As soon as possible! Unfortunately, I don't know how long that will be. I'm going to be typesetting it myself with lots of love using InDesign. I hope the final result will be a really nice book, but it could take me a while. Still, I plan to work on it every single day, so maybe it will go quickly. > I've gotten enough value from it that I'd like to thank you by paying for it.…

> I'm going to be typesetting it myself with lots of love using InDesign.

Have you perhaps considered LaTeX/XeTeX? Would get you incredibly beautiful typeset foundations, then you can customise it a lot further.

Re: “Game Programming Patterns” is now finished

#66
post #55

Good choice of font. I can't stand reading long online material with sans-serif.

Yes, it drives me crazy when people use sans serif fonts for body copy. You need the serifs to help tie the line together!

There are sadly few serif fonts on Google Web Fonts that have consistent letterforms, good metrics, a nice middle-of-the-road x-height, and good bold and italics, but Merriweather is quite nice.

Re: “Game Programming Patterns” is now finished

#67
post #7

Earlier quoted context omitted.

True, always the last 10% consume as much effort as the 90%

"Baseball is 90 percent mental. The other half is physical." -- Yogi Berra Same math applies to software and book-writing

Writing software is 60% understanding the problem, 25% understanding the tools, 20% understainding requirements, and -5% hacking the solution to make it fit requirements.

Re: “Game Programming Patterns” is now finished

#68
love the way this stuff is written. no overloaded jargon. the Command pattern chapter was amazingly straight-forward and everything else learned was immediately applicable to a game project I'm refactoring. hard to say that about many similar books on the subject. bravo! :)
Post reply on HN