Even more mod defs flexibility

Even more mod defs flexibility

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Even more mod defs flexibility

Post by trepan »

Code: Select all

* Added 'gamedata/defs.lua'
 - returns a table that contains the UnitDefs, FeatureDefs, and WeaponDefs
 - parsed using CGame::defsParser, and deleted before the game starts
 - allows modders to automate inter-def dependencies
   (ex: feature metal vs. unit metal cost, or fully defined weapons in unitDefs)
Actually, this could have been done before defs.lua was added (with the other
*.lua defs files), but it would have taken a full reload of unitDefs to make them
available to featureDefs (because they were running in different script environments).

http://spring.clan-sy.com/fisheye/chang ... g/?cs=4316
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Hm, can we also get some form of COB parser? With that we could e.g. generate modular units from a set of weapons and chassises but we would still have to manually COB them all.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

It sounds to me like you want a BOS -> COB compiler built into the engine,
and a way to modify the input BOS file before it gets compiled. Could you
explain exactly what you want?

P.S. Implementing my version of your suggestion would probably mean that
it would take significantly longer to load mods with a lot of units.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

What we ultimately need is a JIT for BOS, or a BOS --> LUA solution. I'm more than a little concerned about performance, however- COB may be a stupid language, and lacks some features, but it's very fast, when optimized correctly.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post by trepan »

http://spring.clan-sy.com/phpbb/viewtop ... 589#166589

But's thats not really the point of this thread...
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

trepan wrote:It sounds to me like you want a BOS -> COB compiler built into the engine,
and a way to modify the input BOS file before it gets compiled. Could you
explain exactly what you want?

P.S. Implementing my version of your suggestion would probably mean that
it would take significantly longer to load mods with a lot of units.
Not necessarily modify much, just being able to "copy" a COB would be a good deal (e.g. Spring.LoadCobAs(cobname, newname)). Imagine you have e.g. ten levels of creep and you want to use lua defs to create the defs for the different levels while only making one definition file for the creep type. Now this would be fine except you won't have matching COBs for your different creeps so if you have ten levels of creeps you still need to have the creep1.cob - creep10.cob files and if you decide to add ten more levels you'll have to manually copy those files to creep11.cob and so on.

For handling differences in the intended script behaviour I think it'd be enough to initialize some static-var differently for each creep level and let the scripter have his code branch if he needs that. This part could probably be handled by a LuaRule anyway so any code for that in the def stuff would be merely for convenience.
Post Reply

Return to “Game Development”