vasl-developers / vasl

Virtual Advanced Squad Leader
http://vasl.info/
GNU Lesser General Public License v2.1
66 stars 27 forks source link

Using SVG for VASL Discussion #627

Open BigAl737 opened 4 years ago

BigAl737 commented 4 years ago

I'm opening this topic to record a history of discussion concerning SVG file format implementation into VASL. An older closed thread (#218) provides a little more history.

So what do we gain by using SVG?

To answer this I ran a test, the results of which are in the screen shot below (double click the image to get full clarity).

The top row is normal VASL using a png image for the basic piece and VASSAL handles the rotations.

The middle row uses an SVG image for the basic piece and VASSAL handles the rotations.

The bottom is an SVG image for each rotation orientation using an added Layer trait. VASSAL is NOT handling the rotations. However, all the rotated images in this third example that you see are generated with the removal of the ruCTtur prototype. This is important to point out because with the inclusion of the ruCTtur prototype, VASSAL would handle the rotations. It's interesting to note that the SVG image for each orientation maintains better clarity than the above examples. If VASSAL handled the rotations (i.e. with the inclusion of the ruCTtur prototype), the results were almost identical to the middle row.

As expected, clarity is maintained with SVG images, even when zooming in. What I didn't expect is the improved clarity attained even when rotated through the use of a Layer trait.

image

A side benefit with SVG images is the improved clarity for backside information (smoke availability, CS, etc). Here's a screen zoomed in at 150%. I can make the superscripts more legible. Same order of formats as above.

image

The Has Info window amplifies this information as well but simply zooming in on a SVG wreck depiction allows easy reading of the notes information. With this being the case, I don't see the need to use the Replace With Other trait for Wreck depiction. I can generate a Wreck prototype that offers the same menu selection options as the current wreck counters. These menu options could be hidden from view until the Wreck layer is active. The only thing we lose is the ability for different information in the Has Info window. Typically the only thing in that window for a Wreck counter is the CS # and MG armament. Using SVG, the CS# is easily visible now and if you do need to check the MG armament, just momentarily flip the counter over to it's non-wrecked side.

Finally, SVG offers more benefits if the Mouse Over Stack trait is changed to show units in an unrotated state. Here's a screen showing what that would look like zoomed in at 150%. Easy for my aging eyes to read for sure.

image

For comparison, the top most screen shot shows these same images at 100%.

What are the SVG drawbacks?

You need to start with an SVG image to gain the benefits. Vectorizing a raster image isn't gonna gain you anything. Hence, the vast majority of current VASL images will probably never be vectorized.

An SVG image is larger than a png or gif image. A 60x60 SVG image is about 65kb vs about 6kb for a png image. Eventually the addition of SVG images will increase the size of a module. And remember that to achieve the clarity in example 3 above, each SVG counter contains 6 SVG images.

I do see benefits for SVG though. Markers can be more readily vectorized to achieve better readability. New additions to VASL (like BFPs OtO2) can be vectorized from the get go. VASL can process both gif, png, and SVG in a manner transparent to the player.

I've opened this issue for education and discussion. Please consider what I've posted here and chime in with your thoughts.

Allan

GordonMolek commented 6 months ago

I'm getting close to having an initial implementation of the base German vehicles and guns in SVG for testing/evaluation (albeit without fancy graphics). I have two known unknowns (along with an unknown number of unknown unknowns).

  1. I still can't get the SVG files scaled down in VASL to the old-busted counter size. Is that something that needs to be re-implemented in the engine? Trying to set the viewport to 60 x 60 just clips to the upper left corner of the large graphic.

  2. Font embedding. So far we need access to Helvetica-condensed and Arial (for the 5-spoked asterisk only). I've found this article:

https://dee.underscore.world/blog/embedding-fonts-in-svgs/

But I'm not sure what we should be referencing, the local host fonts? Some global font source?

TIA,

On Thu, Feb 29, 2024 at 4:39 PM Joel Uckelman @.***> wrote:

I expect 60 x 60. Try and see.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-1972092010, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUUOL5UI4RY6AELF6M3YV6WY3AVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJXGIYDSMRQGEYA . You are receiving this because you were mentioned.Message ID: @.***>

uckelman commented 6 months ago

For 1, you're probably not getting the relationship between the width and height and the viewBox right.

For 2, can you restate the question? I'm not sure what you're asking.

GordonMolek commented 6 months ago

I thought that I would allow me to draw the text and graphical elements on a "canvas 1000 pixels wide and 1000 pixel high with origin at 0,0 but that when it was displayed by Vassal/VASL or a browser it would scale it to an image 60 x 60 pixels. What seems to be happening is that it is cropping it to a 60 x 60 pixel image.

Regarding question 2, even though the SVG files I've created use style="font-family:'Helvetica Condensed'" and style="font-family:'Arial'" I believe you said I needed to "embed" the fonts to get them rendered properly. Or am I mis-remembering?

On Sat, Mar 2, 2024 at 5:14 PM Joel Uckelman @.***> wrote:

For 1, you're probably not getting the relationship between the width and height and the viewBox right.

For 2, can you restate the question? I'm not sure what you're asking.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-1974937559, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUVMQR766WP2VZAQCMTYWJML3AVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJXGQ4TGNZVGU4Q . You are receiving this because you were mentioned.Message ID: @.***>

GordonMolek commented 6 months ago

OK, I think the fonts aren't an issue. When displayed within VASL the font looks "right." However it doesn't appear that Vassal/VASL is rendering the SVG properly. Attached is the SVG for the Tiger I.

First, the "viewbox" doesn't seem to be working. My understanding is that the first two parameters are used to "pan" around the virtual SVG canvas which the "viewport" (the height and width). The second two parameters "zoom" the "viewport" in or out (with values less than the height/width zooming in and values greater zooming out). I still think it is up to Vassal/VASL to determine what the actual displayed size of the rendered SVG should be. Shouldn't it look at the viewbox and scale the image based on its current zoom level? Either that or I have to write all the SVG for a 60 x 60 virtual canvas which seems like it would be difficult to position everything properly.

Second, the positioning/rendering of the elements appears to be "off" within the game engine versus what Microsoft Edge (and the other browsers) create. See VASLMap.png. I've also attached the SVG file used in this test.

Thanks for bearing with me on this journey of exploration. pzvie VASLMap

GordonMolek commented 6 months ago

Also, how do I debug the counter loading code in Vassal/VASL? I'd like to see what it's doing when it fails to load a graphic as part of my SVG counter prototype.

On Sat, Mar 2, 2024 at 7:29 PM Gordon Molek @.***> wrote:

I thought that I would allow me to draw the text and graphical elements on a "canvas 1000 pixels wide and 1000 pixel high with origin at 0,0 but that when it was displayed by Vassal/VASL or a browser it would scale it to an image 60 x 60 pixels. What seems to be happening is that it is cropping it to a 60 x 60 pixel image.

Regarding question 2, even though the SVG files I've created use style="font-family:'Helvetica Condensed'" and style="font-family:'Arial'" I believe you said I needed to "embed" the fonts to get them rendered properly. Or am I mis-remembering?

On Sat, Mar 2, 2024 at 5:14 PM Joel Uckelman @.***> wrote:

For 1, you're probably not getting the relationship between the width and height and the viewBox right.

For 2, can you restate the question? I'm not sure what you're asking.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-1974937559, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUVMQR766WP2VZAQCMTYWJML3AVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJXGQ4TGNZVGU4Q . You are receiving this because you were mentioned.Message ID: @.***>

uckelman commented 6 months ago

how do I debug the counter loading code in Vassal/VASL?

The SVG rendering code is in https://github.com/vassalengine/vassal/tree/master/vassal-app/src/main/java/VASSAL/tools/image/svg.

uckelman commented 6 months ago

Regarding question 2, even though the SVG files I've created use style="font-family:'Helvetica Condensed'" and style="font-family:'Arial'" I believe you said I needed to "embed" the fonts to get them rendered properly. Or am I mis-remembering?

Yes, that's correct.

uckelman commented 6 months ago

For the problem with the viewBox and positioning, I'd need to see the SVG to comment.

GordonMolek commented 6 months ago

My second post back has the SVG attached (the big image).

To clarify, I'd like to see any logging/debugging messages that Vassal/VASL might generate while trying to display a counter. When I have the "Module Debug Window" for VASL open and I place one of the SVG counters, all I see is:

81* MTR GrW 34 ca3 1496,867 1096,467

I also finally found a clear discussion of SVG's Viewport vs. Viewbox at: https://webdesign.tutsplus.com/svg-viewport-and-viewbox-for-beginners--cms-30844t

On Sun, Mar 3, 2024 at 7:52 AM Joel Uckelman @.***> wrote:

For the problem with the viewBox and positioning, I'd need to see the SVG to comment.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-1975171347, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUWM56FQBXD4AFMB5ATYWMTIVAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJXGUYTOMJTGQ3Q . You are receiving this because you were mentioned.Message ID: @.***>

GordonMolek commented 6 months ago

Also, speaking as a newbie SVG creator, it would be VERY helpful to have an easy way to give Vassal/VASL an SVG file or point it at a folder of graphical files and have it render it/them. Not saying it would be easy to implement, but it sure would be nice from a creator's perspective.

On Sun, Mar 3, 2024 at 9:29 AM Gordon Molek @.***> wrote:

My second post back has the SVG attached (the big image).

To clarify, I'd like to see any logging/debugging messages that Vassal/VASL might generate while trying to display a counter. When I have the "Module Debug Window" for VASL open and I place one of the SVG counters, all I see is:

81* MTR GrW 34 ca3 1496,867 1096,467

I also finally found a clear discussion of SVG's Viewport vs. Viewbox at: https://webdesign.tutsplus.com/svg-viewport-and-viewbox-for-beginners--cms-30844t

On Sun, Mar 3, 2024 at 7:52 AM Joel Uckelman @.***> wrote:

For the problem with the viewBox and positioning, I'd need to see the SVG to comment.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-1975171347, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUWM56FQBXD4AFMB5ATYWMTIVAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJXGUYTOMJTGQ3Q . You are receiving this because you were mentioned.Message ID: @.***>

zgrose commented 6 months ago

Maybe put your source into a branch so we can run it? This a code sharing platform after all. )

uckelman commented 6 months ago

This renders at the expected size (60x60) for me in everything I've tried viewing it in---Vassal 3.7.9, Inkscape, Firefox, eog:

<svg width="60" height="60" viewBox="0 0 1000 1000" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
   <rect width="1000" height="1000" x="0" y="0" rx="63" />
</svg>

I recommend adding elements one at a time until it stops working.

GordonMolek commented 6 months ago

Joel, Very weird. It's something in the svg header I inherited from Inkscape or some online tutorial. When I substitute yours I get the same behavior as you do.

Zoltan, well yes, but that would require that I get off my ass and figure out how to do so. 😃 Especially when I'm having so much fun annoying y'all with my stupid newbie questions. 😉

Once I verify the above works for all the counters I've generated so far, that's the next step, however.

On Sun, Mar 3, 2024 at 10:46 AM Joel Uckelman @.***> wrote:

This renders at the expected size (60x60) for me in everything I've tried viewing it in---Vassal 3.7.9, Inkscape, Firefox, eog:

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-1975227052, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUROPI7TYBMM4AJLOADYWNHXHAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJXGUZDENZQGUZA . You are receiving this because you were mentioned.Message ID: @.***>

zgrose commented 6 months ago

Grab GitHub Desktop. It makes working with GitHub nearly as easy as using OneDrive/etc.

derimmer commented 6 months ago

Zoltan, well yes, but that would require that I get off my ass and figure out how to do so. 😃 Especially when I'm having so much fun annoying y'all with my stupid newbie questions. 😉 Once I verify the above works for all the counters I've generated so far, that's the next step, however.

When you get to this point, happy to walk you through the process of submitting source code.

GordonMolek commented 6 months ago

Be warned, I've downloaded Github desktop, chaos may be imminent ...

I think there's an issue with SVG text and dominant-baseline="Central" text-anchor="middle". Here's my test file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

X

And attached is what Vassal/VASL renders. text_alignment

derimmer commented 6 months ago

@GordonMolek you are free to proceed as you wish but I have never found a need to use github desktop. I am not aware of anyone who has. If you are already using a IDE, there is more than likely sufficient functionality to link to the github repo and push changes to a branch.

If you do use github desktop, it might be worth sharing your experience in a separate thread. Maybe it is a tool we should be using.

GordonMolek commented 6 months ago

I haven't been using an IDE (yet). I've been only working in Rust and Notepad++ and cygwin has been sufficient for my needs. I'm trying out Github desktop based on Zoltan's suggestion.

On Tue, Mar 5, 2024 at 6:50 AM Doug Rimmer @.***> wrote:

@GordonMolek https://github.com/GordonMolek you are free to proceed as you wish but I have never found a need to use github desktop. I am not aware of anyone who has. If you are already using a IDE, there is more than likely sufficient functionality to link to the github repo and push changes to a branch.

If you do use github desktop, it might be worth sharing your experience in a separate thread. Maybe it is a tool we should be using.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-1978708680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUUH5OCCAV2ELM2PTZ3YWW5QHAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJXHA3TAOBWHAYA . You are receiving this because you were mentioned.Message ID: @.***>

GordonMolek commented 6 months ago

https://www.youtube.com/watch?v=AJ3QgaKz83s

I believe I've checked in the initial German Ordnance and Vehicle SVG files. If you duplicate an existing counter in the piece palette and change the graphic to the same name as the GIF image but with the extension svg then you should have a new counter show up to experiment with. 2 counters try to load additional graphic images, pzvie.svg and geMTR81s.svg. However the counters display as empty or invisible with no error indication that I can find. What's interesting is that they work in Microsoft Edge, although the Microsoft PowerToys extension to display SVG files in the file explorer doesn't show the extra graphics, although the rest of the counter artwork renders properly. Anyway, let me know if you have any questions or suggestions.

GordonMolek commented 6 months ago

Well I thought I had a pretty good system crafted to read Klas' Chapter H tables and to massage the data into the SVG counters. It seemed to be working reasonably well for the German Vehicles and Ordnance but when I tried to expand the scope to include the Russian Vehicles the special cases kept piling up. So, I think I'm going to take a step back and rather than try to preserve the ability to incorporate updates from Klas' tables I'm just going to use his tables as a starting point and simplify the data to make it easier to process it into the counters. It'll mean a little more data cleanup initially but in the long term I don't think adding new vehicles/ordnance or fixing "bugs" in the existing data will be significantly harder than with my existing approach and the code will be cleaner and easier to maintain.

On Tue, Mar 5, 2024 at 6:53 AM Gordon Molek @.***> wrote:

I haven't been using an IDE (yet). I've been only working in Rust and Notepad++ and cygwin has been sufficient for my needs. I'm trying out Github desktop based on Zoltan's suggestion.

On Tue, Mar 5, 2024 at 6:50 AM Doug Rimmer @.***> wrote:

@GordonMolek https://github.com/GordonMolek you are free to proceed as you wish but I have never found a need to use github desktop. I am not aware of anyone who has. If you are already using a IDE, there is more than likely sufficient functionality to link to the github repo and push changes to a branch.

If you do use github desktop, it might be worth sharing your experience in a separate thread. Maybe it is a tool we should be using.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-1978708680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUUH5OCCAV2ELM2PTZ3YWW5QHAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJXHA3TAOBWHAYA . You are receiving this because you were mentioned.Message ID: @.***>

GordonMolek commented 5 months ago

Now that I've got the basic German/Russian vehicle and ordnance counters checked in, I'd like to circle back to a couple of issues that were discussed previously.

Fonts. If we go the route of embedding the needed glyphs from Helvetica-condensed (and the single asterisk glyph from Arial) would that be in a single file that could be referenced/used from all the individual SVG counter files? We could probably define the subset of needed glyphs but then we'd need to find the right tool to do the font manipulation/base64-encoding.

Graphical images. I still need help trying to debug why SVG counters that try to reference graphics in other files don't work. Clearly the Longest Day module does this successfully. Is there any way to enable Vassal tracing/logging so that I can see what it is trying to do when it attempts to display an SVG counter?

On Thu, Mar 7, 2024 at 3:41 PM Gordon Molek @.***> wrote:

Well I thought I had a pretty good system crafted to read Klas' Chapter H tables and to massage the data into the SVG counters. It seemed to be working reasonably well for the German Vehicles and Ordnance but when I tried to expand the scope to include the Russian Vehicles the special cases kept piling up. So, I think I'm going to take a step back and rather than try to preserve the ability to incorporate updates from Klas' tables I'm just going to use his tables as a starting point and simplify the data to make it easier to process it into the counters. It'll mean a little more data cleanup initially but in the long term I don't think adding new vehicles/ordnance or fixing "bugs" in the existing data will be significantly harder than with my existing approach and the code will be cleaner and easier to maintain.

On Tue, Mar 5, 2024 at 6:53 AM Gordon Molek @.***> wrote:

I haven't been using an IDE (yet). I've been only working in Rust and Notepad++ and cygwin has been sufficient for my needs. I'm trying out Github desktop based on Zoltan's suggestion.

On Tue, Mar 5, 2024 at 6:50 AM Doug Rimmer @.***> wrote:

@GordonMolek https://github.com/GordonMolek you are free to proceed as you wish but I have never found a need to use github desktop. I am not aware of anyone who has. If you are already using a IDE, there is more than likely sufficient functionality to link to the github repo and push changes to a branch.

If you do use github desktop, it might be worth sharing your experience in a separate thread. Maybe it is a tool we should be using.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-1978708680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUUH5OCCAV2ELM2PTZ3YWW5QHAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJXHA3TAOBWHAYA . You are receiving this because you were mentioned.Message ID: @.***>

GordonMolek commented 5 months ago

Update on the fonts. I've gotten at least partial base64-encoded woff2 Arial and Helvetica fonts that kind of work within a single SVG file but it doesn't seem to work if I move the defs containing the fonts into a separate file and try to "use" them.

On Wed, Mar 13, 2024 at 3:38 PM Gordon Molek @.***> wrote:

Now that I've got the basic German/Russian vehicle and ordnance counters checked in, I'd like to circle back to a couple of issues that were discussed previously.

Fonts. If we go the route of embedding the needed glyphs from Helvetica-condensed (and the single asterisk glyph from Arial) would that be in a single file that could be referenced/used from all the individual SVG counter files? We could probably define the subset of needed glyphs but then we'd need to find the right tool to do the font manipulation/base64-encoding.

Graphical images. I still need help trying to debug why SVG counters that try to reference graphics in other files don't work. Clearly the Longest Day module does this successfully. Is there any way to enable Vassal tracing/logging so that I can see what it is trying to do when it attempts to display an SVG counter?

On Thu, Mar 7, 2024 at 3:41 PM Gordon Molek @.***> wrote:

Well I thought I had a pretty good system crafted to read Klas' Chapter H tables and to massage the data into the SVG counters. It seemed to be working reasonably well for the German Vehicles and Ordnance but when I tried to expand the scope to include the Russian Vehicles the special cases kept piling up. So, I think I'm going to take a step back and rather than try to preserve the ability to incorporate updates from Klas' tables I'm just going to use his tables as a starting point and simplify the data to make it easier to process it into the counters. It'll mean a little more data cleanup initially but in the long term I don't think adding new vehicles/ordnance or fixing "bugs" in the existing data will be significantly harder than with my existing approach and the code will be cleaner and easier to maintain.

On Tue, Mar 5, 2024 at 6:53 AM Gordon Molek @.***> wrote:

I haven't been using an IDE (yet). I've been only working in Rust and Notepad++ and cygwin has been sufficient for my needs. I'm trying out Github desktop based on Zoltan's suggestion.

On Tue, Mar 5, 2024 at 6:50 AM Doug Rimmer @.***> wrote:

@GordonMolek https://github.com/GordonMolek you are free to proceed as you wish but I have never found a need to use github desktop. I am not aware of anyone who has. If you are already using a IDE, there is more than likely sufficient functionality to link to the github repo and push changes to a branch.

If you do use github desktop, it might be worth sharing your experience in a separate thread. Maybe it is a tool we should be using.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-1978708680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUUH5OCCAV2ELM2PTZ3YWW5QHAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJXHA3TAOBWHAYA . You are receiving this because you were mentioned.Message ID: @.***>

GordonMolek commented 5 months ago

Another question as I try to finalize the RUST code for generating vehicles. For the case of German vehicles (and maybe for other nationalities as well) there seem to be a number of png files that seem to duplicate gif files. Anyone know what the deal is? Should I be working towards replacing the gif files, the png files, or both?

On Wed, Mar 13, 2024 at 6:21 PM Gordon Molek @.***> wrote:

Update on the fonts. I've gotten at least partial base64-encoded woff2 Arial and Helvetica fonts that kind of work within a single SVG file but it doesn't seem to work if I move the defs containing the fonts into a separate file and try to "use" them.

On Wed, Mar 13, 2024 at 3:38 PM Gordon Molek @.***> wrote:

Now that I've got the basic German/Russian vehicle and ordnance counters checked in, I'd like to circle back to a couple of issues that were discussed previously.

Fonts. If we go the route of embedding the needed glyphs from Helvetica-condensed (and the single asterisk glyph from Arial) would that be in a single file that could be referenced/used from all the individual SVG counter files? We could probably define the subset of needed glyphs but then we'd need to find the right tool to do the font manipulation/base64-encoding.

Graphical images. I still need help trying to debug why SVG counters that try to reference graphics in other files don't work. Clearly the Longest Day module does this successfully. Is there any way to enable Vassal tracing/logging so that I can see what it is trying to do when it attempts to display an SVG counter?

On Thu, Mar 7, 2024 at 3:41 PM Gordon Molek @.***> wrote:

Well I thought I had a pretty good system crafted to read Klas' Chapter H tables and to massage the data into the SVG counters. It seemed to be working reasonably well for the German Vehicles and Ordnance but when I tried to expand the scope to include the Russian Vehicles the special cases kept piling up. So, I think I'm going to take a step back and rather than try to preserve the ability to incorporate updates from Klas' tables I'm just going to use his tables as a starting point and simplify the data to make it easier to process it into the counters. It'll mean a little more data cleanup initially but in the long term I don't think adding new vehicles/ordnance or fixing "bugs" in the existing data will be significantly harder than with my existing approach and the code will be cleaner and easier to maintain.

On Tue, Mar 5, 2024 at 6:53 AM Gordon Molek @.***> wrote:

I haven't been using an IDE (yet). I've been only working in Rust and Notepad++ and cygwin has been sufficient for my needs. I'm trying out Github desktop based on Zoltan's suggestion.

On Tue, Mar 5, 2024 at 6:50 AM Doug Rimmer @.***> wrote:

@GordonMolek https://github.com/GordonMolek you are free to proceed as you wish but I have never found a need to use github desktop. I am not aware of anyone who has. If you are already using a IDE, there is more than likely sufficient functionality to link to the github repo and push changes to a branch.

If you do use github desktop, it might be worth sharing your experience in a separate thread. Maybe it is a tool we should be using.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-1978708680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUUH5OCCAV2ELM2PTZ3YWW5QHAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOJXHA3TAOBWHAYA . You are receiving this because you were mentioned.Message ID: @.***>

derimmer commented 5 months ago

I believe initially VASL used only .gif files. The folks who do graphics work wanted to use .png files so we changed some code to allow that - both for boards and for counters IIRC. I suspect .png files were added to replace .gif files but the .gif files were never removed, probably just in case shit happened.

I recently stumbled across a VASSAL tool (in edit mode I think) to remove all unused image files. I did not push the button. I may go back and do so just to see what happens.

If I were you I would stay in shit-protection-mode and just add the svg files without removing anything. I will create an issue about Image Cleanup to remind ourselves to go back and strip out unused files when we think the time is right.

GordonMolek commented 5 months ago

Oh, I'm DEFINITELY not removing ANYTHING. None of the vehicle and gun counters can really be replaced until we have appropriate vehicle and gun graphics. I just start with the entries from Klas' online Chapter H listings. Then I was adding entries for counters in the folders that are above and beyond that.

BTW, apparently the British JUST HAD to be different. Instead of "gun" and "veh" they have "guns" and "vehicles" folders. Can you make them all consistent one way or the other? I don't want to have to add yet another special case to the counter generation code.

Thanks,

On Fri, Mar 15, 2024 at 12:27 PM Doug Rimmer @.***> wrote:

I believe initially VASL used only .gif files. The folks who do graphics work wanted to use .png files so we changed some code to allow that - both for boards and for counters IIRC. I suspect .png files were added to replace .gif files but the .gif files were never removed, probably just in case shit happened.

I recently stumbled across a VASSAL tool (in edit mode I think) to remove all unused image files. I did not push the button. I may go back and do so just to see what happens.

If I were you I would stay in shit-protection-mode and just add the svg files without removing anything. I will create an issue about Image Cleanup to remind ourselves to go back and strip out unused files when we think the time is right.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-2000121359, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUVG75DB5KEYPM45KHLYYMVPBAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBQGAYTEMJTGU4Q . You are receiving this because you were mentioned.Message ID: @.***>

zgrose commented 5 months ago

Just a question, did we get one counter looking correctly in VASL yet before we worry about more than one counter? It's hard for me to tell if this thread has transitioned to the build process or if we're still trying to get a single counter to look correct.

GordonMolek commented 5 months ago

I am working on three issues in parallel.

  1. Getting an SVG to successfully include an external image (for the base bevelled counter and the vehicle and gun graphics)?

  2. Embedding the fonts for the counter values.

  3. Processing the chapter H tables to generate the counters.

On Fri, Mar 15, 2024, 3:36 PM Zoltan Grose @.***> wrote:

Just a question, did we get one counter looking correctly in VASL yet before we worry about more than one counter? It's hard for me to tell if this thread has transitioned to the build process or if we're still trying to get a single counter to look correct.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-2000406867, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUWVB6QAJCSNSD43L3LYYNLVVAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBQGA2DANRYGY3Q . You are receiving this because you were mentioned.Message ID: @.***>

derimmer commented 5 months ago

We have 3 .svg images displaying correctly in the most recent dev build (not yet widely available). At least they were until I made an unrelated code change that is preventing any images from showing on the map, although they show in the counter palette. So I can't point to a build you can look at yet but once I undo today's mistake, we will. They are PF counters and so much simpler than vehicles or guns.

apbills commented 5 months ago

And for clarity, they are what I call ‘hybrid’ counters. They use the blank .gif counters for each nationality and then use .svg files as layers on top of those. This was so that the counter itself conforms to the current counter look until such time as we convert the ½” counters to svg (which looks like the plan was for maybe 2 years). This allows time with .svg images without causes a major look/feel issue for the players. I have roughly 70 such hybrid counters in an extension that I have been working on. It has been well worth my time and effort to learn a ton about the issues with the new image format.

And I think we have German, SS, Finnish, Hungarian, and Axis Minor (Romanian) PF counters (which end up being ~10 different .svg files). I suspect a fairly low use counter, but we start with something that is not going to break the masses.

From: Doug Rimmer @.> Sent: Friday, March 15, 2024 3:51 PM To: vasl-developers/vasl @.> Cc: apbills @.>; Mention @.> Subject: Re: [vasl-developers/vasl] Using SVG for VASL Discussion (#627)

We have 3 .svg images displaying correctly in the most recent dev build (not yet widely available). At least they were until I made an unrelated code change that is preventing any images from showing on the map, although they show in the counter palette. So I can't point to a build you can look at yet but once I undo today's mistake, we will. They are PF counters and so much simpler than vehicles or guns.

— Reply to this email directly, view it on GitHubhttps://github.com/vasl-developers/vasl/issues/627#issuecomment-2000422773, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3X3PPXHMXANLIMTW6EB4YDYYNNKJAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBQGA2DEMRXG4ZQ. You are receiving this because you were mentioned.Message ID: @.**@.>>

GordonMolek commented 5 months ago

Can you send me some of the image files so I can compare them to what I'm trying to do?

On Fri, Mar 15, 2024 at 4:00 PM apbills @.***> wrote:

And for clarity, they are what I call ‘hybrid’ counters. They use the blank .gif counters for each nationality and then use .svg files as layers on top of those. This was so that the counter itself conforms to the current counter look until such time as we convert the ½” counters to svg (which looks like the plan was for maybe 2 years). This allows time with .svg images without causes a major look/feel issue for the players. I have roughly 70 such hybrid counters in an extension that I have been working on. It has been well worth my time and effort to learn a ton about the issues with the new image format.

And I think we have German, SS, Finnish, Hungarian, and Axis Minor (Romanian) PF counters (which end up being ~10 different .svg files). I suspect a fairly low use counter, but we start with something that is not going to break the masses.

From: Doug Rimmer @.> Sent: Friday, March 15, 2024 3:51 PM To: vasl-developers/vasl @.> Cc: apbills @.>; Mention @.> Subject: Re: [vasl-developers/vasl] Using SVG for VASL Discussion (#627)

We have 3 .svg images displaying correctly in the most recent dev build (not yet widely available). At least they were until I made an unrelated code change that is preventing any images from showing on the map, although they show in the counter palette. So I can't point to a build you can look at yet but once I undo today's mistake, we will. They are PF counters and so much simpler than vehicles or guns.

— Reply to this email directly, view it on GitHub< https://github.com/vasl-developers/vasl/issues/627#issuecomment-2000422773>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/A3X3PPXHMXANLIMTW6EB4YDYYNNKJAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBQGA2DEMRXG4ZQ>.

You are receiving this because you were mentioned.Message ID: @.**@.>>

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-2000432563, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUS3MTHDRSMORNVLY7DYYNONBAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBQGA2DGMRVGYZQ . You are receiving this because you were mentioned.Message ID: @.***>

apbills commented 5 months ago

Gordon,

These are VERY simplistic and only cover some of the text and basic images of some SW, so probably not going to help you much. These are an example set of about 70 or so that I made. You can see I got a sort of template they I have then used to generate new files. I needed to use smaller text in order to put all the b#/X# info I wanted for the captured weapons.

Alan

From: GordonMolek @.> Sent: Friday, March 15, 2024 4:05 PM To: vasl-developers/vasl @.> Cc: apbills @.>; Mention @.> Subject: Re: [vasl-developers/vasl] Using SVG for VASL Discussion (#627)

Can you send me some of the image files so I can compare them to what I'm trying to do?

On Fri, Mar 15, 2024 at 4:00 PM apbills @.<mailto:@.>> wrote:

And for clarity, they are what I call ‘hybrid’ counters. They use the blank .gif counters for each nationality and then use .svg files as layers on top of those. This was so that the counter itself conforms to the current counter look until such time as we convert the ½” counters to svg (which looks like the plan was for maybe 2 years). This allows time with .svg images without causes a major look/feel issue for the players. I have roughly 70 such hybrid counters in an extension that I have been working on. It has been well worth my time and effort to learn a ton about the issues with the new image format.

And I think we have German, SS, Finnish, Hungarian, and Axis Minor (Romanian) PF counters (which end up being ~10 different .svg files). I suspect a fairly low use counter, but we start with something that is not going to break the masses.

From: Doug Rimmer @.<mailto:@.>> Sent: Friday, March 15, 2024 3:51 PM To: vasl-developers/vasl @.<mailto:@.>> Cc: apbills @.<mailto:@.>>; Mention @.<mailto:@.>> Subject: Re: [vasl-developers/vasl] Using SVG for VASL Discussion (#627)

We have 3 .svg images displaying correctly in the most recent dev build (not yet widely available). At least they were until I made an unrelated code change that is preventing any images from showing on the map, although they show in the counter palette. So I can't point to a build you can look at yet but once I undo today's mistake, we will. They are PF counters and so much simpler than vehicles or guns.

— Reply to this email directly, view it on GitHub< https://github.com/vasl-developers/vasl/issues/627#issuecomment-2000422773>, or unsubscribe< https://github.com/notifications/unsubscribe-auth/A3X3PPXHMXANLIMTW6EB4YDYYNNKJAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBQGA2DEMRXG4ZQ>.

You are receiving this because you were mentioned.Message ID: @.**@.mailto:***@***.******@***.***>>

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-2000432563, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUS3MTHDRSMORNVLY7DYYNONBAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBQGA2DGMRVGYZQ . You are receiving this because you were mentioned.Message ID: @.<mailto:@.>>

— Reply to this email directly, view it on GitHubhttps://github.com/vasl-developers/vasl/issues/627#issuecomment-2000438288, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3X3PPWFDIMSQJ3E4EAY3ZDYYNPBBAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBQGA2DGOBSHA4A. You are receiving this because you were mentioned.Message ID: @.**@.>>

BigAl737 commented 5 months ago

BTW, apparently the British JUST HAD to be different. Instead of "gun" and "veh" they have "guns" and "vehicles" folders. Can you make them all consistent one way or the other? I don't want to have to add yet another special case to the counter generation code.

That way madness lies :-)

Links to all images in changed folder names will be broken and must be repaired. A lot of one time work but once it's done, it may save time down the road.

GordonMolek commented 5 months ago

Initial attempt at a programmatic counter bezel. It may be too pronounced but it should be pretty easy to adjust the look of it and adapt it for the half-inch counters as well.

BezelTest

zgrose commented 5 months ago

Ooops, I hit Edit instead of replying to BigAl. I think I have the comment restored. What I was trying to say was: I think a find...replace all in the build.xml would probably fix up the paths pretty quick?

derimmer commented 5 months ago

Anyone who tries Replace All in the buildFile is a better man than me Gunga Din. Just sayin'.

zgrose commented 5 months ago

Just gave it a look in Notepad++. Swapping out br\/guns\/ or br\/vehicles\/ looks quite doable. Maybe when we get closer, I'll create a branch with that in place for you guys.

derimmer commented 5 months ago

@GordonMolek spurred on by Zoltan's comments, I will go where I fear to tread and do a Replace All. I would suggest that I make the Brits consistent with everyone else.

So, I will update the build file, change the folder names and build. The smoke should be visible from a distance! But might as well find out if it is doable. If I trash a dev module, I can just pull down a new one from github so the risk is only to my skills rep.

If I can do this successfully, we can talk about how to integrate it into your environment.

I have been lagging in following this thread as most of this is beyond my ken. Is there any other help we can give you at this point.?

BigAl737 commented 5 months ago

I really hope this works Doug. It didn’t for me when I tried it long ago but I’m sure it was operator error on my part. You and Gordon are much smarter than me.

GordonMolek commented 5 months ago

Current update status.

German and Russian vehicle and ordnance data processing complete, American and British in progress.

I've created placeholder graphics for the German and Russian vehicles and ordnance based on the existing GIF/PNG counters. They display in Microsoft Edge when I load the SVG counters but not in game. Still looking for help/advice on how to debug what's going wrong.

I've figured out how to embed the fonts into each individual SVG counter, but that seems to be very space-inefficient. When I try to put the embedded fonts into a single, separate SVG file and reference them from each counter file the fonts don't display correctly. I'm guessing it is a variation of the problem handling graphic images above.

I'm currently mirroring the existing counters for things like optional machine guns on vehicles, limbered guns, etc. I'm sure that ultimately there's probably a cool way to handle these variations within the SVG counters. Say, for instance, only having a single PzKpfw IVF2 counter and being able to set the optional AAMG in game. Or changing a gun from limbered to unlimbered. I just haven't had a change to noodle on it yet.

I think that pretty much covers everything.

On Tue, Mar 26, 2024 at 1:53 AM Allan Cannamore @.***> wrote:

I really hope this works Doug. It didn’t for me when I tried it long ago but I’m sure it was operator error on my part. You and Gordon are much smarter than me.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-2019518167, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUWF2KAKONLUSJDMG43Y2ELNXAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBRHE2TCOBRGY3Q . You are receiving this because you were mentioned.Message ID: @.***>

derimmer commented 5 months ago

British guns and vehicles looking very comfortable in their new gun and veh folders. This worked perfectly as far as I can see. image

@zgrose thanks for the push

@GordonMolek I can send you the revised mod or you can replicate the changes yourself. What is most useful/easiest for you?

derimmer commented 5 months ago

I just tested this to see the impact on saved games. If you open a game containing British guns or vehicles saved with 667 or earlier, none of the guns or vehicles appear and you get Bad Data messages in Chat. If you then use the Update Game function, it correctly updates the gun and veh counters and they appear. So, this should be a manageable transition. Now, this was based on one test of one file but I see no reason to think it won't replicate across games.

Whether this will hold true for SVG graphics is another question but the directory change does not seem to be a dealbreaker.

GordonMolek commented 5 months ago

Doug, If it is just a matter of doing the replacement I can do that here.

Gordon

On Tue, Mar 26, 2024, 8:11 AM Doug Rimmer @.***> wrote:

I just tested this to see the impact on saved games. If you open a game containing British guns or vehicles saved with 667 or earlier, none of the guns or vehicles appear and you get Bad Data messages in Chat. If you then use the Update Game function, it correctly updates the gun and veh counters and they appear. So, this should be a manageable transition. Now, this was based on one test of one file but I see no reason to think it won't replicate across games.

Whether this will hold true for SVG graphics is another question but the directory change does not seem to be a dealbreaker.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-2020393749, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUXADT3652MEVZ36S5DY2FXW5AVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBSGAZTSMZXGQ4Q . You are receiving this because you were mentioned.Message ID: @.***>

derimmer commented 5 months ago

I did it in my dev environment because I couldn't change the directory names within the .vmod/.zip file. Probably could if I had used a better file compression tool such as 7zip. Have a go and let me know if you need help.

zgrose commented 5 months ago

I did it in my dev environment because I couldn't change the directory names within the .vmod/.zip file. Probably could if I had used a better file compression tool such as 7zip. Have a go and let me know if you need help.

Just unzip the whole thing, rename the folders and re-zip the folders...?

derimmer commented 5 months ago

Oh, so you want to do it the easy way. . . . LOL.

GordonMolek commented 5 months ago

I finally cracked the code on referencing fonts from within the counter SVG files. Instead of a counter being 63 KBytes it is now 6 KBytes. The question before the jury is where would we like the actual font files to reside? A separate "fonts" directory at the same level as "images"? A "fonts" sub-folder of "images"? A "fonts" sub-folder of a "svg" sub-folder of "images"? I'm afraid it's "turtles all the way down."

On Tue, Mar 26, 2024 at 12:12 PM Doug Rimmer @.***> wrote:

Oh, so you want to do it the easy way. . . . LOL.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-2021015498, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUXG2FLZWPOK6OZTM5TY2GT5JAVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBSGEYDCNJUHE4A . You are receiving this because you were mentioned.Message ID: @.***>

derimmer commented 5 months ago

M'lord, may I suggest that since fonts are not images that we put them in a fonts directory at the same level as images. Seems neatest to me.

GordonMolek commented 5 months ago

But isn't each glyph of a font a unique image?!? Just kidding. I was leaning towards adding a fonts directory.

On Wed, Mar 27, 2024 at 8:44 PM Doug Rimmer @.***> wrote:

M'lord, may I suggest that since fonts are not images that we put them in a fonts directory at the same level as images. Seems neatest to me.

— Reply to this email directly, view it on GitHub https://github.com/vasl-developers/vasl/issues/627#issuecomment-2024249568, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYLTFUSDYXV7D53H5LTWWLDY2NYV7AVCNFSM4LRCVSM2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBSGQZDIOJVGY4A . You are receiving this because you were mentioned.Message ID: @.***>

GordonMolek commented 5 months ago

I tested the new linked/embedded fonts in game and as per the attached image, while the font glyphs are correct, the rendering/positioning differs drastically between Vassal/VASL and Microsoft Edge. I am also still having the problem that if I try to link to the vehicle/gun graphics within the counter's SVG file it doesn't render at all in-game. "TestCounters" shows the counter layout for a Pz VG test counter (without and with vehicle graphic which displays just fine in Microsoft Edge). "InGame" shows how drastically different the rendering/positioning of the various information elements are being displayed in game when compared to the "TestCounters" images which is what I've been coding to.

"InGame" InGame

"TestCounters" TestCounters

GordonMolek commented 4 months ago

I have finished the first pass through all the ordnance and vehicle counters. I am looking for volunteer(s) to compare/review the generated counter data against the chapter H notes/physical counters to ensure that I haven't missed anything or gotten anything wrong (there were a LOT of special cases that had to be handled by the code). To ease the review, I've temporarily added the chapter H note number to each generated counter. I can provide a zip archive of all the generated counters and the volunteer(s) can review specific nationalities and report any bugs back to me. The easiest way to review them is to just view the SVG files within the browser of your choice. Let me know if anyone can help, otherwise I'll ask on Gamesquad. TIA