Utilities, Controllers & Bots, Oh My!

Post new mods and scenarios here.

Moderator: Shannon V. OKeets

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

RE: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

I've been pittling away at developing a game file editor controller. I haven't been rushing but I expect to have one with a basic (i.e., crude) interface in a couple of weeks. I'm not sure if this initial version would be classified as an advance alpha or a "premature" beta. Maybe it's a premature alpha. [:)]

If there's any interest in getting your hands on this version, I can package it in something like a windows bat (i.e., cmd) file that, when run, asks for a text file containing your editing inputs/commands.

Also, if there's any interest on getting your hands on the source code for the initial and, as applicable, following versions, I'd always be happy to share that too.

I'm using Spyder 4.1.4 (installed through Anaconda distribution) as my python development IDE and I'm running Python 3.8.3 64-bit version for Windows 10.

So, if there's any interest for either or both you can respond in this thread or PM me.

Honestly, I wouldn't mind sharing this limelight (joking of course) with one or more coders who could help take all this to something grander that I could/can achieve on my own.

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

RE: Utilities, Controllers & Bots, Oh My!

Post by AxelNL »

Promising work.

I can envision bots for convoy guarding, which does the cyclical guard duty in the Faroes and NA with one click. Maybe even production optimisation?

Alas - my programming days were in the 80's (Turbo Pascal and a meriad of other lanquages but not for long). So the only contribution would be defining functional specification.

hope you succeed!
User avatar
rkr1958
Posts: 29900
Joined: Thu May 21, 2009 10:23 am

RE: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

ORIGINAL: AxelNL

Promising work.

I can envision bots for convoy guarding, which does the cyclical guard duty in the Faroes and NA with one click. Maybe even production optimisation?

Alas - my programming days were in the 80's (Turbo Pascal and a meriad of other lanquages but not for long). So the only contribution would be defining functional specification.

hope you succeed!
Thanks!

I cut my teeth on FORTRAN IV and BASIC in the late 70's. The BASIC I learned on had a max variable length of 2!

Worked with both BASIC and FORTRAN early in my career through the mid 90's. In my early career (80's) worked with FORTRAN on card-decks.

I eventually moved on from FORTRAN to MATLAB, java and python. Did a lot of MATLAB programming. Now I'm retired and program for fun. [:D]
Ronnie
TrogusP96
Posts: 163
Joined: Mon Jun 15, 2015 8:30 pm

RE: Utilities, Controllers & Bots, Oh My!

Post by TrogusP96 »

Can any of these tools be used to change unit costs? I am thinking of the divisions in particular. Thanks. Looks ambitious.
Angeldust2
Posts: 416
Joined: Tue Apr 28, 2020 4:24 am

RE: Utilities, Controllers & Bots, Oh My!

Post by Angeldust2 »

I think, this was the most important and inspiring post in MWiF forums of all in 2020. It got me really excited and motivated to start new games. I am amazed, there is not more feedback (and interest?) on this project.
Unfortunately I have no programming skills or experience by myself, otherwise I would happily try to contribute to this unselfish effort for the greater good of the community. rkr1958 was not too shy to ask for any kind of help with coding, but it seems, there is not much response? [:(]

Ronnie, thank you so much for your efforts so far! What is the current status of your project? Do you have something to share or to test?
User avatar
rkr1958
Posts: 29900
Joined: Thu May 21, 2009 10:23 am

RE: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

ORIGINAL: Angeldust2

I think, this was the most important and inspiring post in MWiF forums of all in 2020. It got me really excited and motivated to start new games. I am amazed, there is not more feedback (and interest?) on this project.
Unfortunately I have no programming skills or experience by myself, otherwise I would happily try to contribute to this unselfish effort for the greater good of the community. rkr1958 was not too shy to ask for any kind of help with coding, but it seems, there is not much response? [:(]

Ronnie, thank you so much for your efforts so far! What is the current status of your project? Do you have something to share or to test?
Thanks! I have made some progress. I've decided on a command file based editor and I'm a few coding hours away from that first release. However; coding is taking a distance seat to playing and documenting (i.e., AARs). I'd estimate that I have 10 to 20 hours of work left before I have a workable command line editor.

My vision for anything beyond that (e.g., GUI front end to the editor, AI bots, etc) was one that would require community support, development and testing. I'm afraid I enjoying playing the game too much to sacrifice that for a solo development of what I envisaged in this thread. Though I have no doubt that with a hand full or two of dedicate folks (5 to 10) working in a distributed manner could accomplish a lot of what I envisaged in less than a year.

By the way, a signficiant motivation for a command line editor controller is driven by the significant slow down in MWiF that I've encountered in end game. With the command line editor controller I'm close to completing (10 to 20 hours of more work for an initial version), I will be able to move units and change hex control. This means that I won't be frustrated by the 2 to 3 minutes it takes to move a stack, because of the long supply calculation times, and possibly have 1 to 2 hours off per impulse.
Ronnie
Angeldust2
Posts: 416
Joined: Tue Apr 28, 2020 4:24 am

RE: Utilities, Controllers & Bots, Oh My!

Post by Angeldust2 »

Your last post in
https://www.matrixgames.com/forums/tm.asp?m=5065954
reminded me on your stunning project to develop utilities for MWIF. I want to repeat my availability for helping to develop such tools as you require. My coding skills are almost non-existant, but for other tasks I am at your service.
User avatar
rkr1958
Posts: 29900
Joined: Thu May 21, 2009 10:23 am

RE: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

ORIGINAL: Angeldust2

Your last post in
https://www.matrixgames.com/forums/tm.asp?m=5065954
reminded me on your stunning project to develop utilities for MWIF. I want to repeat my availability for helping to develop such tools as you require. My coding skills are almost non-existant, but for other tasks I am at your service.
Ulrich, thanks! I'd definitely be willing to take you up on your offer if we'd could come up with any worthwhile 2-man project(s) and still have time to play the game. Any ideas for bots and/or controllers that would be worth our time that would improve play?
Ronnie
User avatar
rkr1958
Posts: 29900
Joined: Thu May 21, 2009 10:23 am

RE: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

P.S. I do know someone a few months back that stated they were going to pull together a word document (I believe) on editing the game file. I'll check with them on that and also if they have any interest in all this.
Ronnie
User avatar
rkr1958
Posts: 29900
Joined: Thu May 21, 2009 10:23 am

RE: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

P.S.S. & FYI. What prompted the previous three posts was this from another thread. I suggested we move discussion on that below as not to highjack the original thread I posted it in.

Reference: https://www.matrixgames.com/forums/tm.asp?m=5065954#
ORIGINAL: rkr1958

ORIGINAL: Angeldust2

I completely agree on your assessment MWIF versus Vassal WIF CE. One of the biggest strength (but for sure only one of several) of MWIF is its ability to enforce the rules against intentional and unintentional exploits.

I liked very much when Steve still added some small new features like showing CONV and PIL in Destroyed Pool recently. My main concern is, that too much effort goes into AIO, which is not so relevant if you play with human players using pbem. Too much effort, while at the same time for example the one-map scenarios, who could potentially be an important stepping stone to transform new players into regular ones, are still not functional. Or many small items, bug fixes, improvements, UI enhancements, suggested by the community not being implemented at the same time. This seems to be the main reason, why the community of dedicated players of this fine game is not growing, but seems to be steady on a quite low level, compared with many other ("inferior") Matrix games.

I’m retired now, but I had a professional career that spanned nearly 40-years with the same company. I retired as a Senior Principal Systems Analyst. My career included both management and technical. My passion was always the technical so I got out of management and stayed technical the last 20-years, which included both analysis and software development. My software development experience included both internally used products and externally “shrink-wrapped” delivered products. The later was where I learned that you need to include in your code robust error handling capabilities, which I generally found was not as robust as needed. I discovered that users would often use or break your software in ways of which I haven’t dreamed. I give all this background in the hopes of lending validity to the most important corollary I believe to be true with respect to software development. “Software designers may pick any two: (1) Cheap, (2) Fast and/or (3) Good.”

While some may argue if MWiF is cheap, I think it’s safe to say that Steve chose, (1) Cheap & (2) Good. I don’t believe I’ll get any argument that the MWIF development hasn’t been (2) Fast. I’m grateful that 7-years or so after initial release we still have a developer that’s around making improvements and taking care of bug fixes. Contrast that to other Matrix games, such as WiTP-AE where the developer(s) have long since left the game to the community. But also contrast the size of that community that’s still fateful to WiTP-AE versus MWiF. That’s what saddens me the most about MWiF. That is, that we’ve lost a whole lot of the folks and enthusiasm that was present about this game 12+ years ago. Just take a look at some of the old AI threads. In my opinion that’s a real shame because MWiF is “almost” that great game that could have not only held on to all that but thrived well beyond it’s software end date as WiTP-AE has done. Again, my opinion.

What could have been done differently to accomplish this? I’m going to be frank and, again this is my opinion. Really, it’s a bit of Monday morning quarterbacking, so take it as you wish. My equation for this is quite simple, really:

(1) Steve -> MWiF code base to handle maps, units, rules, scenarios, etc. (pretty much the MWiF solitaire code & functionality + ALL WiF scenarios) +
(2) Volunteer team 1 -> help with scenarios, maps, rules, AI logic, etc (pretty much what was happening in force 12+ years ago) +
(3) Volunteer team 2 -> develop a collection of external apps that interfaced with a well-documented game file.

I documented my vision a year or so ago of what Volunteer team2 and their apps could look like in: Utilities, Controllers & Bots, Oh My!

Well, anyway hindsight is 20/20 and sorry for “high jacking” this thread. I suggest if anyone wishes to comment on this or continue this discussion that we continue in Utilities, Controllers & Bots, Oh My!

Monday quarterbacking over. [8D]
Ronnie
User avatar
rkr1958
Posts: 29900
Joined: Thu May 21, 2009 10:23 am

Re: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

So to get this project resurrected I propose we start small with the development of one external app, which operates on the saved game file.

My suggestion would be a simplified convoy routing/production app either in excel or python.

Other suggestions for external app #1?

Also, what do we call this project and eventually the overall controller for all external apps? Personally, I like "MAGIC" but I'd like to hear from others.
Ronnie
User avatar
Courtenay
Posts: 4396
Joined: Wed Nov 12, 2008 4:34 pm

Re: Utilities, Controllers & Bots, Oh My!

Post by Courtenay »

I am good at C++, and can do pretty well with open office, which has subtle differences from EXCEL. I do not know python. I will help if I can, but do not know if I can.
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 »

Courtenay wrote: Wed Dec 27, 2023 7:04 pm I am good at C++, and can do pretty well with open office, which has subtle differences from EXCEL. I do not know python. I will help if I can, but do not know if I can.
Most definitely you can help! My strengths are logic, figuring out solutions but one of my greatest weakness is anything related to gui's.

I do consider myself fairly competent, possibly skilled, with EXCEL, python, MATLAB, java and object oriented programming. Just no gui's!

I do think a requirement for our apps is that no payware is required, so maybe that rules out EXCEL? And most definitely rules out MATLAB.

A major strength of python is it's ability to read files fast. It does this by treating everything as text, so variable typing (e.g., integer, real, double) is a must.

Also, I feel that the controller for all our external apps will have to have a easy to understand and use gui if we want to gain wider community acceptance and participation.
Last edited by rkr1958 on Thu Dec 28, 2023 12:22 am, edited 3 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 »

For example, below is the python code for the method I wrote to read in the entire game file.

Code: Select all

    def read_game_file(self,input_gf=[]):
        self.gf_load = False
        self.gf_records = []
        if len(input_gf) > 0:
            self.input_gf = input_gf
        try:
            with open(self.input_gf,'rb') as f:
                for line in f:
                    self.gf_records.append(line)
                    
            self.write_to_log('Read in game file: ' + self.input_gf,prt_flag=True)
            self.gf_load = True
        except:
            self.write_to_log('ERROR.  read_game_file. Failed to load game file: ' + self.input_gf,prt_flag=True)
        
        self.init_game_file()
Ronnie
User avatar
Courtenay
Posts: 4396
Joined: Wed Nov 12, 2008 4:34 pm

Re: Utilities, Controllers & Bots, Oh My!

Post by Courtenay »

Open Office is a perfectly good spreadsheet program that has the great virtue that it is free.
I thought I knew how to play this game....
User avatar
Courtenay
Posts: 4396
Joined: Wed Nov 12, 2008 4:34 pm

Re: Utilities, Controllers & Bots, Oh My!

Post by Courtenay »

I have to admit that gui's are not among my strengths, either. Text. I understand text.

You suggested doing something about convoy routing as the first project. I agree that would be nice, but it strikes me as potentially hard, because I am not sure anyone knows exactly how MWiF saves the convoy routing, and what changes when convoy routes change. I have a horrible suspicion that it is not local, particular when it comes to convoys that are used in trade.

Changing unit locations is easy; I can do that. (Hmm. That may be my definition of "easy". :) ) However, doing convoy routes will require some investigation.
I thought I knew how to play this game....
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 »

I don't know anything about how to program these kind of things nowadays. I've had some experience with Cobol (and that's a long, long time ago), when I could read it. But that's about it. But I'm interested in this too, because especially the production planning system is the most difficult part of the game to grasp for players. It took me so long to get it right. So if one can build something to get it right more easily within the constrictions of the rules (which would be a real challenge, I believe), I would be a very, very happy man indeed.
Peter
User avatar
rkr1958
Posts: 29900
Joined: Thu May 21, 2009 10:23 am

Re: Utilities, Controllers & Bots, Oh My!

Post by rkr1958 »

I'm just spit balling and strongly encourage feedback & especially constructive criticism on the following.

(1) I think if we could pull off a simplified convoy routing/production app as our first app we could possibly draw new players, old players back to MWIF and more participation to our external app development activities.

(2) Maybe developing such an app is pie in the sky but if any folks are willing I'm also willing to give it my best shot.

(3) How do folks that play WIF over the board or vassal handle convoy routing & production?

(4) Might it be possible to build an external app that looked like that, that operated on the saved MWIF game file for needed inputs and, if necessary, overrode the production & saved oil numbers in that file if they didn't match?

(5) If so, would such an app & approach have a chance of accomplishing (1) above?
Ronnie
User avatar
Courtenay
Posts: 4396
Joined: Wed Nov 12, 2008 4:34 pm

Re: Utilities, Controllers & Bots, Oh My!

Post by Courtenay »

I have a spreadsheet that I use to do the initial Allied convoy routing. After the initial set up, I don't use it, simply making changes to areas as either new things are added (rare) or replacing CPs that either submerge or are driven from the area.

The main problem with whatever we do is figuring out how to impose our will on MWiF. Whatever we do should be done in Breakdown Units step. For some reason, changes I make before that (Prelim Prod. Planning, I am looking at you) are undone when I reach Final Production Planning. This is particularly frustrating when it is a traded resource that is affected, because you can't change those in Final Production Planning. However, if I make the changes in the Breakdown units step, they stick.

No, I am not sending the Estevan oil to the USSR, going through a semi-infinite number of convoys, I am sending this oil I have saved in Amman which can get there using rail lines. (Syria went Free French.)
I thought I knew how to play this game....
User avatar
paulderynck
Posts: 8477
Joined: Sat Mar 24, 2007 5:27 pm
Location: Canada

Re: Utilities, Controllers & Bots, Oh My!

Post by paulderynck »

The zero box in each sea area will give you the coordinates for where convoys of each side are, per sea zone. Take a game where you know how many convoys are in sea zones and you know the preliminary production plan and search for those coordinates in the game file and you'll find up to three routes that start with the coordinates of a resource and end with the coordinates of a factory (or save location). I assume the routes correspond to normal, default and override settings in convoy planning.

I think it would be possible to take that info and try to process it against external logic for what the production plan "should be" and then change the routes accordingly and rewrite the game file. The big problem would be if MWiF blithely then ignores what's in the file and re-does its own routing at whatever point you load the game file back into MWiF. (Sort of like what happens between preliminary and final production.)

So maybe a better approach would be to read in the locations of the convoys and calculate optimum production and provide a total number of BPs that "should be" achieved and try to insert that total just prior to production. MWiF is pretty good at overland RR transportation so this would only focus on transport of resources by sea.

The first approach would be with the oil rules off and if that gets anywhere, then add in the use of oil.
Paul
Post Reply

Return to “Mods and Scenarios”