# Strategy Game Framework (With Map Generation)

**URL:** <https://forums.unrealengine.com/t/strategy-game-framework-with-map-generation/370271>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [September 13, 2016, 5:38am UTC](https://forums.unrealengine.com/t/strategy-game-framework-with-map-generation/370271 "2016-09-13T05:38:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fishy418](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Fishy418](https://forums.unrealengine.com/u/Fishy418)\
**Post date:** [September 13, 2016, 5:38am UTC](https://forums.unrealengine.com/t/strategy-game-framework-with-map-generation/370271/1 "2016-09-13T05:38:36Z")

</div>

Hi,

I’m creating a 4X turn based space strategy game (like Galactic Civilization, Star Drive, etc) and been looking through all the class types and game framework and I’m starting to get a picture of how things fit together but some examples aren’t very specific to how i want to use it and would love some feedback.

Here are my thoughts on how to currently setup the framework:

- WorldSettings - store game\map config settings, Num Stars\Planets, Galaxy Size, empire count, etc… Though thinking I want these to persist between maps, for menu reading\modifying, should they be in GameInstance, anything else useful I should use World Settings for? Maybe store current galaxies generated parameters for reference, though GameState could do that too easier…?

- GameMode - this will generate the Teams, Units, Start planets, etc. Am I correct using it this way so if I go MP later it will generate units\team\etc that will replicate to all clients?

- GameState - Store an array of all empires, planets, stars, ships and other entities in play - treat like Global Variables. Not sure if this is right or if I should only store replicated Actors and similar here and try to store map objects (Planets, Stars…) elsewhere?

- LevelScript - Use this to generate the Galaxy itself, Stars, Planets, anything that should never or extremely rarely change during play.  
It will grab variables from WorldSettings for galaxy generation parameters and I could have a different map for each galaxy types\layouts, Spiral, Cluster, disc, etc

- GameInstance - Store Base Module\Ship Stats, types, race\empire names\types\bonuses basically any data that could be added to\moddable at some point later

Program Flow will be:

- GameMode calls which level (Galaxy Type) to load, if MP could pass the galaxy gen parameters before loading level, am I right I using this for generating replicated actors etc but don’t really store much data here other than score etc

- Level Script generates galaxy for all stellar bodies, reading GameInstance for parameters and storing arrays of pointers in GameState

- GameMode calls its own “Spawn Content” function which will spawn all start ships, Empires, home planets, etc - also storing arrays of pointers for them in GameState

very rough outline but would love to know if I’m on the right path?

Thanks,
