Request for help developing a new tool for TOAW

The sequel of the legendary wargame with a complete graphics and interface overhaul, major new gameplay and design features such as full naval combat modelling, improved supply handling, numerous increases to scenario parameters to better support large scenarios, and integrated PBEM++.
User avatar
Cpl GAC
Posts: 369
Joined: Fri Jul 16, 2021 6:38 pm

Re: Request for help developing a new tool for TOAW

Post by Cpl GAC »

That Abbey Road one is brilliant. Well done!
User avatar
larryfulkerson
Posts: 42791
Joined: Sat Apr 16, 2005 9:06 pm
Location: Tucson, AZ,usa,sol, milkyway
Contact:

Re: Request for help developing a new tool for TOAW

Post by larryfulkerson »

So um........Bad news guys. Twice this week the electricity went off and I lost my work. AHHHHH. So I didn't get done as much as I wanted to. Also I'm using Visual Studio Code and I've messed something up and now when I hover over a function name or a variable I don't get any tool-tip hints any longer. And I'm not sure how to fix it. So I've downloaded the Eclipse IDE and I'm in the process of configuring it to do Python stuff. I've been using Eclipse for several years now and I like it a lot. Long story short I've fallen short of having something for you guys to play with this week. But I figure maybe this time next week.....maybe. We'll see. There's a lot to do to parse the *.COL file and replacing the numbers in it with new numbers and then writing the result to a file. More than I anticipated.
Wish me luck.
Russia’s 41st Army COLLAPSED in Pokrovsk — 25,000 Soldiers KILLED After a RIDICULOUS Russian Assault
https://www.youtube.com/watch?v=T_CtW3GqPQg
User avatar
rhinobones
Posts: 2185
Joined: Sun Feb 17, 2002 10:00 am

Re: Request for help developing a new tool for TOAW

Post by rhinobones »

larryfulkerson wrote: Sat Jul 29, 2023 4:57 am Twice this week the electricity went off and I lost my work. AHHHHH.
Considering the heat wave you've had for the past month; I'm surprised you have any electricity at all. Time to get that summer cottage in Alaska.

Keep out of the sun, Regards
Colin Wright:
Pre Combat Air Strikes # 64 . . . I need have no concern about keeping it civil

Post by broccolini » Sun Nov 06, 2022
. . . no-one needs apologize for douchebags acting like douchebags
User avatar
larryfulkerson
Posts: 42791
Joined: Sat Apr 16, 2005 9:06 pm
Location: Tucson, AZ,usa,sol, milkyway
Contact:

Re: Request for help developing a new tool for TOAW

Post by larryfulkerson »

So um.........hey you guys. I have good news and bad news. I've managed to get the app to read in an input file ( in the form of the *.COL file ) and write out the new output file. And of course you can choose from more than 2M+ different colors with the color picker dialog. I've installed a label to hold a portion of the input file just to make sure it's reading in stuff correctly and I've compared the output file(s) to the input file and they are exact matches. Which is a good thing. Now for the bad news.....the example *.COL file I'm using is the one being produced by the D21 scenario and it has 109 different color ID's. Here's an excerpt from the head of the file:
<?xml version="1.0" encoding="utf-8"?>
<GAME>
<ICONCOLOR>
<COLOR ID="0" MainBackground="21125" Background="14549033" Foreground="15724527" Numbers="15527148"/>
<COLOR ID="1" MainBackground="21125" Background="8650752" Foreground="16777116" Numbers="15527148"/>
<COLOR ID="2" MainBackground="21125" Background="255" Foreground="16250871" Numbers="15527148"/>
<COLOR ID="3" MainBackground="21125" Background="16250871" Foreground="0" Numbers="43495"/>


I'm planning on constructing a dictionary for these data. Each entry in a dictionary has a key and one or more values for that key. The Key will be the color ID and there will be four different values for that key, one for each of the major labels ( MainBackground, Background, Foreground, and Numbers ). Each color ID is on it's own separate line with only a newline separating the entries. That tends to make it trivial to parse the data and populate a dictionary with the keys and values.

I'm using the *.COL file produced by my D21.sce and there are 109 different entries in the input file to go into the dictionary however I'm pretty sure that the user can use or not use any number of colors in the output file depending on the user's desires. Some *.COL files have only a handful of different color ID's but theoretically any number of color ID's can be built by the user using those color ID's that aren't represented in the input file. Up to however many different color ID's are allowed by the game engine. So I'm guessing that even if the input file has only a handful of different colors the output file can have 100+ different colors.

The bad news is that I'm really not sure what the UI should look like. The color picker opens, you pick a color, and when you click OK it closes, so it's not in the way of the user seeing what he/she has already changed and what yet needs some love. I'm thinking that since you can't see all 109 color ID's simultaneously I will need to install a scrollbar so you can have access to all of them. Perhaps each color ID could be represented by a group of four little buttons, one for each of the major values (bg, fg, numbers, etc.) At the same time I want to make it simple to use, straightforward, so that it will be intuitive to use.

Perhaps clicking on any of the little buttons will cause the color picker to open and the color chosen will replace the old one, for each of the four little buttons for that color ID. Each of which can be adjusted as many times as desired to find the perfect color for that button. I'd like to be able to build a virtual counter that uses those color entries to demonstrate to the user what the new counter might look like but I'm not sure exactly how to do that, not having access to the process the game engine uses to construct the counter(s) with the new colors. I'll give that some more thought. I'll see if I can't produce a working prototype for you guys to play with. Please recognize that your ideas are valuable and are welcomed and will be entertained.

In the image below you can see what I've produced so far. There are only three existing buttons, one to open the color picker and one to load an input file and one to write out the new file. There's a label to hold a portion of the input file, only for me to see if the read function works as designed, I'll do away with that now that I've proved the input routine is working. I need to install a lot more try: except: finally: blocks to contain all the different ways the process can fail. I hate it when the program crashes because I enter a letter when a number was needed, etc. I aim to make it bullet proof. Programs should never crash for any reason. I'd like you beta testers to see if you can make it crash on purpose to expose those causes I have yet to consider.

I'll post the prototype I've built so far so you guys will at least have something to play with and give you an opportunity to give some thought to what the UI should look like. If you would. I'll keep you guys in the loop.

Here's the link to this version of our toy. (Snippet.exe)
https://1drv.ms/u/s!Apv54pJnu32YgSeDSTm ... e?e=Rw8KBi

Image
Russia’s 41st Army COLLAPSED in Pokrovsk — 25,000 Soldiers KILLED After a RIDICULOUS Russian Assault
https://www.youtube.com/watch?v=T_CtW3GqPQg
User avatar
Zovs
Posts: 9276
Joined: Sun Feb 22, 2009 11:02 pm
Location: United States

Re: Request for help developing a new tool for TOAW

Post by Zovs »

larryfulkerson wrote: Mon Jul 31, 2023 5:05 am So um.........hey you guys.
Larry,

Could you add a feature that uses web colors (hex)?

I use this site all the time to get the colors I want to use for various things.

https://www.htmlcsscolor.com/hex/FCC200

I think in the past I had to use MS Calc to convert the hex to whatever it uses in TOAW.
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
larryfulkerson
Posts: 42791
Joined: Sat Apr 16, 2005 9:06 pm
Location: Tucson, AZ,usa,sol, milkyway
Contact:

Re: Request for help developing a new tool for TOAW

Post by larryfulkerson »

Yeah, sure thing. I can supply the hex number as well as the decimal equivalent. Who knows, it might come in handy somewhere. Thanks for the idea. Keep those good ideas coming my friend.

How about something along these lines:
Image
Russia’s 41st Army COLLAPSED in Pokrovsk — 25,000 Soldiers KILLED After a RIDICULOUS Russian Assault
https://www.youtube.com/watch?v=T_CtW3GqPQg
User avatar
Zovs
Posts: 9276
Joined: Sun Feb 22, 2009 11:02 pm
Location: United States

Re: Request for help developing a new tool for TOAW

Post by Zovs »

Larry that seems workable. Or a better way to say it is the workflow you presented seems like a good choice.
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
rhinobones
Posts: 2185
Joined: Sun Feb 17, 2002 10:00 am

Re: Request for help developing a new tool for TOAW

Post by rhinobones »

Looking good Larry, the progress is impressive. Three comments:

1. The screen needs to have a column showing a generic unit icon with all current/changed colors. I think the user needs to have immediate visual feedback so icon colors meet the eye test. Suggest adding the unit icon column between the Color ID and MainBG columns.
2. The example seems to indicate that the color picker and Color ID views are located on two different screens, requiring the user to bounce between the two. Suggest making it easy on the user and build all functions on to one screen. This enables the user to select a color, enter the change and see the result (generic unit icon) in real time on one screen.
3. Please add a “Clear” button that restores the tools back to the last saved color scheme. I can see people like myself getting lost in icon-land and needing to get back to the starting point.

Appreciate the good work.
larryfulkerson wrote: Mon Jul 31, 2023 1:18 pm How about something along these lines:
Image
Colin Wright:
Pre Combat Air Strikes # 64 . . . I need have no concern about keeping it civil

Post by broccolini » Sun Nov 06, 2022
. . . no-one needs apologize for douchebags acting like douchebags
User avatar
larryfulkerson
Posts: 42791
Joined: Sat Apr 16, 2005 9:06 pm
Location: Tucson, AZ,usa,sol, milkyway
Contact:

Re: Request for help developing a new tool for TOAW

Post by larryfulkerson »

rhinobones wrote: Mon Jul 31, 2023 3:04 pm Looking good Larry, the progress is impressive. Three comments:

1. The screen needs to have a column showing a generic unit icon with all current/changed colors. I think the user needs to have immediate visual feedback so icon colors meet the eye test. Suggest adding the unit icon column between the Color ID and MainBG columns.
2. The example seems to indicate that the color picker and Color ID views are located on two different screens, requiring the user to bounce between the two. Suggest making it easy on the user and build all functions on to one screen. This enables the user to select a color, enter the change and see the result (generic unit icon) in real time on one screen.
3. Please add a “Clear” button that restores the tools back to the last saved color scheme. I can see people like myself getting lost in icon-land and needing to get back to the starting point.

Appreciate the good work.
So um...I really like your suggestion in point #1, about having a counter showing with the new colors. So the user gets real time updates for what colors are chosen. The problem is that I'm not sure how to do that. The TOAW game engine does that somehow when it presents the counters on the map but I have no idea how that's done. This is what I'm working on as we speak.

Your suggestion #2 is a good one but I don't yet know how to make the color picker dialog to remain open for the user to be able to choose colors quickly. I may have to build a custom color picker widget that will do that for us.

Suggestion #3 is like an "undo" or "revert" functionality and that's a good idea. I like it. I'll see what I can do to enable that. Perhaps we don't need an "exit" button. The user can click on the "close button" in the upper right of the app to close it.

It's 08:16 ( tucson time ) and I've been working on a new prototype for several hours now and I intend to go for it until about noon when I have a nap scheduled which might last for an hour or so and then I'll keep going after that. It's not like a job, I really enjoy experimenting with what's possible, coming up with workarounds, and seeing the progress being made.

Part of the problem is that Python has every indication of being an old language, dynamically changing in that there are plenty of depreciated functions, functions that shouldn't be used because there are better ones to use. The problem often is that you don't know which ones are no longer functional until you try to use it. The Python documentation is barely useable ( being written by a committee probably ) and I've been using google to find the current best practices to do things not explictly addressed by the existing documentation. For example in C++ there's a macro _line_ which returns the current line number that you can use in print statements to give you a really good idea where your problems are occurring but there's no such thing in Python. I'll have to come up with one of my own that I can use. Like: def __LINE__(): return inspect.stack()[1].lineno. It's only a workaround for now but it seems to work okie dokie. To use it I need to import inspect but that's not a major problem. And so it goes. It's now 08:32 which is how long it took me to write this verbage and edit it to help it make sense to my readers. Which is an indication of how long it takes me to accomplish simple tasks just now. I must be getting older than I feel.
Russia’s 41st Army COLLAPSED in Pokrovsk — 25,000 Soldiers KILLED After a RIDICULOUS Russian Assault
https://www.youtube.com/watch?v=T_CtW3GqPQg
User avatar
rhinobones
Posts: 2185
Joined: Sun Feb 17, 2002 10:00 am

Re: Request for help developing a new tool for TOAW

Post by rhinobones »

We have confidence in you. Enjoy your siesta.
Colin Wright:
Pre Combat Air Strikes # 64 . . . I need have no concern about keeping it civil

Post by broccolini » Sun Nov 06, 2022
. . . no-one needs apologize for douchebags acting like douchebags
User avatar
Zovs
Posts: 9276
Joined: Sun Feb 22, 2009 11:02 pm
Location: United States

Re: Request for help developing a new tool for TOAW

Post by Zovs »

Larry if your not asleep yet, why did you choose Python? Don't the users have to have something installed and running (like java)? Maybe not, I don't know. Seems C++ from your post might be better, but I don't know.

Anyway, having the selected counter and changing it in real time would be awesome and give right up front feedback to the user. But like you said I have no idea how to do that.

A friend of my is working on a project and he used C++ with WxWidgets for the windows part, he has been working on it for two years (its a big project) now though.

Anyway good luck!
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
rhinobones
Posts: 2185
Joined: Sun Feb 17, 2002 10:00 am

Coloring Tool Future Enhancements

Post by rhinobones »

Larry, someday in the future this project will be complete and at that time you’ll need to have a new project.

Changing icon colors is a great mod tool, but it does cause confusion in the force editor. When the COL file is modified, colors shown in the Force Editor no longer match the COL colors. Sometimes this makes it necessary for the user to search for the Force Editor color which equates to the COL color. The fix is to have the coloring tool port the new color scheme to the graphics Standardbuttons256 files.

There are 13 Standardbuttons256 files, one of which supports the Force Editor. The suggestion is to add a function that exports the new COL colors to the Standardbuttons256 files and saves the modified files in a selected location. The default location should be the Graphics Override folder where the COL file is saved. Having the Forced Editor match the COL file would make scenario editing/building much easier.

As I said, this is a future addition after the coloring tool works to perfection. No need to delay publishing the coloring tool for this add-on. Just something to keep in mind for a future, nice to have, enhancement.

Regards, RhinoBones
Attachments
This is the Force Editor icon color selector.  Currently, colors in a modified COL file are not shown in the selection panel.  For the original author this is more of an inconvenience rather than a problem.  For other users, modifying a scenario and picking out the correct icon color set can be frustrating.
This is the Force Editor icon color selector. Currently, colors in a modified COL file are not shown in the selection panel. For the original author this is more of an inconvenience rather than a problem. For other users, modifying a scenario and picking out the correct icon color set can be frustrating.
Force Editor.JPG (437.84 KiB) Viewed 1019 times
Typical view of one of the 13 Standardbuttons256 files.
Typical view of one of the 13 Standardbuttons256 files.
Standard Butons.JPG (149.47 KiB) Viewed 1019 times
Colin Wright:
Pre Combat Air Strikes # 64 . . . I need have no concern about keeping it civil

Post by broccolini » Sun Nov 06, 2022
. . . no-one needs apologize for douchebags acting like douchebags
User avatar
larryfulkerson
Posts: 42791
Joined: Sat Apr 16, 2005 9:06 pm
Location: Tucson, AZ,usa,sol, milkyway
Contact:

Re: Coloring Tool Future Enhancements

Post by larryfulkerson »

rhinobones wrote: Mon Jul 31, 2023 5:42 pm Larry, someday in the future this project will be complete and at that time you’ll need to have a new project.

Changing icon colors is a great mod tool, but it does cause confusion in the force editor. When the COL file is modified, colors shown in the Force Editor no longer match the COL colors. Sometimes this makes it necessary for the user to search for the Force Editor color which equates to the COL color. The fix is to have the coloring tool port the new color scheme to the graphics Standardbuttons256 files.

There are 13 Standardbuttons256 files, one of which supports the Force Editor. The suggestion is to add a function that exports the new COL colors to the Standardbuttons256 files and saves the modified files in a selected location. The default location should be the Graphics Override folder where the COL file is saved. Having the Forced Editor match the COL file would make scenario editing/building much easier.

As I said, this is a future addition after the coloring tool works to perfection. No need to delay publishing the coloring tool for this add-on. Just something to keep in mind for a future, nice to have, enhancement.

Regards, RhinoBones
I had no idea that there was an existing "Force Editor" application. I'd like to know how it works and what kind of output it outputs and exactly what's needed to coordinate my application with it. That would be ideal of course and I'm in favor of whatever makes our "updates" easier to use and I'd like to look into that. What else can you tell me about this "force editor" you mention. Where can I obtain a copy of it? Is it something I'm going to write in the future?

And regarding my using Python. I DID consider using Java instead of Python because I already know Java, have used it in the past but my concern was that our users would be forced to install Java on their machines if they don't already have it installed. If that's not a problem I'd rather work in Java. Should we take a poll and see how many of our users don't think that's too much to ask? Installing Java isn't all that hard and would facilitate a lot more programs that I can write more quickly. I'm finding Python a major problem to use and would rather use Java if that's not a problem for our users. What say you guys?
Russia’s 41st Army COLLAPSED in Pokrovsk — 25,000 Soldiers KILLED After a RIDICULOUS Russian Assault
https://www.youtube.com/watch?v=T_CtW3GqPQg
User avatar
larryfulkerson
Posts: 42791
Joined: Sat Apr 16, 2005 9:06 pm
Location: Tucson, AZ,usa,sol, milkyway
Contact:

Re: Request for help developing a new tool for TOAW

Post by larryfulkerson »

And speaking of future projects....one I'd like to write would be an application that would be able to start up TOAW from within it's RAM footprint so that it would be able to access the various variables and function calls so that TOAW would be "instrumented" so that variables would be able to be monitored and those situations that cause CTD's could be found and fixed. Something for Bob to use maybe. It would be able to keep a running total of the units lost each turn for instance for both sides, and I'd like to be able to take a "digital picture" of the TOAW's running process so that the process could continue on from "the last know good" process which could be loaded and the program could continue from that spot in event the running program has a CTD. Things like that. Interested?
Russia’s 41st Army COLLAPSED in Pokrovsk — 25,000 Soldiers KILLED After a RIDICULOUS Russian Assault
https://www.youtube.com/watch?v=T_CtW3GqPQg
User avatar
Zovs
Posts: 9276
Joined: Sun Feb 22, 2009 11:02 pm
Location: United States

Re: Request for help developing a new tool for TOAW

Post by Zovs »

Larry couple of points.

The Force Editor is built into TOAW IV.

Java would be better in my book. I don't know how they do it (you prob know) but the game Valor and Victory is created in java and I don't recall installing java for it, maybe I already did at one point in time, but I think it runs off a local copy in the game somehow?

I'd go with Java or C++. I think there is more libraries for graphics for both and they are both more updated then Python.

Anyway food for thought.
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
larryfulkerson
Posts: 42791
Joined: Sat Apr 16, 2005 9:06 pm
Location: Tucson, AZ,usa,sol, milkyway
Contact:

Re: Request for help developing a new tool for TOAW

Post by larryfulkerson »

Zovs wrote: Mon Jul 31, 2023 6:55 pm Larry couple of points.

The Force Editor is built into TOAW IV.

Java would be better in my book. I don't know how they do it (you prob know) but the game Valor and Victory is created in java and I don't recall installing java for it, maybe I already did at one point in time, but I think it runs off a local copy in the game somehow?

I'd go with Java or C++. I think there is more libraries for graphics for both and they are both more updated then Python.

Anyway food for thought.
Thank you very much for these suggestions. It shouldn't be all that hard to port the code I've already written to Java. I'll get started right now. I would use C++ but I like Java better because it has a built-in garbage collection process so that the programmer doesn't have to worry about memory leaks whereas in C++ memory leaks are hard to track down and fix. I've been there.
Russia’s 41st Army COLLAPSED in Pokrovsk — 25,000 Soldiers KILLED After a RIDICULOUS Russian Assault
https://www.youtube.com/watch?v=T_CtW3GqPQg
User avatar
larryfulkerson
Posts: 42791
Joined: Sat Apr 16, 2005 9:06 pm
Location: Tucson, AZ,usa,sol, milkyway
Contact:

Re: Request for help developing a new tool for TOAW

Post by larryfulkerson »

Thanks to you I've found it. Now I need to see how to integrate it into my application somehow.
Image
Russia’s 41st Army COLLAPSED in Pokrovsk — 25,000 Soldiers KILLED After a RIDICULOUS Russian Assault
https://www.youtube.com/watch?v=T_CtW3GqPQg
User avatar
rhinobones
Posts: 2185
Joined: Sun Feb 17, 2002 10:00 am

Re: Request for help developing a new tool for TOAW

Post by rhinobones »

Larry, to put a picture on Zov's explanation...

Note that in this example the unit's icon background color does not match the color from the color selection table. This is where the future enhancement would be beneficial.
Attachments
Force Editor Example.jpg
Force Editor Example.jpg (228.83 KiB) Viewed 993 times
Colin Wright:
Pre Combat Air Strikes # 64 . . . I need have no concern about keeping it civil

Post by broccolini » Sun Nov 06, 2022
. . . no-one needs apologize for douchebags acting like douchebags
tomlowshang
Posts: 35
Joined: Sat May 21, 2016 11:27 pm
Contact:

Re: Request for help developing a new tool for TOAW

Post by tomlowshang »

larryfulkerson wrote: Mon Jul 31, 2023 3:35 pm Part of the problem is that Python has every indication of being an old language, dynamically changing in that there are plenty of depreciated functions, functions that shouldn't be used because there are better ones to use. The problem often is that you don't know which ones are no longer functional until you try to use it. The Python documentation is barely useable ( being written by a committee probably )
Please post the function deprecation warnings when you get them so that I can have a look. Are you using the documentation at https://docs.python.org/3/ or something else?

Python programs can be compiled into a standalone binary which does not require Python to be installed.
Wargaming live streams https://www.twitch.tv/tomlowshang
User avatar
larryfulkerson
Posts: 42791
Joined: Sat Apr 16, 2005 9:06 pm
Location: Tucson, AZ,usa,sol, milkyway
Contact:

Re: Request for help developing a new tool for TOAW

Post by larryfulkerson »

tomlowshang wrote: Mon Jul 31, 2023 10:41 pm Please post the function deprecation warnings when you get them so that I can have a look. Are you using the documentation at https://docs.python.org/3/ or something else?

Python programs can be compiled into a standalone binary which does not require Python to be installed.
Yes, that's the documentation I'm talking about. That Python can be compiled into a standalone binary is the process I've been using to produce the prototypes I've already posted but I'm distressed about how LARGE the result is. 16Meg+ is a LOT larger than I would have expected for the miniscule amount of code I've written. Another reason I wish to migrate to Java. If I run across another example of a depreciated library I'll mention it out loud here.
Russia’s 41st Army COLLAPSED in Pokrovsk — 25,000 Soldiers KILLED After a RIDICULOUS Russian Assault
https://www.youtube.com/watch?v=T_CtW3GqPQg
Post Reply

Return to “The Operational Art of War IV”