Dynamic Key Variables

Dynamic Key Variables; support/discussion/questions

Moderator: thunderchero

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

Post by Spocks-cuddly-tribble »

592C28: address of loaded meplanet.bin


Wrong or overlooked? :
58C0B0: address of loaded aibldreq.bin


Also my abbreviation was here in the wrong language:
5B1A90: Mudd cheat (0=OFF, 1=ON) (0x38B27=F9-RPs /0x38B63=F10-credits)
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Post by Gowron »

Spocks-cuddly-tribble wrote:592C28: address of loaded meplanet.bin


Wrong or overlooked? :
58C0B0: address of loaded aibldreq.bin


Also my abbreviation was here in the wrong language:
5B1A90: Mudd cheat (0=OFF, 1=ON) (0x38B27=F9-RPs /0x38B63=F10-credits)
All included/clarified now :)
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Post by Spocks-cuddly-tribble »

58AE7C: address of AIAgtIdCtr (see savegames)
58AE84: address of AITaskIdCtr (see savegames)
58AE88: address of AISysUnt (see savegames)
58AE8C: address of AIShpUnt (see savegames)

5A36C8: address of systInfo (see savegames)
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Post by Gowron »

Spocks-cuddly-tribble wrote:58AE7C: address of AIAgtIdCtr (see savegames)
58AE84: address of AITaskIdCtr (see savegames)
58AE88: address of AISysUnt (see savegames)
58AE8C: address of AIShpUnt (see savegames)

5A36C8: address of systInfo (see savegames)
All included, thanks :)
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Post by Spocks-cuddly-tribble »

I moved the updated list to:

http://flocke.bplaced.net/botfwiki/inde ... _Variables


592BF8: address of loaded race.rst / 5CB2F8: a corresponding count

5A36CC: address of stellInfo (see savegames)
5A36D8: address of sector.lst (see savegames)
5A36E0: address of treaty (see savegames) /5A3748: a corresponding count

shipname.bin -> wrong/unclear
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke »

Spocks-cuddly-tribble wrote:I moved the updated list to:

http://flocke.bplaced.net/botfwiki/inde ... _Variables
Cool!
I just backed it up. If there's anything you want (like having access to the database for creating backups yourself too), let me know. :)
User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Post by Gowron »

Spocks-cuddly-tribble wrote: 592BF8: address of loaded race.rst / 5CB2F8: a corresponding count

5A36CC: address of stellInfo (see savegames)
5A36D8: address of sector.lst (see savegames)
5A36E0: address of treaty (see savegames) /5A3748: a corresponding count
Included now, thank you :)
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1884
Joined: Sun Apr 27, 2008 2:00 am

Post by Spocks-cuddly-tribble »

Hi Flocke,

some notes wrt:

http://flocke.bplaced.net/botfwiki/inde ... &oldid=153



@ the following seems to match gameInfo doc:

Be careful. If at all, at least they're somehow converted when writing to savegame, ini or crashlog - resulting in inconsistencies and even some bugs:

E.g. "5A2B78: generated monsters bitmask" is not stored in savegames or at least not loaded from savegames, see Scheme of the Random Events (2.4)

Also, as you noted, the difficulty level here has a deviation!



@ removed galInfo content duplicate

In the assembler code they're accessed directly (via the removed asm-addresses). So they're easy to miss now, if one just enters the address of an unkown/unclear variable into F3 page search (that's what I do in this case).

Code analysis still should be the focus of the page. So I'd suggest to keep all directly accessed addresses and maybe just move & mark related stuff as you did w.r.t. gameInfo.



For extra noob clarity, maybe we should also add some notes like:

5A2B40: Minor Races setting (0=none, ..., 3=many) -> sometimes gets loaded at [+2] to read the difficulty level
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke »

hi Tribble, funny you address me that way here but well,
if there's partially really a difference I agree it should be made clear, and I also understand you want them accessible by browser search function.

duplicates of completely same data however isn't much of use in my opinion and only lessening the overview, that's why I removed parts and I also incorporated some stuff to the savegame listing that's been missing over there and most likely in there even if eventually unread.
Not all of my research has ever been confirmed anyway so if there's a false one just fix it, that's the intent of a wiki.

But as you noted, some difference made me cautious not to simply remove all the gameInfo. I'm fine if we keep all the previous dynamic variables in boxes like with gameInfo, and if you have disproof, simply revert my changes of the savegame listing.
Though I already thought if we shouldn't split all these file infos like gameInfo,... into seperate topics, link there from dynamic key variables as well as from the savegame listing and just note differences in there.
This would help to preserve overview AND consistency.
What ya think?

Btw, I'm not claiming lead on the wiki, don't hesitate to correct me,
actually cause you're working on that area most actively I'd be happy to give you the lead. :)

Oh, and a note on what got me to take a look in that area, and also cause I think this fits well to the dynamic key variable topic, today I figured how to dynamicly access and probably also change all of the key variables during runtime. I'd just wish you learn some C++ Tribble. :D

In a dll loaded by trek.exe, it can simply be achieved using a reinterpret_cast on one of those dynamic key variables.

Edit: now I also figured how to pass functions to trek.exe and call them using asm code, allowing for unlimited additional code space, so if you need some, you know where to go *haha* :D
therefore I reuse an old key variable or empty space, store a pointer to a function pointer array and call any of the functions with the corresponding function pointer offset in the array like this:

Code: Select all

// get function pointer array
MOV EAX,DWORD PTR DS:[5CD658]
//get 2nd function
MOV EAX,DWORD PTR DS:[EAX+4]
// call it
CALL EAX
5CD658 is just a random address in data segment of trek.exe
of cause also parameters could be added and a return value retrieved,
and cause C++ also supports embedding asm code you could even move some code from trek.exe to whatever dll got wrapped for the job, eventually even without adjustment :roll:

I always thought it would be lots more complicated than this. I didn't even get the idea to access a key variable that directly till today. :?

Edit2:
Hey, now I also found the subroutines for loading a game, saving a game, starting a new one and ending turn!
Well hasn't been that hard and I wouldn't wonder if you already knew them. They've been missing in the wiki though, so I added them.
I don't have to tell ya what this could be used for in combination with above, do I? :D

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

Post by Spocks-cuddly-tribble »

Flocke wrote:funny you address me that way here but well
I just prefer to use the corresponding afc-topics instead of wiki talk pages (cause see below). :)


Flocke wrote:Though I already thought if we shouldn't split all these file infos like gameInfo,... into seperate topics, link there from dynamic key variables as well as from the savegame listing and just note differences in there.
This would help to preserve overview AND consistency.
What ya think?
I'd rather tolerate some duplicates in the savegame / asm data:
me wrote:they're easy to miss now, if one just enters the address of an unkown/unclear variable into F3 page search
Your way, a noob would have to search through all wiki pages for an unknown variable, cause "unknown" means, at the time, it's unknown to which file it belongs (a simple case of deductive logic), but it's your choise in the end.

All in all my work is done, and I have no further ambitions. It's the turn of the upcoming modders now, therefor I addressed this in public, so that people who are interested in participation can point out their preferences (and I think there're some lurking in background, despite of not posting yet). :)


Flocke wrote:now I also figured how to pass functions to trek.exe and call them using asm code... I always thought it would be lots more complicated than this. I didn't even get the idea to access a key variable that directly till today.
IIRC suchlike stuff is already a common procedure in BotF.

And yes, this danymic stuff is *really* useful if one knows how to use it. :wink:

Flocke wrote:I also found the subroutines for loading a game, saving a game, starting a new one and ending turn!
Well hasn't been that hard and I wouldn't wonder if you already knew them. They've been missing in the wiki though, so I added them.
There're tons of useful & known sub's waiting for the wiki (just read some of the modding topics), but as I said, it's the turn of the upcoming modders now...



PS: At the end of the year I'll see to reinstall BotF and then I'm expecting some cool stuff in mods. Otherwise I'd be forced to suggest some unproductive afc-member to the new borg queen sisters (TM) as a replacement for their runaway android for "special purposes": :mrgreen:

:up:
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke »

Spocks-cuddly-tribble wrote:
Flocke wrote:funny you address me that way here but well
I just prefer to use the corresponding afc-topics instead of wiki talk pages (cause see below). :)
I know and would have missed discussion over there, but addressing me directly in a forum I havn't posted is a little funny though. :lol:
Spocks-cuddly-tribble wrote:
Flocke wrote:Though I already thought if we shouldn't split all these file infos like gameInfo,... into seperate topics, link there from dynamic key variables as well as from the savegame listing and just note differences in there.
This would help to preserve overview AND consistency.
What ya think?
Your way, a noob would have to search through all wiki pages for an unknown variable, cause "unknown" means, at the time, it's unknown to which file it belongs (a simple case of deductive logic), but it's your choise in the end.
Well, we could still list these offsets... :roll:
Spocks-cuddly-tribble wrote: All in all my work is done, and I have no further ambitions. It's the turn of the upcoming modders now, therefor I addressed this in public, so that people who are interested in participation can point out their preferences (and I think there're some lurking in background, despite of not posting yet). :)
Comeon, learning some basic C++ isn't that hard, not for a person with your skill, I'd help ya. :D
Spocks-cuddly-tribble wrote:
Flocke wrote:now I also figured how to pass functions to trek.exe and call them using asm code... I always thought it would be lots more complicated than this. I didn't even get the idea to access a key variable that directly till today.
IIRC suchlike stuff is already a common procedure in BotF.
I know, but not access them directly with a simple *reinterpret_cast<value_type>(asm_address) through dll boundary. Just didn't expect this, thought this would be prevented by dll scope. :)
Spocks-cuddly-tribble wrote:And yes, this danymic stuff is *really* useful if one knows how to use it. :wink:
Don't tell me it's not tempting you. ;)
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER »

I know this technically isn't the place but since the wiki is already being discussed here...

It seems the wiki site is currently "invisible" to the rest of the net. It doesn't show up in search results even if you search for the site itself - only afc shows up. If possible this should really be fixed. I'm guessing the robots file is telling crawlers to go away(?).
User avatar
robert_defore
Lieutenant-Commander
Lieutenant-Commander
Posts: 141
Joined: Tue Jul 15, 2008 2:00 am

Post by robert_defore »

Whoohoo, I think I just made a mess in my shorts reading this outstanding news, since this is OT I will keep it short but I suppost this might be the possible "future breakthrough in computers" I was hinted to about. I really appreciate you guys blazing the trail on this, I havent had much time to delv into the code hacking part of modding with BOTF but at the rate the community is going we should have meade BOTF into BOTF2 before the official BOTF2 is ready.... :lol: 8)
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3197
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Post by Flocke »

DCER wrote:I know this technically isn't the place but since the wiki is already being discussed here...

It seems the wiki site is currently "invisible" to the rest of the net. It doesn't show up in search results even if you search for the site itself - only afc shows up. If possible this should really be fixed. I'm guessing the robots file is telling crawlers to go away(?).
Yes that is right, I excluded crawlers by a meta tag. The wiki was meant for afc and as long there's only modding stuff within I see no reason to change that.
User avatar
DCER
Code Master
Code Master
Posts: 683
Joined: Sat Apr 26, 2008 2:00 am

Post by DCER »

Oh, ok. I thought that was by mistake.
Post Reply

Return to “Dynamic Key Variables”