Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Should Be in a 2D Game Engine? [closed]

Tags:

c#

xna

Ok, so I ended up writing my own game engine based on top of XNA, and I am just wondering what else I need to make a complete engine.

This is what's in the engine:

  • Physics (Farseer Physics)
  • Particle Engine (Mercury Project)
  • 2D Cameras
  • Input Handling
  • Screen Management (Menus, Pause Screen, etc.)
  • Sprite ( Animation, Sprite Sheets)
  • And XNA stuff like Sound.

Am I missing anything that might be crucial to a game engine?

like image 549
Khalid Abuhakmeh Avatar asked Apr 13 '09 13:04

Khalid Abuhakmeh


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.

What should a game engine have?

The main functionalities for game engines often include 2D or 3D graphics rendering, physics engine, animation, artificial intelligence, sound, and streaming among others.

What are the features of 2D games?

Characteristics of 2D video games 2D games use flat graphics, called sprites, and don't have three-dimensional geometry. They're drawn to the screen as flat images, and the camera (orthographic camera) has no perspective.


1 Answers

You're approaching it in an upside-down manner.

What should be in your engine is the following:

All the code that turned out to be common between your first and your second game.

First, write a game. Don't write an engine, because, as you have found out, you don't know what it should contain, or how it should be designed. Write a game instead.

Once you have that game, write another game. Then, when you have done that, examine the second game's code. How much of it was reused from the first game?

Anything that was reused should then be refactored out into a separate project. That project is now your game engine.

This doesn't mean that you shouldn't plan, or shouldn't try to write nice code. But make sure you're working towards something concrete, something where you can tell a good implementation from a bad one. A good implementation of a game, is one that works, is fun, and doesn't crash. Write your code to achieve those things first.

A good implementation of an engine? That's trickier. What's a good implementation of a renderer? Of an AI framework? Of a particle system? Ultimately, the only way to determine whether you have a good engine is by seeing how well it works in an actual game. So if you don't have a game, you have no way to evaluate your engine. And if you have no way to evaluate your engine, you have no way of judging whether any of the code you're writing is actually useful.

like image 59
jalf Avatar answered Sep 28 '22 03:09

jalf