A Tale of Two Fixes.

Can you help improve your favourite game? Hardcore C mages, talented artists, and players with any level of experience are welcome!
nef
Hardened
Posts: 258
Joined: Mon Jun 25, 2018 5:01 pm

Re: A Tale of Two Fixes.

Postby nef » Mon Aug 02, 2021 6:11 pm

Everything to this point has been developed on the experimental version of fc 2.6.0 but has been qualified on fc 2.6.5 using my civ1 ruleset. I see no reason for any problems to occur with any 2.6 ruleset, or indeed, any 3.x ruleset as currently formulated.

Ignatus
Elite
Posts: 495
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: A Tale of Two Fixes.

Postby Ignatus » Mon Aug 02, 2021 11:30 pm

WOW!

Hail the brave knight fighting through this grim dungeon full of treacherous traps and unspeakable monsters!

I once tried to fix fsd but my poor programming skills suspended the work for an indefinite time. I hope you'll provide some progress for HRM#880895 and HRM#819533 that I've abandoned.

Ignatus
Elite
Posts: 495
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: A Tale of Two Fixes.

Postby Ignatus » Tue Aug 03, 2021 6:18 am

I think find.nonexistent() in v.3.1 shall get an optional parameter of (int) pointer, that will become the object's "id". There will be some messup with the id of the deleted real object but it's soluable by the scriptor.

The problem of saving metadata by id while the ruleset might change is a good finding. I doubt it is technically a bug, we can change the rule names as well, but surely debugging scenarios with special rulesets is a mess without saving by name. Thanks! (Though, alas, due to scripting engine poverty there are yet few scripted scenarios for Freeciv any way :( I opened some osdn tickets in attempt to fix that.)

nef
Hardened
Posts: 258
Joined: Mon Jun 25, 2018 5:01 pm

Re: A Tale of Two Fixes.

Postby nef » Mon Aug 09, 2021 5:50 pm

Very generous, but I have the advantage of not having to write anything in c.

I read your script (in the patch) with some interest and I had a real sense of deja vu since many of the features had been considered, but in the end, only a few survived as I progressively discovered the treacherous traps and unspeakable monsters. I think the final result came from not being too ambitious. I reckoned that if scribes were needing tables to be saved then they would be up to writing the _fc_restore function even if that meant creating companion 'instruction' tables. After posting the functions I returned to a project that I had interrupted and discovered a possible oversight: that of signal connections. Mostly these are done by script.lua or default.lua but not always. I think this is doable in fsd but for now I intend to leave it for _fc_restore. (Perhaps someone can inspire me.)

I think find.nonexistent() in v.3.1 shall get an optional parameter of (int) pointer, that will become the object's "id". There will be some messup with the id of the deleted real object but it's soluable by the scriptor.

The problem with find.nonexistent() with an id is that there are three distinct sets which I presume could contain duplicates across the sets. One could mess with shifts in ranges to make them non overlapping but that would be a hack. Still, it may be better than the hack I used. If it`s not too late one could consider adding another arg. indicating the userdata type so that duplicate id`s would create distinct versions of Nonexistent.

The problem of saving metadata by id while the ruleset might change is a good finding. I doubt it is technically a bug, we can change the rule names as well, but surely debugging scenarios with special rulesets is a mess without saving by name.

The point I was trying to make is that preserving rule_name is an acceptable (and necessary) requirement for save file compatibility. The additional requirement of preserving the order of sections is capricious and I regard it as a bug because it leads to restore failures.

Ignatus
Elite
Posts: 495
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: A Tale of Two Fixes.

Postby Ignatus » Sun Sep 19, 2021 6:11 pm