Welcome, Guest. Please login or register.
April 19, 2024, 01:40:52 PM

Login with username, password and session length

Search:     Advanced search
we're back, baby
*
Home Help Search Login Register
f13.net  |  f13.net General Forums  |  Gaming  |  Topic: Help with modding game files 0 Members and 1 Guest are viewing this topic.
Pages: [1] Go Down Print
Author Topic: Help with modding game files  (Read 2987 times)
calapine
Terracotta Army
Posts: 7352

Solely responsible for the thread on "The Condom Wall."


on: November 03, 2020, 03:16:19 PM

So, I have a huge problem that goes beyond my basic PC knowledge.

I am trying to change a value in game files that is beyond the reach of the scenario editor.


The game is "Great Naval Battles: North Atlantic 1939–1943"




The value is this:



It's a "YES/NO" value which varies base by base and can be viewed but not changed within the scenario editor.


Out of all the files in the "DATA" folder a 3 sets of filetypes seem to be respsonsible for maps and bases:






By process of process (removes files and seeing what happens) I am pretty sure that MPGUADAL.MPP is the one holding the relevant information.

It looks to me like some sort of binary format?



So I got an hex editor to take a look at it.

My thinking was that out of all the map information, this value set must be stored for each base and because bases have identical values there should be a pattern.




Since I have hardly any programming knowledge nor did anything like this before, my approach was to simply scroll through the file, try to several find identical or similar sections, then apply changes, load up the editor again and see if it has any effect.




I am almost ashamed to say I probably spent two hours doing this. Nothing I did had any discernible effect whatsoever on the scenario. (Removing the file prevents the specific map to load, so the file is used.)

Is there any way I can turn the files into a human readable format? Or analyse the file structure? How did people do this when they modfied game .exes to remove the copy protection?

I need help.  (probably in more than one way) Ohhhhh, I see.

Gamesfiles: https://drive.google.com/drive/folders/1IGYrEHvtg6cuKosdTePCiBcpdO07iBwe?usp=sharing
« Last Edit: November 03, 2020, 03:19:38 PM by calapine »

Restoration is a perfectly valid school of magic!
Trippy
Administrator
Posts: 23619


Reply #1 on: November 03, 2020, 04:04:57 PM

The way I would approach it is searching for the Hanger and Runway values in little endian hex format and then working backwards from there to correlate the values you see to Repair, Status, Runway and Type and then Invasion is likely a single byte field with 0 or 1 value.

E.g. using your Hanger = 200, Runway = 50 example I would look for something like:

C8 32 (stored as one byte for each)
C8 00 32 00  (stored as two bytes for each)
C8 00 00 00 32 00 00 00 (stored as 4 bytes)

If you can find the pattern similar to the above, then you can work backwards by bytes / two bytes / four bytes for the other values (Repair, Status, etc.) and then look for a 01 value by itself to represent "YES" as the Invasion value.

Edit: the fields could be ordered in reverse as well so you may need to search with the values flipped like:

32 C8
32 00 C8 00
32 00 00 00 C8 00 00 00

and then check for the 01 going forwards not backwards.

« Last Edit: November 03, 2020, 07:03:30 PM by Trippy »
calapine
Terracotta Army
Posts: 7352

Solely responsible for the thread on "The Condom Wall."


Reply #2 on: November 04, 2020, 10:43:27 AM

Thank you! Very much.

Learning here, so even if the modding doesn't work out it will still have been worth it.



E.g. using your Hanger = 200, Runway = 50 example I would look for something like:

C8 32 (stored as one byte for each)
C8 00 32 00  (stored as two bytes for each)
C8 00 00 00 32 00 00 00 (stored as 4 bytes)


I tried, but couldn't find a match, so took a step back and tried something easier. The WEAPONS.DAT file has the clear text name of the weapons listed before the values, which is obviously a great help.

Here replacing values actually worked perfectly:





Now the 8th Year torp has exactly the same speed and range values as the Long Lance. And the name change worked too:




What I strill struggle with is understanding how the HEX string:

B0 6A 21 00 E0 67 35 00 50 AE 42 00 2C 00 23 00 16 00 FF 14 30 2A CC 53

translates to these range and speed values:

21900 44
35000 35
43700 22


Any idea, anyone?

« Last Edit: November 04, 2020, 10:52:13 AM by calapine »

Restoration is a perfectly valid school of magic!
Zetor
Terracotta Army
Posts: 3269


WWW
Reply #3 on: November 04, 2020, 11:11:28 AM

When looking at the string of bytes from the left, start splitting them up into groups of 4 (each value is stored in 32 bits), and reorder the bytes within each 'block of 4' from right to left (that's the endianness stuff). The value being stored is actually a fixed-point decimal, with the last two values being after the decimal point.

So the first 4 bytes are B0 6A 21 00 -> 00 21 6A B0 -> 21900.00
Next 4 bytes are 35000.00
4 bytes after that are 43700.00

Then the next 6 bytes are three 16-bit integers: 2C 00 -> 00 2C -> 44 etc. Last six bytes are some ~sekrit data~ (or more likely, some kind of internal reference?)
« Last Edit: November 04, 2020, 11:16:11 AM by Zetor »

calapine
Terracotta Army
Posts: 7352

Solely responsible for the thread on "The Condom Wall."


Reply #4 on: November 04, 2020, 11:14:58 AM

Split them up into groups of 4 (each value is stored in 32 bits), and reorder the bytes from right to left (that's the endianness stuff). The value being stored is actually a fixed-point decimal, with the last two values being after the decimal point

So the first 4 bytes are B0 6A 21 00 -> 00 21 6A B0 -> 21900.00
Next 4 bytes are 35000.00
4 bytes after that are 43700.00

Then the next values seem to be 16-bit integers: 2C 00 -> 00 2C -> 44


Right. Heart  I'm on it!

Edit:



« Last Edit: November 04, 2020, 11:26:56 AM by calapine »

Restoration is a perfectly valid school of magic!
Ashamanchill
Terracotta Army
Posts: 2274


Reply #5 on: November 04, 2020, 11:22:51 AM

Don't invade Rabaul! Bypass it. Bypass it!

A poster signed by Richard Garriot, Brad McQuaid, Marc Jacobs and SmerricK Dart.  Of course it would arrive a couple years late, missing letters and a picture but it would be epic none the less. -Tmon
calapine
Terracotta Army
Posts: 7352

Solely responsible for the thread on "The Condom Wall."


Reply #6 on: November 04, 2020, 11:30:07 AM

Don't invade Rabaul! Bypass it. Bypass it!

I am playing the Japanese side!  Oh ho ho ho. Reallllly?

And that's exactly the issue: The dumb AI sends troops transports to Rabaul while letting the Marines starve to death on Henderson Field. I know from play-testing that setting the base to invasion=No prevents this.

Edit: Basically I am trying to improve the campaign and fix oob and realism issues by diving into primary sources to answer pressing questions like

When did Rabaul receive radar?





or, what is the correct number of planes to give the US troops on Henderson field?

A: Depends on the time.

Late Aug 42                       vs            Mid Nov 42
Battle of the Eastern Solomons          Naval Battle of Guadalcanal
 

 

But this is all pointless if the campaign AI s...ts the bed.  Mob
« Last Edit: November 04, 2020, 11:42:40 AM by calapine »

Restoration is a perfectly valid school of magic!
calapine
Terracotta Army
Posts: 7352

Solely responsible for the thread on "The Condom Wall."


Reply #7 on: November 06, 2020, 08:34:11 AM

Yesssssssssssssssss

We are getting there!



Found the Hex field that defines base type, change from 2 to 3 adds a port  Oh ho ho ho. Reallllly?


How Henderson field looked in reality:


Restoration is a perfectly valid school of magic!
calapine
Terracotta Army
Posts: 7352

Solely responsible for the thread on "The Condom Wall."


Reply #8 on: November 06, 2020, 09:25:55 AM

Fuck me, I am brilliant!  awesome, for real




Restoration is a perfectly valid school of magic!
Trippy
Administrator
Posts: 23619


Reply #9 on: November 06, 2020, 11:30:16 AM

GGs. Now don't fuck up Midway this time. Wait...
Zetor
Terracotta Army
Posts: 3269


WWW
Reply #10 on: November 06, 2020, 01:15:08 PM

Congrats! Haxx0ring the enemy is always the superior solution when preparing for an invasion. awesome, for real

Trippy
Administrator
Posts: 23619


Reply #11 on: November 06, 2020, 01:43:53 PM

That's a big part of how the US won the battle of Midway (they had broken Japan's code by then). It's only fair for Japan to return the favor in a parallel universe.
Pages: [1] Go Up Print 
f13.net  |  f13.net General Forums  |  Gaming  |  Topic: Help with modding game files  
Jump to:  

Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC