SPGrid
Posted: Fri Nov 24, 2017 7:00 pm
SPGrid = space portioning grid
What this does is load a custom file for a zone that will contain the level geometry for that zone. From there it will use that info to divide the entire map up into a 2D grid. Currently what this does is gets the eq2 grid id from the geometry and updates the spawn as they move around.
Before we had an issue if the Spawn moved around and went into a section with a different grid id then where it was spawned it would start acting strange on the client, some times blinking, some times floating in the air, and other times just disappearing all together along with various other issues. Now if the zone has the map file every time spawns moves it will check the level geo and update its grid accordingly so we can have spawns wonder the entire map now.
Future plans for this will be to have range checks only checking the range of spawns in its own grid and neighboring grids instead of the current method that checks range on all spawns in the zone, this should improve performance in larger zones. Long term goals would be pathfinding.
If a zone doesn't have a map file you will get a warning but the zone will continue to work like it always has so map files are not required.
The server will look for the maps in the "Maps" folder in the same directory as the server exe. I have attached a test map file for Nektropos Castle as that is where we had the grid problem the most and the first real dungeon that has been spawned and scripted on the emulator server.
What this does is load a custom file for a zone that will contain the level geometry for that zone. From there it will use that info to divide the entire map up into a 2D grid. Currently what this does is gets the eq2 grid id from the geometry and updates the spawn as they move around.
Before we had an issue if the Spawn moved around and went into a section with a different grid id then where it was spawned it would start acting strange on the client, some times blinking, some times floating in the air, and other times just disappearing all together along with various other issues. Now if the zone has the map file every time spawns moves it will check the level geo and update its grid accordingly so we can have spawns wonder the entire map now.
Future plans for this will be to have range checks only checking the range of spawns in its own grid and neighboring grids instead of the current method that checks range on all spawns in the zone, this should improve performance in larger zones. Long term goals would be pathfinding.
If a zone doesn't have a map file you will get a warning but the zone will continue to work like it always has so map files are not required.
The server will look for the maps in the "Maps" folder in the same directory as the server exe. I have attached a test map file for Nektropos Castle as that is where we had the grid problem the most and the first real dungeon that has been spawned and scripted on the emulator server.