Jump to content
  • 0
Sign in to follow this  
AnnieRuru

custom Instance script always kick the players out of the map

Question

I feel the need to make a topic about this, because many members has report about this bug

http://herc.ws/board/topic/4850-fight-your-clone/?p=31745

http://herc.ws/board/topic/4652-raid-instances/?p=30813

and I didn't make a bug report, because I'm not able to reproduce the bug :(

.

I'm testing it right now and surprisingly, when I enter the instance the instance always destroyed and warp back the party in split seconds. Weird. :unsure:

There are times when you can not enter the event, when players enter the map are immediately teleported out of the event.

This does not always happen.

.

.

.

the example script,

http://upaste.me/9b2110648e7662562

ok, I admit that I used a trick

instance_attachmap( "guild_vs2", .@ins, 1, getcharid(3)+"FYC" )
which will make as many map as possible

and a new map is added everytime an user register this instance

 

1. is there some kind of map name that is invalid to use ?

because if accountID is 2001234, map name will be "2001234FYC" <-- string length :10, should be safe

 

 

2. I wonder is there a limit to how many maps that the server can create ?

I also wonder is there any hardcoded limit for how many maps the server can load

 

 

3. after the instance has destroy, do the map unload ?

when I wrote a custom job pvp script that each class has their own pvp room

http://rathena.org/board/topic/92946-job-vs-job-pvp/?p=246463 <-- advertising the awesomeness of hercules :P

I noticed that when the script loaded, there is some lag ... ok the map is loading

but when I reloadscript, there is no lag -> the map is still available and didn't unload ?

I thought those instance map should be destroyed the moment that instance_id destroy

 

 

funny about this is ... I asked Hadeszeus to change the instance_set_timeout

http://herc.ws/board/topic/4652-raid-instances/?p=30921

he said that will fix it ... ? but when I'm not able to reproduce this bug, I also uncertain about this

Edited by AnnieRuru

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

its a bit late for me to test so I'll be doing the testing when I wake up, I'll be replying now though:

1. is there some kind of map name that is invalid to use ?

because if accountID is 2001234, map name will be "2001234FYC" <-- string length :10, should be safe

not to my knowledge, I have never played with map names that start with numbers though.

2. I wonder is there a limit to how many maps that the server can create ?

there is one limitation left on that which is mapindex.h MAX_MAPINDEX (might be soon dropped), which is currently 2000

but when I reloadscript, there is no lag -> the map is still available and didn't unload ?

I thought those instance map should be destroyed the moment that instance_id destroy

the instances have been made to be reload-persistent, they reset and the script can acknowledge this action on OnInstanceInit: which is run when the instance starts and when reloadscript happens -- you can use *instance_set_respawn(<map_name>,<x>,<y>{,<instance_id>}); to control the progress of the instance and where to teleport the users when reload happens ( e.g. if endless tower kept a instance var of the progress, i.e. 'Room, you could update instance_set_respawn on every room users clear, and when restart happens you just warp them to the begin of the room in question and respawn the monsters (as reloadscript clears the mobs, unfortunately) )

funny about this is ... I asked Hadeszeus to change the instance_set_timeout

hum O__O to my best memory permanent instances shouldn't call instance_set_timeout at all

Share this post


Link to post
Share on other sites
  • 0

not to my knowledge, I have never played with map names that start with numbers though.

long time ago, when the instance system was coded by zephirus (which later he started eamod, his coding very unoptimized)

the instance system map name has to be '<number>@<seven character long>'

example : 1@tower

when instanced, the name will become 0011@tower

and doesn't support custom map name

we have to use dataresnametable.txt to duplicate a map that wasn't '<number>@<seven character long>' into this format

 

now both the instance system rewrite by hercules and rathena

 

hercules system : 1@tower become 0001@tower

custom map name: guild_vs2

instance_attachmap( "guild_vs2", .@ins, 1, getcharid(1)+"FYC" )
that's my technique, unfortunately

.

rathena system : 1@tower become 0011@tower

custom map name: guild_vs2 become 001#guild_vs2

.

by my experience, all instanced map always start with a number, so I don't think start with a number might be an issue

.

.

.

there is one limitation left on that which is mapindex.h MAX_MAPINDEX (might be soon dropped), which is currently 2000

2000 ... should be impossible to reach in just 1 week

my test server says loaded 880 maps, means there should be 1120 maps free to use

 

but from the feedback from community members, they reply me in just 1 day after I finished the script

which must be means ... in just several hours after put on a live server ... this ... is sux ...

 

from what I gather, this kind of instance script works fine in test server,

but doesn't work 100% in live server, due to kicking out from the instance the moment the player went in

its not like crashing the server, which produce a core dump ...

so although we knew the way to reproduce in live server, but we couldn't able to locate what is the cause

.

.

.

the instances have been made to be reload-persistent, they reset and the script can acknowledge this action on OnInstanceInit: which is run when the instance starts and when reloadscript happens -- you can use *instance_set_respawn(<map_name>,<x>,<y>{,<instance_id>}); to control the progress of the instance and where to teleport the users when reload happens ( e.g. if endless tower kept a instance var of the progress, i.e. 'Room, you could update instance_set_respawn on every room users clear, and when restart happens you just warp them to the begin of the room in question and respawn the monsters (as reloadscript clears the mobs, unfortunately) )

ah ... now I just recall this one

 

I just debug it with getmapusers ...

with IOT_CHAR type it return -1

with IOT_NONE type it return 0

 

ok its fine for being like this, IOT_NONE shouldn't need to unload the map

so this one working correctly

.

.

.

hum O__O to my best memory permanent instances shouldn't call instance_set_timeout at all

actually what I meant it happens with IOT_CHAR or IOT_PARTY type

IOT_NONE type not included

 

with IOT_CHAR type (confirmed), they say when set the instance_time_out like this

instance_set_timeout 3600, 1, .@ins; // 1 hour for the map, 1 second to destroy
they say the Memorial Dungeon is destroyed in 1 sec

though, I'm not able to reproduce this bug even once

Share this post


Link to post
Share on other sites
  • 0

with IOT_CHAR type (confirmed), they say when set the instance_time_out like this

instance_set_timeout 3600, 1, .@ins; // 1 hour for the map, 1 second to destroy
they say the Memorial Dungeon is destroyed in 1 sec

though, I'm not able to reproduce this bug even once

 

 

I think that makes sense, you're setting idle for 1 second, meaning if the instance is left empty for 1 second or more it is destroyed (it might be destroyed even before you warp into it) -- I'm not sure why you can't reproduce.

Share this post


Link to post
Share on other sites
  • 0

(it might be destroyed even before you warp into it) -- I'm not sure why you can't reproduce.

oh yeah ... now I just remember something about getmapusers behaviour

apparently the way server calculate map->list[m].users and sd->bl.m a little bit inconsistent

because the map->list[m].users doesn't count the player when that player still in the loading screen

means, if the player loads the map for more than 1 second, the map is consider empty

and my instance_time_out says only wait for 1 second, so it gets destroyed

its my scripting problem

 

there's some clue around at *maprespawnguildid script command

https://github.com/HerculesWS/Hercules/blob/master/src/map/script.c#L11326

Share this post


Link to post
Share on other sites
  • 0

 

 

(it might be destroyed even before you warp into it) -- I'm not sure why you can't reproduce.

oh yeah ... now I just remember something about getmapusers behaviour

apparently the way server calculate map->list[m].users and sd->bl.m a little bit inconsistent

because the map->list[m].users doesn't count the player when that player still in the loading screen

means, if the player loads the map for more than 1 second, the map is consider empty

and my instance_time_out says only wait for 1 second, so it gets destroyed

its my scripting problem

 

there's some clue around at *maprespawnguildid script command

https://github.com/HerculesWS/Hercules/blob/master/src/map/script.c#L11326

 

 

Its intentional, when a player moves out of a map the server removes it and keeps it in memory-limbo, it is only placed back within map bounds when its done loading -- so that a number of things only take effect when you are really visible in the map, otherwise things like aoe damage would be able to hit you -- as well as monsters, while you werent even able to be visible, that also guarantees that other packets are not sent to you while you're into loading screen

Share this post


Link to post
Share on other sites
  • 0

that also guarantees that other packets are not sent to you while you're into loading screen

ahh ... now this sentence looks interesting

 

makes me remember there's also a bug when warp a character then setwall can cause client to crash

which also doesn't happen often

http://rathena.org/board/topic/89525-

 

btw move to script support and solved, its more like a support topic

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.