#958 closed enhancement (fixed)
[PATCH] Allow building in fog of war, within player's territory
Reported by: | historic_bruno | Owned by: | historic_bruno |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 8 |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description
A player's territory will always be explored (either visible or in FoW), so they should be allowed to build anywhere in that territory. CmpRangeManager::GetLosVisibility()
can't be used to check FoW because it uses rendering concepts like RetainInFog
that would break preview entities. The attached patch adds CmpRangeManager::GetLosState()
which checks the internal LOS state and reveal all players flag, returning a value corresponding to explored, unexplored or visible. It also moves the visibility check into BuildRestrictions
for consistency.
Attachments (2)
Change History (12)
by , 13 years ago
Attachment: | territory_fow_building-09122011.patch added |
---|
comment:1 by , 13 years ago
Keywords: | review added |
---|---|
Summary: | Allow building in fog of war, within player's territory → [PATCH] Allow building in fog of war, within player's territory |
comment:2 by , 13 years ago
comment:3 by , 12 years ago
Priority: | Should Have → Must Have |
---|
follow-up: 5 comment:4 by , 12 years ago
CmpRangeManager::GetLosVisibility()
can't be used to check FoW because it uses rendering concepts likeRetainInFog
that would break preview entities.
Preview entities shouldn't use RetainInFog
. They ought to be rendered in a special way that ignores the LOS texture entirely, so they don't look invisible if you try building in SoD (because that's confusing - they should be fully-bright with the red shading). Probably should add a flag like IgnoreLOS
into VisualActor
for that. If we added that flag, is there any need for the new GetLosState
(which involves an unhappy amount of code duplication)?
by , 12 years ago
Attachment: | territory_fow_building-11222011.patch added |
---|
comment:5 by , 12 years ago
Replying to Philip:
Preview entities shouldn't use
RetainInFog
. They ought to be rendered in a special way that ignores the LOS texture entirely, so they don't look invisible if you try building in SoD (because that's confusing - they should be fully-bright with the red shading). Probably should add a flag likeIgnoreLOS
intoVisualActor
for that. If we added that flag, is there any need for the newGetLosState
(which involves an unhappy amount of code duplication)?
I agree with that suggestion, as a rendering fix, because preview entities should always be visible. A new ticket can be made for rendering preview entities regardless of LOS. However we still need a way to check if the entity is visible (not whether it's rendered as visible). I've updated my patch with a simpler implementation per our discussed yesterday in IRC :)
comment:7 by , 12 years ago
Some additional background on RetainInFog
from IRC:
22:05 <@Philip`> Eventually RetainInFog will trigger the weird behaviour where you see a kind of ghost of enemy buildings in FoW 22:06 <@Philip`> which isn't what's wanted here 22:06 <@Philip`> I guess the problem is that the rendering and the gameplay are using the same flags for visibility behaviour 22:07 <@Philip`> which is fine in all cases except for placement previews (which are weird anyway since they should ignore the LOS texture when rendering)
comment:8 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:9 by , 12 years ago
Keywords: | review removed |
---|
Replying to historic_bruno:
Hmm this would break AIs, since they don't have LOS data, maybe it's best to keep it separate from the other build restrictions.