Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of focus changes #83

Open
paulvi opened this issue Jan 27, 2021 · 3 comments
Open

Order of focus changes #83

paulvi opened this issue Jan 27, 2021 · 3 comments

Comments

@paulvi
Copy link

paulvi commented Jan 27, 2021

Freecol is turn based game. And in every turn one should move units (that are not town population).

However when number of units grows, I find that the order of focus changes (please give me better word) is not logical and seems random.

Let me give you an example: suppose there are 2 colonies or clusters in different part of the (new) world with ships, wagons and units. Now when I have moved some unit, and would want to move other unit visible on the screen, instead the focus jumps to other location 2, where similar there may be 2-3-4-5 and more units that needs some of coordinated movement.
But instead after (spending some time to reassess and) moving one unit, the focus jumps back to location 1 or worse to location 2 etc...

I would like that the game would bring first focus to next unit visible on the screen (preferably first from those close to each other in the screen center). That would give workflow for each turn, when starting from say north part of east cost, then moving slowly along the cost to south, then some remoter locations.
(The observation, that in all games the most and largest colonies happen on east cost)

The problem and the solution proposed are for game in later stage.
The problem significant in a way, that I find uninteresting to open previous games as with larger number of units it become more boring experience with every turn. For me it is usually 20+ colonies, 100 units in say 1560 with military still far from enough for independence war and trade with Europe being still profitable.

Please point to the related source file.

@mpope042
Copy link
Member

However when number of units grows, I find that the order of focus changes (please give me better word) is not logical and seems random.

This is an area where FreeCol certainly could be improved. IIRC the current algorithm ultimately defaults to traversing the map from left to right + top to bottom, so some jumping is almost guaranteed. However beware, this is an area where whatever you do, someone will not like it.

Please point to the related source file.

Good luck with that! Focus control is well distributed. What you need to know about is the "currently active unit" logic. The low level part of that is in .../freecol/client/gui/..., the trigger to switch is probably mostly in .../freecol/client/control/InGameController.java, and the general ordering mechanism is in .../freecol/common/model/Unit.java.

@paulvi
Copy link
Author

paulvi commented Apr 20, 2021

So improving "currently active unit" logic is actually current words for what this issue describes.

@mpope042
Copy link
Member

More or less. Many things freecol user actions implicitly use the currently active unit, and when the action completes we have to decide whether to select a new active unit or not. So there are a lot of cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants