"Simulation" ruleset (2.5) - v1.0 released

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
Post Reply
User avatar
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Corbeau's ruleset (2.5)

Post by Alien Valkyrie »

Corbeau wrote:Actually, the README.effects that I have contains a list of effects and a very rough description of what they do, but not *how* they do it. For example, if you guys hadn't told me, there is no way in hell that I'd be able to figure out myself that "Terrain", "Mountain", "Local" also works for creating veteran units or that you can't have multiple automatic upgrading improvements.
Think about it. The Upgrade_Unit effect dictates how many units the player gets upgraded per turn. If it was evaluated at a city range, then in the classic ruleset, Leonardo's Workshop would give you one free upgrade per turn per city.
And I don't know that Terrain requirements work for Veteran_Build. I just assumed that, since it's evaluated at a city range (evident from the way Barracks work). If you haven't tested it yet, I wouldn't take it for granted.
The way I see it, there's enough information in README.effects that if you already know those things, you'll feel like it's obvious, but if you don't know yet, it can be quite a riddle. So if you're ever not sure, and thinking about it for a moment doesn't make it clear, just test it. There are a lot of interesting things to discover.
~ AVL
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: Corbeau's ruleset (2.5)

Post by JTN »

Corbeau wrote:Considering renaming "Library" to "Schoolhouse" but then a lot of stuff should be tracked down and changed and I'm kind of too lazy for that.
You can of course, if you're lazy, leave 'rule_name' as "Library" and set 'name' to "Schoolhouse"; that way, all the references to "Library" in effects etc don't need changing (and also old savegames will work, if you care).
Corbeau wrote:Is there a way for a Wonder to give +1 shield to each city? Something like this:

Code: Select all

[effect_5yrPlan]
type    = "Output_Add_Tile"
value   = 1
reqs    =
    { "type", "name", "range"
      "Building", "Five Year Plan", "Player"
      "CityTile", "Center", "Player"
      "OutputType", "Shield", "Local"
    }
Yes, that sort of thing works; civ2civ3 does this sort of thing (e.g.). (As Caedo says, your "CityTile" range needs to be "Local", not "Player".)
Caedo wrote:"Upgrade_Unit" is an effect type, not a requirement type. That it's "checked at player range" means that for the requirements, only the range "Player" and bigger ones (e.g. "Allied", "Team" and "World") are valid. I'm not sure if requirements at other ranges are simply ignored, always evaluate to FALSE or cause an error while loading, but either way, they don't work.
A City-ranged requirement for an effect like Upgrade_Unit (which is never evaluated in the context of a specific city) is quietly never met, I think.
(It ought to be possible to catch these at ruleset load time, but we don't, I'm afraid. We do have a lot of ruleset sanity-checking, but not effects-against-requirement-ranges sanity checking.)
Caedo wrote:And I don't know that Terrain requirements work for Veteran_Build. I just assumed that, since it's evaluated at a city range (evident from the way Barracks work). If you haven't tested it yet, I wouldn't take it for granted.
Looking at the code, I think it will work (but haven't tested it). Things taken into account for this particular effect are player (city owner), city, tile city is on, and unit type. (code 1, 2).
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: Corbeau's ruleset (2.5)

Post by Corbeau »

Ok. Thanks, guys :)
--
* 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
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: Corbeau's ruleset (2.5)

Post by Corbeau »

Right now I'm trying to implement one of the things I mentioned above: base veteran "bonus" is -25% and all governments except Democracy and Republic give additional veteran status to all units.

My question: what do I have to put here in order to have ALL units gain veteran status? I would like to avoid (PLEASE) havign to list EVERY class for every government that modifies it.

Code: Select all

[effect_veteran_monarchy]
type    = "Veteran_Build"
value	= 2
reqs	=
    { "type", "name", "range"
      "Gov", "Monarchy", "Player"
      "UnitClass   (???)", "(????)", "Local"
Also, does this "value = 2" work for giving two veteran levels?
--
* 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...
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: Corbeau's ruleset (2.5)

Post by cazfi »

Corbeau wrote:My question: what do I have to put here in order to have ALL units gain veteran status?
Simple. Don't require any specific unit class at all, i.e., leave such an requirement out.

README.effects:
Veteran_Build
Increases the veteran class of newly created units of this type. The
total amount determines the veteran class (clipped at the maximum for the
unit).
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: Corbeau's ruleset (2.5)

Post by Corbeau »

*headdesk*

Thank you.
--
* 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
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: Corbeau's ruleset (2.5)

Post by Corbeau »

When starting the ruleset, I get a (sort of) error:

Invalid veteran definition 'veteran_system.veteran_power_fact[0]'!
Invalid veteran definition 'veteran_system.veteran_power_fact[1]'!


However, the game starts fine. But I'd like to be sure that things are working as intended. And the intention is that the first two veteran levels actually give units a decreased power. Can anyone tell me where exactly is the code for this? Is it actually possible to have a negative veteran "bonus" (value smaller than 100)?
--
* 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
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Corbeau's ruleset (2.5)

Post by Alien Valkyrie »

Apparently there's a couple of "sanity checks", ensuring (among others that are genuinely necessary) the following things:
  • The initial level's power factor has to be exactly 100%
  • One veteran level's power factor must not be smaller than the previous one's
So apparently it's not possible to have a negative veteran level. But then again, is there a specific reason you don't just lower the units' base power?

EDIT: Also, the code for this specific stuff is here. The sanity checks are below the line where they're defined.
~ AVL
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: Corbeau's ruleset (2.5)

Post by Corbeau »

Caedo wrote:But then again, is there a specific reason you don't just lower the units' base power?
Yeah, the only reason would be "clean accounting", but I guess this will do. And I was thinking about adjusting firepower, but I'll think about it a bit more, it may be a can of worms. Thanks.
--
* 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
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: Corbeau's ruleset (2.5)

Post by Corbeau »

One more thing. I tried to implement the Provisional Government city improvement. It would make a change of governemnt immediate, but the improvement would cost, say, 100 shields and have upkeep 20 gold per turn. The effect would be that you build it, change government and then sell it because it costs so much, rebuild it later if the need occurs and, basically, allowing you to pay in material (shields or money) for a peaceful transition if you wish to do so. An idea I picked up from another game.

However, it seems the "No_Anarchy" effect can't be tied to a regular city improvement, only to a Wonder (either small or big). So I've given up on the idea for now. if anyone has any suggestions, feel free to share.
--
* 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...
Post Reply