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

Post new mods and scenarios here.

Moderator: Shannon V. OKeets

User avatar
craigbear
Posts: 769
Joined: Tue Jan 21, 2020 2:30 am
Location: Calgary, Alberta

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

Post by craigbear »

Thank-you.

I am gradually accruing a file of these very useful unit data.
User avatar
rkr1958
Posts: 30001
Joined: Thu May 21, 2009 10:23 am

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

Post by rkr1958 »

Trade agreement info is around line 10,000 in your game file.

To locate this info search for line 44,-1, which you'll encounter at least one before you find the right section. The correct section is outlined in red in the below screen cap (lines 9988-9993). The first value of the last line (9993) in that section is the number of trade agreement (12). All other lines (9988-9992), as far as I can tell, are constant and thus provide the key for finding the trade agreement section.

The trade agreements themselves are down a bit further (outlined in red, lines 10055 - 10066) with one trade agreement per line. In 4.X each trade agreement (i.e., line) consists of 11 fields. In 3.X and lower each trade agreement consists of 10 fields. My understanding of these fields are:

4.X trade agreement field definitions:
(1) BPs given
(2) Oil given
(3) RPs (Oil + Non-Oil) given
(4) ?
(5) ?
(6) ?
(7) Country ID (CID) of sender
(8) CID of receiver
(9) ?
(10) ?
(11) 0=mandatory, 1=temporary, 2=one-turn only.

Note in my example that the Spain to Germany trade is showing as 1-turn only. Not only am I going to convert this from 4.4.1 (beta) to 3.2.0 (beta) but I'm going to fix this trade agreement and make it Mandatory.
Attachments
Trade-4-4-0.jpg
Trade-4-4-0.jpg (392.15 KiB) Viewed 2059 times
Last edited by rkr1958 on Thu Oct 27, 2022 5:34 pm, edited 3 times in total.
Ronnie
User avatar
rkr1958
Posts: 30001
Joined: Thu May 21, 2009 10:23 am

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

Post by rkr1958 »

To retrograde I edited the game file and changed 4.4.1 on line 1 to 3.2.0

I then loaded this retrograded game file in 3.2.0 (debug) and saved it. Below is what the trade agreements now look like. Note that when 3.2.0 saved that the 11th value was truncated (i.e., deleted), which fouled up the trade agreement statuses and in this example made them all mandatory. But I've seen cases where the status was blank for one or more agreements at this point because the value in field 10 (4.X) was some other value than 0, 1 or 2.
Attachments
trade-retro-3-2-needs-fixing.jpg
trade-retro-3-2-needs-fixing.jpg (418.65 KiB) Viewed 2056 times
Last edited by rkr1958 on Mon May 23, 2022 12:25 am, edited 2 times in total.
Ronnie
User avatar
rkr1958
Posts: 30001
Joined: Thu May 21, 2009 10:23 am

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

Post by rkr1958 »

So to fix the agreements for this 3.2.0 (beta) retro-grade file, I edited the value in field (10) to the correct value for each agreement (i.e., 0=Mandatory, 1=Temporary, 2=One Turn). Note for flavor I changed the Vichy to Germany agreement from temporary to one turn only in addition to fixing the Spain to Germany agreement.

Note that the more sporty editors can also delete and add trade agreements. However if you do make sure that you change the number of active agreements (in our example, first value on line 9993) to match the number of trade agreement (records/line). if the number of trade agreements in the above example which is 12 (line 9993) doesn't match the number of trade agreement records (lines 10055 to 10066) then this will cause your game/production screen not to load properly and send the game into an infinite loop.

3.X Trade agreement field definitions:
(1) BPs given
(2) Oil given
(3) RPs (Oil + Non-Oil) given
(4) Oil given
(5) Non-Oil given
(6) BPs given
(7) Country ID (CID) of sender
(8) CID of receiver
(9) ?
(10) 0=mandatory, 1=temporary, 2=one-turn only.
Attachments
trade-retro-3-2-fixed.jpg
trade-retro-3-2-fixed.jpg (422.29 KiB) Viewed 2057 times
Ronnie
cpmcarlinda
Posts: 7
Joined: Fri Sep 20, 2019 10:28 am

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

Post by cpmcarlinda »

Hi friends!

First, sorry for my English level!

Could you help me? In surrender phase, France is incompletely conquest for Axis! Then, 4 french ships (in Construction pool or Repair pool) cand change to propierty and these have seen for enemies (axis). Axis choose Italy propierty, and then, we have the problems:
- 2 ships are in destroyed pool,
- 1 ship is Cw propierty in repair pool
- 1 ship (submarine) is Germany propierty in Construction pool

How we change these 4 units to Italy propierty and place in Construction or/and repair pool?

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

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

Post by rkr1958 »

cpmcarlinda wrote: Mon Aug 01, 2022 10:27 pm Hi friends!

First, sorry for my English level!

Could you help me? In surrender phase, France is incompletely conquest for Axis! Then, 4 french ships (in Construction pool or Repair pool) cand change to propierty and these have seen for enemies (axis). Axis choose Italy propierty, and then, we have the problems:
- 2 ships are in destroyed pool,
- 1 ship is Cw propierty in repair pool
- 1 ship (submarine) is Germany propierty in Construction pool

How we change these 4 units to Italy propierty and place in Construction or/and repair pool?

Thanks
I think these fixes are beyond my knowledge. I'd recommend posting w/game file in the Tech section and ask one of the beta testers with the debug version of MWIF to help. Good luck!
Ronnie
User avatar
rkr1958
Posts: 30001
Joined: Thu May 21, 2009 10:23 am

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

Post by rkr1958 »

Before & After changes for being able to place a reserve (vol) unit built in 4.X but not able to place in 3.2.0.

NOTE: (1) #=comments that are NOT in the game file.
(2) 47220=where the unit is placed on the map. In this example it's Calcutta, India [92,116]
(3) To place a unit that can't be placed you can make the edits in blue exactly except for where you wish to place the unit.
(4) As ALWAYS, make a backup copy of your game file before you make and confirm your edits!

# INA(Vol) MIL. 3.2.0 (Beta). Can't be placed.
INA,49,14,1936
0
0,1531,,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0
.T Although the Indian leaders (such as Nehru and Gandhi) were prepared to go to war against Nazism and other authoritative regimes they wanted a say in the matter. When the British took the decision to go to war with India without at least asking for their advice some members of the Congress party decided to fight the British alongside with the Japanese. .P A number of soldiers defected together with the former congress party leader Subhash Chandra Bose and were moving alongside with the Japanese invasion in Burma. As the Japanese got bogged down so did the Indian National Army, as it called itself. This “army” never reached the Indian border. .P After the war Indian leaders made sure that no soldiers that fought for the Indian National Army got to be reinstated in the regular Indian Army, as punishment for their betrayal during the war.
6295,6286,0,2187,17407,65535,10240,0,0,0,13,0,640,0,0,0
-1,UndoData
23610,16434

# INA(Vol) MIL. 4.2.3.2 (Beta). Placed in Calcutta, India [92,116]=47220.
INA,49,14,1936
0
0,1531,,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.T Although the Indian leaders (such as Nehru and Gandhi) were prepared to go to war against Nazism and other authoritative regimes they wanted a say in the matter. When the British took the decision to go to war with India without at least asking for their advice some members of the Congress party decided to fight the British alongside with the Japanese. .P A number of soldiers defected together with the former congress party leader Subhash Chandra Bose and were moving alongside with the Japanese invasion in Burma. As the Japanese got bogged down so did the Indian National Army, as it called itself. This “army” never reached the Indian border. .P After the war Indian leaders made sure that no soldiers that fought for the Indian National Army got to be reinstated in the regular Indian Army, as punishment for their betrayal during the war.
6295,6286,8,2187,1023,65535,0,47220,128,0,12,0,736,0,0,0
-1,UndoData
23610,16434
Ronnie
User avatar
rkr1958
Posts: 30001
Joined: Thu May 21, 2009 10:23 am

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

Post by rkr1958 »

How to increase the number of Pilots and/or O-Chits in the Reserve Pool.

(1) As always make a backup copy of your game file before making any edits.

(2) Get (country) id of the country, or countries, for whose reserve pool you wish to edit (i.e., Germany=79, Italy=89, Japan=49, China=53, CW=201, France=80, USA=11 & USSR=51).

(3) Locate the section in the game file containing the country's reserve pool.
The 4 lines that end that section are:

-1,CSet
-1,CSet
-1,CSet
-1,MCSet


The 2 lines that begin that section are ~12 lines above and are:

cid,cid
cid,cid


Example (CW).

201,201
201,201
-1,0,-1,0
-1,CSet
0
0
0,0,-1,-1
3,3,1,1,1,1,1,1,1,1,1,1,3,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,1,0,2,1,2,1,1,1,3,0,1,3,1,1,0,2,1,1,1,1,1,1,3,1,1,0,1,1,1,1,1,2,1,1,1,0,0,0,0,1,1,1,1,1,0,1,0,0,0,1,1,1,1,1,1,2,2,2,0,1,1,1,1,1,1,1,0,1,1,1,1,1,2,1,1,1,1,2,1,0,1,1,0,2,2,2,0,1,2,2,3,2,2,1,2,1,1,1,1,1,1,1,2,1,1,1,2,1,1,1,1,1,2,1,1,2,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0
2,0,8191,0,255,0
3,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0
0,0,0,0,0
0,0,0,0,0
-1,1,1,0,0,0,0,0,0,0,0,0,-1,-1,0,0,0,0,99
-1,CSet
-1,CSet
-1,CSet
-1,MCSet


(4) The line that contains the number of O-chits & pilots in the reserve pool for country=cid is the line directly above the end section 4 lines (i.e., directly above the first -1,CSet of the end section).

Example (CW).

-1,1,1,0,0,0,0,0,0,0,0,0,-1,-1,0,0,0,0,99
-1,CSet
-1,CSet
-1,CSet
-1,MCSet


(5) The number of O-chits is the 2nd # on that line and the number of pilots is the 3rd.
-1,# O-Chits,# Pilots,0,0,0,0,0,0,0,0,0,-1,-1,0,0,0,0,99

In the screen CAP (example) below:
(1) Increased CW O-chits from 1 to 5.
(2) Increased CW Pilots form 1 to 10.
(3) Increased USSR O-chits from 3 to 10.
(4) Increased USSR Pilots from 0 to 5.
Attachments
Reserve-Pool-Pilots-O-chits.jpg
Reserve-Pool-Pilots-O-chits.jpg (583.78 KiB) Viewed 1821 times
Ronnie
User avatar
rkr1958
Posts: 30001
Joined: Thu May 21, 2009 10:23 am

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

Post by rkr1958 »

How to Move PIL from the Destroyed to the Production Pool.

(1) Make a backup of your game file.

(2) Get the country id of country of interest (e.g., CW=201).

(3) Search on the string ,[cid],62,1936 until you find a destroyed pilot (e.g., for the CW search on ,201,62,1936)

Note: 201= CW country's id, 62=PIL type code and 1936=year.

(4) The key to finding a destroyed pilot is on the line right after ,[cid],62,1936. Specifically you're looking for -1 in the next to the last value of that line. For example,

,201,62,1936
0,3693,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,5


(5) Steps to move the destroyed PIL to the production pool.
(a) Last value on that 2nd line is the turn in which the Pilot will come in (i.e., 0=Jan/Feb, 1=Mar/Apr, 2=May/Jun, 3=Jul/Aug, 4=Sep/Oct, 5=Nov/Dec). In the screen CAP below I edited the destroyed CW pilot to come in on the Jul/Aug=3 turn.
(b) Move the PIL from the destroyed to the production pool by changing the next to last value of that 2nd line from -1 to 0 and the 6th 0 after the ,, to -1.

For example, 0,3693,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,5 -------------> 0,3693,,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,3

(c) Now on the next line down with values and just above -1, UndoData change the 7th value on that line from 30720 to 10240 and the 13th value change from 32768 to 0.

For example, 25751,25790,0,0,1023,65535,30720,0,0,0,13,0,32768,0,0,0 -------------> 25751,25790,0,0,1023,65535,10240,0,0,0,13,0,0,0,0,0
Attachments
Add-PIL-to-Production.jpg
Add-PIL-to-Production.jpg (574.2 KiB) Viewed 1815 times
Ronnie
User avatar
rkr1958
Posts: 30001
Joined: Thu May 21, 2009 10:23 am

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

Post by rkr1958 »

How to Increase the Number of Remaining Activities.

(1) The following edit will show you have increase the number of remaining activities for a given Major Power and action taken. For example, France takes a combine, which gives her 1 naval move, but wishes to move all her subs in port and in supply for free.

(2) As always backup up your game file before beginning any edits in case you really mess it up.

(3) Get the country id (cid) of the country of interest (e.g., France=80).

(5) Locate the section in the game file that holds the country's remaining activities. This section is the same section that contains the country's reserve pool. The 4 lines that end that section are:

-1,CSet
-1,CSet
-1,CSet
-1,MCSet


The 2 lines that begin that section are ~12 lines above and are:

cid,cid
cid,cid


(6) The line that contains the activity limits is 2 lines above the first -1,CSet that ends the section.

(7) The line that contains the number of activities remaining is just above that line. This is the line to edit to increase the number of remaining activities. The activities on that line, and the one below, are in the same order that's used in the MWIF "Activities Available" form. That is, the order is: Air, Naval, Rail, Land Moves, Land Attacks.

(8) For the example in the screen cap below shows that I successfully edited the game file so give France 2 more, for a total of 3, naval moves (remaining) in order for her to be able to move her 2 subs for free.

(9) NOTE: If I had, for example, taken a land with France I still would have been able to edit her activities remaining to get these 2 free naval moves. However; she would NOT have been able to have initiated any naval searches. I've got this on my list to track down and figure out how to do. Why? If one wants to use WIF CE O-points rule to take a land and also make one naval move for example.
editing-Available-Activities.jpg
editing-Available-Activities.jpg (1.02 MiB) Viewed 1748 times
(10) PS. Just noticed that my initial screen cap got saved without the game file edit not shown. It was on there but got lost in the save. Below shows the game file post edit.
editing-Available-Activities-2.jpg
editing-Available-Activities-2.jpg (165.38 KiB) Viewed 1740 times
Last edited by rkr1958 on Tue Oct 25, 2022 6:27 pm, edited 2 times in total.
Ronnie
User avatar
rkr1958
Posts: 30001
Joined: Thu May 21, 2009 10:23 am

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

Post by rkr1958 »

(1) I've got several (MWIF gaming) projects on my wish list. One is to develop the "definite" MIWF editing guide and possibly game file structure description.

(2) I was wondering if there's an interest and, more significantly, a willingness to help develop and write such a document for our MWIF community?

(3) If so, we could use google docs, or some other, document sharing site to develop and maintain such a community document.
Ronnie
User avatar
eouellet
Posts: 143
Joined: Thu Feb 01, 2018 5:35 pm

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

Post by eouellet »

Hi Ronnie,

If it is relatively user-friendly, this would be very much of interest to me. Given that bug fixing has taken a backseat to AI for an indefinite period of time, this could really help saving games that would have to be abandonned otherwise.

Thank you for offering this.

Eric
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 »

I would love to help with composing a document to understand the saved game file. My issue as always is time, but I will do what I can.
Pat
Pat
User avatar
rkr1958
Posts: 30001
Joined: Thu May 21, 2009 10:23 am

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

Post by rkr1958 »

Thanks! Ok, what if we just start off with format.

(1) Word or powerpoint?

(2) How to share & collaborate? Google docs? Something else (better)?

(3) Write it like a "cookbook"? Give "recipes" for specific edits?

(4) Or, write it like a technical specification or interface description document (IDD) on the game file as we know it?
Ronnie
Angeldust2
Posts: 416
Joined: Tue Apr 28, 2020 4:24 am

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

Post by Angeldust2 »

rkr1958 wrote: Tue Oct 25, 2022 6:16 pm (1) I've got several (MWIF gaming) projects on my wish list. One is to develop the "definite" MIWF editing guide and possibly game file structure description.
(2) I was wondering if there's an interest and, more significantly, a willingness to help develop and write such a document for our MWIF community?
I am willing to help, if you have tasks I am able to contribute to. I liked your former project to develop an easy to use game file editor for MWIF even more! But maybe such a document is a needed requirement for the more ambitious project anyway?
User avatar
rkr1958
Posts: 30001
Joined: Thu May 21, 2009 10:23 am

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

Post by rkr1958 »

Angeldust2 wrote: Sun Nov 06, 2022 4:19 pm
rkr1958 wrote: Tue Oct 25, 2022 6:16 pm (1) I've got several (MWIF gaming) projects on my wish list. One is to develop the "definite" MIWF editing guide and possibly game file structure description.
(2) I was wondering if there's an interest and, more significantly, a willingness to help develop and write such a document for our MWIF community?
I am willing to help, if you have tasks I am able to contribute to. I liked your former project to develop an easy to use game file editor for MWIF even more! But maybe such a document is a needed requirement for the more ambitious project anyway?
Yeah ... maybe that would be more beneficial than a guide. I've been wanting to pick that project back up again too.
Ronnie
NBC_man
Posts: 5
Joined: Thu Sep 24, 2009 9:52 pm

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

Post by NBC_man »

Have you figured out how to edit the ship production spiral? For example, remove a ship in the first step and replace it with another.
User avatar
rkr1958
Posts: 30001
Joined: Thu May 21, 2009 10:23 am

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

Post by rkr1958 »

NBC_man wrote: Wed Nov 16, 2022 10:26 pm Have you figured out how to edit the ship production spiral? For example, remove a ship in the first step and replace it with another.
I believe so ...

If you post a game file with instructions on specifically what you want I'd be happy to give it a go.
Ronnie
User avatar
Courtenay
Posts: 4396
Joined: Wed Nov 12, 2008 4:34 pm

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

Post by Courtenay »

What I want to do is to move a lent lend-lease aircraft that is in the recipient's force pool back to the force pool of the original owner.

This is legal, but MWiF has never implemented this capability.
I thought I knew how to play this game....
User avatar
rkr1958
Posts: 30001
Joined: Thu May 21, 2009 10:23 am

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

Post by rkr1958 »

Courtenay wrote: Thu Nov 17, 2022 10:45 pm What I want to do is to move a lent lend-lease aircraft that is in the recipient's force pool back to the force pool of the original owner.

This is legal, but MWiF has never implemented this capability.
I haven't done this before but I pretty sure I can. Will give it a shot and if successful provide documentation on how I did it.
Ronnie
Post Reply

Return to “Mods and Scenarios”