Page 5 of 7

Re: SaveGame v. 0.4

Posted: 26 Jan 2010, 02:09
by R-TEAM
Hi,
Argh wrote:Sorry, I haven't released that update yet.

Hold on, I'm still tracking the loading bug. It's something wrong with main.lua in the game, which is some ancient copy of CA's main instead of Spring's current. Cutting it out == most of the stuff working, leaving it == no reload. Pretty annoying, but that's curable.
he,he - i know - the mod is longer time not updatet ;)
But i will try to give him save/load .. other mods i will convert (from tdf to lua and then insert save/load) :
arachnomania 0.8f
ESO 0.53
EvolutionRTS 1.09
EE 0.46
MetropolisSpring 0.15
Micro Modules 1.08
SimBase a25.1E4
SmallMod 0.867

;)

Re: SaveGame v. 0.4

Posted: 26 Jan 2010, 02:59
by Argh
OK, I've figured out what's wrong.

I need to a few more tests, but I think I'm pretty close to resolving the problems. I need to do a few more checks to be sure, though, so please be patient.

Re: SaveGame v. 0.4

Posted: 26 Jan 2010, 03:11
by Argh
OK, here's version 0.5- this seems to resolve the problems with old mods that use variant structures for some of the Lua base files, and fixes a couple of deeper issues with GG save-states that weren't exposed earlier.

This should also hopefully mean it gets along with CA / BA and the other games using CA base files as well (yay!).

Seems to operate well with REVELATION; please let me know if this resolves the bugs for you.

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 03:30
by aegis
you realize {} probably isn't the same as nil... and what was wrong with tostring()? that fixed nil string concat issues for me...

and replacing functions with nils doesn't sound like an awesome way to preserve state either <_<

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 03:44
by Argh
1. The tostring doesn't work with [1], basically.

2. Functions aren't causing problems, per se; it's when they're supposed to return something and the result is nil that it's a mess. That breaks the entire Gadget right there and then.

I think that storing a function call in GG is just plain bad design anyhow, and I'm not sure if there is any way to fix that issue.

3. It's obviously not the only problem with GG atm; the other one is unitIDs, and code that expects them to be valid.

I'm "looking forward" to preparing my Squad code to be save-friendly, for example :P

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 05:10
by R-TEAM
Hi,

save now "work" (doing a save ..)
But load still not work, only partialy.
Infolog:
[ 0] invalid added point: Start 2
[ 0] invalid added point: Start 0
[ 0] invalid added point: Start 1
[ 0] <SkirmishAI: AAI 0.9 (team 0)>: water map detected
[ 0] <SkirmishAI: AAI 0.9 (team 0)>: AAI loaded
[ 1] <SkirmishAI: AAI 0.9 (team 0)>: ressurected
[ 1] <SkirmishAI: AAI 0.9 (team 0)>: ressurected
[ 1] <SkirmishAI: AAI 0.9 (team 0)>: ressurected
[ 1] <SkirmishAI: AAI 0.9 (team 0)>: ressurected
[ 1] <SkirmishAI: AAI 0.9 (team 0)>: ressurected
[ 1] LuaRules::RunCallIn: error = 2, GameFrame, [string "savegame1.lua"]:1120: attempt to call field '?' (a nil value)
stack traceback:
[string "savegame1.lua"]:1120: in function 'GameFrame'
[string "LuaRules/gadgets.lua"]:920: in function <[string "LuaRules/gadgets.lua"]:918>
(tail call): ?
[ 31] Skirmish AI "Bot1" took over control of team 0
[ 62] Skirmish AI "Bot2" took over control of team 1

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 06:12
by Argh
What does "partially" mean?

I mean, with AAI, I would be quite surprised if Spring didn't just crash outright.

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 06:15
by R-TEAM
Hi,

yes - this was with AAI .. so it is not supportet ?
And partialy:
Only ~30% of my units/buildings was here.
Mostly on wrong positions and the half with wrong health
status.

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 06:22
by Argh
yes - this was with AAI .. so it is not supportet ?
It's up to AI developers to make sure their code can handle save states.

There's very little we can do about that from the Lua end of things.
And partialy:
Only ~30% of my units/buildings was here.
Mostly on wrong positions and the half with wrong health
status.
That must be related to whatever that message was:
LuaRules::RunCallIn: error = 2, GameFrame, [string "savegame1.lua"]:1120: attempt to call field '?' (a nil value)
stack traceback:
[string "savegame1.lua"]:1120: in function 'GameFrame'
[string "LuaRules/gadgets.lua"]:920: in function <[string "LuaRules/gadgets.lua"]:918>
But I need the savegame file to know why it stopped there.

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 06:36
by R-TEAM
Hi,

have now testet with 2 RAI, the same result , infolog:
[ 1] LuaRules::RunCallIn: error = 2, GameFrame, [string "savegame1.lua"]:1261: attempt to call field '?' (a nil value)
stack traceback:
[string "savegame1.lua"]:1261: in function 'GameFrame'
[string "LuaRules/gadgets.lua"]:920: in function <[string "LuaRules/gadgets.lua"]:918>
(tail call): ?

Savegame File:

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 06:45
by Argh
OK, seems that Spring.AddBuildOrders no longer exists :P I'll get that fixed for the next version, no problem.

So... here... does this savegame run all right?

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 06:55
by Argh
And here's a fix for writesave- should fix that issue for now, so that Factory queues get restored correctly...

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 06:58
by R-TEAM
Hi,

yes - the postet savegame loads flawles, except that the Vehicle-lab
was under build and now it is ready but have not full HP.

Will test the new writesave.lua ....

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 07:00
by Argh
yes - the postet savegame loads flawles, except that the Vehicle-lab
was under build and now it is ready but have not full HP.
Well, that's a problem- I'll look at the build issue. IIRC, didn't somebody say we weren't allowed to set it backwards? I thought that got fixed...

Ah, duh... I needed to set "build" to "true" in CreateUnit(). Here's another fix for that issue... should set Units that aren't built all the way to the correct status.

Still working on GG issues- the squad system in P.U.R.E. is proving to be a pretty good proving-ground for what will have to get done, and thus far it's a bit obnoxious but mainly I think it's just that I'm tired and need to get some sleep now :P

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 07:48
by R-TEAM
Hi,

have nice sleep ;)
and -> the new file stop save working :\
By clicking of save -> nothing happen ..

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 08:02
by Argh
:oops: Fixed. Off to bed now.

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 10:13
by Tobi
Argh wrote:I think that storing a function call in GG is just plain bad design anyhow, and I'm not sure if there is any way to fix that issue.
Where do you put them?
3. It's obviously not the only problem with GG atm; the other one is unitIDs, and code that expects them to be valid.

I'm "looking forward" to preparing my Squad code to be save-friendly, for example :P
Why not just offer each gadget a way to save some of the data it needs and a way to load it, and let the gadget handle what it needs to save from GG, and how it should restore it?

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 10:18
by R-TEAM
Hi,
Argh wrote::oops: Fixed. Off to bed now.
sorry - Nope - Still doing nothing - no save ...

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 16:02
by Argh
Sorry, there must still be another bug, nothing like coding when I'm sleep-deprived 8) I'll take another look in a little while.

Re: SaveGame v. 0.5

Posted: 26 Jan 2010, 16:05
by Argh
Nevermind, that was a 30-second problem... sleep is good.