Page 1 of 1

Rooms pointing to a room

Posted: Sat Oct 25, 2014 3:22 pm
by Swal
Hi!

I am interested in finding what rooms have exit to a certain room.

I know that I can always just loop through all the rooms, check if any of their exit points to the room, but that is very inefficient, and my map is over 30.000 room (and growing), this search freezes up the UI (noticably, not for a long period, 1-1.5 sec). I want to get rid of this freeze.

My attempt to make the resolution more efficient is by overwriting exit, stub, specialexit functions and update the target room's "pointshere" userdata anytime these functions are called.

I was really happy to see it do exactly what I wanted... except mapper UI windows don't make use of any of these functions, they must use something internal. Meaning if I deleted/added an exit through the ui, my "pointshere" userdata did not update.

Wondering if I am just over complicating things and there is an existing function that does this for me. Maybe I've missed it.

Re: Rooms pointing to a room

Posted: Sat Oct 25, 2014 10:22 pm
by Silvine
Maybe make a table of room -> entrances, then lookup this table, that should be a lot faster I think.

Re: Rooms pointing to a room

Posted: Sun Oct 26, 2014 12:22 am
by Swal
Hi Silvine,

Problem is the UI doesn't make use of the public functions so I can not be sure my table is up to date at a given time.
My attempt to make the resolution more efficient is by overwriting exit, stub, specialexit functions and update the target room's "pointshere" userdata anytime these functions are called.

I was really happy to see it do exactly what I wanted... except mapper UI windows don't make use of any of these functions, they must use something internal. Meaning if I deleted/added an exit through the ui, my "pointshere" userdata did not update.
Some things are simply easier with a graphical interface.. like deleting an exit, overwriting one. Anything what my automatic map scanner shouldn't/can't do.

Re: Rooms pointing to a room

Posted: Sun Oct 26, 2014 7:04 am
by Vadi
I'd do your room location in batches, then you wouldn't have a UI freeze. Think that is about the only way to go about it unless we add this in as a function.

The UI doesn't make use of those functions, that would be non-sensical from a design POV. They are just for users scripting purposes.

Re: Rooms pointing to a room

Posted: Sun Oct 26, 2014 3:56 pm
by Swal
Vadi wrote:I'd do your room location in batches, then you wouldn't have a UI freeze. Think that is about the only way to go about it unless we add this in as a function.
Alright, thanks for the answer Vadi. The UI freeze is not a deal breaker, just something I wanted to get rid of if possible.
Vadi wrote:The UI doesn't make use of those functions, that would be non-sensical from a design POV. They are just for users scripting purposes.
Yeah, I can see why. I was hoping there would be still some undocumented hookup I could use.

Will think of something :)