Jump to content

  • Log In with Google      Sign In   
  • Create Account


basic architecture for a simulation


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 hawkeye_de   Members   -  Reputation: 190

Like
0Likes
Like

Posted 08 April 2012 - 01:59 AM

Hi,

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 ? Posted Image

Thanks a lot.

Sponsor:

#2 hawkeye_de   Members   -  Reputation: 190

Like
0Likes
Like

Posted 08 April 2012 - 02:34 AM

Ok, I found this interesting arcticle: http://altdevblogaday.com/2011/07/03/threading-and-your-game-loop/




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS