Project Description
A 2D game engine written in C# and XNA. Features animated sprite capability and physics simulation by FarseerPhysics. Includes a level editor, a GUI controls library and a sample RTS game, Factions. Contains A* pathfinding for unit movement and an ants system for AI navigation.
The DEngine requires XNA 3.0 Runtime: http://www.microsoft.com/downloads/details.aspx?FamilyID=6521d889-5414-49b8-ab32-e3fff05a4c50&displaylang=en
and the .NET 3.5 Framework: http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&displaylang=en
You will also need to install the fonts Miramonte and Miramonte Bold from the XNA Redistributable Fonts pack: http://creators.xna.com/en-GB/contentpack/fontpack
These fonts are also included with the source code, in the file "RedistributableTTFs.zip".
Documentation
The Documentation will give you an idea how to use the DEngine to make your own 2D game.
DEngine Overview
The DEngine is a 2D engine work-in-progress that includes physics simulation and a level editor for Windows.
The DEngine uses Tiles, Actors and Backgrounds to make up a game world. These are defined using images and XML files as defined in the included sample game, Factions.
Read the full Documentation for more info.
The DEngine also includes a set of GUI objects that you can use in your game, they are contained in the project DGui.
The Factions game includes robust multi-unit pathfinding code, an ants system for enemy navigation, a minimap, and capable of playing (fairly) large maps.
The gameplay is currently near-nonexistant it is merely a tech demo! So, you can't yet build units. But units placed on the game board can be controlled and will fight with enemy units. The enemy will also attack you.
Currently I'm also using a sprite that I shouldn't be - it's a Doom sprite - but keep in mind this is a tech demo and I needed placeholder art. It is not intended to be a commercial game.
Hopefully people may find useful code in here to use in their own game. Hack it apart as you wish!
Outstanding Issues / Future Work
There are numerous issues with this code as it currently stands.
Thanks to:
A 2D game engine written in C# and XNA. Features animated sprite capability and physics simulation by FarseerPhysics. Includes a level editor, a GUI controls library and a sample RTS game, Factions. Contains A* pathfinding for unit movement and an ants system for AI navigation.
The DEngine requires XNA 3.0 Runtime: http://www.microsoft.com/downloads/details.aspx?FamilyID=6521d889-5414-49b8-ab32-e3fff05a4c50&displaylang=en
and the .NET 3.5 Framework: http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&displaylang=en
You will also need to install the fonts Miramonte and Miramonte Bold from the XNA Redistributable Fonts pack: http://creators.xna.com/en-GB/contentpack/fontpack
These fonts are also included with the source code, in the file "RedistributableTTFs.zip".
Documentation
The Documentation will give you an idea how to use the DEngine to make your own 2D game.
DEngine Overview
The DEngine is a 2D engine work-in-progress that includes physics simulation and a level editor for Windows.
Image may be NSFW. Clik here to view. ![]() |
---|
The DEditor main window. |
The DEngine uses Tiles, Actors and Backgrounds to make up a game world. These are defined using images and XML files as defined in the included sample game, Factions.
Read the full Documentation for more info.
The DEngine also includes a set of GUI objects that you can use in your game, they are contained in the project DGui.
Image may be NSFW. Clik here to view. ![]() |
---|
The New Skirmish Game menu for Factions. |
The Factions game includes robust multi-unit pathfinding code, an ants system for enemy navigation, a minimap, and capable of playing (fairly) large maps.
The gameplay is currently near-nonexistant it is merely a tech demo! So, you can't yet build units. But units placed on the game board can be controlled and will fight with enemy units. The enemy will also attack you.
Image may be NSFW. Clik here to view. ![]() |
---|
In-game screenshot of Factions. |
Currently I'm also using a sprite that I shouldn't be - it's a Doom sprite - but keep in mind this is a tech demo and I needed placeholder art. It is not intended to be a commercial game.
Hopefully people may find useful code in here to use in their own game. Hack it apart as you wish!
Outstanding Issues / Future Work
There are numerous issues with this code as it currently stands.
- Memory management for GUI objects is terrible. The game will run out of memory if you open and close a menu screen repeatedly. Version 1.1.1 has gone a long way to fixing this but there are still leaks.
- There is still a situation in which a transition tile is not added correctly to an interior corner.
- XML data for levels, actors, and tile transitions are not compiled with the XNA content processor. This is not a big deal but allows the user to modify game data which will become a problem when multiplayer code is written.
- The DEditor currently uses some "magic numbers" to correct the mouse coordinates in the editor window. It will work under Windows 7 but users of Windows XP will find that there is a bit of an offset between the mouse cursor and the tile placement/actor placement indicator!
- Effects such as bullet impacts and tank turret fire are Actors. This is undesirable as Actors are physically simulated. It would be best to introduce another class called Effect which is not physically simulated. The game currently causes version 2.1.1 of FarseerPhysics to throw an exception; I suspect this is because of the rapid adding/removal of bodies to the physics simulator.
- Z-priority! A proper rendering order with respect to units and terrain needs to be written. Should be able to have units be rendered in front of or behind other units/terrain.
- General code cleanup is required.
Thanks to:
- http://www.codeplex.com/FarseerPhysics - The Farseer Physics engine which handles all the physical simulation in the DEngine.
- http://www.ziggyware.com/readarticle.php?article_id=130&rowstart=0 - mdx4ever for his SceneGraph tutorial.
- http://www.gamedev.net/reference/articles/article934.asp - Gamedev for their excellent article which I drew upon for the terrain transitions.