2.5 (unstable beta) mod ruleset bug

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

2.5 (unstable beta) mod ruleset bug

Post by GriffonSpade »

Edit: It appears this is actually happening upon the ruleset itself loading, rather than a new game. (I missed this because I usually rush through and start the game)

Upon 'Never'ing a technology (Railroad) and starting a game i received this (nonfatal) error message in the chat log.
"data/default2/buildings.ruleset" improvement "Hanging Gardens": obsoleted by removed tech "Railroad".
/rulesetdir: Ruleset directory set to "default2"
"data/default2/buildings.ruleset" improvement "Hanging Gardens": obsoleted by removed tech "Railroad".
After going into buildings.ruleset and changing the obsoleting technology to Industrialization (or None on a different try) it still yields this error message:
"data/default2/buildings.ruleset" improvement "Hanging Gardens": obsoleted by removed tech "Railroad".
/rulesetdir: Ruleset directory set to "default2"
(note that the /rulesetdir line is just for reference)
(said ruleset is a copy of the 'classic' folder renamed 'default2' and the 'default' serv file renamed 'default2' and set to reference the former.)

Don't know the cause, or if it's since been fixed, but thought I'd point it out anyway.

It apparently also changes the building it claims is obsoleted by the removed tech when you add or remove buildings.
Last edited by GriffonSpade on Thu Jul 03, 2014 7:55 pm, edited 2 times in total.
User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Re: 2.5 (unstable beta) mod ruleset bug

Post by GriffonSpade »

Edit: It appears this is actually happening upon the ruleset itself loading, rather than a new game. (I missed this because I usually rush through and start the game)

When the 16th unit flag (of the ones defined in [control]), is set to a unit, it gives this non-critical failure message upon starting a game (above and below lines included for reference)
GriffonSpade: 'read classic3.serv'
GriffonSpade: 'rulesetdir classic3'
in precalc_one() [../../../../common/unittype.c::770]: assertion 'j == n_with_role' failed.
Please report this message at http://gna.org/projects/freeciv/
/rulesetdir: Ruleset directory set to "classic3"


This does not occur when a 16th flag is present, but not set to a unit. Including setting flag 15 to a unit.

These are the only changes to the ruleset.

Code: Select all

[control]
; Names for custom unit type flags.
flags =
  { "name", "helptxt"
    "Airbase", _("Can build Airbases.") 
    "Transform", _("Can transform terrain.")
    "AirUnit", _("Very bad at attacking AEGIS.")
    "Horse", _("Attack value halved when attacking Pikemen.")
    "Helicopter", _("Defends very badly against Fighters.")
    "6", _("Attack value halved when attacking Pikemen.")
    "7", _("Attack value halved when attacking Pikemen.")
    "8", _("Attack value halved when attacking Pikemen.")
    "9", _("Attack value halved when attacking Pikemen.")
    "10", _("Attack value halved when attacking Pikemen.")
    "11", _("Attack value halved when attacking Pikemen.")
    "12", _("Attack value halved when attacking Pikemen.")
    "13", _("Attack value halved when attacking Pikemen.")
    "14", _("Attack value halved when attacking Pikemen.")
    "15", _("Attack value halved when attacking Pikemen.")
    "16", _("Attack value halved when attacking Pikemen.")
  }

(Only change in Settlers is "16" flag added)

Code: Select all

[unit_settlers]
name          = _("Settlers")
class         = "Land"
tech_req      = "None"
obsolete_by   = "None"
graphic       = "u.settlers"
graphic_alt   = "-"
sound_move    = "m_settlers"
sound_move_alt = "m_generic"
sound_fight   = "f_settlers"
sound_fight_alt = "f_generic"
build_cost    = 40
pop_cost      = 1
attack        = 0
defense       = 1
hitpoints     = 20
firepower     = 1
move_rate     = 1
vision_radius_sq = 2
transport_cap = 0
fuel          = 0
uk_happy      = 0
uk_shield     = 1
uk_food       = 1
uk_gold       = 0
flags         = "16", "Settlers", "NonMil", "AddToCity", "Cities", "NoVeteran"
roles         = "Cities"
helptext      = _("\
Settlers are one of the key units in the game. As well as building new\
 cities, they can also improve terrain, for instance by building\
 irrigation, mines, and roads. See the Terrain Alterations section of\
 the help for more details.\
"), _("\
Upkeep for Settlers is in food as well as production, and a Settler\
 can die if its supporting city runs out of food. Settlers in a\
 Republic or Democracy require twice as much food per turn.\
")

PS These flags are AMAZINGLY useful. Having access to more than 16 would be useful :D
Archers can have weak defense against mounted units, siege units can have bonus defense against themselves, and many other things as well.
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: 2.5 (unstable beta) mod ruleset bug

Post by JTN »

GriffonSpade wrote:When the 16th unit flag (of the ones defined in [control]), is set to a unit, it gives this non-critical failure message upon starting a game (above and below lines included for reference)
in precalc_one() [../../../../common/unittype.c::770]: assertion 'j == n_with_role' failed.
Please report this message at http://gna.org/projects/freeciv/
This is a real bug, thanks. Raised as gna bug #22272, fix coming soon.
GriffonSpade wrote:PS These flags are AMAZINGLY useful. Having access to more than 16 would be useful :D
Raised this request as gna patch #4904.
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: 2.5 (unstable beta) mod ruleset bug

Post by JTN »

Your earlier report:
GriffonSpade wrote:Upon 'Never'ing a technology (Railroad) and starting a game i received this (nonfatal) error message in the chat log.
[...]
After going into buildings.ruleset and changing the obsoleting technology to Industrialization (or None on a different try) it still yields this error message:
"data/default2/buildings.ruleset" improvement "Hanging Gardens": obsoleted by removed tech "Railroad".
/rulesetdir: Ruleset directory set to "default2"
It's hard to see how this can be anything other than a confusion about which ruleset file the server is loading?
GriffonSpade wrote:It apparently also changes the building it claims is obsoleted by the removed tech when you add or remove buildings.
I'm afraid I don't understand what you mean here.
User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Re: 2.5 (unstable beta) mod ruleset bug

Post by GriffonSpade »

JTN wrote:It's hard to see how this can be anything other than a confusion about which ruleset file the server is loading?
Started with a new ruleset and named it 'classic6' based on 'classic' ruleset
Start in techs.ruleset
Step 1: "Never" Railroad's tech reqs
Step 2: Replace "Railroad" with "Steam Engine" on Industrialization's tech reqs

Selecting this ruleset gives this Result:
GriffonSpade: 'read classic6.serv'
GriffonSpade: 'rulesetdir classic6'
"data/classic6/buildings.ruleset" improvement "Hanging Gardens": obsoleted by removed tech "Railroad".
/rulesetdir: Ruleset directory set to "classic6"
"data/classic6/buildings.ruleset" improvement "Hanging Gardens": obsoleted by removed tech "Railroad".
/show: ------------------------------------------------------------------------------
/show: All options with non-default values
/show: ------------------------------------------------------------------------------
/show: In the column '##' the status of the option is shown:
/show: - a '!' means the option is locked by the ruleset.
/show: - a '+' means you may change the option.
/show: - a '=' means the option is on its default value.
/show: ------------------------------------------------------------------------------
/show: Option ## value (min, max)
/show: ------------------------------------------------------------------------------
/show: ------------------------------------------------------------------------------
/show: A help text for each option is available via 'help <option>'.
/show: ------------------------------------------------------------------------------
Next, go into buildings.ruleset
Step 3: go to hanging gardens and set 'obsolete_by' from "Railroad" to "Steam Engine"

Selecting 'classic6' gives this Result:
GriffonSpade: 'read classic6.serv'
GriffonSpade: 'rulesetdir classic6'
"data/classic6/buildings.ruleset" improvement "Hanging Gardens": obsoleted by removed tech "Railroad".
/rulesetdir: Ruleset directory set to "classic6"
/show: ------------------------------------------------------------------------------
/show: All options with non-default values
/show: ------------------------------------------------------------------------------
/show: In the column '##' the status of the option is shown:
/show: - a '!' means the option is locked by the ruleset.
/show: - a '+' means you may change the option.
/show: - a '=' means the option is on its default value.
/show: ------------------------------------------------------------------------------
/show: Option ## value (min, max)
/show: ------------------------------------------------------------------------------
/show: ------------------------------------------------------------------------------
/show: A help text for each option is available via 'help <option>'.
/show: ------------------------------------------------------------------------------
JTN wrote:
GriffonSpade wrote:It apparently also changes the building it claims is obsoleted by the removed tech when you add or remove buildings.
I'm afraid I don't understand what you mean here.
Step 4: Copy and Paste Great Wall above Hanging Gardens. Rename it to [building_great_wall2] and set its name to "Great Wall2"

Selecting 'classic6' gives this Result:
GriffonSpade: 'read classic6.serv'
GriffonSpade: 'rulesetdir classic6'
"data/classic6/buildings.ruleset" improvement "Great Wall2": obsoleted by removed tech "Railroad".
/rulesetdir: Ruleset directory set to "classic6"
/show: ------------------------------------------------------------------------------
/show: All options with non-default values
/show: ------------------------------------------------------------------------------
/show: In the column '##' the status of the option is shown:
/show: - a '!' means the option is locked by the ruleset.
/show: - a '+' means you may change the option.
/show: - a '=' means the option is on its default value.
/show: ------------------------------------------------------------------------------
/show: Option ## value (min, max)
/show: ------------------------------------------------------------------------------
/show: ------------------------------------------------------------------------------
/show: A help text for each option is available via 'help <option>'.
/show: ------------------------------------------------------------------------------
Edit: I'm using the server-in-client, not connecting to the stand-alone server and connecting to it with the client, if that makes any difference.
cazfi
Elite
Posts: 3336
Joined: Tue Jan 29, 2013 6:54 pm

Re: 2.5 (unstable beta) mod ruleset bug

Post by cazfi »

How old freeciv revision you are using? Or don't I just understand what you mean be "Nevering"? The special tech "Never" has been gone from ruleset format for a long time (and it had been broken even longer). Just remove, or comment out, the tech you don't want included.
cazfi
Elite
Posts: 3336
Joined: Tue Jan 29, 2013 6:54 pm

Re: 2.5 (unstable beta) mod ruleset bug

Post by cazfi »

Correction: it seems to still exist in 2.5 (gone from 2.6 development version very long time ago...)

Anyway, in S2_5 setting both req1 and req2 for Railroad to "Never" leads to popup "Ruleset couldn't be loaded. Keeping previous one." and chat window has exact error as ""data/classic6/techs.ruleset" tech "Industrialization": req1 leads to removed tech."
cazfi
Elite
Posts: 3336
Joined: Tue Jan 29, 2013 6:54 pm

Re: 2.5 (unstable beta) mod ruleset bug

Post by cazfi »

I really should go to sleep... you told quite clearly to make Industrialization to require Steam Engine instead of Railroad.

data/classic6/buildings.ruleset" improvement "Sun Tzu's War Academy": obsoleted by removed tech "Railroad".
data/classic6/buildings.ruleset" improvement "Hanging Gardens": obsoleted by removed tech "Railroad".
cazfi
Elite
Posts: 3336
Joined: Tue Jan 29, 2013 6:54 pm

Re: 2.5 (unstable beta) mod ruleset bug

Post by cazfi »

Ok, it's an actual freeciv bug, and I have a fix to submit tomorrow morning (err... in about 4 hours), but now I really go to sleep.
User avatar
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Re: 2.5 (unstable beta) mod ruleset bug

Post by GriffonSpade »

Ugh, this error message is certainly retarded. I figured out its behavior with some testing.

Point to technology that holds the position in the file that Railroad normally has (can be any technology, I'll call it Technology A)
Check if Technology A is Never'd
If Technology A is Never'd, then:
Point to building that holds the position Hanging Gardens normally has (can be any building, I'll call it Building B)
Give error message: improvement "Building B": obsoleted by removed tech "Technology A".

It looks like it is an ad hoc warning message, and only checked if Technology A was Never'd, not that Building B had Technology A as its Obsoletion requirement. It isn't actually related to any functionality, perhaps a throwback.

That being said, why the heck didn't I just comment it out in the first place!? You should make it spit out a warning message whenever anyone tries to use "Never" and tell them to stop being stupid and just comment the tech out. :lol:
Post Reply