Extreme slowdowns with setRoomArea/resetRoomArea

All and any discussion and development of the Mudlet Mapper.
Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Extreme slowdowns with setRoomArea/resetRoomArea

Post by Nyyrazzilyss » Tue Apr 19, 2016 8:58 pm

deleteRoom(roomid) is crashing - Not always, but often. I'll need to figure out the exact sequence/whether it only happens after the original loading of the map etc, but it isn't giving me an error, just crashing Mudlet.

I keep all rooms unassigned until I 'map' the room. When I try showing the room now, it's giving a warning:

[MAP ERROR:]Warning: When setting the Area for Room (Id: 48605) it did not have a current area!

I just successfully built a 30k mapfile using the newer version. The map itself is building from the cmud import on my computer in 15 seconds (30000 rooms, previous would have been 4-5 hours+) - It's also running fast fast fast :)

(edit)

Somewhat related to the 2nd error: Error is thrown, and it refuses to move the room into -1

lua getRoomArea(81889)
43

lua resetRoomArea(81889)
false

lua getRoomArea(81889)
43

[MAP ERROR:]AreaID=-1 does not exist, can not set RoomID=81889 to non-existing area!

-----

Quite possibly this one i've just never seen before (i.e. it never echoed about it)

[ INFO ] - Reading map (format version:16) file:
"C:/Users/Chris/.config/mudlet/profiles/toril010d_0409c/map/19-04-2016#18-29-45map.dat",
please wait...
[ INFO ] - Sucessfully read the map file in 0.224778 seconds, will now check
some consistency details, please wait...

Does that imply that (given i'll now be able to use just a single map file) once i've loaded it the first time on installation, I don't really need to ever be loading it again? I rechecked the event order:

[ OK ] - Lua module rex_pcre loaded.
[ OK ] - Lua module zip loaded.
[ OK ] - Lua module lfs loaded
[ OK ] - Lua module sqlite3 loaded
[ INFO ] - Reading map (format version:16) file:
"C:/Users/Chris/.config/mudlet/profiles/toril010d_0409c/map/19-04-2016#21-40-44map.dat",
please wait...
[ INFO ] - Sucessfully read the map file in 0.235013 seconds, will now check
some consistency details, please wait...
[ INFO ] - ...auditing of map starting...
[ INFO ] - Area Id numbering is satisfactory.
[ INFO ] - Room Id numbering is satisfactory.
[ OK ] - Auditing of map completed in 0.282273 seconds. Enjoy your game...
[ OK ] - Mudlet-lua API & Geyser Layout manager loaded.
[Initializing NyyLIB...]

Script version: 4/9/2016 NyyLIB010d https://github.com/Nyyrazzilyss/NyyLIB
[Loaded charData]
SQLite3 connection (0C51F518)

[Consumable database cached: Potions, Scrolls]
[Initializing chat windows...]
[Chat containers created]

(at this point I place a call to Geyser.Mapper:new )
[ INFO ] - Reading map (format version:16) file:
"C:/Users/Chris/.config/mudlet/profiles/toril010d_0409c/map/19-04-2016#21-40-44map.dat",
please wait...
[ INFO ] - Sucessfully read the map file in 0.173933 seconds, will now check
some consistency details, please wait...
[ INFO ] - ...auditing of map starting...
[ INFO ] - Area Id numbering is satisfactory.
[ INFO ] - Room Id numbering is satisfactory.
[ OK ] - Auditing of map completed in 0.282186 seconds. Enjoy your game...

It would appear the map file is getting loaded twice, before I even reach the point where I was going to load it myself
Last edited by Nyyrazzilyss on Wed Apr 20, 2016 4:12 pm, edited 3 times in total.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Extreme slowdowns with setRoomArea/resetRoomArea

Post by Nyyrazzilyss » Wed Apr 20, 2016 2:47 am

This either freezes or crashes:

local maxid = table.maxn(getRooms())
local i

for i = 1, maxid do
if roomExists(i) then
deleteRoom(i)
end
end


I really don't need to be able to delete rooms myself, it's only when i'm trying to erase the loaded mapfile and create a new one. For myself, I just went around it by using delta to create an empty mapfile, as needed i'll load that and remove the above code. Did there happen to be a command btw to just erase in memory the loaded map?

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Extreme slowdowns with setRoomArea/resetRoomArea

Post by Nyyrazzilyss » Wed Apr 20, 2016 3:55 pm

SlySven wrote: You now have to have an actual exit (or a stub) in a particular direction before you can have a door in that direction. That warning is advising you that there was a door (of type closed - i.e. drawn in orange) in room 80033 which was set on a south exit direction but that there was not a south exit or exit stub and so it was removed.
The below information is from just after a map rebuild.

lua getDoors(80033)
{
south = 2
}

lua getRoomExits(80033)
{
west = 80034,
east = 80044,
south = 80045
}

lua getRoomExits(80045)
{
west = 80035,
down = 80045,
south = 80046,
east = 80043,
north = 80033
}

On restart, mudlet is reloading the map, and deleting every door on the map

[ INFO ] - In room with Id: 80033 found one or more surplus door items that were removed:
south (closed).

lua getDoors(80033)
{}

Might it be possible that 'south exit or exit stub' is actually being treated as 'south exit AND exit stub'? I don't have any exit stubs on my map at all, only completed exits.
Last edited by Nyyrazzilyss on Wed Apr 20, 2016 5:17 pm, edited 1 time in total.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Extreme slowdowns with setRoomArea/resetRoomArea

Post by Nyyrazzilyss » Wed Apr 20, 2016 5:05 pm

Looks like i'm getting an error as soon as I create a room

lua addRoom( 99999 )
true

[MAP ERROR:]AreaID=-1 does not exist, can not set RoomID=99999 to non-existing area!

I'd previously seen mention of -1 on startup, so I exited/reloaded the map (going through the error checking)

[ ALERT ] - Area with id: -1 expected but not found, will be created.

That didn't however stop the same error message

lua addRoom( 99998 )
true

[MAP ERROR:]AreaID=-1 does not exist, can not set RoomID=99998 to non-existing area!

(edit)

Sorry! This was a repost (though more detailed) of the first error i'd posted.

User avatar
SlySven
Posts: 914
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Extreme slowdowns with setRoomArea/resetRoomArea

Post by SlySven » Thu Apr 21, 2016 8:50 pm

Nyyrazzilyss wrote:...I really don't need to be able to delete rooms myself, it's only when i'm trying to erase the loaded mapfile and create a new one. For myself, I just went around it by using delta to create an empty mapfile, as needed i'll load that and remove the above code. Did there happen to be a command btw to just erase in memory the loaded map?
If you want to "blow-away" an existing map, try:

Code: Select all

loadMap("_")
assuming, of course, that you do not have a "_.dat" file in the maps sub-directory of the relevant profile - that will clear the existing map, try to load a map of that name and fail (because there isn't one) and leave you in the wanted - mapless - state {you have to specify an non-empty map file name as the "" empty file name is used to reload the latest dd-mm-yyyy#hh-mm-ss.dat map file from the profile's map directory} ...

User avatar
SlySven
Posts: 914
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Extreme slowdowns with setRoomArea/resetRoomArea

Post by SlySven » Thu Apr 21, 2016 10:02 pm

Oh, thanks for the pointer to the fact that the code didn't actually create the -1 area with a new/cleared map (or properly check for it after loading in new map data)! :o

Should now have cured that issue {in commits: 398e004c for release_30 branch and 86e66986 for development branch}. This may fix the room deletion failures IMHO - there may have been problems in the code trying to remove rooms from the -1 area - when it did not exist but code assumed it did. :ugeek:

Not sure whether this will touch the door issue - can you recheck that with this revision in place...?

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Extreme slowdowns with setRoomArea/resetRoomArea

Post by Nyyrazzilyss » Thu Apr 21, 2016 11:08 pm

I've installed/run that patch now. Thanks!

resetRoomArea is working again, it does place the room into -1. Additionally, i'm no longer getting the error messages in regards to the -1 area, either on restart or after adding a new room (example: lua addRoom(99999) )

The doors however are still being removed when I exit/restart :(

One other thing that did pop up on this patch that wasn't present previously. In the previous version, I was importing my complete map from cmud (30k rooms) in 12 seconds! On this one, I just crashed mudlet after a frozen 15 minutes. I changed it to import only a single area (about 500 rooms) and it did complete, though it took about 5 minutes.

I just tested the 'delete map by deleting every room' function I posted earlier, it still crashes mudlet.

Nyyrazzilyss
Posts: 334
Joined: Thu Mar 05, 2015 2:53 am

Re: Extreme slowdowns with setRoomArea/resetRoomArea

Post by Nyyrazzilyss » Fri Apr 22, 2016 2:33 am

In my previous post - It's slower for sure, but not quite as bad as I reported - I timed it, 30k rooms was 6 minutes (not 15 - So I had got impatient)

I've compiled the update you made a little while ago. It's now not creating doors at all :( It returns nil/no errors.

+//SYNTAX: setDoor( roomId, exitCommand, doorStatus )

lua getDoors(48765)
{}
lua display ( setDoor(48765, 5, 2) )
nil
lua getDoors(48765)
{}
lua display ( setDoor(48765, "w", 2) )
nil
lua getDoors(48765)
{}

(edit)

Put it in an alias to get the error:

local x,y = getRoomExits(48765)

display(x)
display(y)

local a,b = setDoor(48765, "w", 2)

display(a)
display(b)

local c,d = getRoomExits(48765)

display(c)
display(d)

{
south = 48763,
west = 48767,
east = 48766,
north = 48768
}
nil

nil

"setDoor: bad argument #2 value (room with Id 48765 does not have a normal exit or a stub exit in direction "w".)"

{
south = 48763,
west = 48767,
east = 48766,
north = 48768
}
nil

Just in case -

lua display ( setDoor(48765, "west", 2) )
nil

lua display ( setDoor(48765, "West", 2) )
nil

User avatar
SlySven
Posts: 914
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Extreme slowdowns with setRoomArea/resetRoomArea

Post by SlySven » Fri Apr 22, 2016 3:22 pm

I found a separate bug in the door handling - and you have to use the exact door cmd for normal exits - as per the (recent edited to clarify this) setDoor entry in the Wiki. Can you check again with commit-f4e1352e (development) or commit-8ecfd241 (release_30 preview)?

BTW I think you can use the intrinsic lua command "print(...)" as a wrapper around a command which will print out ALL the return values - thereby catching the increasingly prevalent (as I touch various parts of the C++ Mudlet Lua commands!) <nil> + warning message as <string> form of multiple returns result of runtime VALUES issues (using the wrong TYPE of arguments will still throw a Lua ERROR with a single error string)...

User avatar
SlySven
Posts: 914
Joined: Mon Mar 04, 2013 3:40 pm
Location: Deepest Wiltshire, UK
Discord: SlySven#2703

Re: Extreme slowdowns with setRoomArea/resetRoomArea

Post by SlySven » Fri Apr 22, 2016 3:33 pm

Oh, b****r - yep there is something amiss here still - let me see...

Update: humm, looks like I had forgotten the details of DeMorgan's Laws, anyhow it is finally working NOW - and just to show this I've also arranged for the 2D map to be immediately refreshed after a successful change to the doors - all that is left is to show the up/down/in/out doors (and I know exactly how I will do that from previous experimental work with the mappers) and for doors on stubs and custom lines (the latter will be useful for doors on special exits when they are represented on the mapper)... but that is for the future.

So this is done in commit-9b821e00 (development) and commit-53f16b71 (release-30 preview).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest