Terrain file edit error

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
Post Reply
ahfretheim
Posts: 49
Joined: Sat Apr 05, 2014 9:29 pm

Terrain file edit error

Post by ahfretheim »

I'm trying to adjust movement points to make my ruleset more accurate for Cavalry and Armor, and so the only change I make to the terrain file is increasing movement cost for several terrain types to values as high as 4, 5 or 6. Freeciv ends up crashing when I try to run the ruleset. I replace with the original terrain file, and the ruleset loads without error, so I know the error is in the terrain file. Again, all I changed was the value for movement cost. Is there some flaw in the FreeCiv server that makes it unable to handle larger values?

Oh, and I'm running 2.3.
User avatar
Corbeau
Elite
Posts: 1293
Joined: Mon Jan 13, 2014 11:13 pm

Re: Terrain file edit error

Post by Corbeau »

What comes to mind are stupid things such as: what editor were you using, did you end up with paragraph breaks instead of line breaks (or vice versa), what format was the file saved in (maybe it looks like txt but is actually rtf or something...)
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
ahfretheim
Posts: 49
Joined: Sat Apr 05, 2014 9:29 pm

Re: Terrain file edit error

Post by ahfretheim »

Corbeau wrote:What comes to mind are stupid things such as: what editor were you using, did you end up with paragraph breaks instead of line breaks (or vice versa), what format was the file saved in (maybe it looks like txt but is actually rtf or something...)
Thank you for your thoughtful response. I was using Notepad (which has worked well for most of my other edits in making this ruleset) and its saved as a .ruleset file extension. I've looked it over a million times and it doesn't seem to have any particular artifacts of any other format left over - everything in clean numbers. Anyways, thanks for your help.
User avatar
Corbeau
Elite
Posts: 1293
Joined: Mon Jan 13, 2014 11:13 pm

Re: Terrain file edit error

Post by Corbeau »

You got me curious. Can you attach the file here?
--
* Freeciv LongTurn, a community of one-turn-per-day players and developers
* LongTurn Blog - information nexus with stuff and stuff and stuff
* Longturn Discord server; real-time chatting, discussing, quarrelling, trolling, gaslighting...
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: Terrain file edit error

Post by JTN »

ahfretheim wrote:Freeciv ends up crashing when I try to run the ruleset.
What kind of crash? For most syntax errors you should get some sort of helpful error message.

Have you tried starting a standalone freeciv-server?

If you edit the default ruleset and introduce an error, the server can't start. If you're spawning the server from the client ("Start New Game"), you won't see any useful diagnostics from the server, it'll just fail to start the game. If you start a standalone freeciv-server you should see the error messages.

(If you're on Windows you'll want to start freeciv-server from a command line rather than the start menu, or the freeciv-server window with the error messages will disappear as soon as the server quits.)
User avatar
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Terrain file edit error

Post by Alien Valkyrie »

ahfretheim wrote:
Corbeau wrote:What comes to mind are stupid things such as: what editor were you using, did you end up with paragraph breaks instead of line breaks (or vice versa), what format was the file saved in (maybe it looks like txt but is actually rtf or something...)
Thank you for your thoughtful response. I was using Notepad (which has worked well for most of my other edits in making this ruleset) and its saved as a .ruleset file extension. I've looked it over a million times and it doesn't seem to have any particular artifacts of any other format left over - everything in clean numbers. Anyways, thanks for your help.
Are you sure there aren't any incorrect line breaks (freeciv always has LF only I think) or something? Also, did you make sure that there's a line break after the last (content) line, so that the very last line is empty?

On a different note, did you edit any kind of help texts or the ruleset description or something? After debugging for a painfully long time yesterday I found out that the ruleset description can't be longer than (probably) 4096 characters, and that didn't give me a user-understandable error message. Perhaps some text in your ruleset is too long now.

Also, if you haven't modified the default/classic ruleset, what you can do is load the ruleset (which will cause you to crash to the main menu) and the click "Start new game" again to see the console. Or, of course, as JTN posted above, start a server.
~ AVL
ahfretheim
Posts: 49
Joined: Sat Apr 05, 2014 9:29 pm

Re: Terrain file edit error

Post by ahfretheim »

Corbeau wrote:You got me curious. Can you attach the file here?
I'll do that, and thank you, your help is much appreciated!

FYI: The actual original is a .ruleset but this forum won't allow me to attach a .ruleset file to a post.
Attachments
terrain.txt
(32.49 KiB) Downloaded 245 times
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: Terrain file edit error

Post by JTN »

My 2.3 build is happy with that file, and it looks fine to me.

What exact 2.3 version are you using?

(The line ending thing shouldn't be an issue these days. As of 2.3.1, Freeciv on either Windows/Unix is tolerant of the other platform's line endings. patch #2843)
ahfretheim
Posts: 49
Joined: Sat Apr 05, 2014 9:29 pm

Re: Terrain file edit error

Post by ahfretheim »

JTN wrote:My 2.3 build is happy with that file, and it looks fine to me.

What exact 2.3 version are you using?

(The line ending thing shouldn't be an issue these days. As of 2.3.1, Freeciv on either Windows/Unix is tolerant of the other platform's line endings. patch #2843)
2.3.4
cazfi
Elite
Posts: 3104
Joined: Tue Jan 29, 2013 6:54 pm

Re: Terrain file edit error

Post by cazfi »

Individual .ruleset files are not completely independent. Is this to be used with otherwise default ruleset files, or some other ruleset, or have you might made changes to any other ruleset file?
Post Reply