Adding the Minor Race Personality in Race Info Screen?
Moderator: thunderchero
Forum rules
Please search before starting new topic.
There is a good chance it has already been asked.
Please search before starting new topic.
There is a good chance it has already been asked.
- Tethys
- Past Administrator
- Posts: 2404
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: Adding the Minor Race Personality in Race Info Screen?
I had already added it to GALM before your reply, and have been testing it out. You have done great work as always
- Spocks-cuddly-tribble
- Code Master
- Posts: 1961
- Joined: Sun Apr 27, 2008 2:00 am
AI Agenda fix - Offensive War
Glad you like the patch. Here's another one:
Warning This patch can cause issues in later stages of the game (crash without log). You should remove it for the time being.
I'll update the code if I find the problem (shared code doesn't work for certain Harass tasks?).
Crashing ECM save to doublecheck (just press turn):
---
I fixed the issue by adding a second check for Harass tasks (not restricted to medium range).
This should fix an exploit of too peaceful AI empires if one keeps a min distance. I think ECM feels too easy because of that.
Plus it gives the Federation AI another canon feature since their special Harass restrictions still keep them more defensive than the other AI empires.
ASM code:
Spocks-cuddly-tribble wrote: ↑Sun Dec 17, 2023 11:37 amAI Agenda Issues with Offensive/Defensive War
1.) AI wants to go to war vs a weaker empire but has no valid invade targets in medium range:
Bug/bias = defensive war -> should be offensive so the AI can get closer (defensive = new stations only in own territory)
Warning This patch can cause issues in later stages of the game (crash without log). You should remove it for the time being.
I'll update the code if I find the problem (shared code doesn't work for certain Harass tasks?).
Crashing ECM save to doublecheck (just press turn):
---
I fixed the issue by adding a second check for Harass tasks (not restricted to medium range).
This should fix an exploit of too peaceful AI empires if one keeps a min distance. I think ECM feels too easy because of that.
Plus it gives the Federation AI another canon feature since their special Harass restrictions still keep them more defensive than the other AI empires.
ASM code:
► Show Spoiler
Last edited by Spocks-cuddly-tribble on Wed Dec 27, 2023 12:55 pm, edited 3 times in total.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- Spocks-cuddly-tribble
- Code Master
- Posts: 1961
- Joined: Sun Apr 27, 2008 2:00 am
Race Info Screen with Minor Race Personality and AI Agenda
Quite some downloads, so the patch seems to go down well. I forgot to credit thunderchero in the patch for his help (much appreciated).
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- Spocks-cuddly-tribble
- Code Master
- Posts: 1961
- Joined: Sun Apr 27, 2008 2:00 am
Re: AI Agenda fix - Offensive War
viewtopic.php?p=60936#p60936Spocks-cuddly-tribble wrote: ↑Mon Dec 18, 2023 2:48 pm Warning This patch can cause issues in later stages of the game (crash without log). You should remove it for the time being.
I'll update the code if I find the problem (shared code doesn't work for certain Harass tasks?).
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- Tethys
- Past Administrator
- Posts: 2404
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: Adding the Minor Race Personality in Race Info Screen?
Interesting. I had a case recently where I uninstalled the old economic military score overflow in GALM and installed the new one... scrapping any taskforce with 2 or more ships caused crash on turn. Probably a conflict somewhere, even reverting the patch in QD patcher still had the fleet scrap crash. I had to restore from exe backup. I will remove this patch for now until we figure out the issue.
Did you see I updated the race name Borg pop patch? I am having small issues with AI unrest turn delay.. or lack thereof. Two full days of analysis of subroutines dealing with the unrest, system attack, change system owner, next orders in build queue, and AI tasks (07 unrest). I found a few mov locations (5 or 6) of text phrase search "+86h], 0" which should be "Offset 0x0086 to 0x0087 = turn count for unrest order delay" and even fewer for mov AI task "+10h], 7" which is "order labor typeID 7". Doesn't seem to be called directly for the AI, so I am thinking its one of those hidden moved into several registers thing
Directly changing the former had no effects but changing the latter caused the unrest building in player system to cease functioning. The AI remained unaffected. I am searching for what location tells the AI to build an unrest structure after successful invasion. It happens on the turn of invasion, and nothing I have found to change seems to prevent the AI from forcing martial law on the subjugated population. It is my hope to use the in-built turn delay on the AI as well.. I just can't find where the trigger is for their instant unrest. Do you know of any such location, or where would be a better place for me to look? I have a test patch I am building to change all "+86h], 0" to "+86h], 2" all at once (forced turn delay 2) as maybe they are being overridden somehow. Next test patch would be for all "+10h], 7" to "+10h], 5" excluding cmps (force trade goods).
Here is one I did not investigate, because no graph view. But it IS called by other active subroutines?! > loc_465330
Did you see I updated the race name Borg pop patch? I am having small issues with AI unrest turn delay.. or lack thereof. Two full days of analysis of subroutines dealing with the unrest, system attack, change system owner, next orders in build queue, and AI tasks (07 unrest). I found a few mov locations (5 or 6) of text phrase search "+86h], 0" which should be "Offset 0x0086 to 0x0087 = turn count for unrest order delay" and even fewer for mov AI task "+10h], 7" which is "order labor typeID 7". Doesn't seem to be called directly for the AI, so I am thinking its one of those hidden moved into several registers thing
Directly changing the former had no effects but changing the latter caused the unrest building in player system to cease functioning. The AI remained unaffected. I am searching for what location tells the AI to build an unrest structure after successful invasion. It happens on the turn of invasion, and nothing I have found to change seems to prevent the AI from forcing martial law on the subjugated population. It is my hope to use the in-built turn delay on the AI as well.. I just can't find where the trigger is for their instant unrest. Do you know of any such location, or where would be a better place for me to look? I have a test patch I am building to change all "+86h], 0" to "+86h], 2" all at once (forced turn delay 2) as maybe they are being overridden somehow. Next test patch would be for all "+10h], 7" to "+10h], 5" excluding cmps (force trade goods).
Here is one I did not investigate, because no graph view. But it IS called by other active subroutines?! > loc_465330
- Spocks-cuddly-tribble
- Code Master
- Posts: 1961
- Joined: Sun Apr 27, 2008 2:00 am
Re: Adding the Minor Race Personality in Race Info Screen?
This is not about the Race Info Screen patch (just cosmetics), only the above Offensive War Agenda fix!
Plus economic military score overflow fix was updated at some point IIRC. Neither affects scrapping ships!
Larger task forces patch needs adjustements when combined with scrapping ratio patches (can crash for fleets with more than one ship)
UM5 extra patches by thunderchero: viewtopic.php?p=59256#p59256
Depending on scrap patch used you need to search in sub_469370 Scrap_Ship and change an add 4 to add 2 for larger TF patch.
TF patch changes this in vanilla code:
I can't analyse your unrest patch mess up right now.
There was an outdated version of the Larger Maps Total Score Fix causing issues, just use new patch (if needed).Tethys wrote: ↑Thu Dec 28, 2023 1:02 pmI had a case recently where I uninstalled the old economic military score overflow in GALM and installed the new one... scrapping any taskforce with 2 or more ships caused crash on turn. Probably a conflict somewhere, even reverting the patch in QD patcher still had the fleet scrap crash.
Did you see I updated the race name Borg pop patch?
Plus economic military score overflow fix was updated at some point IIRC. Neither affects scrapping ships!
Larger task forces patch needs adjustements when combined with scrapping ratio patches (can crash for fleets with more than one ship)
UM5 extra patches by thunderchero: viewtopic.php?p=59256#p59256
Depending on scrap patch used you need to search in sub_469370 Scrap_Ship and change an add 4 to add 2 for larger TF patch.
TF patch changes this in vanilla code:
0046943D add ebx, 4 -> 2
I can't analyse your unrest patch mess up right now.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- Tethys
- Past Administrator
- Posts: 2404
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: Adding the Minor Race Personality in Race Info Screen?
Thanks. I did a few different patches and I was pretty sure it wasnt the ship scrap patch but you are correct. It was a case where the patch itself had the vanilla value. I have corrected it.
Patch name: NAME: Disable the ship scrapping exploit [square root] (fix)
AUTHOR: Spocks-cuddly-tribble
Also I wasnt asking you to analyze it just if you happen to know if the AI has a task that forces unrest after subjugation or if it is something that is calculated based on some morale value (in which case I would go about it a different way). I will continue to run my tests I know I put some values and names but that is to jog the memory
Edit: I am so stupid, or tired, or both... I had your patch installed THIS WHOLE TIME along with mine. I know I uninstalled it. But I guess when I restored my backup exe, it was installed and I forgot to uninstall it again No wonder the pop kept changing no matter what! Take a screenshot, this one is gonna go on the "Pakled Wall of Shame"
Patch name: NAME: Disable the ship scrapping exploit [square root] (fix)
AUTHOR: Spocks-cuddly-tribble
► Show Spoiler
Edit: I am so stupid, or tired, or both... I had your patch installed THIS WHOLE TIME along with mine. I know I uninstalled it. But I guess when I restored my backup exe, it was installed and I forgot to uninstall it again No wonder the pop kept changing no matter what! Take a screenshot, this one is gonna go on the "Pakled Wall of Shame"
Last edited by Tethys on Thu Dec 28, 2023 5:27 pm, edited 3 times in total.
- Spocks-cuddly-tribble
- Code Master
- Posts: 1961
- Joined: Sun Apr 27, 2008 2:00 am
Re: Adding the Minor Race Personality in Race Info Screen?
No, and since the vanilla AI has morale cheats (+3 per turn if lower than base morale and no -1/turn in conquered systems) it might not even use emergency morale programs?
Data areas in systInfo and OrdInfo are shared with different locations depending on build type (e.g. unrest order). There is still some unkown AI build bugs. In many cases AI uses OrdInfo data only and ignores systInfo area, so your patch code might get out of sync.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- Tethys
- Past Administrator
- Posts: 2404
- Joined: Fri Jul 18, 2008 2:00 am
- Location: Your mom's bed ;)
- Contact:
Re: Adding the Minor Race Personality in Race Info Screen?
The solution is looking simple now, sorry to trouble you. Unrest Assimilation patch works fine, AI not building unrest structure. All is well in the Nexus. I will have to add some kind of turn delay. But after some research I think it might be better to try to make the AI build the unrest structure, since a turn delay might break during save/load.