Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun Mar 18, 2018 4:07 am

All times are UTC

Post new topic  Reply to topic  [ 1 post ] 
Author Message
 Post subject: Server - Main Game Loop
PostPosted: Thu Dec 07, 2006 5:58 pm 
Traffic Manager
Traffic Manager
User avatar

Joined: Fri May 26, 2006 3:54 pm
Posts: 221
Location: Perth, Australia
When the game is being run, the server acts like a black box and just does stuff while looking really dull.
while (game == active)
   tickframe()         'FPS nominal?
   if newday then tickday()   'day = ? ticks
   if newmonth then tickmonth()   'month = 28/9/ 30/1 days
   if newyear the tickyear()   'year = startdate + yearsplayed

if game != active
   tell everyone the game has finished
   clean up

   update all vehicles
      broken down?
         update counter
         counter finished?
            make no longer broken down
      at station?
         just arrived?
            add $ if del. complete

      otherwise - move

   will vehicle breakdown today? (should breakdown probability be in days?)
      make broken down, reset counter
   stock market stuff
   update daily town stuff

   update industry
   update monthly counters
   update economic indicators
   interest repayments, etc
   update monthly town stuff
   update year counters
   update all yearly depedent parameters

I want to leave discussion about server <-> client interaction until later...

Have I missed anything? (I know I have...)

Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.