Jump to content

Selection shapes


Nescio
 Share

Recommended Posts

On 8/24/2019 at 1:52 PM, Nescio said:

1:2 shapes, for cavalry, elephants, and traders:

  Reveal hidden contents

128x256.png.c8f46fb518667f6575c38cd528aa075e.png128x256.png.eba5658bf736789324ddf5cb92a09c90.png128x256.png.1ac6266018f2f613b0185eccff679584.png128x256.png.a3314ab52ef5eec664393c29ac278777.png

1:3 shapes, for completeness:

  Reveal hidden contents

128x384.png.0e3d0ad90e6262592aaae5601f627dae.png128x384.png.c94ba454c949f3f49ca22ab430575399.png128x384.png.57b49d25087f6ad91aa28856cdfdf017.png128x384.png.ed8638aa2b896328a30ae10fecbd3a76.png

1:4 shapes, for warships:

  Reveal hidden contents

128x512.png.fd3923c180d93d2bd35cb1657a2ff1e4.png128x512.png.09f99753d7aa507e98188a08511e7feb.png128x512.png.a5bfa58351644318089edb309bb489fb.png128x512.png.c37f0c01fcc8d5b541a5258758c22906.png

Some polygons I already added earlier:

  Reveal hidden contents

128x128.png.34bfe61cd7b55c1213a9b4dcc39523e8.png128x128.png.930d22027c4a8f9fbd904c0caf044593.png128x128.png.7b2279fefdaa3f4264436fc2e62d2d91.png128x128.png.88d7d4ab1921ca21034a12dbc34aebcf.png

Some polygrams in circles, perhaps useful for a magic mod:

  Reveal hidden contents

@Alexandermb, @Stan`, @wowgetoffyourcellphone, are these selection overlays something you'd like to have available in the svn version? 256x256 circle (left) vs 128x512 ellipse (right), for comparison:

Spoiler

comparison.thumb.png.4f98544b419f4832b0b16a44ff82b53b.png

As you can see the current marker (left) is thin at the sides and thick at the front and end, whereas the new one (right) has an equal line thickness everywhere.

 

  • Like 1
Link to comment
Share on other sites

14 minutes ago, Stan` said:

@Nescio yep sounds good to me too :) We should use most of them, those we don't won't get in for now :)

So which ones do you want specifically? I could create a patch on phabricator later or upload a zip here, whichever is easier for you.

The source files are at https://github.com/0abc/0abc-a23/tree/master/art/textures/selection/svg_source

 

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
On 12/21/2019 at 7:45 PM, Nescio said:

Could you specify the parameter you used? And did you use some script or graphic programming language to make them? I would be interested by that, especially for the "non classic" shapes (not the circles and squares).

Edited by fatherbushido
Link to comment
Share on other sites

3 hours ago, fatherbushido said:

Could you specify the parameter you used? And did you use some script or graphic programming language to make them? I would be interested by that, especially for the "non classic" shapes (not the circles and squares).

No, graphical software is too difficult for me – I'm very much a text-based person – just open those files in a text editor. svg is basically xml, so it should be fairly self-explanatory. If you have further questions, feel free to ask.

Link to comment
Share on other sites

20 minutes ago, Nescio said:

No, graphical software is too difficult for me – I'm very much a text-based person – just open those files in a text editor. svg is basically xml, so it should be fairly self-explanatory. If you have further questions, feel free to ask.

Oh I mean graphic programming language like TikZ, asymptote or things like that.

But then I just noticed that svg is actually close to what I need.

EDIT: yes that's what I needed

Edited by fatherbushido
Link to comment
Share on other sites

18 hours ago, fatherbushido said:

Could you specify the parameter you used?

Could you specify the outer stroke and inner stroke policy you used, I tried to figure that out from the svg files but I am not sure I deduced the right thing.

(As the old ones were picked among the script generated ones many years ago, I could have a consistent way of doing that)

Edited by fatherbushido
too much "ed"
Link to comment
Share on other sites

9 hours ago, fatherbushido said:

Could you specify the outer stroke and inner stroke policy you used, I tried to figure that out from the svg files but I am not sure I deduced the right thing.

The <polygon> points lie on a circle with radius 1000 (or actually, they fit in a 2000×2000 square). For the inner line (the one that will show up in player colour) I used a stroke-width of 100; to make it look good on all terrains, it needs to be surrounded by white; for this I used a stroke-width of 150; this results in a 1:4:1 white:colour:white line.

<g transform="translate(128 128) scale(0.1 0.1)">

The translate because svg positions are by default relative to the top left corner, and I find it easier to visualize them calculating from the centre (all selection textures are symmetrical). The scale is necessary to fit everything within 256×256.

I suppose I could have used a circle with radius 1, stroke-wirdth of 0.1, and scale(100, 100) instead. I didn't, because I slightly prefer integers over decimals, and because in my experience things look better scaled down than scaled up.

 

Now, the above applies to generating the 256×256 png; for the 128×128 png output, double the line thicknesses. For the *_mask.png, comment the first <g> and uncomment the last <g>.

[EDIT] The <rect> (rectangle, rounded rectangle, cartouche) and <ellipse> shapes are not scaled and use a stroke-width of 10, which is the same as 100 scaled by 0.1, or 200 by 0.05.

Edited by Nescio
<rect>
  • Thanks 1
Link to comment
Share on other sites

Thanks for the detailed explanations!

I don't know if there was a specific 0 A. D. Empires Ascendant topic about those textures, in that case, my post should be moved in that place.

 

Quote

1:4:1 white:colour:white line.

If I remember correctly it was planed to use 1:2:1, which has probably changed meanwhile. Anyway what matters is to have a consistent numbers with pleasant visual, that's why I refer to you (and others).

Just to understand, I looked at WFG svn (I looked only at the easy case, circles).

r11623 introduced the scripted generated textures 32x32 64x64 128x128 (Ideally we should have one quad overlay texture by footprint shape and size)

r11628 replaced the 128x128 and introduced the 256x256

r13759 introduced the 512x512

r23636 replaced the 128x128 and 256x256

I will post the images in the next post as the forum is (or I am) bugged.

Edited by fatherbushido
  • Like 1
Link to comment
Share on other sites

10 hours ago, fatherbushido said:

Just to understand, I looked at WFG svn (I looked only at the easy case, circles).

r11623 introduced the scripted generated textures 32x32 64x64 128x128 (Ideally we should have one quad overlay texture by footprint shape and size)

r11628 replaced the 128x128 and introduced the 256x256

r13759 introduced the 512x512

r23636 replaced the 128x128 and 256x256

rP23636 (redid existing shapes to ensure uniform line thickness) and rP23638 (new 128x256 and 128x512 shapes for units with oblong footprints) are split off from D2503, you might want to have a look at that.

Link to comment
Share on other sites

Thanks for the refs! So not all D2503 had been commited in WFG svn?

Back to the circle, the current WFG svn state is messy, isn't it? Also I still don't understand what is the desired scaling for inner stroke and outer stroke (just for the circle).

Also do you know what is the game unit proper equivalent in pixel?

I asked all that because I just printed a table with a lot of numbers and I would like how to include your new textures in a well thought way.

Link to comment
Share on other sites

56 minutes ago, fatherbushido said:

Thanks for the refs! So not all D2503 had been commited in WFG svn?

No, not yet; it probably will when @Stan` has sufficient time to finish the review. 23636 and 23638 were split off in order to preserve the file history and because phabricator sometimes has trouble with png files.

53 minutes ago, fatherbushido said:

Back to the circle, the current WFG svn state is messy, isn't it?

Yes, it is. Currently the 32x32 and 64x64 are unused, the 128x128 is used for infantry etc., the 256x256 for units with larger footprints, and the 512x512 for the whale. The problem is that most units have oblong footprints. It's especially notable for animals, where about half use the 128x128 circle and half 256x256.

With D2503 the situation will be much simpler:

  • selection textures grouped as {size}/{shape} instead of {shape}/{size}, because many more shapes are conceivable, but more sizes are unnecessary
  • 256x256 used by units with a large circular or approximately 1:1 footprint (e.g. war elephant, siege tower)
  • 128x512 used by units with an approximately 1:4 footprint (e.g. warships, whales)
  • 128x256 used by units with an approximately 1:2 footprint (e.g. animals, cavalry, traders)
  • 128x128 used by units with a small circular footprint (e.g. infantry, healers)
1 hour ago, fatherbushido said:

Also do you know what is the game unit proper equivalent in pixel?

No, I don't, nor do I think it's worth knowing. What matters is that the selection texture has a sufficiently high resolution so one wouldn't be able to identify individual pixels when maximally zooming in. I believe 128 is sufficiently wide for all units.

The line thickness of the 128x128 is relatively twice as wide as that of the 256x256, to make the selection marker for units with small footprints stand out more. The 128x256 and 128x512 shapes are added to ensure footprints are no longer much narrower at the left and right than at the front and back:

On 12/20/2019 at 10:17 PM, Nescio said:
256x256 circle (left) vs 128x512 ellipse (right), for comparison:
  Reveal hidden contents

comparison.thumb.png.4f98544b419f4832b0b16a44ff82b53b.png

As you can see the current marker (left) is thin at the sides and thick at the front and end, whereas the new one (right) has an equal line thickness everywhere.

Smaller and larger sizes (e.g. 64x64, 512x512) don't really serve a purpose. No units have oblong footprints beyond 1:4, so adding even narrower textures (e.g. 128x1024) is unnecessary as well. Image dimensions have to be powers of 2, that's why no sizes in between (e.g. 128x384) are added.

  • Like 1
Link to comment
Share on other sites

I didn't take the time to respond because I am a bit busy, but I still would like your input (later).

Meanwhile, I don't know if you had the numbers for the quad textures, here are some (animals are missing).

Column1: radius, Column2: width, Column3: depth, Column4: texture

1.5 NaN NaN arrow/128x128.png
2.5 NaN NaN arrow/256x256.png
3.0 NaN NaN arrow/256x256.png
3.5 NaN NaN arrow/256x256.png
NaN 10.0 5.50 arrow/256x256.png
NaN 10.0 10.00 arrow/256x256.png
NaN 15.0 7.50 arrow/256x256.png
NaN 16.0 8.00 arrow/256x256.png
1.5 NaN NaN circle/128x128.png
2.0 NaN NaN circle/128x128.png
4.0 NaN NaN circle/128x128.png
NaN 6.0 4.00 circle/128x128.png
NaN 8.0 4.00 circle/128x128.png
NaN 12.0 5.00 circle/128x128.png
NaN 12.0 8.00 circle/128x128.png
NaN 9.0 6.75 circle/128x128.png
NaN 15.0 7.00 circle/128x128.png
NaN 10.0 6.75 circle/128x128.png
NaN 20.0 6.00 circle/128x128.png
3.5 NaN NaN circle/256x256.png
4.0 NaN NaN circle/256x256.png
NaN 48.0 12.00 circle/256x256.png
NaN 12.0 5.00 circle/256x256.png
NaN 40.0 10.00 circle/256x256.png
NaN 24.0 8.00 circle/256x256.png
NaN 10.0 4.00 circle/256x256.png
NaN 33.0 8.00 circle/256x256.png
NaN 37.0 7.00 circle/256x256.png
NaN 42.0 9.00 circle/256x256.png
NaN 31.0 8.00 circle/256x256.png
NaN 17.0 7.00 circle/256x256.png
NaN 5.0 5.00 circle/256x256.png
NaN 24.0 12.00 circle/256x256.png
NaN 15.0 15.00 circle/256x256.png
NaN 43.0 10.00 circle/256x256.png
NaN 28.0 12.00 circle/256x256.png
NaN 45.0 17.00 circle/256x256.png
NaN 36.0 12.00 circle/256x256.png
NaN 28.0 8.00 circle/256x256.png
NaN 25.0 6.00 circle/256x256.png
1.5 NaN NaN plus/128x128.png
NaN 10.0 10.00 square/256x256.png
NaN 15.0 6.00 square/256x256.png
NaN 15.0 9.00 square/256x256.png
1.5 NaN NaN star/256x256.png
2.5 NaN NaN star/256x256.png
3.0 NaN NaN star/256x256.png
NaN 9.0 4.50 star/256x256.png
NaN 12.0 6.00 star/256x256.png

 

 

 

 

 

Link to comment
Share on other sites

from left to right

footprint: 1.5, texture: arrow_128x128

footprint: 1.5, texture: arrow_256x256

footprint: 2.5, texture: arrow_128x128

footprint: 2.5, texture: arrow_256x256

 

image.thumb.png.6d5e19d38c7371ea69d4ab969e56f9f3.png

from left to right

footprint: 2.5, texture: arrow_256x256

footprint: 1.5, texture: arrow_128x128

image.thumb.png.3e87e93c947a283e23522b0c36639d75.png

 

 

Edited by fatherbushido
strangely it's hard to delete the last image
Link to comment
Share on other sites

@fatherbushido, to clarify, the purpose of rP23636 is to ensure uniform line thickness given the same size. So for a unit with e.g. a footprint of r=1.5 (e.g. infantry),  it doesn't matter whether they use the 128x128 arrow, circle, cross, square, star, etc., all (should) now have then same line thickness.

And as stated before, the 128x128 shapes have relatively double the line thickness of the 256x256 shapes, so units with small footprints stand out more.

The champion cavalry templates are odd in that they have r=2.5 circular footprints, whereas citizen cavalry have 4×6 rectangular footprints. (I think 3×6 would be better, see D2496, and they should use the 128x256 shape, see D2503.)

[EDIT]: infantry using 128x128 and cavalry using 128x256 footprint:

Spoiler

footprints.png.4f893454e1ec9b5a0230233de411889c.png

 

Edited by Nescio
image
Link to comment
Share on other sites

Quote

uniform line thickness given the same size

Yes I understand that, you mean using proper texture to avoid stretching (for rectangular footprints). (That's it?)

And indeed, I (we) mix in the discussion different meaning for uniform.

The first (circular and rectangular) footprints were script-generated. The goal was to have a (close) shape to avoid thickness issue when resizing. Also at that time, I guess rectangular overlay were for rectangular footprints and circle overlay were for circle footprints. (So there was not yet that other issue you adressed). A restricted set of size could also do the job (one can consider the weight of loaded textures). I would like to fit your new textures in that schema.

Also as we both agree, the current footprint are still to be checked and fixed (see the numbers), in shape or in dimensions. There are more width depth ratio than one can expect! In my opinion, that's the first step.

Then, and you have a good input about that, the what texture to which shape and which unit has to be done. I almost wonder if ellipsis are actually needed (moving to the rounded square or the stadium/capsule/cartouche is perhaps better? or something even fancier?) for the rectangular shape (it's far better than stretched circle but still not optimal?), but I don't have the eye fitted for that. That's imo the second step.

Then I had a third step but it's too shiny outside.

 

Edited by fatherbushido
  • Like 1
Link to comment
Share on other sites

On 5/18/2020 at 2:20 PM, fatherbushido said:

Yes I understand that, you mean using proper texture to avoid stretching (for rectangular footprints). (That's it?)

 Yes, that's why I wrote the 128x256 and 128x512 selection textures: stretching 128x128 or 256x256 to an oblong (e.g. 1:2, 1:4) shape looks quite bad.

On 5/11/2020 at 9:23 PM, Nescio said:

for the 128×128 png output, double the line thicknesses.

On 5/14/2020 at 10:58 AM, fatherbushido said:

r23636 replaced the 128x128 and 256x256

On 5/18/2020 at 12:51 PM, Nescio said:

@fatherbushido, to clarify, the purpose of rP23636 is to ensure uniform line thickness given the same size. So for a unit with e.g. a footprint of r=1.5 (e.g. infantry),  it doesn't matter whether they use the 128x128 arrow, circle, cross, square, star, etc., all (should) now have then same line thickness.

And as stated before, the 128x128 shapes have relatively double the line thickness of the 256x256 shapes, so units with small footprints stand out more.

As a consquence all png output files have the same absolute line thickness. You can open any of the current selection textures, zoom in, and observe the black line is 10 pixels wide, regardless of shape or size. This was not the case prior to rP23636.

In game this means the following are equivalent:

selection | footprint | example
texture   | size      |

 128x128  | r = 1.5   | infantry
 128x256  | 3 × 6     | D2496 citizen cavalry
 128x512  | 3 × 12    | D2721 crocodile
 256x256  | 6 × 6     | 

However, I don't think it's important that the line thickness is constant for units with different footprints. What matters to me is that the aspect ratio is about right, and that the line thickness is uniform with units with the same footprint; e.g. healers (plus), citizen infantry (circle), champion infantry (arrow), and hero infantry (star) all have a r=1.5 footprint.

On 5/18/2020 at 2:20 PM, fatherbushido said:

Also as we both agree, the current footprint are still to be checked and fixed (see the numbers), in shape or in dimensions. There are more width depth ratio than one can expect! In my opinion, that's the first step.

I gather you're advocating constant line thicknesses for different footprints? That would be only doable if there were separate selection textures for each footprint size. Given that all animals have different footprints, as do ship, siege, and trader actors, I don't think that's a good idea.

As for different width-to-depth ratios, the png dimensions have to be powers of 2, otherwise they cause errors. This means that the 128x256 textures are to be used by units with footprints between 2:3 and 1:3 and the 128x512 tectures between 1:3 and 1:6. I believe none of the units in game has a footprint narrower than 1:6 or wider than 1:1, but if those would be added at some point, it's quite easy to tweak the svg files and generate appropiate selection textures for those.

On 5/18/2020 at 2:20 PM, fatherbushido said:

Then, and you have a good input about that, the what texture to which shape and which unit has to be done. I almost wonder if ellipsis are actually needed (moving to the rounded square or the stadium/capsule/cartouche is perhaps better? or something even fancier?) for the rectangular shape (it's far better than stretched circle but still not optimal?), but I don't have the eye fitted for that. That's imo the second step.

That's why I wrote four different oblong shapes, allowing people to choose case by case which shape looks best:

On 8/24/2019 at 1:52 PM, Nescio said:
  Hide contents

128x256.png.c8f46fb518667f6575c38cd528aa075e.png128x256.png.eba5658bf736789324ddf5cb92a09c90.png128x256.png.1ac6266018f2f613b0185eccff679584.png128x256.png.a3314ab52ef5eec664393c29ac278777.png

 

(From left to right: rectangle, rounded_rectangle, cartouche, ellipse.)

On 5/18/2020 at 2:20 PM, fatherbushido said:

Then I had a third step but it's too shiny outside.

Getting a bit of sunshine and enjoying the nice weather is certainly important. :)

Link to comment
Share on other sites

On 5/21/2020 at 11:25 AM, Nescio said:

 Yes, that's why I wrote the 128x256 and 128x512 selection textures: stretching 128x128 or 256x256 to an oblong (e.g. 1:2, 1:4) shape looks quite bad.

As a consquence all png output files have the same absolute line thickness. You can open any of the current selection textures, zoom in, and observe the black line is 10 pixels wide, regardless of shape or size. This was not the case prior to rP23636.

In game this means the following are equivalent:


selection | footprint | example
texture   | size      |

 128x128  | r = 1.5   | infantry
 128x256  | 3 × 6     | D2496 citizen cavalry
 128x512  | 3 × 12    | D2721 crocodile
 256x256  | 6 × 6     | 

I understood, we agree about that.

On 5/21/2020 at 11:25 AM, Nescio said:

However, I don't think it's important that the line thickness is constant for units with different footprints.

What matters to me is that the aspect ratio is about right, and that the line thickness is uniform with units with the same footprint; e.g. healers (plus), citizen infantry (circle), champion infantry (arrow), and hero infantry (star) all have a r=1.5 footprint.

 

On 5/21/2020 at 11:25 AM, Nescio said:

I gather you're advocating constant line thicknesses for different footprints? That would be only doable if there were separate selection textures for each footprint size. Given that all animals have different footprints, as do ship, siege, and trader actors, I don't think that's a good idea.

It's not my subjective point of view, it's how it was planed and done: a rectangle texture and a circular texture were generated for each rectangle footprint width and depth and each circle footprint radius (rounded to the closest power of 2).

Also my personal taste is more for fancier texture but plain ones work very badly with the quad thing.

On 5/21/2020 at 11:25 AM, Nescio said:

As for different width-to-depth ratios, the png dimensions have to be powers of 2, otherwise they cause errors. This means that the 128x256 textures are to be used by units with footprints between 2:3 and 1:3 and the 128x512 tectures between 1:3 and 1:6. I believe none of the units in game has a footprint narrower than 1:6 or wider than 1:1, but if those would be added at some point, it's quite easy to tweak the svg files and generate appropiate selection textures for those.

That's also why I asked above about the pixel - size equivalence.

On 5/21/2020 at 11:25 AM, Nescio said:

That's why I wrote four different oblong shapes, allowing people to choose case by case which shape looks best:

(From left to right: rectangle, rounded_rectangle, cartouche, ellipse.)

Nice I would appreciate you personal taste about that (by entity type and footprint type) to have a proper consistent set.

On 5/21/2020 at 11:25 AM, Nescio said:

Getting a bit of sunshine and enjoying the nice weather is certainly important. :)

;-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...