Jump to content
  • Advertisement
Sign in to follow this  

basic architecture for a simulation

This topic is 2746 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


I'm currently into developing a simulation game (no 3D, it is a tactical 2D 'map-centric' simulation for Android tablets in C# (Mono).

Since I am new to game development (but not to development in general) I'd have a basic question how to align the simulation engine and the UI.

According to the Android development model I have an own thread for rendering the 2D canvas (view, representing the map and later may be also other graphical stations), a GUI thread(which takes care about rendering the overall UI and reacts on user input).

My plan is now run the simulation engine in an own thread (game loop), which, let's assume, updates the simulation world every 1/60 seconds.

I'm currently struggeling now how to align the thread, which draws the map (by using objects, which are updated by the simulation engine) with the simulation thread.

My basic concern is how to sync them...I mean when the UI thread starts to draw the stuff, the simulation thread might already be in the next 'game cycle', thus the game world is not consistent since it is currently in the process of being updated.

I think there must be already well defined patterns available but I did not succeed to find them in the net.
Can anybody help me here ? smile.png

Thanks a lot.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!