freeciv21 icon indicating copy to clipboard operation
freeciv21 copied to clipboard

City ID in middle click

Open jwrober opened this issue 11 months ago • 10 comments

Is your feature request related to a problem? Please describe. When evaluating what enemy cities to capture, it would be good to know the ID of the city to gain a sense of the age of the city. Older cities, when captured, give the most territory to the victor.

Describe the solution you'd like Add the ID of the city to the middle click pop up menu.

Describe alternatives you've considered None

Additional context None

jwrober avatar Mar 06 '24 23:03 jwrober

Would it be possible to show the founding date instead? Using in-game time. That would be a neat addition, perhaps nicer than IDs.

hugomflavio avatar Mar 23 '24 01:03 hugomflavio

Would it be possible to show the founding date instead? Using in-game time. That would be a neat addition, perhaps nicer than IDs.

I don't think we have this information. At least I couldn't find it in the city struct

lmoureaux avatar Mar 23 '24 22:03 lmoureaux

What about the turn when the city was built? If that is stored, perhaps it could be calculated from there.

hugomflavio avatar Mar 23 '24 22:03 hugomflavio

This is what we have: https://github.com/longturn/freeciv21/blob/ad20326066bb6c1ffef303b475620508b1a88c0a/common/city.h#L283-L454

lmoureaux avatar Mar 23 '24 22:03 lmoureaux

Turn founded: https://github.com/longturn/freeciv21/blob/ad20326066bb6c1ffef303b475620508b1a88c0a/common/city.h#L349

hugomflavio avatar Mar 23 '24 22:03 hugomflavio

I must be blind :D

lmoureaux avatar Mar 23 '24 22:03 lmoureaux

can we back-calculate the year from the turn to make it look fancier?

hugomflavio avatar Mar 24 '24 00:03 hugomflavio

mmmh, I'm not entirely sure we can. Will need to check

lmoureaux avatar Mar 24 '24 01:03 lmoureaux

The turn works well enough for now. I'll try to figure this out once we're done with #2232

hugomflavio avatar Mar 24 '24 02:03 hugomflavio

@blabber posted in another issue:

I have a commit (https://github.com/longturn/freeciv21/commit/415d813cf5f4406306064063c9dea9afc5071a1f) in my local, that displays the turn_founded for a city in the popup info. Testing shows, that you can rely on turn_founded only for your own cities.

For foreign cities, after reloading a saved game, turn_founded seems to contain the turn number when the game was reloaded. Even before reloading I had the impression, that turn_founded displayed the turn number when I discovered the city rather than when it was founded by the enemy, but I didn't check this any further.

lmoureaux avatar Jul 14 '24 00:07 lmoureaux