Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are some good resources on 2D game engine design?

Tags:

c++

directx

I'm messing around with 2D game development using C++ and DirectX in my spare time. I'm finding that the enterprisey problem domain modeling approach doesn't help as much as I'd like ;)

I'm more or less looking for a "best practices" equivalent to basic game engine design. How entities should interact with each other, how animations and sounds should be represented in an ideal world, and so on.

Anyone have good resources they can recommend?

like image 519
Gabriel Isenberg Avatar asked Oct 07 '08 18:10

Gabriel Isenberg


People also ask

What does a 2D game engine need?

Well, the few features pretty much any 2D engine needs: Loading and displaying sprites (including animations) Loading and playing sounds. Loading and playing music.


1 Answers

Gamedev.net is usually where I turn to get an idea of what other people in the game development community are doing.

That said, I'm afraid that you'll find that the idea of "best practices" in game development is more volatile than most. Games tend to be such specialized applications that it's near impossible to give any "one size fits all" answers. What works great for Tetris is going to be useless with Asteroids, and a model that works perfectly for Halo is likely to fail miserably for Mario.

You'll also find quickly that there's no such thing as an "industry standard" for texture, mesh, level, sound, or animation formats. Everyone just rolls their own or uses whatever is convenient to the platform. You do occasionally see things like COLLADA, which is nice, but it's still just an intermediate format designed to make writing exporters easier.

If you're new to game development, my advice would be this: Don't kill yourself over your code structure on your first go. Try a simple game, like asteroids, and just hack away until it works, no matter how "ugly" the code is. Use simple formats that you are familiar with without worrying about how well they'll hold up in larger projects. Don't worry about plugins, skins, editors, or any of that other fluff. Just make it WORK! Then, when you're done with that first, all important game, pick another, and this time around clean up one or two aspects of your code (but don't go overboard!) From there, iterate!

I promise you that this will get you farther faster than any amount of poking around online for the "right way" ever could (this coming from someone who's done a LOT of poking).

And one last thought for you: If you feel more comfortable working in a more well defined space, take a look at XNA or a similar library. They'll pre-define some of the "best" formats to use and give you tools to work with them, which takes some of the initial guesswork out.

Good luck, and above all else remember: Games (and their development) are supposed to be FUN! Don't get too caught up on the small stuff!

like image 150
Toji Avatar answered Sep 28 '22 04:09

Toji