unitai_treasure: uses and theorycrafts

Tekamthi

Emperor
Joined
Aug 12, 2016
Messages
1,941
afaik we have a fully-functional, if rudimentary, AI type that sits unused in VP: UNITAI_TREASURE

its from one of the conquest of new world scenarios, in which various mechanisms generate 'treasure' units, which must be moved back to a player's capital. for ref, see https://civilization.fandom.com/wiki/Treasure_(Civ5)

idk to what extent it integrates with other ai considerations, like does it just beeline units with no regard for danger? but it seems to be intact and basically functional: in modmod sub, I updated a whoward mod to use this AI (see the population/refugees thread), but I redundantly also gave the affected units a custom mission to go to capital, so I'm not completely sure which is doing the job, but between the two AI seems to handle these units as expected.

Assuming it works, what else can be done with this AI to improve gameplay?

Personally, i'd prefer if goody huts worked via this AI rather than an instant yield -- this would provide a natural balancer to players that exploit distant goodies en masse (*cough cough* Polynesia... ahem) but I gather that some would find this retrieval gameplay tedious. Seems a shame we can't find SOME kind of way to incorporate this into the mainmod -- it is inherently part of civ 5 codebase after all, and has survived many VP iterations in which other unused features were neutered or altogether removed.

In mb+ I will likely attempt a few concepts I have in mind, connected to this. But thats months off at best. In meantime, what ideas does community have in connection to this unused AI type?
 
Last edited:
Maybe city conquering instant yields could be attached to one of these instead of just happening instantly? It would give the player who just lost a city a bit of counterplay if they could try to at least recover some of the loot.
 
Maybe city conquering instant yields could be attached to one of these instead of just happening instantly? It would give the player who just lost a city a bit of counterplay if they could try to at least recover some of the loot.
aye i was thinking TR's maybe too

played a few turns this afternoon -- barbs invaded with 4 galleys -- i had 3 boats escorting the flipping trade boat plus a ranged partially able to target from land, but barbs managed to get the last one with 25 hp onto the tr as the stupid boat moved straight into it -- sunk that last galley that very same turn. I suppose we can say the barbs just sunk the trade boat for the sport of it and didn't take it for the loot, and maybe there are other issues with TRs that need addressing, but i had a full 33% of my supply protecting the trade route and still lost it -- all my defenders were above 75 hp after the battle, it wasnt even close, jsut couldnt kill fast enough. Here a treasure unit even worth just a fraction of the cost of the cargo boat would at least feel like some kind of thematically-appropriate consolation.
 
it is inherently part of civ 5 codebase after all, and has survived many VP iterations in which other unused features were neutered or altogether removed.
It's there because we're still supposed to be supporting scenarios. The removed features are truly unused ones from civ4, or unimplemented stuff that's only there to occupy memory.

Unit AI type is 100% moddable; we can even add more of them.
 
Not compatible with VP, but should (supposed to) be compatible with CP.
 
how bout this -- thinking modmod here, not maindmod
1. we put civilians on the map in every worked plot, locked forever in a build that does nothing -- they represent the "worked" part of the worked plot
2. at end of each player turn these get updated
3. if enemy invades a worked plot they capture 1 of these civilians, city loses 1 pop.
4. enemy can return the unit to own city and convert to half-rate worker etc. -- after x turns the unit can be converted to some other reward (we want to leave in play for a bit to have a chance to rescue)
5. f losing player recaptures one of these units, can then return to city and restore pop

there'd be a lot of civilians on the map with this, would it crash the game? otherwise can probably be scripted w/o too much trouble
 
Last edited:
My guess is a unit on every tile on the whole map would make the game unplayably laggy even if it didn't crash the game. But I could be wrong.
 
aye ur probably right, especially late game... that said the unit carpets already get pretty bad and these would just be stacked underneath

maybe a working alternative would be to generate this effect each time an improvement is pillaged -- problem there is it wouldnt be tie-able to city pop
 
Alternative :
Pillaging a tile remove a pop from the city and creates a civilian units which originate from the city.
Those civilians have only one movement point, and can't be manually sold/destroyed.
Sending such pop to one of your city awards food worth half a citizen.
Capturing such a unit either :
  • Gives an option to return it if you do not control its origin city
    • If you return it, the unit is destroyed and the origin city gain one pop.
    • If you keep it, same mechanic as above.
  • Instantly destroy the unit and gives one pop to its origin city, if you control that city.
I am ultimately not a fan of the idea (too much micro), just giving thoughts.
 
(too much micro)
fair, i agree in some respects, and this will probably be the dealbreaker even if it doesnt crash -- plus AI will never be able to prioritize recovery of its pop appropriately

needs to be somewhat rare or occasional, not an all-the-time occurrence, and somewhere in between important and trivial, so that it worth doing but the AI isn't left behind if it messes it up -- probably also should be connected to combat in some way so its not just routine return to city each time, theres some maneuvering to be done... the city conquering instant yields fits though maybe a little leaning towards 'too important'. Maybe its like 50% instant 50% treasure unit
 
Back
Top Bottom