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

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
Danquebec
Posts: 6
Joined: Thu Sep 03, 2015 6:02 pm
Location: Québec, Canada

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

Postby Danquebec » Fri Sep 04, 2015 12:25 am

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
Attachments
azeroth-220x140-v1.sav.gz
(3.85 KiB) Downloaded 89 times
Last edited by Danquebec on Sat Sep 05, 2015 2:00 am, edited 1 time in total.

cazfi
Elite
Posts: 1710
Joined: Tue Jan 29, 2013 6:54 pm

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

Postby cazfi » Fri Sep 04, 2015 3:59 am

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.

Danquebec
Posts: 6
Joined: Thu Sep 03, 2015 6:02 pm
Location: Québec, Canada

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

Postby Danquebec » Fri Sep 04, 2015 3:26 pm

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.
Attachments
freeciv_d_3_verbose_load_azeroth.txt
(135.88 KiB) Downloaded 102 times

cazfi
Elite
Posts: 1710
Joined: Tue Jan 29, 2013 6:54 pm

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

Postby cazfi » Fri Sep 04, 2015 10:08 pm

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.

Danquebec
Posts: 6
Joined: Thu Sep 03, 2015 6:02 pm
Location: Québec, Canada

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

Postby Danquebec » Fri Sep 04, 2015 11:22 pm

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..