Utilities, Controllers & Bots, Oh My!

Post new mods and scenarios here.

Moderator: Shannon V. OKeets

User avatar
Courtenay
Posts: 4396
Joined: Wed Nov 12, 2008 4:34 pm

Re: Utilities, Controllers & Bots, Oh My!

Post by Courtenay »

OK. It is an annoying fact that MWiF is liable to ignore anything you do to production before the Breakdown Units step. You can do things before then, to see what you need, but MWiF then often goes ahead and puts everything back the way it was.
I thought I knew how to play this game....
Angeldust2
Posts: 416
Joined: Tue Apr 28, 2020 4:24 am

Re: Utilities, Controllers & Bots, Oh My!

Post by Angeldust2 »

Assuming both rkr1958 and Courtenay statements are valid and always true, would it be possible to get a perfect result, if you do a first edit during Naval Movement, in order to be still able to position additional CP as explained by rkr1958, and in case it is needed a second edit during Breakdown, after all CP are already in place?
Admitted, this would be annoying, time consuming and highly input error prone, but would it always work, if you put in such effort?
Ronnie?
User avatar
Joseignacio
Posts: 3011
Joined: Fri May 08, 2009 11:25 am
Location: Madrid, Spain

Re: Utilities, Controllers & Bots, Oh My!

Post by Joseignacio »

Courtenay wrote: Thu Jan 04, 2024 9:56 pm Trying to fix production in the Final Production step is generally hopeless, and doing so in the Preliminary Production step is pointless, because MWiF happily overwrites things you do there. For some reason fixing production in the Breakdown units step often works. What phase is your save in?
That is pretty interesting
User avatar
paulderynck
Posts: 8476
Joined: Sat Mar 24, 2007 5:27 pm
Location: Canada

Re: Utilities, Controllers & Bots, Oh My!

Post by paulderynck »

Let's assume we have an external program that takes an MWiF game file and outputs a game file with "optimal production". Then assuming the above about game phases is correct, you would not need to edit the file after naval movement assuming you are happy with what the production planner is telling you. Instead you take the MWiF file from the start of Breakdown, run the external program and then resume the game with that file.

So - three assumptions, the biggest of which is that such an external program could be created.
Paul
User avatar
Centuur
Posts: 9065
Joined: Fri Jun 03, 2011 12:03 pm
Location: Hoorn (NED).

Re: Utilities, Controllers & Bots, Oh My!

Post by Centuur »

That's one of the major problems with production planning. I've given up on getting things right before the preliminary production phase starts. I don't know what the program is doing, but I've concluded a long time ago that MWIF can mess things up the moment you get the screen for the preliminary production phase. Why? I don't know.

So I simply calculate what I need to have in the see area's on convoy points and sail them out. Then when preliminary production planning phase is there, I set things so that I get an optimized production (and I can get that result everytime).

Another problems arises, when you have to reload the game between the preliminary production phase and the production phase itself. There's a problem in the program there too, because when you reload, it will recompute production planning again (in some cases a human player will be able to get an optimized result when MWIF isn't able to get that same result during it's recomputing when it's reloading the game). So in the netplay game I'm in, we always make sure to finish the end of turn phases in one go.

Very annoying IMHO, but with the work around, you can get things right.

So if it's indeed possible to let another program calculate the optimized result and put it in the game, that would be an very big improvement.
Peter
User avatar
Courtenay
Posts: 4396
Joined: Wed Nov 12, 2008 4:34 pm

Re: Utilities, Controllers & Bots, Oh My!

Post by Courtenay »

I do not know why MWiF ignores completely what I tell it in production planning, but it does. As examples, the CW is sending build points and an oil to Russia. MWiF insists on sending the build points from London and the Oil from Estevan, Canada, which completely fouls up the CW convoys. If I change that to build points from Calcutta and Bombay and oil from saved oil in Amman (the CW holds Syria), everything works in preliminary planning; however, MWiF changes everything back. However, if I make the changes in the Breakdown units phase, for some reason MWiF does not change things back. This is all very mysterious, and, since I have no idea why MWiF behaves this way, I can NOT guarantee it will always work.
I thought I knew how to play this game....
User avatar
rkr1958
Posts: 29900
Joined: Thu May 21, 2009 10:23 am

Re: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

Angeldust2 wrote: Fri Jan 05, 2024 1:15 pm Assuming both rkr1958 and Courtenay statements are valid and always true, would it be possible to get a perfect result, if you do a first edit during Naval Movement, in order to be still able to position additional CP as explained by rkr1958, and in case it is needed a second edit during Breakdown, after all CP are already in place?
Admitted, this would be annoying, time consuming and highly input error prone, but would it always work, if you put in such effort?
Ronnie?
Interesting approach. I like the concept. Create a production, convoy routing configuration file during naval movement, or whenever during your turn, and load that file over or into the game file during breakdown. Possible? But worth a look I think.
Ronnie
User avatar
Courtenay
Posts: 4396
Joined: Wed Nov 12, 2008 4:34 pm

Re: Utilities, Controllers & Bots, Oh My!

Post by Courtenay »

One thing I just came across that I haven't figured out how to do: The CW conquered Iraq last turn. That turn, France did not get the oil it was used to getting from Iraq, and as a result, used up its last oil. This was my mistake, not the fault of MWiF. The next turn, the CW wants to send an oil to France. MWiF of course picks some oil resource a zillion miles from France. I go to the saved oil in Amman, meaning to ship it to Syria, which is France, not Vichy. I click on the saved oil, and am given the choices of None, France, USSR. I pick France. The default window for the saved build point now reads France/Production/In Place, which is nonsense, because France has no factories. However, I can't figure out ho to tell France to save the oil. When I recompute, the saved Oil I sent disappears from the production screen, and it certainly doesn't make it to Syria.

Of course, I can edit to get the result I want, but I can't get the oil saved in Syria using MWiF. Does anyone know how to do this?
I thought I knew how to play this game....
User avatar
rkr1958
Posts: 29900
Joined: Thu May 21, 2009 10:23 am

Re: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

Proof of principle?

(1) I wanted to start simple and see if a convoy route edit to the game file that I made actually stuck.

(2) Oil Resource (Estevan, Canada) is defaulted as saved to London.

(3) it's being routed, Estevan -> New York -> East Coast -> North Atlantic -> Faeroes Gap -> Glasgow -> London.

(4) The Western Allies have 1 unused CP in both the Canadian Coast & Denmark Straights.
001-Produciton.png
001-Produciton.png (167.78 KiB) Viewed 997 times
(5) I wanted to see if I could edit the game file to route, Estevan -> New York -> East Coast -> Canadian Coast -> Denmark Straights -> Faeroes Gap -> Glasgow -> London.

(6) So as a proof of principal I fired up my text editor (Notepad ++) and made the following edits and saved the game file to another file name.
001-002-WinMerge.png
001-002-WinMerge.png (141.48 KiB) Viewed 997 times
(7) Would my edit stick? It has to if we really have any chance of accomplishing our external production/convoy routing app.
Last edited by rkr1958 on Sun Jan 07, 2024 9:48 pm, edited 2 times in total.
Ronnie
User avatar
rkr1958
Posts: 29900
Joined: Thu May 21, 2009 10:23 am

Re: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

Proof of Principal? Result.

(8) IT WORKED!!!!
002-Production.png
002-Production.png (166.2 KiB) Viewed 996 times
(9) I've never been able to get MWIF to route a resource from US/Canada to the UK through the Canadian Coast & Denmark Straight until now! It's always wanted to take it through the North Atlantic.

(10) This simple proof of principle is a long way from where we'd like to wind up but it's an encouraging start I believe.

(11) Game files (before & after edit).
001-002-Production.zip
(3.18 MiB) Downloaded 17 times
(12) By the way, I'm running the beta tester version so if you're not a beta tester you'll need to downgrade the MWIF version in the above attached game files to yours. That is,

Change line 1 from
6.0.0.3 (Debug),10,0
to
5.0.0.10 (Debug),10,0
Ronnie
Angeldust2
Posts: 416
Joined: Tue Apr 28, 2020 4:24 am

Re: Utilities, Controllers & Bots, Oh My!

Post by Angeldust2 »

As you say, a promising start! Well done!
User avatar
Orm
Posts: 30724
Joined: Sat May 03, 2008 7:53 pm
Location: Sweden

Re: Utilities, Controllers & Bots, Oh My!

Post by Orm »

Courtenay wrote: Sun Jan 07, 2024 5:50 am One thing I just came across that I haven't figured out how to do: The CW conquered Iraq last turn. That turn, France did not get the oil it was used to getting from Iraq, and as a result, used up its last oil. This was my mistake, not the fault of MWiF. The next turn, the CW wants to send an oil to France. MWiF of course picks some oil resource a zillion miles from France. I go to the saved oil in Amman, meaning to ship it to Syria, which is France, not Vichy. I click on the saved oil, and am given the choices of None, France, USSR. I pick France. The default window for the saved build point now reads France/Production/In Place, which is nonsense, because France has no factories. However, I can't figure out ho to tell France to save the oil. When I recompute, the saved Oil I sent disappears from the production screen, and it certainly doesn't make it to Syria.

Of course, I can edit to get the result I want, but I can't get the oil saved in Syria using MWiF. Does anyone know how to do this?
After CW selected what oil to send to France, have you tried to switch to France and see if the traded oil is listed there and try to save it from the French screen?
Have a bit more patience with newbies. Of course some of them act dumb -- they're often students, for heaven's sake. - Terry Pratchett

A government is a body of people; usually, notably, ungoverned. - Quote from Firefly
User avatar
Courtenay
Posts: 4396
Joined: Wed Nov 12, 2008 4:34 pm

Re: Utilities, Controllers & Bots, Oh My!

Post by Courtenay »

Orm wrote: Sun Jan 07, 2024 10:14 pm
Courtenay wrote: Sun Jan 07, 2024 5:50 am One thing I just came across that I haven't figured out how to do: The CW conquered Iraq last turn. That turn, France did not get the oil it was used to getting from Iraq, and as a result, used up its last oil. This was my mistake, not the fault of MWiF. The next turn, the CW wants to send an oil to France. MWiF of course picks some oil resource a zillion miles from France. I go to the saved oil in Amman, meaning to ship it to Syria, which is France, not Vichy. I click on the saved oil, and am given the choices of None, France, USSR. I pick France. The default window for the saved build point now reads France/Production/In Place, which is nonsense, because France has no factories. However, I can't figure out ho to tell France to save the oil. When I recompute, the saved Oil I sent disappears from the production screen, and it certainly doesn't make it to Syria.

Of course, I can edit to get the result I want, but I can't get the oil saved in Syria using MWiF. Does anyone know how to do this?
After CW selected what oil to send to France, have you tried to switch to France and see if the traded oil is listed there and try to save it from the French screen?
Yes, I have tried, and it does not show up on the French list. For that matter, the saved oil disappears from the CW list when I switch to the French screen and come back to the CW one.
I thought I knew how to play this game....
Angeldust2
Posts: 416
Joined: Tue Apr 28, 2020 4:24 am

MWIF Workaround App

Post by Angeldust2 »

Ronnie,

I fully understand, most important to you in creating the "MWIF Workaround App" is a function to manipulate the convoy/production system in a satisfying way. This is because you have mastered the art of editing the game file manually already a long time ago. But I am afraid, most players of MWIF would already be happy, if they could use your app for much simpler problems like
- editing the version of a game file
- moving units between pools and on the map
- changing control of hexes
- creating and changing number of saved oil and build points

Basically, all situations which are mentioned in the
https://www.matrixgames.com/forums/view ... 4&t=301200
thread should be covered by the app in the end state, not?

Now, your favorite topic of getting 100% efficiency with the convoy/production system is obviously more complicated than many much simpler tasks as listed above. Would it be possible to start with a few of the simpler tasks, so both the develoment of the app itself and the more complicated issue of convoy/production within the app can get rolling?
User avatar
Courtenay
Posts: 4396
Joined: Wed Nov 12, 2008 4:34 pm

Re: MWIF Workaround App

Post by Courtenay »

Angeldust2 wrote: Mon Jan 08, 2024 9:09 am Now, your favorite topic of getting 100% efficiency with the convoy/production system is obviously more complicated than many much simpler tasks as listed above. Would it be possible to start with a few of the simpler tasks, so both the develoment of the app itself and the more complicated issue of convoy/production within the app can get rolling?
'
This makes a lot of sense to me. Changing unit locations is easy, as is changing between organized and disorganized, changing convoy sentry status on and off, and changing available actions. (Easy has a simple definition: I can do it. :) ) Coding these first is a much simpler task. We don't have to spend any time figuring out what changes have to be made. Save convoys for last.
I thought I knew how to play this game....
User avatar
rkr1958
Posts: 29900
Joined: Thu May 21, 2009 10:23 am

Re: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

Ok guys. I hear you. I have some homework to do then. How do I turn my python code into an exportable Windows app?

I (personally) make changes (currently) to the game file either by text editor or through Anaconda/Spyder IDE in which I develop and test my python scripts.

At this time I don't know how to take those scripts and make an exportable Windows apps. But I will do some searching and learning.

Also, I'm inexperience in GUI development. So that's another thing I need to do some searching and learning on too.

Unless someone here has the knowledge, skill and could help me in such endeavors.
Ronnie
User avatar
Zovs
Posts: 9209
Joined: Sun Feb 22, 2009 11:02 pm
Location: United States

Re: Utilities, Controllers & Bots, Oh My!

Post by Zovs »

rkr1958 wrote: Mon Jan 08, 2024 8:41 pm Ok guys. I hear you. I have some homework to do then. How do I turn my python code into an exportable Windows app?

I (personally) make changes (currently) to the game file either by text editor or through Anaconda/Spyder IDE in which I develop and test my python scripts.

At this time I don't know how to take those scripts and make an exportable Windows apps. But I will do some searching and learning.

Unless someone here has the knowledge, skill and could help me in such an endeavor.
A quick search:

https://www.datacamp.com/tutorial/two-s ... n-exe-file

I am not that familiar with python. Been a few years since I even did one of the tutorials for it.
Image
Beta Tester for: War in the East 1 & 2, WarPlan & WarPlan Pacific, Valor & Victory, Flashpoint Campaigns: Sudden Storm, Computer War In Europe 2
SPWW2 & SPMBT scenario creator
Tester for WDS games
User avatar
rkr1958
Posts: 29900
Joined: Thu May 21, 2009 10:23 am

Re: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

I guess for the python gui: tkinter

A package I've installed previously and, please pardon the pun, done some tinkering with.
Ronnie
User avatar
rkr1958
Posts: 29900
Joined: Thu May 21, 2009 10:23 am

Re: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

Never too late to learning something new ... just started going through the tkinter python tutorial
MWIF-Magic-app-tutorial.png
MWIF-Magic-app-tutorial.png (166.4 KiB) Viewed 912 times
It's a start but I've got some more lessons to go through. By the way, the code for moving units, changing hex control, changing version already exists and has been extensively tested. The challenge is getting working inside a working gui and then exporting that to a windows application.
Ronnie
Angeldust2
Posts: 416
Joined: Tue Apr 28, 2020 4:24 am

Re: Utilities, Controllers & Bots, Oh My!

Post by Angeldust2 »

Magic is a nice and fitting working title for the project ...
Post Reply

Return to “Mods and Scenarios”