-
X wrote on 2015-06-26 15:41
A quick post about some information I just stumbled upon. Have you ever been in a situation like this?
[CODE](Somewhere deep inside a dungeon, two enterprising cows prepare to destroy their next challenge)
Kenero: Ready?
Xcelled: Go for it.
Kenero: *Opens chest*
(Doors close)
(No monsters spawn)
(Key drops into the middle of the room)
(Doors open)
Xcelled: ...
Xcelled: They took one look at us and died of fright.
Kenero: moo
[/CODE]
You've probably run into this at least once, right? Most of us assumed it was a glitch with the dungeon generation algorithms. Well... It's not.
Puzzles (aka rooms/mimic pits/etc) in dungeons all have an associated script that determines their behavior to a large extent. For a chest room, this script has functions to set up the chest, close the door, spawn the monsters, open the door once monsters are dead, and so on and so forth.
Additionally, all chest rooms have the following in their scripts:
[SPOILER="You don't need to read this if you don't care about code"][CODE]////////////////////////////////////////////////////////////////////////////////
server void
OnTemplateMonsterAllocate(
puzzle_template _this,
puzzle _puzzle,
string _name,
bool _bSucceeded)
// : í¼ì¦ì—서 몬스터 í• ë‹¹ ì´ë²¤íŠ¸ê°€ ë°œìƒí–ˆë‹¤
////////////////////////////////////////////////////////////////////////////////
{
if (_bSucceeded)
{
if (_name == `Mob_Last`.LowerCase())
{
// ëª¬ìŠ¤í„°ì— ì—´ì‡ ë¥¼ 추가한다
_puzzle.FindMonster(`Mob_Last`).AddKey(
_this.FindPuzzle(`KeyChest`), `Lock1`);
}
// ì—´ì‡ ê°€ 담긴 ìƒìžê°€ ì—´ë ¸ë‹¤
// ì—´ì‡ ë°©ì˜ ë¬¸ì„ ë‹«ëŠ”ë‹¤
_puzzle.GetPlace(0).CloseAllDoor();
}
else
{
// ì‹¤íŒ¨ì¸ ê²½ìš° 몬스터 ë‹¤ìš´ì„ ê°€ì •í•˜ê³ ì—´ì‡ ë¥¼ 주지 ì•Šê³ ê¸¸ì„ ë§‰ìŒ.
_this.FindPuzzle(`KeyChest`).DropKey(1, `Lock1`);
// ì—´ì‡ ê°€ 담긴 ìƒìžê°€ ì—´ë ¸ë‹¤
// ì—´ì‡ ë°©ì˜ ë¬¸ì„ ì—°ë‹¤
_puzzle.GetPlace(0).OpenAllDoor();
}
}[/CODE][/SPOILER]
This code is invoked by the server after it attempts to spawn the monsters. The server gives the script some basic information like the name of the dungeon, but, most importantly, tells the script if the monsters spawned successfully.
If the mobs are MIA, probably because the monster server is too overloaded or bugged out, the script contains specific logic to abort the puzzle. The required key is dropped randomly and the doors are opened.
So it turns out that the monsters were really just too afraid to show up to the fight.
(Look for a more extended post on dungeon puzzle scripts later this weekend)
-
Kaeporo wrote on 2015-06-26 15:46
I've seen this a few times.
I don't know if it's still possible but a few years ago I reached the staircase to another floor with an extra four or five keys on me. Specifically room keys (not chest keys).
-
Osayidan wrote on 2015-06-26 16:09
It's good that they set up a fail-safe for when the monsters don't spawn, but it doesn't seem to help 99.999% of the time since the door just stays closed until the monsters spawn (or you give up and leave). Really annoying if you had a specific dungeon pass that you don't feel like having to get again.
-
Tyskiyomy wrote on 2015-06-26 16:20
I like how recently in an alby adv hm I had 1 blue key and there was this intersection with 2 blue doors, I looked at my map to see which led to the exit and try to open it, it didn't since I guess the doors have corresponding keys regardless of color v.v
Dungeons are interesting
-
X wrote on 2015-06-26 16:21
I believe this is a separate issue involving the monster server just being incredibly laggy. So the monsters do "spawn", but they don't show up for hours.
Quote from Tyskiyomy;1280054:
I like how recently in an alby adv hm I had 1 blue key and there was this intersection with 2 blue doors, I looked at my map to see which led to the exit and try to open it, it didn't since I guess the doors have corresponding keys regardless of color v.v
Dungeons are interesting
Are you sure they were the exact same color of blue?
Did you end up needing the other door?
-
SozenCratosFocker wrote on 2015-06-26 17:06
When did they add this? Back in C1 you were just stuck in the empty room until they spawned or you logged out.
-
Zekkii wrote on 2015-06-26 17:12
Quote from Osayidan;1280051:
It's good that they set up a fail-safe for when the monsters don't spawn, but it doesn't seem to help 99.999% of the time since the door just stays closed until the monsters spawn (or you give up and leave). Really annoying if you had a specific dungeon pass that you don't feel like having to get again.
Isn't there a timer where the key would drop and the door would open after X amount of time of being locked in?
-
Darkboy132 wrote on 2015-06-26 17:43
It's pretty damn common in Albey G1. The same thing also happens on the third wave, too.
Semi-related, is there any code explanation why the mobs spawn then immediately despawn for no reason?
-
X wrote on 2015-06-26 18:07
Quote from SozenCratosFocker;1280059:
When did they add this? Back in C1 you were just stuck in the empty room until they spawned or you logged out.
This has been in since G13, at least. Probably from very early in the game, back when the mob server was much more unstable.
Note that this does not help delayed-spawn mobs, but rather failed-spawn mobs. It's still quite possible for the mob server to successfully spawn the mobs but take forever to actually show them.
Quote from Zekkii;1280060:
Isn't there a timer where the key would drop and the door would open after X amount of time of being locked in?
I've never seen this either in game or in code.
Quote from Darkboy132;1280062:
It's pretty damn common in Albey G1. The same thing also happens on the third wave, too.
Semi-related, is there any code explanation why the mobs spawn then immediately despawn for no reason?
The script I posted above is executed whenever monsters are spawned.
What do you mean by "spawn and immediately despawn"? They actually show up for a second or two and then vanish?
-
Darkboy132 wrote on 2015-06-26 18:14
Quote from X;1280063:
What do you mean by "spawn and immediately despawn"? They actually show up for a second or two and then vanish?
Yes. IIRC the same thing happens in Shadow Missions.
-
X wrote on 2015-06-26 18:30
I've never seen that in game. I can think of a few possibilities though:
- The monster server messes up and despawns the mobs early.
- The game server spawns the monsters, but then decides the monster server can't assume control of them.
- The puzzle itself has a bug or buggy implementation.
- A GM or hacker was trolling you.
-
Zekkii wrote on 2015-06-26 19:41
Quote from X;1280063:
I've never seen this either in game or in code.
Unless I'm going senile, it was a common occurrence in C4 era. We used to have spawn problems
constantly and after sitting for a while the key just plopped out of nowhere. Maybe it's just that script you mentioned in the first post lagging?
-
X wrote on 2015-06-26 19:49
Possible, though I think if the script was lagging, you'd notice a lot more than just mob lag.
I can look through the rest of the dungeon scripts later on. Maybe there's a different function that does it.