Server - Main Game Loop

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

Moderator: Transport Empire Moderators

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

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

	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...)
Post Reply

Return to “Transport Empire Development”

Who is online

Users browsing this forum: No registered users and 0 guests