Zwiebelchen
Hosted Project GR
- Joined
- Sep 17, 2009
- Messages
- 7,234
We all know this problem: We have areas in our maps that the player isn't supposed to enter. Like that giant lake of doodad-water or that mountain chain. You carefully block any entry into that zone via pathing blockers... so far so good. But now, as we added a jump spell to the mix, suddenly players are able to enter that supposed-to-be-unpathable zone easily...
What are we going to do? Spam hundreds of pathing blockers to lock the zone? Nah. A "fill" type of tool would be handy!
And this is where the lab comes into play!
The basics about how it could work:
As looping through tiles one by one is very taxing on performance (a 480x480 maximum scale map can have up to 16.7 million pathing cells), we either need to run a continuous interation process in the background while the players are already playing (this requires the mapper to carefully select the "entry points" of this system so that players won't suddenly reach areas that haven't been filled yet), or we have to check for the operation limit and front-load the entire calculation on map init and live with a longer loading screen.
So... any volunteers that want to code this? I think this could be extremely useful for almost any mapper. Let's do this!
http://en.wikipedia.org/wiki/Flood_fill
What are we going to do? Spam hundreds of pathing blockers to lock the zone? Nah. A "fill" type of tool would be handy!
And this is where the lab comes into play!
The basics about how it could work:
- There is a native that allows manually enabling/disabling the pathability of a 16x16 cell. I don't recall the name now, but I have been using it quite a few times already, so it's definitely there
- The user defines a list of X,Y "seed" coordinates that are meant to be unpathable and inside the zone that is meant to be blocked off
- The system takes those coordinates, then expands from those in all directions until it hits a pathing blocker, kind of like "filling" tools in graphical applications like Paint
- To reduce the load, the system will only iterate a defined number of steps per interval, processed in the background while the players are already playing the map
- The system writes the coordinates/cells processed into a table and as soon as the filling process is completed, loops through them to turn the pathing for those cells off
As looping through tiles one by one is very taxing on performance (a 480x480 maximum scale map can have up to 16.7 million pathing cells), we either need to run a continuous interation process in the background while the players are already playing (this requires the mapper to carefully select the "entry points" of this system so that players won't suddenly reach areas that haven't been filled yet), or we have to check for the operation limit and front-load the entire calculation on map init and live with a longer loading screen.
So... any volunteers that want to code this? I think this could be extremely useful for almost any mapper. Let's do this!
http://en.wikipedia.org/wiki/Flood_fill

Last edited: