Page 1 of 1

[Zscript] Map Exploration %

Posted: Thu Jan 10, 2019 12:29 pm
by Collegia Titanica
I'm sure you all know that shroud that gets revealed in RTS games as a unit moves.

I'm thinking of implementing a statistic feature:
-How much has the player explored the map ?

We have "secrets" but that doesn't tell much.

Brainstorming right now:
-Player actor emits linetrace rays often and in many directions, but with limited Range. If one and/or multiple linetraces hit walls, the sector that has those lines is added to an array or something.
In effect, player has a shroud-like-revelation that is used for sector mapping.
I guess the end result would be
total sectors - revealed sectors ... percentage wise. Thoughts ?

Re: [Zscript] Map Exploration %

Posted: Thu Jan 10, 2019 12:42 pm
by m8f
I've done this here.

Basically, I count the sectors with Sector.SECMF_DRAWN flag. The sectors that are found at level start are not counted as foundable (declaring the map 15% explored right on the start makes no sense).
The one problem is large inacessible areas. It can be monster teleport rooms, and special deathmatch areas in singleplayer maps. I deal with this by declaring the map explored when about 90% of the sectors are drawn.
Spoiler: