RE: Lua animation (cob replacement)

RE: Lua animation (cob replacement)

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

Moderator: Moderators

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

RE: Lua animation (cob replacement)

Post by FLOZi »

Was any progress ever made on this?
Was an API ever drawn up?
If not, it'd be a good idea to get some game dev suggestions on it imo.
Or will it be totally outdated by the introduction of new model formats?

(And no I'm not promising to have the time/patience/skills to finally implement this :wink: )
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: RE: Lua animation (cob replacement)

Post by AF »

Im sure trepan has mentioned this though I dont remember exactly what he said or whether he had code on his machine or not
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: RE: Lua animation (cob replacement)

Post by trepan »

I had it coded to the point where lua could be used to
replace all COB functionality (and with per-unit scripting
as an option). It's been a while since I wrote the code,
and so there are a lot of conflicts against the current git
repository. The patch results can be found here:
http://trepan.bzflag.bz/spring-patch-log.txt

The LuaUnitScript code also required significant changes
to the lua script base code for speed enhancements.

I don't have any plans to reintegrate the code, a.t.m. ;-)
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Re: RE: Lua animation (cob replacement)

Post by BrainDamage »

what about publishing such code somewhere so someone else could integrate it?
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: RE: Lua animation (cob replacement)

Post by trepan »

not likely
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: RE: Lua animation (cob replacement)

Post by Argh »

I'm pretty much of the opinion that finished MD5 support's more important long-term anyhow.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Re: RE: Lua animation (cob replacement)

Post by jcnossen »

I'm pretty much of the opinion that finished MD5 support's more important long-term anyhow.
Isn't that a different category? This is about animation of models. MD5 contains both model data and animation, but still needs to be animated with COB-like code to do things like aim animations.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: RE: Lua animation (cob replacement)

Post by Argh »

Fair enough. I just always figured we were going to want to do that with COB, tbh. After all, why reinvent that wheel?
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: RE: Lua animation (cob replacement)

Post by Pxtl »

Argh wrote:Fair enough. I just always figured we were going to want to do that with COB, tbh. After all, why reinvent that wheel?
Wouldn't it be nicer for new developers to only need one language to work with Spring, instead of three?

We've already abandoned FBI/TDF. With lua-animation, it would all be unified as Lua.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: RE: Lua animation (cob replacement)

Post by Argh »

Sure, that would be nice.

I'm just thinking how long the engine would probably have to recover from all of the inevitable bugs that would follow such a sweeping change. I mean... COB's full of tricky nastiness that would have to be replicated for stuff not to get broken everywhere. Pretty grim prospect, that.

But I can totally see Lua used as the control language for MD5 stuff, and basically just leave COB as a legacy tool.
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: RE: Lua animation (cob replacement)

Post by trepan »

FWIW, the approach that I took was a safe one. Created a UnitScript
interface class, with a 'float' based API. Then sub-classed it into
CobUnitScript and LuaUnitScript. CobUnitScript did the ugly integer/
float conversions required for COB scripts.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: RE: Lua animation (cob replacement)

Post by AF »

It would make supreme commander units much easier to support ^_^
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: RE: Lua animation (cob replacement)

Post by jK »

trepan wrote:FWIW, the approach that I took was a safe one. Created a UnitScript
interface class, with a 'float' based API. Then sub-classed it into
CobUnitScript and LuaUnitScript. CobUnitScript did the ugly integer/
float conversions required for COB scripts.
that was one part of my model handling abstraction ^^
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: RE: Lua animation (cob replacement)

Post by smoth »

Pxtl wrote:Wouldn't it be nicer for new developers to only need one language to work with Spring, instead of three?
With zero examples it will raise the learning curve greatly. It would also mean that in order for people to learn anything from our scripts we would have to convert them all
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: RE: Lua animation (cob replacement)

Post by lurker »

trepan wrote:The LuaUnitScript code also required significant changes to the lua script base code for speed enhancements.
If you mean specific things could you please give an overview?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: RE: Lua animation (cob replacement)

Post by FLOZi »

smoth wrote:
Pxtl wrote:Wouldn't it be nicer for new developers to only need one language to work with Spring, instead of three?
With zero examples it will raise the learning curve greatly. It would also mean that in order for people to learn anything from our scripts we would have to convert them all
It needn't if the API is set up to nicely mirror COB, hence this thread.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: RE: Lua animation (cob replacement)

Post by smoth »

that would be cool, I would still like to see md5 and skeletals first but hey it would be neat.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: RE: Lua animation (cob replacement)

Post by FLOZi »

I also don't particularly understand why trepan can't make the code available to, say, jK, who knows a fair bit about lua, and Springs handling of models. :|
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: RE: Lua animation (cob replacement)

Post by Hoi »

If he's not going to do anything with it, then yeah why not...
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: RE: Lua animation (cob replacement)

Post by Forboding Angel »

I second that wholeheartedly. If lua replaced cob but at the same time supported cob's language it seems like we would all win out.

Cob is kind of like the ass backwards html of spring. Easy to read and understand, but it does things in such a weird way that it can be confusing sometimes, that said it would be nice to not be forced to stop using it.

Didn't someone say long ago that cob was orders of magnitude faster than lua (doing the exact same things)?

I agree, scriptor sucks, but it's not "THAT" bad. Tbh what would really rule is if someone would make a cob compiler plugin for a popular text application (like notepad++ for example). A big part of me doubts that that is even possible, but in N++ we could easily set up syntax highlighting and all kinds of really cool stuff.

./pipe dreams
Post Reply

Return to “Engine”