build settlers only if city size is big enough?

Smallpox vs. largepox, gen2 vs gen5, early war vs. peaceful alliances. Which is your favourite gaming style?
Post Reply
yuh
Posts: 9
Joined: Sat Nov 27, 2021 1:25 pm

build settlers only if city size is big enough?

Post by yuh »

Hi,

is it possible to restrict building settlers to a specific minimum size of a city (in version 2.5.3)? And if so: how? I'd like to experiment with a slower way of empire expanding in early gameplay by making settlers available only to cities with a size of 3 or even 4. As a workaround I could change tech_req or pop_cost in units.rulesets, section [unit_settlers] to get there. But neither do I want a specific tech to be necessary for building settlers nor do I want them to cost more than 1 city size.

My first message here, so I have to state by the way: Freeciv really is big stuff. Thanks a huge lot to the community of developers. I hope the vast possibilities of the game will grow and grow.
XYZ
Elite
Posts: 432
Joined: Fri Jan 31, 2014 12:00 pm

Re: build settlers only if city size is big enough?

Post by XYZ »

Check out https://longturn.net/ there we play turns of 23h with other online players and settlers cost you 2 population so you need to grow your city to at least 3 in order to build a settler (unless you want to move the city, then city size 2 is enough).
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: build settlers only if city size is big enough?

Post by Corbeau »

yuh wrote:Hi,

is it possible to restrict building settlers to a specific minimum size of a city (in version 2.5.3)?
Not directly, but this is as good as:

Code: Select all

[building_depot]
name		= _("Supply Depot")
genus		= "Improvement"
reqs	=
    { "type", "name", "range"
      "MinSize", "5", "City"
    }
and

Code: Select all

[unit_settlers]
name          = _("Settlers")
impr_req      = "Supply Depot"
In English: you need a "Supply Depot" to build Segtlers and you can build the "Supply Depot" only if your city is size 5 or more.

Also, what XZY said ;)
--
* 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...
yuh
Posts: 9
Joined: Sat Nov 27, 2021 1:25 pm

Re: build settlers only if city size is big enough?

Post by yuh »

Thanks for your replies. I have a thought about playing longrun, but can't really imagine to play every day even in summer and only get to round 180 after half a year.
Corbeau wrote:Not directly, but this is as good as:
CODE: SELECT ALL

[building_depot]
name      = _("Supply Depot")
genus      = "Improvement"
reqs   =
    { "type", "name", "range"
      "MinSize", "5", "City"
    }


and

CODE: SELECT ALL

[unit_settlers]
name          = _("Settlers")
impr_req      = "Supply Depot"
Looks to me like some kind of "invisible" building/improvement. Would be a nice solution and probably an interesting way to experiment some more with rulesets. But, sadly, it won't work: can't start game/connect to server, because of reading error. I'd guess, it's necessary to at least define some build_cost or other stuff for that building. But I really don't know. impr_req = "Marketplace" is no problem, so error seems to be in buildings.ruleset. Anything else I have to define for that Supply Depot?
yuh
Posts: 9
Joined: Sat Nov 27, 2021 1:25 pm

Re: build settlers only if city size is big enough?

Post by yuh »

Tried it out by myself. It seems, I need to define at least build_cost, upkeep and sabotage. Did it this way now:

Code: Select all

[building_depot]
name      = _("Supply Depot")
genus      = "Improvement"
reqs   =
    { "type", "name", "range"
      "MinSize", "3", "City"
    }
build_cost	= 0
upkeep		= 0
sabotage	= 100
I'll now run a game and have a look how it works, especially how ai deals with it.
User avatar
Corbeau
Elite
Posts: 1291
Joined: Mon Jan 13, 2014 11:13 pm

Re: build settlers only if city size is big enough?

Post by Corbeau »

yuh wrote:Tried it out by myself. It seems, I need to define at least build_cost, upkeep and sabotage.
Yes, I didn't type that out as a complete solution. It was just an example. It is expected that you'll fill out the rest according to your wishes and preferences.

And yes, the AI may have problems with it.
--
* 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...
yuh
Posts: 9
Joined: Sat Nov 27, 2021 1:25 pm

Re: build settlers only if city size is big enough?

Post by yuh »

Played a game until there were several ai cities with a size of 4 for quite a while: ai does not seem to get the idea at all, no settler at all was build by any ai.

Another problem: If you've got that Supply Depot in some city, you can build a settler even with city size of 2. That's not exactly what I wanted. But, well, ai can't cope with it anyway. So, it's not a working workaround. To restrict myself to build settlers only in a city of size 3 or more I don't have to change rulesets. But thank you anyway for the idea. It would have been really nice, if it worked the way I thought it would in the first place: some invisible building with no cost and no need to build would be there if city reaches a specific size ... I'd loved to fool around with a concept like this ...

I guess it would be nice to have a concept that restricts building of units to some city size. For example, building a battleship in a city with size 1 isn't that realistic, but no problem at the moment.
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: build settlers only if city size is big enough?

Post by Ignatus »

yuh wrote:Played a game until there were several ai cities with a size of 4 for quite a while: ai does not seem to get the idea at all, no settler at all was build by any ai.
Maybe some positive effect to the building (like, +1 luxury) would make AI to build it. It's possible to restrict effects to AI nation only.
Another problem: If you've got that Supply Depot in some city, you can build a settler even with city size of 2. That's not exactly what I wanted. But, well, ai can't cope with it anyway. So, it's not a working workaround. To restrict myself to build settlers only in a city of size 3 or more I don't have to change rulesets. But thank you anyway for the idea. It would have been really nice, if it worked the way I thought it would in the first place: some invisible building with no cost and no need to build would be there if city reaches a specific size ... I'd loved to fool around with a concept like this ...
What if we put obsoletion requirement for the building

Code: Select all

obsoleted_by   =
    { "type", "name", "range", "present"
      "MinSize", "3", "City", FALSE
    }
(I hope it won't disappear too often :| ) Also, we can tie ability for building units to some extra at city tile and put or remove this extra with a Lua script, but this is a lot of coding.
I guess it would be nice to have a concept that restricts building of units to some city size. For example, building a battleship in a city with size 1 isn't that realistic, but no problem at the moment.
Likely, we'll have normal requirement vectors for units in v.3.2, but alas not earlier.
Dino the Dinosore
Hardened
Posts: 171
Joined: Sun Dec 31, 2017 3:41 am

Re: build settlers only if city size is big enough?

Post by Dino the Dinosore »

The longturn ruleset changes the pop_cost to 2, which prevents cities with size <2 from making Settlers. This way, the number of tiles worked in the original city are reduced by 2, equal to the number of tiles worked in a newly founded city. This also discourages infinite city sprawl strategy. If a Settler joins an existing city, it adds 2 population. I think this a good idea in general and am doing this in the custom ruleset I'm working on. But I don't think you'd want to do pop_cost = 3 or 4.
yuh
Posts: 9
Joined: Sat Nov 27, 2021 1:25 pm

Re: build settlers only if city size is big enough?

Post by yuh »

Ignatus wrote: Maybe some positive effect to the building (like, +1 luxury) would make AI to build it. It's possible to restrict effects to AI nation only.
Tried out to motivate ai by giving an effect to Supply Depot:

Code: Select all

[effect_supply_depot]
type = "Output_Bonus"
value = 100
reqs =
    { "type", "name", "range"
      "Building", "Supply Depot", "City"
      "OutputType", "Luxury", "Local"
    }
It wouldn't work. Played a game until there were several ai cities with size of 5 for some rounds, but still no ai settler.
What if we put obsoletion requirement for the building

Code: Select all

obsoleted_by   =
    { "type", "name", "range", "present"
      "MinSize", "3", "City", FALSE
    }
(I hope it won't disappear too often :| )
Wouldn't work, too. After reaching city size of 3, building Supply Depot and one Settler the city shrank to size 2, but Supply Depot wouldn't vanish the way barracks do when inventing Gunpowder, was still an active city building. I could go on with building a Settler even with size of 2.
Also, we can tie ability for building units to some extra at city tile and put or remove this extra with a Lua script, but this is a lot of coding.
I'm afraid, I'm only able to change some stuff in the rulesets, but I don't have the necessary experience to code, sorry.
Likely, we'll have normal requirement vectors for units in v.3.2, but alas not earlier.
Sounds good, though I don't have an idea what those vectors might be.
Dino the Dinosore wrote:The longturn ruleset changes the pop_cost to 2, which prevents cities with size <2 from making Settlers. This way, the number of tiles worked in the original city are reduced by 2, equal to the number of tiles worked in a newly founded city. This also discourages infinite city sprawl strategy. If a Settler joins an existing city, it adds 2 population. I think this a good idea in general and am doing this in the custom ruleset I'm working on. But I don't think you'd want to do pop_cost = 3 or 4.
I tried a game with pop_cost = 3. Very slow starting phase, but interesting, in a way. I guess, I will try to play for a while wtih pop_cost = 2. Isn't all bad, makes Granary even more desirable.
Post Reply