Mapper(Fiendish): drawing rooms in batches

Posted by Asmodeusbrooding on Tue 05 Nov 2019 05:26 AM — 2 posts, 12,882 views.

#0
I found this code from fiendish, here:
function draw_next_batch_of_rooms()
https://raw.githubusercontent.com/fiendish/aardwolfclientpackage/905df5b79046be9351d8f2a300d7ba1c8a7b1d52/MUSHclient/lua/aardmapper.lua


I have put it into my mapper.lua, featured here:
https://www.dropbox.com/s/cy3kdccxbyeagpk/cleftmapper.lua?dl=0


How exactly shall I implement this code? I've pasted it into my mapper, and trying to figure out the next step.

I need to add a timer to prevent the rooms from drawing hotspots while I'm in a speedwalk, right?

Wondering what you originally had in mind, fiendish.
I'm drawing quite a bit of images in the map, so not drawing every single room as a hotspot during speedwalk would probably help with speed quite a bit.

Looking for guidance, since this is your code.
I obviously don't have the metrics part in my game, continent wise, but as far as I saw that shouldn't matter much?
Let me know.

All help is appreciated.
Amended on Tue 05 Nov 2019 05:46 AM by Asmodeusbrooding
USA Global Moderator #1
Quote:
I need to add a timer to prevent the rooms from drawing hotspots while I'm in a speedwalk, right?

Not a timer. mapper.running is a variable that gets set true/false in my plugin when I detect that the player is running or not.

Quote:
Wondering what you originally had in mind, fiendish.

That code delays doing work that isn't important. If you're in the middle of a speedwalk, you don't need to see as far and none of the hotspots matter because your surroundings are going to change immediately anyway.

So it does a few things:
1. Limits how much it draws at any one time to what can be done in 0.08 seconds because Aardwolf speedwalks go quite fast.
2. Keeps a record of which hotspots should get drawn but then only draws them at the very end (#rooms_to_draw_next == 0).