Ticket #144 (closed task: fixed)
Visualize player controlled units that are hidden behind other objects
| Reported by: | nicolai | Owned by: | |
|---|---|---|---|
| Priority: | Should Have | Milestone: | Alpha 5 |
| Component: | Game engine | Keywords: | |
| Cc: |
Description
We need a way to render player controled/obstructed (by trees, walls, terrain) units (player color/filled sillohettes), and some nifty effects to render enemy units hiding in 'trees' (some sort of transparency).
Change History
comment:2 Changed 16 months ago by anonymous
- Milestone Advanced Playability Demo deleted
Milestone Advanced Playability Demo deleted
comment:4 Changed 12 months ago by Philip
Hmm, I haven't been able to easily find any documentation of how people usually render unit silhouettes. The only way I can think to do it is:
- Render all objects which block units (i.e. buildings and terrain and maybe trees) as normal.
- Render all objects which have silhouettes (i.e. units) as a solid colour, with an inverted Z test (i.e. only draw when they're behind an already-rendered object).
- Render all objects which have silhouettes as normal, plus any objects we haven't rendered yet.
That means we need to render all unit vertexes twice, but hopefully that won't be too expensive (and it's just a single batch per player colour) and it should be fairly straightforward.
comment:5 Changed 11 months ago by Philip
That won't work, because of alpha blending. Something like this should work better.
Note: See
TracTickets for help on using
tickets.

I think the easiest way to do this would be to have a key that toggles building visibility down to just the base of the building (i.e. you'd see the outline of the building on the ground, but not the walls/roof of the building). This would fix not only the issue of seeing units, but also selecting things like animals behind buildings.