disassembler help/energy screen project

Energy Screen with 15+ Building Buttons + patchtool; support/discussion/questions

Moderator: thunderchero

User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3178
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: disassembler help/energy screen project

Post by Flocke »

Peter1981 wrote:just an off the cuff thought but wouldn't larger task forces need some consideration of the auto-battle at least and maybe the battle calculations as well? or does trek.exe not care about the individual ships in a task force but its combined overall stats
of course there'll be multiple references to taskforce size, all will have to be found and adjusted just as usual ;)
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: disassembler help/energy screen project

Post by QuasarDonkey »

Peter1981 wrote:just an off the cuff thought but wouldn't larger task forces need some consideration of the auto-battle at least and maybe the battle calculations as well? or does trek.exe not care about the individual ships in a task force but its combined overall stats
I don't think would matter that much in the end. See it's all done through arrays and loops, so in C programming language it might like this:

Code: Select all

struct TaskForce_t { // (sizeof=0x6C)
    int fleetId;
    int shipCount;
    int shipIDs[9];
    int mission;
    ...
    int cloaked;
}
and the code would use it like this:

Code: Select all

for (i = 0; i < 9; i++) {
    id = taskForce.shipIDs[i];
    ...
}
So we'd have to patch a lot of

Code: Select all

cmp eax, 9
instructions, etc., to make the code handle more than 9.

But we'd also need to move the shipId's array within the TaskForce structure, here's how we'd expand it to 18 ships:

Code: Select all

struct TaskForce_t { // (sizeof=0x6C + 18*4)
    int fleetId;
    int shipCount;
    int oldShipIDs[9]; // NO LONGER USED
    int mission;
    ...
    int cloaked;
    int newShipIDs[18]; // <- ship id's are moved to the end of the structure
}
and we'd change a lot references to the shipId's offset within Trek.exe. Note this is the high-level theory behind it, in practice, we're just fiddling with offsets, i.e. the original uses offset 8 within the TaskForce structure, we want to change it to offset 0x6C. That's the basic idea. This is the basic method I used for extending the Energy Screen. If it's done right, the code will still behave exactly as before.

I've done some basic research into this mod, and it seems to be possible, but at the very least it would break compatibility with save games, i.e. you couldn't use modded save games with an unmodded version of Trek.exe and vice versa. A small price to pay.

Though I wouldn't hold my breath waiting for this mod, I can't guarantee it will work, there are far more complications than the Energy Screen Project. But I'll try.
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: disassembler help/energy screen project

Post by Tethys »

Might I add in that since you are diving into the ship side of things now, if you can look into creating more ship types such as Cruiser, Destroyer, etc. IF you dont stumble across it no worries, but this would just be nice for AI improvement (considering the AI adapting or more patching)

You are my hero :D
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Re: disassembler help/energy screen project

Post by Peter1981 »

fair point if its arraies QD just a few values and some (read lots) of codeing.
Post Reply

Return to “Energy Screen with 15+ Building Buttons + patchtool”