wakystuf / ESG-Mod

An Endless Space 2 balance and overhaul mod
31 stars 4 forks source link

Patch preview merge #1433

Closed captaincobbs closed 7 months ago

captaincobbs commented 8 months ago

This does not fix any conflicting modifiers, duplicate properties, or missing features from the patch preview. All this does is make the game not crash when you load the mod, open the game, and pass the turn.

I have done the hard part, it's your job to make it work how you want. The math is definitely messed up and I don't care.

Things to note:

Arpharnator commented 8 months ago

looks correct to me @wakystuf take a look as well

captaincobbs commented 8 months ago

Just letting you guys know that none of the new PatchPreview content is currently working and it's on you guys to selectively peel back stuff to get it working if you really care. Also, there's probably some conflicts with Chaos's PatchPreview combat rework with the ESG one, I noticed some warnings about missing properties when I started a fight but I didn't want to do much more than that.

I also completely remade the planet fidsi calculations when working on the patch to get things working there. Anything that uses "DefaultPlanet{FIDSI}" or "RawPlanet{FIDSI}" will need to be changed to Planet{FIDSI} = x * Population.

I added a few new variables for you guys to mess with in ClassEmpire and ClassShip, and Cyrob made sure you guys were eating well with some of the new features available with SystemAwakening constructibles and the new registry options.

wakystuf commented 7 months ago

OK, I just pushed a commit that fixed the few issues I found in my review. A few questions: 1) Should we merge this into another branch of code and release it as 1.7? It will cause all save files to explode, right? 2) What is the Patch Preview content that is currently rendered nonfunctional by ESG? Is there a changelog someplace that we can review? 3) Is the incremental code that Chaos added already included here or is there other stuff as well? 4) I need to more carefully study the changes to the Planet sim descriptors. I think I understand the concept, but as you said I suspect that will break a bunch of stuff. 5) How extensively has this been tested so far?

wakystuf commented 7 months ago

Also, this might not matter, but the variable name for PoliticalRelicScientistRelicDustBoost has Relic included twice, but other political affiliations do not. If the uses of this variable elsewhere in the code match it, then it'll be fine.

wakystuf commented 7 months ago

OK, I see what the planet/pop stuff is doing now. I think it's much easier to simply restore the PlanetRaw[FIDS] variables with just 2 steps, right? This seems way easier than manually modifying the hundreds of instances that reference those variable:

1) Within ClassColonizedPlanet, add 1 row for each FIDS: <BinaryModifier TargetProperty="PlanetFood" Operation="Addition" Left="$(PlanetRawFood)" BinaryOperation="Multiplication" Right="$(Population)" Priority="-5"/>

2) Within ClassPlanet, remove these rows: <Modifier TargetProperty="PlanetRawFood" Operation="Addition" Value="$(PlanetInitialFood)"/>

Arpharnator commented 7 months ago

1) Probably would be for the best 2) no 3) don't think it is either 4) yea cobbers changed a shit ton of stuff related to fidsi calcs 5) uhhhh barely

Arpharnator commented 7 months ago

As for PlanetRaw[FIDS] variables being restored, maybe that's not possible? I think this could break horribly, especially since there would probably always be blindspots we wouldn't catch until it's too late.

wakystuf commented 7 months ago

@captaincobbs Should probably weigh in on those questions as well. I think for now I've done all I can do

captaincobbs commented 7 months ago

Sorry, didn't emails about this. Feel free to message on discord if there are updates here.

  1. This will indeed cause all save files to violently explode. I think it's fine to push to 1.6 since the reason we originally made test versions of mods in the first place was because we were pushing changes that would break saves but still wanted test feedback.

  2. The Nakalim rework and Academy rework are the only conflicting things. This would mostly just involve comparing Nakalim system improvement values / faction traits / hero skills / relic values and tuning things to how you want since I definitely didn't care about balance when working on the official patch. For Academy stuff, there's a lot of new entity actions you'd be able to mess with., along with the new Academy difficulty setting you'd need to make room for on the settings window, and the associated fleet changes in the FleetMissions or whatever file.

  3. Chaos's changes weren't accounted for since they didn't outright crash the game, but tbh ESG already has working versions of all those variables so you could likely just change the variables they look for and tweak a few paths and it'd be fine.

  4. That's likely going to be the biggest change yeah, I'm worried about Depletion related stuff in particular, and any planet multiplicative bonuses that might exist.

  5. I ran games by the AI (1 of each faction) until someone won. I only pushed this when I could get a full game without the game crashing or perma turn pending. So, pretty decently tested but there are likely some smaller issues I missed.

Regarding restoring PlanetRaw values, I really wouldn't recommend that. They were used for a lot of stuff in the C# -- including AI, and all of that functionality was removed and placed onto PlanetInitialFIDSI. It's really not that hard to accommodate the Planet changes and have them work properly in most cases, at least in my opinion. Again, the biggest exception to this would be Depletion fidsi penalty stuff and maybe slave driver bonuses.

Also, very important since this was added at your request, we added 5 new logging-related launch arguments that should hopefully help you guys in the future. Check the base game documentation folder for more detail. I also made an AIGain and Icons thing that should be helpful.

wakystuf commented 7 months ago

OK, a few thoughts: 1) Let's make this 1.7 in that case. Otherwise ESG will only work with the patch, I think? 2) Maybe we circle back to this one later, but sounds like we can skip for now 3) Is there a record or detailed log of his changes in the patch? I can fix it all, but I'd need to know exactly what he did 4) Oof, the PlanetRaw values just come up in SO many places; it's literally hundreds. What exactly will break if we just rebuild the old link? If it just screws with the AI then that's probably better than rebuilding like 400 formulas which are scattered all over the place.

captaincobbs commented 7 months ago
  1. My main concern about releasing it as 1.7 is that we never even released 1.6 officially, so it would look a bit odd. Also, the previous patch version likely won't be available anymore once the full release happens, so I don't see any reason to stick to it.
  2. Alrighty, makes sense
  3. I've DM'd you the official changelog
  4. It genuinely wouldn't be much of a hassle in most cases. Most per-population stuff can be replaced with Planet{FIDSI} += Population * Value, and I added Planet{FIDSI}Modifier (for % modifiers), PlanetInitial{FIDSI}BonusPerPopulation, Planet{FIDSI}FromDevelopment, and {FIDSI}FromPopulation properties. I didn't want to do this part since you had made a lot of specific changes for Depletion. However, the best solution I can see for Depletion is to scrap the existing code and to make it apply a multiplier to Planet{FIDSI}. Anything directly added to Planet{FIDSI} will show up in the tooltip properly. I double checked and the Slave Driver bonuses should be unaffected and not need changes.
wakystuf commented 7 months ago

@captaincobbs I will handle depletion, since it was a complicated one that I originally built. Best to avoid giving you nightmares :) Can you handle the huge # of various things that affect "PlanetRaw[FIDS]"? I just don't want to go through all of the buildings, hero skills, traits, laws, etc etc and manually change every single one of those lines.

captaincobbs commented 7 months ago

Sure, I'll look through it after my exams are finished. I'm not going to touch combat at all though.

captaincobbs commented 7 months ago

All done, there are probably a few small issues but someone will report it eventually. All that is left is for Waky to finish the Combat changes and for a discussion to happen about the Academy changes, since some of the new stuff I added in the Preview will definitely conflict heavily with ESG changes and cause crashes.

One other thing I noticed that I will not be touching -- Adamantian Alloys has like 3x as much stuff on it as it should, I'll leave that to you guys to fix.