Joined: 01 Jun 2005, 10:36 Location: The Netherlands
In the next major version the engine will not bother with start units or start metal/energy anymore.
This change has been made to clean up an ugly deprecated piece of engine code, and because spawning start units the way the engine did was not flexible, leading to many games writing gadgets to actually remove the engine spawned start unit only to replace it with a new one.
More reasons and details about the changes can be found in the three related commits:
I've made an example gadget that should be pretty much a drop in replacement for the removed engine functionality for many games. (It honours startmetal/startenergy mod options, custom team keys, honours sidedata, shouldn't error if sidedata doesn't specify a start unit, etc.)
Modify it as desired (different way to determine start resources/storage, spawn multiple units, calculate optimal build facing for the start unit, etc.), in particular try to get rid of ugly hacks like re-spawning start units.
If I've missed an important feature someone relied upon please let us know.
EDIT: Link to example gadget updated and added the commit containing zwzsg's improvements to the list of commits above.
will this break spawning random commanders? When u pick the random side in the lobby,ingame,It replaces your initial commander with a random one,core or arm.
Joined: 01 Jun 2005, 10:36 Location: The Netherlands
Oh, btw, one other thing.
The fact that this gadget now handles StartMetal and StartEnergy, also means I have removed StartMetal and StartEnergy from EngineOptions.lua (since it isn't an engine option anymore...)
So please copy the relevant parts of EngineOptions.lua to ModOptions.lua (if desired). If you already override EngineOptions.lua or override the options in ModOptions.lua then this is irrelevant of course.
The relevant part of EngineOptions.lua, right before I removed it:
Code:
{ key = 'StartingResources', name = 'Starting Resources', desc = 'Sets storage and amount of resources that players will start with', type = 'section', },
{ key = 'StartMetal', name = 'Starting metal', desc = 'Determines amount of metal and metal storage that each player will start with', type = 'number', section= 'StartingResources', def = 1000, min = 0, max = 10000, step = 1, -- quantization is aligned to the def value -- (step <= 0) means that there is no quantization }, { key = 'StartMetal', scope = 'team', name = 'Team Starting metal', desc = 'Determines amount of metal and metal storage this team will start with', type = 'number', section= 'StartingResources', def = 1000, min = 0, max = 10000, step = 1, -- quantization is aligned to the def value -- (step <= 0) means that there is no quantization }, { key = 'StartEnergy', name = 'Starting energy', desc = 'Determines amount of energy and energy storage that each player will start with', type = 'number', section= 'StartingResources', def = 1000, min = 0, max = 10000, step = 1, -- quantization is aligned to the def value -- (step <= 0) means that there is no quantization }, { key = 'StartEnergy', scope = 'team', name = 'Team Starting energy', desc = 'Determines amount of energy and energy storage that this team will start with', type = 'number', section= 'StartingResources', def = 1000, min = 0, max = 10000, step = 1, -- quantization is aligned to the def value -- (step <= 0) means that there is no quantization },
mhh .. have without problems managed the migration from modinfo.tdf to .lua on different old mods that not more maintained....
But this change i cant handle easy Have as a example depacked BA7.11 to BA711.SSD dir and on a test the game starts - but without units/resources. This was expectet ... Now i copyed the game_spawn.lua to Luarules/gadgets/ ... Now the units (the commander) apear - but still no resources .........? and i know the BA mod WILL updatet to work flawles, but i need to understand this to fix a couple of old mods to work with the new system. (if its not TO MUCH work - still like primary to PLAY spring and dont code it ... )
And no, Every rts game engine, in most cases the game and game engine are the same thing, since spring is only an engine though it's going to remove functionality in and of itself for spawning starting units, and people will have to use a gadget to spawn starting units?
Joined: 01 Jun 2005, 10:36 Location: The Netherlands
Because the way engine spawned starting units was less flexible than having some gadget spawn starting units.
For example: in many games engine spawned starting unit was immediately removed after it was spawned only to spawn a new starting unit facing another direction.
Another example: random faction is usually implemented by removing engine spawned starting unit, picking a random faction and then spawning the startunit of that faction at the same place.
If the game would respawn anyway then it isn't really needed for engine to spawn units in the first place. (Besides, the code that did this was in a very confusing part of the loading procedure, which could use a cleanup or removal.)
Users browsing this forum: No registered users and 0 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