Page 5 of 8
Re: Utilities, Controllers & Bots, Oh My!
Posted: Tue Jan 09, 2024 8:24 am
by lucliu
It will be great to have an editor to fix the convey/product bugs.
Good job!
Re: Utilities, Controllers & Bots, Oh My!
Posted: Tue Jan 09, 2024 9:55 pm
by paulderynck
rkr1958 wrote: Mon Jan 08, 2024 10:02 pm
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.
You loaded the new route and it worked, which is very encouraging, but which phase of the game was that in and did it hold up through to production?
At any rate, I have considerable experience with using Visual Basic to create Windows apps. I use Microsoft Visual Studio which is a free download. Visual Studio does offer the use of python but I don't know if you can create the same kind of Windows Apps that way. It may be worth checking out.
Perhaps given suitable passing of parameters, Visual Basic could be used to make the GUI that the user would manipulate and in the background it would call the python code.
Re: Utilities, Controllers & Bots, Oh My!
Posted: Wed Jan 10, 2024 8:22 pm
by rkr1958
paulderynck wrote: Tue Jan 09, 2024 9:55 pm
You loaded the new route and it worked, which is very encouraging, but which phase of the game was that in and did it hold up through to production?
It was during naval movement and the route changes have stuck through the end of impulse and into the next (axis) impulse.
paulderynck wrote: Tue Jan 09, 2024 9:55 pm
rkr1958 wrote: Mon Jan 08, 2024 10:02 pm
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.
At any rate, I have considerable experience with using Visual Basic to create Windows apps. I use Microsoft Visual Studio which is a free download. Visual Studio does offer the use of python but I don't know if you can create the same kind of Windows Apps that way. It may be worth checking out.
Perhaps given suitable passing of parameters, Visual Basic could be used to make the GUI that the user would manipulate and in the background it would call the python code.
I definitely can use all the help and expertise that folks are willing to give! I have made an initial start on a MWIF MAGIC GUI. Took me a couple of days to figure out how to manipulate button and label widgets in python (tkinter).
Re: Utilities, Controllers & Bots, Oh My!
Posted: Wed Jan 10, 2024 8:26 pm
by rkr1958
Re: Utilities, Controllers & Bots, Oh My!
Posted: Wed Jan 10, 2024 8:32 pm
by rkr1958
Load MWIF game file.
(1) Default MWIF game directory specified in MAGIC.cfg file.
(2) User may load from this default or override to another directory.

- 05-LOAD-Game-file.png (76.53 KiB) Viewed 1417 times

- 06-MWIF-MAGIC-GUI.png (22.05 KiB) Viewed 1417 times
Save (Edited) Game File.
(3) Edited saved game directory also specified in MAGIC.cfg file.
(4) Again, user may save to the directory or override to another directory.

- 07-Save-EDITED-Game-File.png (79.84 KiB) Viewed 1417 times
First UNIT TEST, open & save (to another name) game file.
(5) Winmerge DIFF shows both files (as expected) are identical!
(6) First unit test passed with flying colors.

- 08-MAGIC-UT000-File-Diff.png (58.06 KiB) Viewed 1417 times
Re: Utilities, Controllers & Bots, Oh My!
Posted: Wed Jan 10, 2024 8:48 pm
by rkr1958
Session Log File.

- 09-Session-Log.png (39.12 KiB) Viewed 1412 times
MWIF MAGIC Input Directory.
Specific relative path to MWIF MAGIC (executable) scripts.

- 10-inputs-dir.png (138.37 KiB) Viewed 1412 times
Near-Term Plans.
(1) Implement editing methods developed over the past 3 to 4 years (i.e., various reports, move counters, flip/unflip counters, change game file version, change hex control).
(2) Figure out how to export python/tinker scripts to an executable version for other folks to try out & test.
(3) Add more names to the developer & tester (CFG) lines.
Re: Utilities, Controllers & Bots, Oh My!
Posted: Wed Jan 10, 2024 9:38 pm
by paulderynck
Here is an example of what I was picturing when the idea of an editing GUI first came up. This is not an application that I wrote, I just downloaded it. It is a program that can edit game files from the game Master of Orion 2 (one of my long time favorites).
It allowed you to edit just about anything in the game - races, weapons, ships, tech achievements and planetary systems and other stuff.

- GUI sample.jpg (84.01 KiB) Viewed 1401 times
Re: Utilities, Controllers & Bots, Oh My!
Posted: Wed Jan 10, 2024 9:41 pm
by rkr1958
paulderynck wrote: Wed Jan 10, 2024 9:38 pm
Here is an example of what I was picturing when the idea of an editing GUI first came up. This is not an application that I wrote, I just downloaded it. It is a program that can edit game files from the game Master of Orion 2 (one of my long time favorites).
It allowed you to edit just about anything in the game - races, weapons, ships, tech achievements and planetary systems and other stuff.
GUI sample.jpg
Nice.
Re: Utilities, Controllers & Bots, Oh My!
Posted: Wed Jan 10, 2024 9:43 pm
by paulderynck
The components shown such as: buttons, radiobuttons, dropdown pick lists, text boxes, etc. are really very easy to make in Visual Studio.
Writing all the code to support them is the time consuming part.
Re: Utilities, Controllers & Bots, Oh My!
Posted: Wed Jan 10, 2024 10:06 pm
by rkr1958
paulderynck wrote: Wed Jan 10, 2024 9:43 pm
The components shown such as: buttons, radiobuttons, dropdown pick lists, text boxes, etc. are really very easy to make in Visual Studio.
Writing all the code to support them is the time consuming part.
I imagine they're just as easy in Python using tkinter. It took me a day or so to generate the code to do this. Crude I know, though I'm an experienced coder, I'm inexperience gui person. It's just learning the best widget to use for the job and using it correctly.

- 11-MWIF-MAGIC.png (127.6 KiB) Viewed 1394 times
My game file editing code, MWIF_Utilities_01.py currently stands at 1126 line and will definitely grow if all this takes root. Most of the code was written back in 2020 (3 to 4 years ago).

- 12a-MWIF-MAGIC-EDITOR-1.png (119 KiB) Viewed 1394 times

- 12b-MWIF-MAGIC-EDITOR-2.png (143.32 KiB) Viewed 1394 times
Re: Utilities, Controllers & Bots, Oh My!
Posted: Thu Jan 11, 2024 7:47 pm
by paulderynck
I found some info on the net about the possibility of Visual Basic code calling python scripts and it does appear to be possible. Cooperators would need to know which parameters are to be passed between them and agree on whether they should be passed as command line arguments or stored in data files that both VB and python could access.
Re: Utilities, Controllers & Bots, Oh My!
Posted: Thu Jan 11, 2024 7:53 pm
by rkr1958
Initial Release (MWIF MAGIC v0.01).
(1) If folks are willing to install & test and initial version, I think I can have one ready next week which includes a dozen or so game file editing and report options.
(2) This initial version will include a rudimentary gui and install configuration that hopefully will be improved upon as we move forward, including editing functionality.
(3) Also, this initial version will run python scripts via a windows bat (command) file that will have to be edited by the user to your machine (PC) specifics.
(4) For the initial versions you'll need python installed, including certain packages.
(5) If any folks willing to try out this and I'll proceed with getting this initial version ready.
(6) NOTE. Hopefully if we proceed in this development later versions will include an install that doesn't require python.
(7) Any takers?

- 14-Initial-Release.png (194.42 KiB) Viewed 1348 times
Re: Utilities, Controllers & Bots, Oh My!
Posted: Thu Jan 11, 2024 7:58 pm
by paulderynck
I'll give it a try. I installed the python module into Visual Studio last night.
Re: Utilities, Controllers & Bots, Oh My!
Posted: Thu Jan 11, 2024 8:11 pm
by Angeldust2
I will give it happily a try, if you guide me through the installation process.
Re: Utilities, Controllers & Bots, Oh My!
Posted: Thu Jan 11, 2024 10:11 pm
by rkr1958
paulderynck wrote: Thu Jan 11, 2024 7:58 pm
I'll give it a try. I installed the python module into Visual Studio last night.
Angeldust2 wrote: Thu Jan 11, 2024 8:11 pm
I will give it happily a try, if you guide me through the installation process.
Will do.
Look for an initial release this time next week ... Crude, Ugly & Unashamed,
MWIF MAGIC version 0.01!
I'm going to add some more basic editing function and include some reports.
Re: Utilities, Controllers & Bots, Oh My!
Posted: Sat Jan 13, 2024 5:23 pm
by Joseignacio
rkr1958 wrote: Thu Jan 11, 2024 10:11 pm
paulderynck wrote: Thu Jan 11, 2024 7:58 pm
I'll give it a try. I installed the python module into Visual Studio last night.
Angeldust2 wrote: Thu Jan 11, 2024 8:11 pm
I will give it happily a try, if you guide me through the installation process.
Will do.
Look for an initial release this time next week ...
Crude, Ugly & Unashamed, MWIF MAGIC version 0.01!
I'm going to add some more basic editing function and include some reports.

Re: Utilities, Controllers & Bots, Oh My!
Posted: Mon Jan 15, 2024 2:08 am
by rkr1958
Quick update:
(1) Still on track for a crude release by end of the week (and I do mean crude).
(2) Definitely trying to climb up the python tkinter (GUI development) learning curve.
(3) Do think I'm slowly climbing the curve and expect to get in the initial release of a gui that looks like it was created by a beginner (which it will be!).
(4) It's taken me 2 or 3 days to figure out how to get inputs from the user, filter the game file on those inputs & display the results back in the gui.
(5) Specifically on the "Move Unit(s)" form. I still have some work to go but have made progress. For this initial release the user enters row, col -> hits enter for the gui to get those values, then hits -> Show Unit(s) for the GUI to list all counters in that hex. I will then add to the right of each unit: (a) Move Row, (b) Move Col, (c) ORG/DOG, (d) RTB/SAS (applicable for naval units only). In fact (d) may be a separate form that filters on naval units at sea (haven't decide yet).
(6) I do want to add change hex control and some report functionality too in this initial (crude) release.
(7) My initial release(s) will include my source code so folks that wish to improve on things or just play around will be welcomed to it!

- 15-Move-Units-Status.png (53.04 KiB) Viewed 1231 times
(8) Anyway, this is where things stand at the moment.
(9) Now I do have experience with software development and deployment projects.
(10) MWIF->MAGIC is following a typical file structure that we followed in those projects. The path to the lib and exe folders are added during execution so folks may tie in the own executables (exe folder) and included their own libraries (lib folder).

- 16-MAGIC-FILE-STRUCTURE.png (65.09 KiB) Viewed 1231 times
Re: Utilities, Controllers & Bots, Oh My!
Posted: Mon Jan 15, 2024 2:30 am
by rkr1958
Still climbing that curve, wanted and did make this refinement to the Move Unit(s) form before stopping for the evening.

- 17-Move-Units-Refinement.png (47.45 KiB) Viewed 1227 times
Time for a whiskey! Dalmore 12-year scotch. I also have Knob Creek 120 single barrel reserve bourbon. Think I'm going with the scotch tonight.

Re: Utilities, Controllers & Bots, Oh My!
Posted: Mon Jan 15, 2024 3:41 am
by rkr1958
Just had do some more fiddling with the Move Unit(s) form. At least I've been sipping my whiskey as I'm fiddling.
Added entry boxes, which are automatically filled with initial values, for ORG/DOG, row, column.
Also, added the command button MOVE. Need to add the logic for that button which will move the units if the user changes ORG/DOG, row or column for the unit(s). Barring anything unexpected will have done by tomorrow.
P.S. Just noticed that I got the year & type column labels (row 0) reversed.

- 18-Move-Units-Refinement.png (45.31 KiB) Viewed 1222 times
Now it's off to sip my whiskey while I watch an episode or two of "Murder She Wrote" (with Angela Lansbury) or "Magnum P.I." (original with Tom Selleck). I bought the complete series of both on DVD and have been thoroughly enjoying both!
Re: Utilities, Controllers & Bots, Oh My!
Posted: Mon Jan 15, 2024 5:45 am
by Courtenay
I once saw a theory that Angela Lansbury's character was a very successful serial killer, who not only went around the country killing people, but, to prevent suspicion falling on her, would frame some innocent bystander of the killing. This always made sense to me, because what are the odds that a person wandering around the country would always find someone who has just been murdered? Clearly she is the cause.
