Server - Main Game Loop

Development discussion about Transport Empire. Other discussion to General forum please.

Moderator: Transport Empire Moderators

Post Reply
User avatar
aarona
Traffic Manager
Traffic Manager
Posts: 221
Joined: 26 May 2006 15:54
Location: Perth, Australia
Contact:

Server - Main Game Loop

Post by aarona »

When the game is being run, the server acts like a black box and just does stuff while looking really dull.

Code: Select all

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
	end

tickframe()
	update all vehicles
		broken down?
			update counter
			counter finished?
				make no longer broken down
		at station?
			just arrived?
				add $ if del. complete
			load/unload

		otherwise - move
			

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

tickmonth()
	update industry
	update monthly counters
	update economic indicators
	interest repayments, etc
	update monthly town stuff
	
tickyear()
	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...)
Post Reply

Return to “Transport Empire Development”

Who is online

Users browsing this forum: No registered users and 6 guests