#1334 closed enhancement (fixed)
[PATCH] Make allies visible on map and minimap
Reported by: | rdxi | Owned by: | Deiz |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 11 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
Each player still maintains their own LoS calculations. But when the game renders the LoS onscreen, combine Ally LoS (that is, LoS of all players on the same team) at render time to give one big LoS for same team members.
Eventually LoS techs will be implemented. So keep that in mind when implementing this (make sure any LoS tech would only affect the current players LoS - it shouldn't expand the LoS of allies).
Attachments (3)
Change History (14)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Milestone: | Backlog → Alpha 10 |
---|
As a temp thing though, Philip believes it would be easy to render an allys line of sight along with yours. Ally == same team until diplomacy is properly implemented. Might throw this into Alpha 10 and see if there is time.
comment:3 by , 12 years ago
Milestone: | Alpha 10 → Alpha 11 |
---|
comment:4 by , 12 years ago
Description: | modified (diff) |
---|---|
Priority: | Nice to Have → Should Have |
comment:5 by , 12 years ago
Keywords: | patch review added |
---|---|
Owner: | set to |
Status: | new → assigned |
Summary: | Make allies visible on map and minimap → [PATCH] Make allies visible on map and minimap |
I've done a (to my eyes) relatively clean implementation. Rather that modify all the LoS-checking call sites, I opted to make the low-level GetLosVisibility function smarter. It can now accept a mask (calculated at the call-site), or retrieves a mask that matches a player and all of its allies (generated and cached once per frame), such that visibility by any one of them can be checked for in one operation.
Rather importantly, GetLosRevealAll is deliberately checked only for the 'main' player in a query, such that the AI's cheating doesn't let human players see the whole map.
Making GetLosVisibility "smart" seems safe enough to me, because everything it does is read-only, and GetPercentMapExplored doesn't use that function, so the summary screen is unaffected by shared LoS.
by , 12 years ago
Attachment: | shared-los.patch added |
---|
comment:6 by , 12 years ago
Hey Deiz. Thanks for your work. Someone will review it soon hopefully. Meanwhile, two quick questions:
- We eventually want to be able to have ingame diplomacy. When that happens, does your code support LoS returning to only what the player has scouted themselves, and not being stuck with allies LoS, when the allies/teams are dissolved?
- Does this make any more rendering passes, or does it combined LoS data before rendering? We want to keep this as fast as possible.
comment:7 by , 12 years ago
Since r11935 made cmpPlayer.diplomacy sane, I've removed my redundant ally status code from the GUI (which apparently would have caused out-of-sync errors in multiplayer).
by , 12 years ago
Attachment: | shared-los-2.patch added |
---|
comment:8 by , 12 years ago
Here's attempt #3. Per suggestions from Philip and historicbruno, I've avoided caching every frame, and instead extended cmpRangeManager so that the LoS masks are updated (from Javascript) whenever diplomacy changes.
LoS masks are now stored in cmpRangeManager as well.
by , 12 years ago
Attachment: | shared-los-3.patch added |
---|
comment:11 by , 8 years ago
Keywords: | review removed |
---|
This will probably be added as part of #7.