[Zscript] Map Exploration %

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

[Zscript] Map Exploration %

Postby Collegia Titanica » Thu Jan 10, 2019 1:29 pm

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 ?
Collegia Titanica
Joined: 25 Jan 2018
Discord: 2834

Re: [Zscript] Map Exploration %

Postby m8f » Thu Jan 10, 2019 1:42 pm

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.

User avatar
Joined: 29 Dec 2017
Discord: m8f#0629
Github ID: mmaulwurff

Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests