Opened 10 years ago
Last modified 5 years ago
#2564 new enhancement
Territory influence preview for buildings
Reported by: | Yves | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Backlog |
Component: | UI – In-game | Keywords: | |
Cc: | Patch: |
Description (last modified by )
It would be nice to somehow show the territory influence before you place a building. It could update the borders on the fly when moving the building preview on the map.
This would not only be useful for gameplay but it's also a nice way to teach players how territories work and how much influence different buildings have on territory.
Change History (9)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|
follow-up: 5 comment:2 by , 10 years ago
comment:3 by , 10 years ago
In addition to the territory influence it might be also a good idea to preview effect ranges of certain buildings. (defence tower attack ranges, wooden tower visibility influence, healing range of temple, …)
comment:4 by , 10 years ago
I definitely approve of this design idea, Yves. It would definitely enhance the game for the player and territories specifically.
As for nylki's idea, I approve of that too, provided we can make it look nice (like a nice graphical decal visible with the preview object). I wouldn't want just a plain old circle around the object, but something with some forethought behind it. Of course a simple circle is fine for the first implementation. Though, I wonder if the "range preview" idea should be ticketed separately from the territory preview idea.
comment:5 by , 10 years ago
Replying to sanderd17:
This would need a rewrite of the territory calculation method. As now it's horribly slow, but that doesn't matter a lot, as it's only updated once a building is finished. In Atlas, when you move a building around, you can notice how slow it gets. Certainly when you do it when the simulation is running.
It would also need a separate territory map for the preview, since the local preview entity can't influence the synchronized simulation state. Both the real territory map and the preview one would have to be updated in response to gameplay.
follow-up: 8 comment:6 by , 10 years ago
This would need a rewrite of the territory calculation method. As now it's horribly slow
On Azure Coast 2 (on a fast machine), I see it taking about 10msec to recompute the territory map, and 10msec to recompute the boundary line graphics.
One way to make the map recomputation faster is to lower the resolution - the patch in #1756 made it variable and changed it to 2x2 terrain tiles (8x8 navcells) per territory tile, which should make it about 4x faster. (That avoids some of the rendering glitches at sharp corners, too).
Another way is that if you're only moving a single building, you should only need to recompute the territory map within the influence-radius of that building, and the rest will be the same as the original map from before the building was placed.
Don't remember how the graphics work so I'm not sure how to improve them. But I think it's probably feasible to make it fast enough to work real-time.
comment:7 by , 10 years ago
The map size matters, but also the number of already present buildings with a territory modification. As for every building present, it loops uses a new floodfill and copy the entire resulting map of that floodfill over to a player map. So for every building, you loop the entire map one more time.
comment:8 by , 10 years ago
Replying to Philip:
Another way is that if you're only moving a single building, you should only need to recompute the territory map within the influence-radius of that building, and the rest will be the same as the original map from before the building was placed.
Couldn't it change the connectivity of the whole map? (Buildings have to be connected to that player's CC or else they decay) That's important information, it should be shown in the preview, if possible. If the territory manager stored connectivity efficiently (maybe like the new pathfinder?), it could handle that case.
How will the preview even look?
- Show only border preview
- Show both the real borders and the preview lines overlaid (could be different line style)
- Show the real borders, and a new set of lines for added/removed territory
- Use some other indicator, like terrain shading
comment:9 by , 5 years ago
Component: | UI & Simulation → In-game UI |
---|
Move tickets to In-game UI
as UI & Simulation
got some sub components.
This would need a rewrite of the territory calculation method. As now it's horribly slow, but that doesn't matter a lot, as it's only updated once a building is finished. In Atlas, when you move a building around, you can notice how slow it gets. Certainly when you do it when the simulation is running.