GamePreload vs. GameStart

GamePreload vs. GameStart

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

GamePreload vs. GameStart

Post by Argh »

What are the differences between these two? I assume GameStart means Frame 1 now?

[EDIT] I just tested with World Builder, and seems to speed it up by a teeny amount. So... is it safe to do synced stuff like Unit creation during Preload, or will that desync people in MP? [/EDIT]
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: GamePreload vs. GameStart

Post by Tobi »

Not much, just the moment when they run.

I found that:

Code: Select all

function gadget:Initialize()
	-- This is executed first, just after gadget is loaded
end

function gadget:GamePreload()
	-- This is executed BEFORE headquarters / commander is spawned
end

function gadget:GameStart()
	-- This is executed AFTER headquarters / commander is spawned
end
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: GamePreload vs. GameStart

Post by jK »

GamePreload is pretty useless, it gets called while the LoadingScreen is visible. And in the case the widget/gadget is activated in that phase, it is called after Initialize() (if you enable the widget in a running game GamePreload won't get called again).

And GameStart is pretty similar to GameFrame == 1.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: GamePreload vs. GameStart

Post by Argh »

OK, that's pretty much what I was thinking.

Loading before the Commander is pretty important.
Post Reply

Return to “Engine”