Planet trading, refits and AI
Posted: Tue Mar 26, 2019 3:39 pm
Hey!
Question number one: how does planet trade via diplomacy work? More specifically, where are the costs for tradable planets calculated? I haven't been able to even give away planets for free; and I'd like to allow planet gifting to any major faction and buying planets from close allies.
Question number two: how can I unify refit costs across instant and manual refits without nullifying the discount system based on number of changed parts? I.e. currently instant refit skips that calculation altogether, while manual takes it into account and is correspondingly more expensive. I don't actually see any skipping for instant refits in the .lua files, so it's some second-order effect (cleverly?) hidden in the code. Or maybe I'm blind?
Edit2: I'm an idiot. The refit system counts different weapon mods, not changed parts. What threw me was that the system first calculates refit costs based on full price including mods, gives discounts for old components also with mods, and then does an additional round of discounting for mod differences. And that last discount system does not seem to fully line up with the way weapon mod pricing is usually calculated. \edit2
Edit: Question number three: how does the system for unlocking ship templates via tech progression work? I've tried modifying the 'unlock' in ship template files (specifically, the Tinker Mobile Base which shares its unlock with Starbases) and no changes appear in-game. Is it another case of having to go through the Lua state directory instead of the Mods directory? \edit
Edit2: Yeah, it is. Inconvenient, that. \edit2
I will precede the rest of my post with the caveat that I'm using a modded version of the DLC mod (ver 190314), incorporating a number of other mods (notably akkamadi's extra races and the 'Population manager' UI mod) and quite a few of my own alterations.
The most relevant of my changes are
Edit3: Continuing the 'answer my own questions' theme, here's what I found:
Question number one: how does planet trade via diplomacy work? More specifically, where are the costs for tradable planets calculated? I haven't been able to even give away planets for free; and I'd like to allow planet gifting to any major faction and buying planets from close allies.
Question number two: how can I unify refit costs across instant and manual refits without nullifying the discount system based on number of changed parts? I.e. currently instant refit skips that calculation altogether, while manual takes it into account and is correspondingly more expensive. I don't actually see any skipping for instant refits in the .lua files, so it's some second-order effect (cleverly?) hidden in the code. Or maybe I'm blind?
Edit2: I'm an idiot. The refit system counts different weapon mods, not changed parts. What threw me was that the system first calculates refit costs based on full price including mods, gives discounts for old components also with mods, and then does an additional round of discounting for mod differences. And that last discount system does not seem to fully line up with the way weapon mod pricing is usually calculated. \edit2
Edit: Question number three: how does the system for unlocking ship templates via tech progression work? I've tried modifying the 'unlock' in ship template files (specifically, the Tinker Mobile Base which shares its unlock with Starbases) and no changes appear in-game. Is it another case of having to go through the Lua state directory instead of the Mods directory? \edit
Edit2: Yeah, it is. Inconvenient, that. \edit2
I will precede the rest of my post with the caveat that I'm using a modded version of the DLC mod (ver 190314), incorporating a number of other mods (notably akkamadi's extra races and the 'Population manager' UI mod) and quite a few of my own alterations.
The most relevant of my changes are
- added a number of "X World Colonization" techs and restricted all races to ca 3 starting types, with new types unlockable by progressing through the planetology tree, at least two of which can be acquired more or less immediately;
- changed around ship templates a bit; I'm not entirely sure all my changes are 'safe';
- extensively changed all sorts of galaxy generation parameters, including planet distribution, adding 'Huge' planets, modifying starting fleets, infrastructure and population (fun fact: if you overcrowd your starting world, growth goes negative and loses 'growth rate' information, so you cannot make any calculations based on overcrowding 'death rates'; I have a minor UI mod that calculates current growth as a percentage of max growth, which won't work on overcrowded worlds) etc.
- AI expansion is really wacky; the two races hardest hit by my colonisation changes are Orthin and Phidi, whose habitat types are rarer; and Yoral can settle most worlds without research; yet Phidi are the undisputed expansion champs (aided by a chance overabundance of water planets near their homeworld), while Orthin are stuck on their homeworld, Gremak and Yoral have small sections of the map with as many outposts as proper colonies; Humans haven't settled anything, Haduir have a passable mini-empire and I haven't run into the Teros yet.
- Some of the nonexpanders (specifically, Orthin and Humans) seem to be going around in circles with their fleet(s);
- AI appears to be heavily metal-starved, if the diplomacy interface is any indication of the true state of their economy.
Edit3: Continuing the 'answer my own questions' theme, here's what I found:
- Orthin: WAD, no Ice or Glacier planets nearby, but they're pretty strong with only one world. Circling is into an anomaly, no clue what it's about, but their entire fleet including the starter colship is into it.
- Humans: why they didn't colonise their starter planet, I haven't a clue. Circling is also into an anomaly (how do they even have tech to see these?!)
- Yoral: WAD, a considerable lack of nearby non-hostile planets, and then they ran into my own expansion.
- Gremak: WAD, an absolute lack of nearby Swamp or Garden planets means they were stuck on their homeworld.
- Haduir: WAD, colonised what they could get, which wasn't much.
- Teros: holy s***, these guys are on a roll! Bigger than the abnormally-lucky Phidi by a considerable margin.