Page 1 of 1

[solved] savegame.c errors on loading a map I’ve made

Posted: Fri Sep 04, 2015 12:25 am
by Danquebec
Hello,

I’ve made a map. To make sure it works, I simply took the content of earth-160x90-v2.sav.gz and replaced the map found inside with my own map (I also changed the name and the description, but I expect this shouldn’t cause problems). I even left out the rivers, which I’ve made, to let things as simple as possible so I can know what is bugging. I also left only the Roman starting position there and set it to another coordinate to make sure that I don’t get bugs because of units falling into water.

I have attached my .sav file to this thread.

My version of freeciv is 2.4.4 (1.fc21).

It confuses me that it doesn’t work, since earth-160x90-v2 works, and these two are basically the same save for the different map, the absence of rivers and the start positions. But surely there’s something else I *should* have changed?
There are the errors I get when trying to load the scenario:
[19:33:56] in map_load_tiles() [savegame.c::861]: assertion '0' failed.
[19:33:56] Please report this message at http://gna.org/projects/freeciv/
[19:33:56] Saved game contains incomplete map data. This can happen with old saved games, or it may indicate an invalid saved game file. Proceed at your own risk.
[19:33:56] in map_load_rivers_overlay() [savegame.c::933]: assertion '0' failed.
[19:33:56] Please report this message at http://gna.org/projects/freeciv/
[19:33:56] Saved game contains incomplete map data. This can happen with old saved games, or it may indicate an invalid saved game file. Proceed at your own risk.
Even though I don’t know C, I wanted to take a look at savegame.c hoping I could understand something. I’ve been searching for savegame.c in the sources of Freeciv and I couldn’t find it. I’m confused. The problem is clearly happening at the running of savegame.c, if we are to believe the error message.

I would be grateful if someone could help me with either of my problems.

Daniel

Re: savegame.c errors on loading a map I’ve made

Posted: Fri Sep 04, 2015 3:59 am
by cazfi
server/savegame.c line 861 (and around) in S2_4 HEAD is:

/* get the terrain type */
LOAD_MAP_DATA(ch, line, ptile,
secfile_lookup_str(file, "map.t%03d", line),
ptile->terrain = char2terrain(ch));

That macro seems to have also log_verbose() call describing the exact error (in addition to log_error() giving the message you're already seeing)

Try to run server with commandline parameter "-d 3" to see verbose output.

Re: savegame.c errors on loading a map I’ve made

Posted: Fri Sep 04, 2015 3:26 pm
by Danquebec
In the attached file is what I get as soon as I click on “Ok” when I have selected my scenario, when running freeciv in verbose mode “d 3”.

I personally don’t understand what these messages mean.

Re: savegame.c errors on loading a map I’ve made

Posted: Fri Sep 04, 2015 10:08 pm
by cazfi
Your log seems to be from the client side. Try running server separately (or in this case just attempt to start the server and loading your scenario file)

...

Actually, I had a moment to test it myself with the savegame you had attached to the first post, and I believe this to be the relevant output
3: Line too short (expected 160 got 220)='secfile_lookup_str(file, "map.t%03d", line)'
3: last message repeated 2 times
3: last message repeated 2 times (total 4 repeats)
3: last message repeated 4 times (total 8 repeats)
3: last message repeated 8 times (total 16 repeats)
3: last message repeated 16 times (total 32 repeats)
3: last message repeated 32 times (total 64 repeats)
3: in map_load_tiles() [../../../src.patched/server/savegame.c::861]: last message repeated 25 times (total 89 repeats)
I guess your map.t??? lines are not of correct length for the map dimensions.

Re: savegame.c errors on loading a map I’ve made

Posted: Fri Sep 04, 2015 11:22 pm
by Danquebec
Ok “freeciv-server -d 3” is what I needed. It gives meaningful error messages that I can work with.

I’ll report back if another problem happens or if it works.

EDIT:
Wheeee it works! \o/ I corrected the problems with my scenario according to the error messages. Thank you a lot cazfi.

So for others having the same problem:
To get meaningful error messages, open your terminal, type the command “freeciv-server -d 3” (“LC_ALL=C freeciv-server -d 3” to get the messages in English). Then type “/load /some/folder/your_map.sav.gz” and you will see meaningful error messages..