# Class Structure & Design Patterns for MPRTS game

**URL:** <https://forum.kirupa.com/t/class-structure-design-patterns-for-mprts-game/171844>\
**Category:** programming\
**Created:** [December 8, 2005, 5:34pm UTC](https://forum.kirupa.com/t/class-structure-design-patterns-for-mprts-game/171844 "2005-12-08T17:34:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwopitz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jwopitz/32/1556_2.png) [@jwopitz](https://forum.kirupa.com/u/jwopitz)\
**Post date:** [December 8, 2005, 5:34pm UTC](https://forum.kirupa.com/t/class-structure-design-patterns-for-mprts-game/171844/1 "2005-12-08T17:34:31Z")

</div>

Hi. I was searching around the forums to see if there was a good tutorial on how to organize classes for a RTS game. I didn’t find any tutorials that really touch on this subject.

Basically I want to desing/develop a Multi-Player Real-Time or Turn-Based strategy game. I have the ideas all sketched out, the development part pretty well planned and I have started a few classes, but I don’t really know how to approach putting all the classes together. I have been reading ‘The OO Thought Process’ by Matt Weisfeld and ‘Essential AS2.0’ by Moock, but I am a little stuck as to where to go after reading about these design patterns:

[list]  
[_]Observer  
[_]Singleton  
[_]Model-View-Controller  
[_]Delegation Event Model  
[/list]The game will use attack/defend rules much like board-based games i.e. Hero’s Quest or Warhammer 40k. The GUI and basic look/feel will be much like Homeworld 2 or Diablo 2 (top-down or iso, not sure yet). So far I have created the following classes:  
[list]  
[_]Unit - represents a soldier (will be inherited by subclasses for more specialized troops) - see uploaded ex.  
[_]UnitMenu - brings up the commands avail to Unit class  
[_]RangeFinder - GUI class that indicates if certain commands are avail to Unit based on Unit’s range based vars  
[_]Map - (not a class yet) - this will represent the terrain, Units, obstacles and battle events. For an example: [http://www.jwopitz.com/map/map.html](http://www.jwopitz.com/map/map.html)  
[/list]So given the basic idea of the game, can anyone recommend a good design pattern that would work best. I just don’t know the pros/cons to each design pattern to really start putting it together.

Also if you are interested in working on this with me, email me at [j@jwopitz.com](mailto:j@jwopitz.com).
