C7-Game / Prototype

An early-stage, open-source 4X strategy game
https://c7-game.github.io/
MIT License
33 stars 9 forks source link

Truncate Movement Point Display #350

Closed QuintillusCFC closed 10 months ago

QuintillusCFC commented 1 year ago

Right now a unit that has moved on a road displays its movement like this:

image

I actually kind of like that it shows the fractional part, versus in Civ3 where it would show 1/1 even though it had already used 1/3 of its movement points. But it's a little silly that it shows that many digits.

I propose we default to two digits, truncated. So with default road speeds, it would be 1/1, 0.66/1, 0.33/1, and 0. With 4-movement roads, it would be 1, 0.75, 0.5, 0.25. It reminds the player of how much movement they have left if they jump back and forth between units a bit, but it's as overkill as 0.6666666.

benskywalker commented 11 months ago

I'll take this one. I'm just working on finding out which branch I need to base it off of, and then I'll fork this repo and have a PR. I've already got the changes working locally. For consideration: would it be better to have (2/3)/1 instead of 0.67/1 ?

WildWeazel commented 11 months ago

I was just thinking fractions would be great if you can get it to work with any numbers. There's probably a function somewhere in .NET to produce that.

benskywalker commented 11 months ago

I was just thinking fractions would be great if you can get it to work with any numbers. There's probably a function somewhere in .NET to produce that.

Hmm, ok so I've given this some more thought. Irregular fractions might pose an issue. For example, (15/4)/4 is probably less clear than 3.75/4

We could fix that by making it a mixed number like (3+3/4)/4 or (3 3/4)/4 That would induce some ui clutter though, and I'm not sure if this is worth it. The fractions would probably be pretty useful if the movements costs on roads / railroads are more irregular (eg: roads cost 1/6 and railroads cost 1/12). In that case it would pay dividends, and I'm happy to go forward with that route if that's what we prefer

QuintillusCFC commented 11 months ago

The other UI consideration is that some units will have defensive bombard, e.g. an archer would display like:

2.1(1) 0.5/1

If Civ3 conventions were followed and it had traveled one tile on a road that cost half a movement point.

So if we had fractions, it would be:

2.1(1) (1/2)/1

Or for a catapult-type unit:

0.0(4) (3/4)/1 or 0.0(4) 0.75/1

If roads cost 1/4 of a movement point.

With cannons/catapults/ships that can bombard, being able to see their bombard power is somewhat useful (I'm not sure it provides as much value for defensive-bombard-only units; I suppose it's a reminder that they provide some bonus in a defensive stack).

That, along with the possibly-large denominators, is why I'm less convinced fractional display makes sense as a default (I also agree with benskywalker about (15/4)/4 not aiding clarity). If a mod sets the roads to cost 1/3, and railroads to cost 1/20, and a unit has moved over one road and three railroads, it has used 29/60ths of a movement point, so the display if its total movement is two would be something like:

4.4 (1 29/60)/2 or 4.4 (89/60)/2

Which seems a bit silly to me compared to:

4.4 1.48/2

Though fractions as a configurable option could be nice, especially in scenarios where the fractions will divide nicely into sixths or ninths or something of that sort.

I'm also open to re-ordering this display in general; the Civ3 style isn't the most intuitive if you're new to the game. What do those numbers mean? They aren't labeled.

But in short, I would encourage opening a PR and we can improve the UI incrementally as we figure out better ways of presenting it.

benskywalker commented 11 months ago

I've got a working mixed number version now. I took the algorithm from https://stackoverflow.com/a/32903747. I think I like this look, but is this good from other's perspective? It's a bit of a deviation from the civ 3 style. @pcen @WildWeazel If so I'll go ahead and fork the repo and open a pull request image

QuintillusCFC commented 11 months ago

First thought is it looks better than the old 0.666666/1 version. Still ruminating on whether it's going to be clear to a new player with the multiple slashes (but that's also a concern about the whole inherited format for that line).

benskywalker commented 11 months ago

The other UI consideration is that some units will have defensive bombard, e.g. an archer would display like:

2.1(1) 0.5/1

If Civ3 conventions were followed and it had traveled one tile on a road that cost half a movement point.

So if we had fractions, it would be:

2.1(1) (1/2)/1

Or for a catapult-type unit:

0.0(4) (3/4)/1 or 0.0(4) 0.75/1

If roads cost 1/4 of a movement point.

With cannons/catapults/ships that can bombard, being able to see their bombard power is somewhat useful (I'm not sure it provides as much value for defensive-bombard-only units; I suppose it's a reminder that they provide some bonus in a defensive stack).

That, along with the possibly-large denominators, is why I'm less convinced fractional display makes sense as a default (I also agree with benskywalker about (15/4)/4 not aiding clarity). If a mod sets the roads to cost 1/3, and railroads to cost 1/20, and a unit has moved over one road and three railroads, it has used 29/60ths of a movement point, so the display if its total movement is two would be something like:

4.4 (1 29/60)/2 or 4.4 (89/60)/2

Which seems a bit silly to me compared to:

4.4 1.48/2

Though fractions as a configurable option could be nice, especially in scenarios where the fractions will divide nicely into sixths or ninths or something of that sort.

I'm also open to re-ordering this display in general; the Civ3 style isn't the most intuitive if you're new to the game. What do those numbers mean? They aren't labeled.

But in short, I would encourage opening a PR and we can improve the UI incrementally as we figure out better ways of presenting it.

Those are good points. I really like the point about labelling and configuring it as fraction / mixed number / decimal. That would be great. Alright, since I don't have permission yet do I need to fork the repo, make changes, and then open a PR? I haven't done that before but I'll give it a try

pcen commented 11 months ago

can we close this? @benskywalker

benskywalker commented 11 months ago

can we close this? @benskywalker

Yes! Woohoo!

QuintillusCFC commented 10 months ago

Congratulations on your first merged issue! I've moved it to the Carthage milestone and "Done" status.

WildWeazel commented 10 months ago

Congrats and thank you @benskywalker