Has anyone ever split production between units and buildings?

DaddyHolby

Chieftain
Joined
Feb 20, 2003
Messages
32
Location
Superior, Co
So that you could have two production bars in a city, one producing a building and another producing a unit?

Is this even possible?

How about only allowing unit generation through buildings so that buildings like factories can be assigned to build units and the city itself could only build buildings? (This is more for the mods like RTW or FF which have the ability to build unit specific buildings like Tank Factory)
 
yes that is all possible I'm sure, but has it been done, I couldn't tell you. There are a lot of innovative mods out there, perhaps someone knows better than me.

To do these things would most likely require some changes to the SDK or at minimum some python.
 
Had a feeling that I would have to do some python or change the SDK. I'm hoping someone might be able to point me to where this has been done in the past.
 
Hasn't been done. Well there is a remote possibility it has been done, but I don't know how I wouldn't have noticed. I browse through the mod sections pretty frequently and look at what's around. This would have been a pretty impressive mod, and I can't see how it could slip under the radar as it were.

So you'd have to design this mod from scratch. This would require SDK & Python, you would need to set up a new city screen for the UI, and you would need to have the game calculate hammer distribution differently and you'd need to teach the AI how to use it.
 
So that's all I'd have to do:rolleyes:

How about this then, have buildings build a unit every X number of turns. Thus a new tank would roll out of the tank factory every few turns, but if the tank factory was destroyed you would no longer get tanks. And if you had a tank factory and a aircraft factory you might get two units few turns (one tank and one fighter or bomber).

This should be easier to mod right?
 
It could be done in python with saving data and such to get variables. Primordial Stew did something like that on Rise and Fall of the Roman Empire and I am pretty sure davidlallen did that on his Fury Road mod. If you do implement it, remember, alot of python is relativly processor intensive, so if you have alot of civs late game, the game will be very slow.
 
XML is only a data storage system, it cant say when something occurs, only what the abilities of the effects are.
 
So that's all I'd have to do:rolleyes:

How about this then, have buildings build a unit every X number of turns. Thus a new tank would roll out of the tank factory every few turns, but if the tank factory was destroyed you would no longer get tanks. And if you had a tank factory and a aircraft factory you might get two units few turns (one tank and one fighter or bomber).

This should be easier to mod right?

that combined with the RTW functions like industrial bombing would make for a really really nice mod. I'd say teaching the AI to use it all would be the hardest part
 
I understand, I was just hoping that there might be an option in the definitions of the buildings or units, kinda like Civ III where you could have a building that would build a unit after X turns.
 
That was Civ III Conquests only, not Vanilla. And it was a great feature. There is the free missionary you get with some religions. If the code for that is in python it would be a good place to start.
 
What about substracting a given amount (%) of hammers from the production and re-add them in a counter ( same as gold ) reseted upon completion of the item (like for 'food storage' upon growth).
That way, you will get rid of "crappy-production cities spamming units every five turns" exploit
 
After thinking about this some more here's what I'd really like to do:

Be able to give buildings production queues. Whatever is in the production queue would raise the maintenance cost of the building by X amount until the unit was built. After the building builds the unit then the maintenance cost would go back to the original cost or to the X amount for the next unit.

The city would still have a production queue but it would be limited to just buildings. Buildings production queues would be limited to either a specific unit or a specific unit type.

Ex. Say you build a tank factory. Once the tank factory is complete it can then start building tanks and you can open up a build queue for it and assign which tanks you want built. The factory's maintenance cost would go up by a number equal to the cost of building a tank per round until the tank was built. While the factory was producing the unit the city could still build buildings to improve it's infrastucture. After building the number you need you could set it to do nothing at which time the maintenance would be reduced back to the number for just the building.

Now I'm not sure what that X number per turn should be yet or how to calculate it, but I think this might work. Of course it will require changes to the SDK, Python, the UI, and teaching the AI how to use it, which means it's probably out of the reach for me to do (wife won't let me spend that much time dealing with this and after a full day of coding at work I usually don't feel like touching the stuff at home).

So I doubt I'll attempt this, but I'll keep you posted if I do.

Thanks again for all of your help.
 
How about this then, have buildings build a unit every X number of turns. Thus a new tank would roll out of the tank factory every few turns, but if the tank factory was destroyed you would no longer get tanks. And if you had a tank factory and a aircraft factory you might get two units few turns (one tank and one fighter or bomber).
Take a look at CvFinalFrontierEvents.py for how Jon Shafer got Starbases (which are units, not buildings) to generate a missile every 15 turns. That ought to give you an idea.

In fact, you might want a "tank factory" to be a unit instead of a building, allowing you to pretty much lift Jon's code and do a quick search/replace. Then you could do things like "retooling the factory" (upgrading) to produce a newer kind of tank, APC, etc. You could also provide a mechanism to give the factory XP periodically, (like the spell-casters in FfH2), so that it can earn promotions. One promotion might increase its production rate; others might act like Military Instructors/Barracks/Stables etc. and give the tanks/planes produced there some XP, while another kind might be like Red Cross and give a specific promotion to the units it creates.

You'd have to cause the tank factory to somehow drain some hammers from the city it's in, to reflect the cost of producing the tanks. Starbases give the missiles for free, but a lot of players end up killing them off to avoid paying 1 gold/turn to support that many units.

And that's another reason to make the tank factory be a unit. It would allow the owner to disband it if they no longer wanted to pay maintenance on the factory.
 
Back
Top Bottom