Multiple same-class prerequisits for a unit?

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
User avatar
Corbeau
Elite
Posts: 1293
Joined: Mon Jan 13, 2014 11:13 pm

Multiple same-class prerequisits for a unit?

Post by Corbeau »

I'm toying with a ruleset and one of the things I'd try would be to make multiple prerequisites for a unit (for example, you need Mass Production, Automobile AND Machine Tools to build armour units, along with Factory AND Library in a city where you want to produce it).

My questions are:
1. Has anyone tried this before and how did it work out technically?
2. What is Civipedia going to look like, especially the tech tree? Is there going to be an incompregensible mess if there are many prerequisits for something?

(I'm assuming this part of Civipedia updates automatically as you change the ruleset, right?)
--
* 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
GriffonSpade
Elite
Posts: 578
Joined: Mon Apr 29, 2013 4:41 pm

Re: Multiple same-class prerequisits for a unit?

Post by GriffonSpade »

As far as I know, limit is 1 tech, 1 improvement(building, present in the city as well, I believe), and 1 government (Including "none" for each), plus there's an obsoletion technology.
User avatar
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: Multiple same-class prerequisits for a unit?

Post by Alien Valkyrie »

At least in 2.5 (don't know how it's after that), units don't have a reqs field, only, as GriffonSpade already said, a tech requirement, a building requirement and a government requirement. Unless I'm misinformed, it's not possible to add multiple values for any single one of them.
~ AVL
User avatar
Corbeau
Elite
Posts: 1293
Joined: Mon Jan 13, 2014 11:13 pm

Re: Multiple same-class prerequisits for a unit?

Post by Corbeau »

Ok, just curious, does anyone know, if I added multiple requirements, what would happen? Error/crash or only one requirement would work?

And if not for units, is it possible to add multiple requirements for buildings?
--
* 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...
The Square Cow
Veteran
Posts: 53
Joined: Wed Nov 19, 2014 5:47 pm

Re: Multiple same-class prerequisits for a unit?

Post by The Square Cow »

Buildings can have multiple requirements, but if you make things very complex the AI might have a hard time understanding. You could set up multiple requirements for a unit (I suspect) by making it require a very cheap building that requires all the requirements that you want the unit to require. The helptext and AI may not understand it though.
User avatar
Corbeau
Elite
Posts: 1293
Joined: Mon Jan 13, 2014 11:13 pm

Re: Multiple same-class prerequisits for a unit?

Post by Corbeau »

I'm not worried about AI, I'm thinking about multiplayer human-only games. (Y'can call me racist all y'want, I don't like'em silicon brains scuttling 'round me feet, just makes me wish to stomp'em, but that'd make a bloody mess and me missus w'd yell at me again. *spits tobacco* )

Also, another motive for this is preventing a backward stone-age nation receiving one tech and then being able to build armour. Yes, they could receive all three, but with penalties and random tech loss when bulbs go into negative, stuff would get more realistic.
--
* 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: Multiple same-class prerequisits for a unit?

Post by Alien Valkyrie »

Corbeau wrote:Also, another motive for this is preventing a backward stone-age nation receiving one tech and then being able to build armour. Yes, they could receive all three, but with penalties and random tech loss when bulbs go into negative, stuff would get more realistic.
Well, for that, there's advance_*.root_req (in techs.ruleset). For example, in the experimental ruleset (2.5) you can not only not research, you can't even have Mobile Warfare unless you have Automobile, which requires you to have Combustion, which needs Refining and so on and so forth. If you want to build Armor, you need at least 13 technologies, all the way from Alphabet over Steam Engine to Mobile Warfare.
~ AVL
User avatar
Corbeau
Elite
Posts: 1293
Joined: Mon Jan 13, 2014 11:13 pm

Re: Multiple same-class prerequisits for a unit?

Post by Corbeau »

Interesting. However, what happens if you get all those techs from your allies, start building stuff, and then one of the techs in the middle is lost due to negative bulbs? Does the whole structure collapse?
--
* 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: Multiple same-class prerequisits for a unit?

Post by Alien Valkyrie »

Corbeau wrote:Interesting. However, what happens if you get all those techs from your allies, start building stuff, and then one of the techs in the middle is lost due to negative bulbs? Does the whole structure collapse?
You can't lose a tech that's a root_req for a tech you currently have, so if you have negative bulbs, you'd lose Mobile Warfare first, then Automobile, then Combustion etc.
Also, even if you only lost Mobile Warfare, you'd have to research everything up to Tactics first before being able to research it again, so you'd be kind of dependant on your allies giving you the techs again and again. And if the server setting techlost_give is set greater than 0, there's a chance that they'll lose it when giving it to you.
~ AVL
User avatar
Corbeau
Elite
Posts: 1293
Joined: Mon Jan 13, 2014 11:13 pm

Re: Multiple same-class prerequisits for a unit?

Post by Corbeau »

Caedo wrote:
Corbeau wrote:Interesting. However, what happens if you get all those techs from your allies, start building stuff, and then one of the techs in the middle is lost due to negative bulbs? Does the whole structure collapse?
You can't lose a tech that's a root_req for a tech you currently have, so if you have negative bulbs, you'd lose Mobile Warfare first, then Automobile, then Combustion etc.
Oh? Does that mean that, if I set the whole tree so that ALL reqs are also root_reqs, then when a tech is lost due to negative bulbs it will no longer be random? Only highest techs can be lost? That would be excellent!
--
* 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