Question: Implementing unit resource requirements.
-
- Posts: 19
- Joined: Wed Feb 27, 2013 10:08 am
Question: Implementing unit resource requirements.
Hello everyone, I've been following this project for a decade now and I was a long time fan. I would like to kindly ask is it now possible to implement civ3 or civ4 style resource requirements or trade networks. And if not can this be implemented in lua somehow to make up for it, I know lua is powerful but I know little else about it. Like for example, is it possible to plant a improvement on a tile with coal to get coal available for your civilization and enable/disable coal power and steam ships? Or make Iron a requirement for Legions and so on.
Re: Question: Implementing unit resource requirements.
As units do not support generic requirement vectors, the only way I see to do something like that is to have a resource requirement for a building (those do support requirement vectors), and then to make that building requirement of the unit.
E.g. one could only build stables if there's horses around, and only cities with stables could build horsemen.
Units are lagging behind other concepts in this lack of requirement vectors. Should look in to making some progress with them (i.e. to check what are the current blockers against implementing it)
E.g. one could only build stables if there's horses around, and only cities with stables could build horsemen.
Units are lagging behind other concepts in this lack of requirement vectors. Should look in to making some progress with them (i.e. to check what are the current blockers against implementing it)
Re: Question: Implementing unit resource requirements.
Or you could have something like action enablers, but they allow the construction of the targeted building or unit.
Civ 3 tileset: viewtopic.php?t=92953
3d Irrlicht desktop client development: viewtopic.php?t=92289&start=20
3d Irrlicht desktop client development: viewtopic.php?t=92289&start=20
Re: Question: Implementing unit resource requirements.
As I assumed, there's moderate size dependency chain for internal changes to be made to the freeciv engine before unit type requirement vectors can be exposed to the ruleset interface. Good news is that I now have some of those changes in development already. There's a fair chance that we have it available by freeciv-3.2.
Re: Question: Implementing unit resource requirements.
As that work has not started yet, and the time 3.2 development was planned to stay on master is already 3/4 gone, it's unlikely that they are coming to 3.2.
Re: Question: Implementing unit resource requirements.
btw. We don't even need to decide if we go for requirement vectors for units, or implement this via city-actor action enablers, yet. We need to work towards less hardcoded code behavior (especially AI) first, in either case.
Re: Question: Implementing unit resource requirements.
You could use Lua to grant a root_req tech that enables the unit creation. The tech could be dependant on existing techs - like iron working. Another possibility is to get Lua to automatically upgrade a freshly created unit based on whatever criteria is available to Lua (e.g. phalanx to legion). For city improvements one could use Lua to create an extra on the city centre tile(s).NotAnyoneSpecial wrote: ↑Thu Jun 23, 2022 11:31 pm I would like to kindly ask is it now possible to implement civ3 or civ4 style resource requirements or trade networks. And if not can this be implemented in lua somehow to make up for it, ... . Like for example, is it possible to plant a improvement on a tile with coal to get coal available for your civilization and enable/disable coal power and steam ships? Or make Iron a requirement for Legions and so on.
If you`re not comfortable with Lua I can work something up for you but it might take a couple of weeks. The real problem is trade. fc3.x has 'goods' but I have not tried it yet.