Monster Editing Info

Monster Editing Info; support/discussion/questions

Moderator: thunderchero

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1961
Joined: Sun Apr 27, 2008 2:00 am

Re: Monster Editing Info

Post by Spocks-cuddly-tribble »

Tethys wrote: Fri Oct 06, 2023 7:18 pmSo I imagine this will help alleviate any potential crashing for inhabitant check.
More than that. It will fix behavior glitches for your GOD stations. :wink:

Say you have an affiliation treaty with a minor with 'GOD' station and the above Edo codes still in trek.exe:
If you are at war with minor race 0x12 your affiliated station will open fire at your ships (unless part of your empire). :evil:
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2404
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: Multiple Edo Gods (hacky way)

Post by Tethys »

Spocks-cuddly-tribble wrote: Thu Oct 05, 2023 9:19 pm
Tethys wrote: Thu Oct 05, 2023 4:38 pmsay hello to Nor Class Stations in Bajor and Cardassia :mrgreen:
Sorry to spoil the fun, but there is still much work to do.

There is many hardcoded checks for EDO in bitmasks and special pointer for EDO alienInfo entry to check relationship of others to the EDO in combat.
One of my fixes even adds another special EDO pointer: viewtopic.php?p=29166#p29166

So you'd have to switch all codes to dynamic calculations via race ID (bitmask and alienInfo). One example of many:
00430620         test    byte ptr ds:dead_races_BitMask_1+2, 4  // check if EDO race still alive for race ID 18 / 12h

00430653         mov     eax, offset AlienInfo_EDO_entry  // get AlienInfo entry for relationship test
EDIT: A solution for you the check the minor race ID by loading systInfo :up:
5B5560 TC_sector_lst_entry
But there is at least six xrefs to 5A2490 AlienInfo_EDO_entry, so you're going to have a lot of fun with this...
5A2490 is full of zeroes in both HxD and Olly. IDA showing ??'s so I am assuming there is some additional code being obtained from somewhere. I cannot for the life of me find the value relative to in-built Edo race check 12h. All attempts to even change the inhabitant race per Edo god (with even the one map monster) using the already discovered race cmp locations, the bitmask is still hard coded to race 12h. Even though ALL race cmp and mov for the alien's system inhabitant has been changed to 06, still declaring war for race 12h for the tactical combat attack case/at war check.

I'd like to not disable the bitmask if possible, so the war checks would function, but finding the seemingly nonexistent value required is proving challenging to say the least. I also looked into the alienInfo file which supposedly has some special pointer for Edo. But no such value I could find on any entries within. My guess is it is some elusive stack pointer moved into a value for cmp later in the exe somewhere. You're right, lot's of fun...
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1961
Joined: Sun Apr 27, 2008 2:00 am

Re: Multiple Edo Gods (hacky way)

Post by Spocks-cuddly-tribble »

Tethys wrote: Fri Jan 26, 2024 11:32 am5A2490 is full of zeroes in both HxD and Olly. IDA showing ??
Direct asm pointer to the EDO entry in loaded AlienInfo, starting at 5A2010, data format see wiki: http://flocke.bplaced.net/botfwiki/inde ... #alienInfo
Even labeled in my IDA database. :wink:
Tethys wrote: Fri Jan 26, 2024 11:32 amI'd like to not disable the bitmask if possible, so the war checks would function
Possible but, as told, a lot of work due to many codes, each location requires dynamic recoding efforts.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2404
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: Monster Editing Info

Post by Tethys »

Yes I use that wiki religiously now, and perhaps the one in the UE topic more, but still dont really understand a few things (perhaps they are not explained in deatails)

I believe what you are referring to is this where 0x20 = the Acamarians.
Offset 0x0020 = known races (bitwise XOR with 0x01 = card, 0x02 = fed, 0x04 = ferg, 0x08 = kling, 0x10 = rom, 0x20 = acam ...)

I just want to confirm that each raceID in these examples are doubled exponentially? The difference between Klingons and Romulans is 16, the difference between Romulans and Acamarians is 32, so this means the difference between Acamarians and next race would be 64, correct, and then 128, 256, and so on until reaching the end of the races, if my math is correct?

Code: Select all

05h = 20 00 00 00(32)
06h = 40 00 00 00
07h = 80 00 00 00
08h = 00 01 00 00
09h = 00 02 00 00
0Ah = 00 04 00 00
0Bh = 00 08 00 00
0Ch = 00 10 00 00
0Dh = 00 20 00 00
0Eh = 00 40 00 00
0Fh = 00 80 00 00
10h = 00 00 01 00
11h = 00 00 02 00
12h = 00 00 04 00(262144)
Another question, would there be some list that lists all the racesID's in this scenario? We already know raceID's by true ID, but I don't think I've seen much info wrt to these obfuscated raceIDs.
Spocks-cuddly-tribble wrote: Mon Jan 29, 2024 12:59 pm Possible but, as told, a lot of work due to many codes, each location requires dynamic recoding efforts.
There are only the 6 offset pointer loaded from alienInfo for the bitwise xor. I would simply cmp inhabitant to get the correct variable for the correct raceID, as I had done with your wonderful Borg racename change mod ;) It seems like a lot less work than adding galaxy shapes :lol:

In short, I am looking for alienInfo loaded and some xor to the alienInfo+offsetEDO (id obfuscated)

However, the confusion arises when seeing Offset 0x0018 = starID of homesystem. Leads me to believe the ID are from 00-1F. I'm not sure where to go from here. I now believe this is the random value assigned to inhabited systems during galaxy generation and colonization.

Yes there is the possibility of disabling all the race checking stuff, but I feel like THAT is a lot more work, because then I would have to copy the Gomtuu alien to the relocation table and repurpose that for the "new Edo multiple Gods", change retreat > attack, and increase the hail chance to around 75%, to giving a 25% of attack on hail. Or if enemy weapons are unlocked, override and attack every time (hail vs monster would still get the 25% chance)
Last edited by Tethys on Mon Jan 29, 2024 5:24 pm, edited 2 times in total.
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1961
Joined: Sun Apr 27, 2008 2:00 am

Re: Monster Editing Info

Post by Spocks-cuddly-tribble »

Easiest way is to write a new shared sub:

- read the star ID from [5B5560] TC_sector_lst_entry (using wiki info on sector.lst)
- load systInfo entry by star ID and read pop race ID aka inhabitants
- if empire 0-4 then exit set eax 0 (best check >4 and <24h in case pop is dead)
- else load start position minor race alienInfo entry to eax (base + race ID * entry size)

Then call that new sub from all listed code positions (you can remove dead race bitmask checks and old fixed EDO alienInfo pointers).

Just move alienInfo entry to right register (most eax), the remaining codes check either for enemy (war) or ally status or skip if register is zero.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2404
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: Monster Editing Info

Post by Tethys »

Spocks-cuddly-tribble wrote: Mon Jan 29, 2024 5:17 pm Easiest way is to write a new shared sub:

- read the star ID from [5B5560] TC_sector_lst_entry (using wiki info on sector.lst)
- load systInfo entry by star ID and read pop race ID aka inhabitants
- if empire 0-4 then exit set eax 0 (best check >4 and <24h in case pop is dead)
- else load start position minor race alienInfo entry to eax (base + race ID * entry size)

Then call that new sub from all listed code positions (you can remove dead race bitmask checks and old fixed EDO alienInfo pointers).

Just move alienInfo entry to right register (most eax), the remaining codes check either for enemy (war) or ally status or skip if register is zero.
Ahhh, I see, that's going to be tricky for me but I am up for these challenges in recent times. I have not written a subroutine from scratch, only copied and repurposed preexisting ones to the relocation table for extended features. Finding the right registers to use might be the barrier for me though. I will surely be referencing this topic heavily.
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2404
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: Monster Editing Info

Post by Tethys »

There are 2 issues I seem to be having with my Edo god aliens.

1. If race 12h is being attacked by a monster, game will crash due to wrong alien in 12h home system ie ailen!=0 narrowed it down to

Code: Select all

00471330                             alien_0_loop_471330:    ; "alien != 0"
Depending on dead_race_bitmask1 it would either xor the current eax or load the Edo offset to eax and then move the eax into the ecx which is looking like it might be where the Edo God is contained (471348 test ecx), and it is looping back to assert_failure. If the ecx is not equal then proceeding to secondary? Edo_alive_2 check? esp+30h moved into the esi (error code 2293 last location 47130B used esi). Test esi, if not equal returns to edo loop.

2. If war declared on race 12h, Edo alien will attack even if hail used. Narrowed down to war check, which can be disabled, but would nerf the God. Looking to shift the bitmask if possible to race 05 or 06. From there dynamic calculation would take over, cmp 05/06 and send to relevant bitmask location via raceID (also to include major race for station takeover > new owner).

Other crash logs have been avoided with coding to force system validity/race comparisons. No issue encountered there. This is mostly for my own information but feel free to add more info if you like.
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1961
Joined: Sun Apr 27, 2008 2:00 am

Re: Monster Editing Info

Post by Spocks-cuddly-tribble »

Tethys wrote: Thu Feb 01, 2024 11:26 amIf race 12h is being attacked by a monster, game will crash due to wrong alien in 12h home system ie ailen!=0 narrowed it down to

Code: Select all

00471330                             alien_0_loop_471330:    ; "alien != 0"
Default code for EDO god (monster race ID 2A). You shouldn't change the shared monster ID of your new minor stations or the code switch i.e. keep 0x2A.


I was a bit tricky, but I coupled all monster and AI features for monster ID 2A (ex EDO GOD) with the dynamic minor race IDs each.
So you can give each and any minor race its own ex-god station during galaxy generation. :wink:

I did not test if a minor having a station and own ships causes issues, so best first test with vanilla!

Here is hex dump from compare trek tool, so you can create your own patch (based on vanilla code - monster ID is 2A - includes dynamic ID auto hail fix):

vanilla

Code: Select all

0x0002b00d 31 d2 66 8b
0x0002b012 34 89 f0 e8 66 48
0x0002b019 00
0x0002b1c9 31 d2 66 8b
0x0002b1ce 34 89 f0 e8 aa 46
0x0002b1d5 00
0x0002b391 31 d2 66 8b
0x0002b396 34 89 f8 e8 e2 44
0x0002b39d 00
0x0002bbba 31 d2 66 8b
0x0002bbbf 34 89 f0 e8 b9 3c
0x0002bbc6 00
0x0002bfb6 31 d2 66 8b
0x0002bfbb 34 89 f0 e8 bd 38
0x0002bfc2 00
0x0002c3b3 31 d2 89 f8 66
0x0002c3b9 56 34 e8 c0 34
0x0002c3bf 00
0x0002fa20 f6 05 52 2b 5a 00 04 74 2a 31 c0 85 c0 74 35 31 d2 66 8b
0x00070701 bf 14 b6 57 00 bd 48 ae 57 00 be f5 08 00 00 66 83 79 44 12
0x00070716 85 83 00 00 00 f6 05 52 2b 5a 00 04 0f 84 8e 00 00 00 31 c0 89 c1 85 c0 75 1c bb 30 b6 57 00 ba f9 08 00 00 b8 48 ae 57 00 e8 6c 6e 09 00 85 c0 74 04 85 c9 74 e4
0x000767fc f6 05 52 2b 5a 00 04 74 33 31 c0
0x00076879 c7 44 24 14 12 00 00 00
0x00078365 66 3d 29 00 73 14 66 3d 28 00
0x0007837f 0f 86 22
0x00078384 ff 66 3d 2a 00 0f 84 18 ff ff ff
0x00151da3 f6 05 52 2b 5a 00 04 0f 84 6a 00 00 00 31 c0
0x00151eb1 f6 05 52 2b 5a 00 04 0f 84 d7 00 00 00 31 c0
0x00152228 f6 05 52 2b 5a 00 04 0f 84 6a 00 00 00 31 c0
patch

Code: Select all

0x0002b00d 0f b7 50 34
0x0002b012 8b c6 e8 67 48 00
0x0002b019 5a
0x0002b1c9 0f b7 50 34
0x0002b1ce 8b c6 e8 ab 46 00
0x0002b1d5 5a
0x0002b391 0f b7 50 34
0x0002b396 8b c7 e8 e3 44 00
0x0002b39d 5a
0x0002bbba 0f b7 50 34
0x0002bbbf 8b c6 e8 ba 3c 00
0x0002bbc6 5a
0x0002bfb6 0f b7 50 34
0x0002bfbb 8b c6 e8 be 38 00
0x0002bfc2 5a
0x0002c3b3 0f b7 56 34 56
0x0002c3b9 c7 e8 c1 34 00
0x0002c3bf 5a
0x0002fa20 8b 44 24 18 83 c0 38 e8 84 d4 00 00 e8 e4 0c 04 00 0f b7
0x00070701 0f b6 49 44 c1 e1 06 81 c1 10 20 5a 00 eb 3c a1 60 55 5b 00
0x00070716 b7 40 0c 69 c0 28 03 00 00 03 05 c8 36 5a 00 0f b6 40 44 c1 e0 06 05 10 20 5a 00 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
0x000767fc e8 0f 9f ff ff 90 90 90 90 90 90
0x00076879 0f b6 46 44 89 44 24 14
0x00078365 3c 2a 74 16 3c 29 74 04 3c 28
0x0007837f e8 8c 83
0x00078384 8b 5c 24 10 80 7c 98 28 04 75 e2
0x00151da3 e8 68 e9 f1 ff 90 90 90 90 90 90 90 90 90 90
0x00151eb1 e8 5a e8 f1 ff 90 90 90 90 90 90 90 90 90 90
0x00152228 e8 e3 e4 f1 ff 90 90 90 90 90 90 90 90 90 90

ASM:
► Show Spoiler
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2404
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: Monster Editing Info

Post by Tethys »

Interesting, I didn't expect code. I will give this a try real soon. Been busy with life and such with my son and newborn daughter, she is just 2 weeks old as of today.

I ended up also switching out the Echo Papa 2B and put 2A Edo God in it's place, which makes the station shoot back if attacked. I have some ideas for switchable cases for that, though, for a while I was trying to use the Chodak routine + 3 turn "Hold" but the station never fired. I think I can come up with a switchable case as I believe it may be possible to test attacking ships weapons lock for a conditional jump to either "Hold" or "Attack". If inhabitant < 05 cmp ds_player_emps(or whatever it is) if true cmp emp ships weapons lock if false "Hold" if true "EdoAttack".

I will be a few days, but I will report back with initial results.
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1961
Joined: Sun Apr 27, 2008 2:00 am

Re: Monster Editing Info

Post by Spocks-cuddly-tribble »

Congrats! No urgency, code won't run away. :wink: Default EDO GOD code 2A retaliates instantly when attacked!

There is just that bug with unchanged initial commands (glitch where the game either crashes or ships don't fire - then the monster doesn't fire either, unless war with minor): viewtopic.php?p=29642#p29642

And the issue with dead angels so the vanilla EDO GOD cannot target certain positions (when exploiting above bug first): viewtopic.php?p=46459#p46459
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Final Run
Lieutenant-Junior Grade
Lieutenant-Junior Grade
Posts: 89
Joined: Mon Apr 13, 2015 3:34 pm

Re: Adding the Planet Killer

Post by Final Run »

Spocks-cuddly-tribble wrote: Tue May 03, 2016 3:43 pm Omission broken/unfinished feature fix wrt. the Doomsday Machine files in stbof.res (cone.hob / gif)

monster raceID 25h reads lexicon entry 205 'the crystal entity' change to -> 'Alien Entity'

shiplist.sst entry of crystal -> 'Unknown Lifeform' change to -> 'Crystal Lifeform'
I wanted to note my interest in this topic ever since implementing the planet killer in the mod I'm working on.
Went through the readme in planetkiller.zip, added the neccessary files, then went to edit/text/Lexicon in UE and making changes to stats after.

Never managed to actually get it to work though. Planet killer is yet to spawn in all my games, in fact having random events enabled seems to crash the game later in the game when clicking turn. Curiously "appears in screensaver" is unchecked. Is that some clue to what I did wrong?
Attachments
Screenshot_12.png
Screenshot_12.png (42.99 KiB) Viewed 674 times
Screenshot_11.png
Screenshot_11.png (9.34 KiB) Viewed 676 times
doomsday.png
doomsday.png (29.55 KiB) Viewed 676 times
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1961
Joined: Sun Apr 27, 2008 2:00 am

Re: Adding the Planet Killer

Post by Spocks-cuddly-tribble »

Final Run wrote: Wed Feb 07, 2024 10:06 pmNever managed to actually get it to work though. Planet killer is yet to spawn in all my games, in fact having random events enabled seems to crash the game later in the game when clicking turn. Curiously "appears in screensaver" is unchecked. Is that some clue to what I did wrong?
Best test the patch and the files with vanilla (you might need to edit shiplist.sst?). If it works then there is a code conflict with your mod exe.

I developed the asm code with different options for some picture files. The final patch, all stbof.res files and editing the ECM shiplist were a courtesy of thunderchero. So I'm not familiar with potential obstacles for other mods.

thunderchero originally inspired the patch by pointing out the unused cone.hob and receated it with the right orientation. :up:

Here is link to ECM trek.exe patch: viewtopic.php?p=60039#p60039
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Final Run
Lieutenant-Junior Grade
Lieutenant-Junior Grade
Posts: 89
Joined: Mon Apr 13, 2015 3:34 pm

Re: Monster Editing Info

Post by Final Run »

So first tried adding it with a fresh vanilla game from the 2.0.3 installer. Unfortunately did not work. I've not looked into shiplist.sst (don't know how to open the file after extraction), but I have no other ideas as to what could be preventing it from showing so maybe that is the problem.

I've included a video run-through of all the changes made recording UE. I did not miss anything from the patch directions to my knowledge. https://youtu.be/mwdoapwLMRw

Maybe the order I did it in matters? (UE edits/new files before adding patch) Nonetheless I removed the planet killer patch and readded it after all necessary changes-- to my surprise I opened the game and even checked the ship display pressing pause to cycle through all ships/monsters and still no luck! :shock:

Upon opening Error Correction Mod though I did quickly find the planet killer in the cycle. :mrgreen:
I developed the asm code with different options for some picture files. The final patch, all stbof.res files and editing the ECM shiplist were a courtesy of thunderchero. So I'm not familiar with potential obstacles for other mods.
Well regardless, big appreciation to both of you for bringing to it to life. And i'll be level with you, I'm not so sure why I'm so fixated on getting the Doomsday Machine working (other than the fact that we play with randoms events turned on a lot to spice-up MP a bit), but having been agonizing over this for nearly a year now and at this point I *must* have it, agh :lol:
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7966
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Monster Editing Info

Post by thunderchero »

Final Run wrote: Fri Feb 09, 2024 12:24 am Upon opening Error Correction Mod though I did quickly find the planet killer in the cycle. :mrgreen:
screen saver changes were more than likely changed later (after release of files), you need to check box in UE and test if it then displays in screensaver.
Final Run wrote: Wed Feb 07, 2024 10:06 pm Never managed to actually get it to work though. Planet killer is yet to spawn in all my games, in fact having random events enabled seems to crash the game later in the game when clicking turn.
does this happen in single player or only MP games? (might have a code issue in MP)

don't forget to better test to see if doomsday is spawning use mudd and F6 bitmask to spawn more random events. :wink:

note; doomsday model uses vanilla "TEMP" phaser slot.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1961
Joined: Sun Apr 27, 2008 2:00 am

Re: Monster Editing Info

Post by Spocks-cuddly-tribble »

For now ignore (unrelated to main random events/monster issue):

- screen saver
- trek.exe phaser slot (only for tactical combat)
- multiplayer tests

What info/code/file is wrong/missing in patch/files preventing it from working for you in vanilla?

My best guess is it crashes when the game tries to add the new monster to the map (or clicking on it)?

thunderchero wrote: Fri Feb 09, 2024 12:32 pmdon't forget to better test to see if doomsday is spawning use mudd and F6 bitmask to spawn more random events. :wink:
Yes, best large map, random ON, impossible, after turn 11+ each turn F6 then check map with F11. Until it crashes or adds the new monster.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
Post Reply

Return to “Monster Editing Info”