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.
- Spocks-cuddly-tribble
- Code Master
- Posts: 1961
- Joined: Sun Apr 27, 2008 2:00 am
Adding the Minor Race Personality in Race Info Screen?
I think adding the personality (warlike, peaceful, pacifist, deceptive or spiritual) after name in Race Info would be a useful patch (hidden trait):
Editing the first contact popup is not needed IMHO: Personality is a float value read from aiminor.wtf and stored as integer at 4081D1.
So call 405F00 Load_special_AIAgent_data_eax14h and reading [eax+4] is easy. [eax+8] would be the Explorer trait.
But where is the text strings for the personalities warlike, peaceful, pacifist, deceptive and spiritual (not trek.exe, aiminor.wtf or lexicon.dic)?
How hard would be editing wdf files & code of Race Info screen (I don't even know the file names)? Just replacing the name shouldn't require editing wdf.
Editing the first contact popup is not needed IMHO: Personality is a float value read from aiminor.wtf and stored as integer at 4081D1.
So call 405F00 Load_special_AIAgent_data_eax14h and reading [eax+4] is easy. [eax+8] would be the Explorer trait.
But where is the text strings for the personalities warlike, peaceful, pacifist, deceptive and spiritual (not trek.exe, aiminor.wtf or lexicon.dic)?
How hard would be editing wdf files & code of Race Info screen (I don't even know the file names)? Just replacing the name shouldn't require editing wdf.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7965
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Adding the Minor Race Personality in Race Info Screen?
correct should be all trek code changesSpocks-cuddly-tribble wrote: ↑Thu Dec 07, 2023 6:56 am (I don't even know the file names)? Just replacing the name shouldn't require editing wdf.
*d_rinfo.wdf called at 004C4548 is basic code area, but not seeing where race name string code is right now.
I think these descriptions were imposed by Gowron? and are never listed in any file or trek. I think even UE uses a language string to display in UE.Spocks-cuddly-tribble wrote: ↑Thu Dec 07, 2023 6:56 am warlike, peaceful, pacifist, deceptive or spiritual
But this project is similar to X, Y project.
needed
strings added to data area (warlike, peaceful, pacifist, deceptive and spiritual).
not sure if a jump table or what we would use to select correct personality string
new/borrowed wild card string "%s %s"
plus code space to use all above
edit; we might be able to use something like lexicon string id160 (but think code is a random selection?)
if personality = 0 use first string, if = 1 used 2nd string ect ...
Enormous|Juggernaut|Gigantic|Colossus|Leviathan|Tremendous
- 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?
Thank you, using this information I located:
4C2410 push eax // name string from race.rstEasy to create a test patch, with strings from an asm pointer, replacing the race name.
For AI empires it could display the current AI agenda (same code location), but needs an exception for other player empires in MP....
I can't see the personality code key in UE source code for aiminor.wtf: https://gitlab.com/stbotf/ultimate-edit ... minor.javathunderchero wrote: ↑Thu Dec 07, 2023 10:55 amI think these descriptions were imposed by Gowron? and are never listed in any file or trek. I think even UE uses a language string to display in UE.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7965
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Adding the Minor Race Personality in Race Info Screen?
\ue\gui\stbof\emp\AiminorGUI.javaSpocks-cuddly-tribble wrote: ↑Thu Dec 07, 2023 2:22 pm I can't see the personality code key in UE source code for aiminor.wtf: https://gitlab.com/stbotf/ultimate-edit ... minor.java
line 72?
- 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?
Line 65... so "AiminorGUI.0" - "AiminorGUI.4" would be labels for personality values 0-4? And where is the language file with the data?
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7965
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Adding the Minor Race Personality in Race Info Screen?
sorry I have not had much time to look at this, but helping when I canSpocks-cuddly-tribble wrote: ↑Thu Dec 07, 2023 3:04 pm Line 65... so "AiminorGUI.0" - "AiminorGUI.4" would be labels for personality values 0-4? And where is the language file with the data?
https://gitlab.com/stbotf/ultimate-edit ... properties
line 509
AiminorGUI.0=Warlike AiminorGUI.1=Peaceful AiminorGUI.2=Pacifist AiminorGUI.3=Deceptive AiminorGUI.4=Spiritual
- 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?
Don't worry, I'm just not used to the UE java files.
My first test code reads new asm strings via Personality*10 (using 50 unused bytes).
Final patch will check for AIAgents, and for other player empires just display race name in capitals (default -> MP-proof).
Else it will compose a new string:
- race name in capitals (default) +
- 5808A0 '%s - %s'
- minor Personality or current AI empire Agenda (usual letters)
If you have a better idea, let me know.
My first test code reads new asm strings via Personality*10 (using 50 unused bytes).
Final patch will check for AIAgents, and for other player empires just display race name in capitals (default -> MP-proof).
Else it will compose a new string:
- race name in capitals (default) +
- 5808A0 '%s - %s'
- minor Personality or current AI empire Agenda (usual letters)
If you have a better idea, let me know.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7965
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Adding the Minor Race Personality in Race Info Screen?
after helping me you might know how to add strings better than me.
as for font if it shares the string, I think all font will be the same (all capitals)
as for displaying "current AI empire Agenda" this would be interesting. not sure if this will give human player too much of an advantage.
- 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
Epic win.
ASM code:
ASM code:
► Show Spoiler
I'm not aware of any AI agenda which doesn't translate into 'hardcore Pakled', so no worry. Plus 'Jihad' still needs more research.thunderchero wrote: ↑Fri Dec 08, 2023 11:26 amas for displaying "current AI empire Agenda" this would be interesting. not sure if this will give human player too much of an advantage.
Last edited by Spocks-cuddly-tribble on Fri Dec 08, 2023 2:20 pm, edited 1 time in total.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7965
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Adding the Minor Race Personality in Race Info Screen?
nice, look forward to patch.Spocks-cuddly-tribble wrote: ↑Fri Dec 08, 2023 12:35 pm Epic win. Patch will be released after more tests.
No, I don't think so:thunderchero wrote: ↑Fri Dec 08, 2023 11:26 amas for font if it shares the string, I think all font will be the same (all capitals)
btw I was thinking that was 28.fnt (no lower case in file)
the only thing I wonder about is using race list area some mods with edited majors/minors might have overlap
although all mods I checked had room for 50 bytes
- 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?
Patch released in above post. Multiplayer tests would be useful before use in public mods.
I just noticed the vanilla/ECM Bynars are Warlike by default.
Post was edited and query removed since I optimised patch and relocated new strings to a safe area.thunderchero wrote: ↑Fri Dec 08, 2023 1:19 pmthe only thing I wonder about is using race list area some mods with edited majors/minors might have overlap
I just noticed the vanilla/ECM Bynars are Warlike by default.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7965
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Adding the Minor Race Personality in Race Info Screen?
Quick MP test, patch looks goodSpocks-cuddly-tribble wrote: ↑Fri Dec 08, 2023 2:23 pm Multiplayer tests would be useful before use in public mods.
(test done on patched vanilla)
if human player if AI
- Spocks-cuddly-tribble
- Code Master
- Posts: 1961
- Joined: Sun Apr 27, 2008 2:00 am
AI 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)
2.) AI at the brink of annihilation vs a stronger enemy but also at war vs a weaker empire with valid invade targets:
Bug/bias = offensive war -> should be defensive (or even Jihad?)
3.) Jihad = open war vs a stronger but not more than twice as powerful (bug?) enemy who broke 3+ treaties
Trigger using unfinished features (second hidden attitude value) should be optimised/fixed, but leads to 'dumb' random ramming in combat.
Bug/bias = defensive war -> should be offensive so the AI can get closer (defensive = new stations only in own territory)
2.) AI at the brink of annihilation vs a stronger enemy but also at war vs a weaker empire with valid invade targets:
Bug/bias = offensive war -> should be defensive (or even Jihad?)
3.) Jihad = open war vs a stronger but not more than twice as powerful (bug?) enemy who broke 3+ treaties
Trigger using unfinished features (second hidden attitude value) should be optimised/fixed, but leads to 'dumb' random ramming in combat.
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: Race Info Screen with Minor Race Personality and AI Agenda
Does the text update if their expansion agenda changes? If so, this is complete geniusSpocks-cuddly-tribble wrote: ↑Fri Dec 08, 2023 12:35 pm Epic win.
Race_Info_Patch.png
Race_Info_Screen.patch
ASM code:► Show Spoiler
I'm not aware of any AI agenda which doesn't translate into 'hardcore Pakled', so no worry. Plus 'Jihad' still needs more research.thunderchero wrote: ↑Fri Dec 08, 2023 11:26 amas for displaying "current AI empire Agenda" this would be interesting. not sure if this will give human player too much of an advantage.
- Spocks-cuddly-tribble
- Code Master
- Posts: 1961
- Joined: Sun Apr 27, 2008 2:00 am
Re: Race Info Screen with Minor Race Personality and AI Agenda
Yes, it's the agenda string used in 'map ai data type' E: viewtopic.php?p=34204#p34204
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.