A Layman's Guide to Successfully Editing the MWiF Game File.

Post new mods and scenarios here.

Moderator: Shannon V. OKeets

User avatar
rkr1958
Posts: 27449
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

---

Image
Attachments
Slide32.jpg
Slide32.jpg (278.59 KiB) Viewed 344 times
Ronnie
User avatar
rkr1958
Posts: 27449
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

---

Image
Attachments
Slide33.jpg
Slide33.jpg (281.44 KiB) Viewed 343 times
Ronnie
User avatar
rkr1958
Posts: 27449
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

---

Image
Attachments
Slide34.jpg
Slide34.jpg (234.86 KiB) Viewed 344 times
Ronnie
User avatar
rkr1958
Posts: 27449
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

---

Image
Attachments
Slide35.jpg
Slide35.jpg (333.52 KiB) Viewed 343 times
Ronnie
User avatar
ashkpa
Posts: 1513
Joined: Thu Jan 16, 2014 3:11 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by ashkpa »

very nice [&o]
Pat
User avatar
davidc
Posts: 103
Joined: Wed Dec 05, 2007 9:47 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by davidc »

Agreed [&o] [&o]
Excellent stuff Ronnie
User avatar
paulderynck
Posts: 8356
Joined: Sat Mar 24, 2007 5:27 pm
Location: Canada

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by paulderynck »

One of the reasons that Production got so complicated in the code is this simple sentence in the rules: "If, during production (see 13.6), it is possible for the promised resources (or build points) to be delivered then they must be delivered."

This means FREX if the route to northern Russia gets cut by U-boats then you might have to run some of your resources and/or build points around Africa to Persia if they can be delivered that way - because you must. You must do this no matter how much it messes up your carefully planned CP routes. Unless you spot the problem during Stay-at-Sea and RTB some inconsequential CP that is providing the connection to Russia - thus making it impossible to get the stuff there and then you are OK except you can't use that number of resources and/or BPs for yourself.

Now I'm not saying this alone is causing the "Faroes-Biscay Triangle" issues but it illustrates that convoy routing and delivery is quite difficult to code. (also consider Search and Seizure being planned for).

So if you are going to edit the file, you now become responsible for enforcing the applicable rules.
Paul
User avatar
rkr1958
Posts: 27449
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

ORIGINAL: ashkpa

very nice [&o]
Thanks! [:)]

ORIGINAL: davidc

Agreed [&o] [&o]
Excellent stuff Ronnie
Thanks! [:)]

ORIGINAL: paulderynck
So if you are going to edit the file, you now become responsible for enforcing the applicable rules.
I agree 100%. This workaround assumes you are enforcing the applicable rules and that you live with any oversights or misinterpretations. That's the risk player's must accept in applying this method. However, I think the gains are obvious to those of us who've played MWiF for a while and struggled with convoy routing and production. In the end the "unwillingness" of MWiF to accept and maintain my overrides to reroute from the Bay of Biscay to the Faeroes Gap finally drove me over the edge. I absolutely love this game and the fact that MWiF handles everything else so well. I just didn't want this one flaw to destroy that love.

By the way, I've started another game with jjdenver who's an experienced WiF player (much more experienced than me) but is new to MWiF. He's playing the allies and the CW convoy routing during preliminary and final production of turn 1 nearly drove him to abandoned our game and MWiF. This was the driving reason behind me documenting and posting this workaround I came up with a while back. I just hadn't got around to documenting and posting it yet. Sorry.

Also, we're playing with the isolated reorganization optional rule, which we're having to enforce ourselves. This certainly changes some of the dynamics in China, East and Central Africa. I can see how this optional rule may be even more significant in MWiF than in WiF given the new Asia scale and unit densities in MWiF.
Ronnie
TrogusP96
Posts: 163
Joined: Mon Jun 15, 2015 8:30 pm

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by TrogusP96 »

I thought it was just me and I have spent inordinate time with CW convoys in particular so I just added more BPs and factories.

Thanks for explanation about CW convoy routes. Faroes Island and Bay of Biscay reversion.

What I really want to be able to edit are divison, eng, arty AT armor etc costs
sfreudig
Posts: 5
Joined: Sun May 21, 2017 6:05 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by sfreudig »

Hello,
i've got some trouble to find some hex near Noumea in Coral Sea... it seems that the hexes down here have a different coordinate system... is it possible ?
For exemple, Noumea is 143,194 and so should be 73410. But in the file, the hex is noted 7874. So the coordinate "line" seems to be in fact "15" instead of "143".

What do you think ?
Regards
Seb
User avatar
rkr1958
Posts: 27449
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

ORIGINAL: sfreudig

Hello,
i've got some trouble to find some hex near Noumea in Coral Sea... it seems that the hexes down here have a different coordinate system... is it possible ?
For exemple, Noumea is 143,194 and so should be 73410. But in the file, the hex is noted 7874. So the coordinate "line" seems to be in fact "15" instead of "143".

What do you think ?
Regards
Seb
Yes, this is something that I've noticed/encountered a while back (maybe a year or so ago) but haven't documented it. I've figured how to work with it but don't know exactly the rule. I'll write what I know and how I work with it.

Encoded coordinates logged by the game in the USR(8) field do not exceed 2^16, or 65536. So for example, if the coordinate you're working with is, [x=164,y=50] = 84018, USR(8) will be equal to 84018 - 65536 or 18482. However, the field before this value (i.e., USR(7)) will not be 0. I haven't figure out specifically what different non-zero values mean except that a non-zero field will distinguish this coordinate from [x=36,y=50] which also is equal to 18482.

And for your case, x=143, y=194; USR(8)=(512 x 143 + 194) - 65536 = 73410 - 65536 = 7874. However, USR(7) is (must be) non-zero in order to distinguish it from the x=15 & y =194. This coordinate, which also is 7874 will have USR(7) = 0).

On the upside, you can edit a game file and put a coordinate in greater than 65536 in USR(8) provided the preceding field (i.e., USR(7) is zero). You can then load that game file and (re) save it and MWiF will take care of the wrap around (i.e., subtracting 65536) and populating USR(7) with a non-zero value. If you're editing a coordinate that is already larger than 65537, in which case USR(7) ~= 0, you can use the formula USR(8) = 512x + y - 65536 to change the coordinate provided the new (unwrap) coordinate is also greater than 65536. That is, USR(8) can NEVER be less than 0.
Ronnie
User avatar
Kull
Posts: 2744
Joined: Tue Jul 03, 2007 3:43 am
Location: El Paso, TX

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by Kull »

Very interesting thread, thanks! As to the choice of editor, I highly recommend that you consider switching to Notepad++. It's superior to Notepad in almost every way, in particular because the Total War mod team I work with has found that Notepad sometimes inserts unwanted characters and line breaks that can directly result in CTDs. Perhaps the same issue does not apply with MWIF files, but even if not, the many cool features of Notepad++ vault it to the top of the class, in our estimation. And of course, it's free.
User avatar
rkr1958
Posts: 27449
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

ORIGINAL: Kull

Very interesting thread, thanks! As to the choice of editor, I highly recommend that you consider switching to Notepad++. It's superior to Notepad in almost every way, in particular because the Total War mod team I work with has found that Notepad sometimes inserts unwanted characters and line breaks that can directly result in CTDs. Perhaps the same issue does not apply with MWIF files, but even if not, the many cool features of Notepad++ vault it to the top of the class, in our estimation. And of course, it's free.
Thanks. Will download and give it a go then.
Ronnie
User avatar
rkr1958
Posts: 27449
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

Because of an infinite loop I encountered with 2.8.4 that caused my game to hang, see tm.asp?m=4489140# , I thought I'd post these edits on how to change hex control That was the only way I found, barring not capturing hex, to get around this bug.

Image
Attachments
chc01.jpg
chc01.jpg (677.3 KiB) Viewed 346 times
Ronnie
User avatar
rkr1958
Posts: 27449
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

I highly recommend notepad ++ (a free application) for editing the game file. As always, make sure you backup your game file before beginning any edits.

Image
Attachments
chc02.jpg
chc02.jpg (1.57 MiB) Viewed 346 times
Ronnie
User avatar
rkr1958
Posts: 27449
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

Let's get this puppy edited, change hex control and see if this gets us through the infinite loop the games apparently entered into.

Image
Attachments
chc-03.jpg
chc-03.jpg (3.72 MiB) Viewed 346 times
Ronnie
User avatar
rkr1958
Posts: 27449
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

Success!

Image
Attachments
chc04.jpg
chc04.jpg (651.54 KiB) Viewed 346 times
Ronnie
User avatar
AxelNL
Posts: 2389
Joined: Sat Sep 24, 2011 12:43 pm
Location: The Netherlands

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by AxelNL »

Excellent sherlocking! Maybe somebody will make a little program to do this edits with a nice GUI, and it saves even more time.
User avatar
rkr1958
Posts: 27449
Joined: Thu May 21, 2009 10:23 am

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by rkr1958 »

ORIGINAL: AxelNL

Excellent sherlocking! Maybe somebody will make a little program to do this edits with a nice GUI, and it saves even more time.
Thanks! I've been wanting to learn python ... maybe someday ...
Ronnie
jjdenver
Posts: 2438
Joined: Thu Nov 01, 2007 11:07 pm

RE: A Layman's Guide to Successfully Editing the MWiF Game File.

Post by jjdenver »

Ronnie can you add notes here on how to increase saved oil on map? Say there is 1 oil in Montreal - how to make it 4?

Thanks
AARS:
CEAW-BJR Mod 2009:
tm.asp?m=2101447
AT-WW1:
tm.asp?m=1705427
AT-GPW:
tm.asp?m=1649732
Post Reply

Return to “Mods and Scenarios”