Garry's Mod

Garry's Mod

gmDoom Maps
Map collision and Height issues when going through certain doorways
(already posted this on gmDoom, but maybe here will have some answers)
Some background information: I have already tried running with no addons other than the required doom addons and get the same problems.
It really starts in the first map for Doom 2, if I back up to grab the chainsaw as usual, if I run into the fencing back there I will slip right through. Same thing happens where if you go into the big room, the fencing holding the imp in also has no collisions, so he walks right through it. Not a "game breaking bug," but definitely an annoyance at times.
Now the real issue starts with trying to move through the map. There seems to be some issues regarding the height of the playermodel or maybe even collisions with certain parts of the map. I tried changing my playermodel, using the Doom Marine through the doom menu, disabled all my addons except the necessary ones for this, and I cannot seem to figure out what the problem is here. Namely the Exit sign in the first Doom 2 map blocks me from actually getting inside the exit room, so I end up needing to use noclip.
Any help would be nice as I'm at a loss.
< >
Showing 1-15 of 15 comments
Jcw87  [developer] 20 Aug, 2020 @ 10:31pm 
The non-solid fence issue is on the known issues list. The problem boils down to not being able to set the collision of the fence to allow bullets to pass but not NPCs and players. Blocking bullets would be more breaking to the gameplay than not blocking players, so I left them as non-solid. I have found an oddity that allows this to work better, but how it works is a mystery, and it also interacts badly with gmDoom projectiles like imp fireballs and rockets.

There's a known issue regarding step height due to a difference in how steps are climbed in the true 3D world of Garry's Mod vs the pseudo 3D world of Doom. Doom's map structure is simpler, and so it is able to work out exactly how high the player needs to move to fit through an opening, while half-life 2 derived games will perform a hull trace at the player position + step height, which will fail in areas with low ceilings. But, based on your description of getting stuck on the exit sign, I don't think this is the issue you are seeing. You need to use the teleporter pad entity to enter the map. This will set your player hull to the correct size.
Gelliteration 20 Aug, 2020 @ 11:39pm 
Originally posted by Jcw87:
You need to use the teleporter pad entity to enter the map. This will set your player hull to the correct size.

I noticed that the portals set your height correctly the last time I tried the mod. But does a level change at the end of the map not set your height to that same value? Because I noticed on map 2 on doom 2 I got stuck in the little drop down areas with the water in them because there is a little square of water and I guess that prevents me from walking anywhere else. I'll try it again starting from map 2 and entering with a portal to see if you can only get this height with the entry portal. But there's also issues on later maps where the teleporters have a bit of a ceiling and you can't actually step into them without noclipping, like map 2's secret teleporter where you get the red keycard.
Jcw87  [developer] 21 Aug, 2020 @ 9:13am 
I don't recall the specifics off the top of my head, but the intention is that you use the teleporter to get to the map, and then your hull should be correct until something else changes it

IIRC the teleporter you cannot step on to is affected by that step height issue I mentioned. Doom guy has an absurdly large step height compared to Gordon Freeman, which makes the flaw with the Half-life 2 step height implementation more obvious. You are usually able to jump into these spaces.
Last edited by Jcw87; 21 Aug, 2020 @ 9:14am
Gelliteration 21 Aug, 2020 @ 1:37pm 
Originally posted by Jcw87:
Doom guy has an absurdly large step height compared to Gordon Freeman.

I have the marine model enabled in the doom cl menu and i used the portal to get into the map, but it still doesn't let me step onto the
I have the marine model enabled in the doom cl menu and i used the portal to get into the first map, but upon map change it doesn't let me step onto the platform to get in to the portal that teleports you to the start.
And upon simply going directly into the second map using the teleporter, I run into the same issue

https://postimg.cc/gallery/7PhS5nT
attached files
First is the location of the room with the secret
Second is the secret with the portal I can't step into
Third is another spot on the same map where if you land in the little water space, you get stuck and have to noclip out.
Last edited by Gelliteration; 21 Aug, 2020 @ 1:38pm
Gelliteration 21 Aug, 2020 @ 1:46pm 
One more spot in the level directly after
https://postimg.cc/3dGc1nD6
Gelliteration 21 Aug, 2020 @ 2:18pm 
I'm also getting these weird errors on later maps

[gmDoom Maps] lua/doommap/hooks.lua:31: attempt to index local 'check' (a nil value) 1. P_RecursiveSound - lua/doommap/hooks.lua:31 2. P_RecursiveSound - lua/doommap/hooks.lua:45 3. P_RecursiveSound - lua/doommap/hooks.lua:45 4. P_RecursiveSound - lua/doommap/hooks.lua:45 5. P_NoiseAlert - lua/doommap/hooks.lua:53 6. v - lua/doommap/hooks.lua:62 7. unknown - lua/includes/modules/hook.lua:84 (x90)
Jcw87  [developer] 21 Aug, 2020 @ 6:40pm 
Originally posted by Gel:
Originally posted by Jcw87:
Doom guy has an absurdly large step height compared to Gordon Freeman.

I have the marine model enabled in the doom cl menu and i used the portal to get into the map, but it still doesn't let me step onto the
I have the marine model enabled in the doom cl menu and i used the portal to get into the first map, but upon map change it doesn't let me step onto the platform to get in to the portal that teleports you to the start.
And upon simply going directly into the second map using the teleporter, I run into the same issue

https://postimg.cc/gallery/7PhS5nT
attached files
First is the location of the room with the secret
Second is the secret with the portal I can't step into
Third is another spot on the same map where if you land in the little water space, you get stuck and have to noclip out.

Originally posted by Gel:
One more spot in the level directly after
https://postimg.cc/3dGc1nD6

These issues are the step-height issue I mentioned.

Originally posted by Jcw87:
There's a known issue regarding step height due to a difference in how steps are climbed in the true 3D world of Garry's Mod vs the pseudo 3D world of Doom. Doom's map structure is simpler, and so it is able to work out exactly how high the player needs to move to fit through an opening, while half-life 2 derived games will perform a hull trace at the player position + step height, which will fail in areas with low ceilings.

I'm going to use some real numbers to help explain the problem. To keep things simple, I'm going to ignore the vertical stretching needed to keep Doom's original aspect ratio, and the "thin layer of air" that exists between all collisions in Source

Doomguy has a height of 56, and a step height of 24. In the real game, if Doomguy is about to cross into another sector, the game can simply check the difference between the 2 floor heights to see if he can pass. if the sector floor he is moving to is no higher than 24 above his current sector, and the ceiling is no lower than 56 units above the destination, then doomguy can pass.

Source works a bit differently. While I can use the Garry's Mod APIs to make the player have the same height and step height attributes, steps are climbed in a very different way. Source's maps are more complex, and so calculating the height difference between 2 floors isn't trivial. You cannot simply ask the engine "Hey, what sector is on the other side of this linedef?". So, Source uses a different method. It instead asks "Can the player exist at 24 units above the spot they are moving to?" If the next floor is 8 units above the current floor, but the ceiling is exactly 56 units above it, then the player cannot exist 24 units above the next floor, and the game will decide that "the step is too high", even though 8 is clearly less than 24. If I were to change the player step height to 8, suddenly Source would be ok with allowing the player to step up in the scenario I described, but then you would not be able to go up steps that are 24 units.
Jcw87  [developer] 21 Aug, 2020 @ 6:53pm 
Originally posted by Gel:
I'm also getting these weird errors on later maps

[gmDoom Maps] lua/doommap/hooks.lua:31: attempt to index local 'check' (a nil value) 1. P_RecursiveSound - lua/doommap/hooks.lua:31 2. P_RecursiveSound - lua/doommap/hooks.lua:45 3. P_RecursiveSound - lua/doommap/hooks.lua:45 4. P_RecursiveSound - lua/doommap/hooks.lua:45 5. P_NoiseAlert - lua/doommap/hooks.lua:53 6. v - lua/doommap/hooks.lua:62 7. unknown - lua/includes/modules/hook.lua:84 (x90)

I'm pretty sure that some aspect of my code (possibly the recursion) is confusing LuaJIT, as the variable it claims is nil is set as part of a loop over an array that 100% definitely has no holes in it. There is no possible way that the variable is actually nil. I've seen even more absurd messages where it claims the type is a number or a string, when the only thing it could possibly be is a table. If I use the type() function to get the type and print the value if it is ever anything but a table, this error never happens. Using the type() function disables the JIT compiler for the function, so I can only conclude that this is a LuaJIT bug.
Gelliteration 21 Aug, 2020 @ 9:39pm 
Originally posted by Jcw87:

Source works a bit differently. While I can use the Garry's Mod APIs to make the player have the same height and step height attributes, steps are climbed in a very different way. Source's maps are more complex, and so calculating the height difference between 2 floors isn't trivial. You cannot simply ask the engine "Hey, what sector is on the other side of this linedef?". So, Source uses a different method. It instead asks "Can the player exist at 24 units above the spot they are moving to?" If the next floor is 8 units above the current floor, but the ceiling is exactly 56 units above it, then the player cannot exist 24 units above the next floor, and the game will decide that "the step is too high", even though 8 is clearly less than 24. If I were to change the player step height to 8, suddenly Source would be ok with allowing the player to step up in the scenario I described, but then you would not be able to go up steps that are 24 units.

This makes more sense. Thank you.

Originally posted by Jcw87:
I'm pretty sure that some aspect of my code (possibly the recursion) is confusing LuaJIT, as the variable it claims is nil is set as part of a loop over an array that 100% definitely has no holes in it. There is no possible way that the variable is actually nil. I've seen even more absurd messages where it claims the type is a number or a string, when the only thing it could possibly be is a table. If I use the type() function to get the type and print the value if it is ever anything but a table, this error never happens. Using the type() function disables the JIT compiler for the function, so I can only conclude that this is a LuaJIT bug.

Just checked. It's another mod conflicting with it.
I'll have to figure out which one though. Do you have any idea of mods that might conflict?
Jcw87  [developer] 21 Aug, 2020 @ 11:34pm 
Originally posted by Gel:
Just checked. It's another mod conflicting with it.
I'll have to figure out which one though. Do you have any idea of mods that might conflict?

I've seen this error and others like it while developing this addon, and I prefer to develop with few to no other addons enabled. Other addons also wouldn't be able to produce the scenarios that I have seen while trying to debug it. It's not other addons, it's LuaJIT. The really annoying part is that it is incredibly inconsistent to reproduce, until it isn't. You could play 10 or 20 maps and never have it happen, but once it does happen, it suddenly becomes way more frequent until you restart Garry's Mod.
Last edited by Jcw87; 21 Aug, 2020 @ 11:35pm
Zsombor99 5 Mar, 2022 @ 4:14pm 
Originally posted by Jcw87:
There's a known issue regarding step height due to a difference in how steps are climbed in the true 3D world of Garry's Mod vs the pseudo 3D world of Doom.
Not a gameplay breaking thing, but I need to jumping if I want to go up on stairs. I just wanted to mention this minor thing. ☺
Zsombor99 7 Mar, 2022 @ 9:08am 
Sometimes when dying enemies dropping their gun, it fells out of the DOOM map. 😨 I just saw it happening myself.
Last edited by Zsombor99; 7 Mar, 2022 @ 9:14am
Zsombor99 12 Mar, 2022 @ 3:32am 
@Gelliterate So, I sum it up for you:
DOOM and Gmod uses different scale of sizes, so where the player can easily go through originally, it might be trickier in Gmod to get trough. Other thing, for example, a red key is on an elevated platform: in DOOM when the player walks to it the key will be picked up, but in Gmod, it needed to be noclipping into the key to pick it up. Also, going up on stairs can be a lots of jumping in Gmod. So yeah, size scale differences between the two games... 😉
Gelliteration 12 Mar, 2022 @ 8:53am 
Originally posted by Zsombor99:
@Gelliterate So yeah, size scale differences between the two games... 😉
I understand that, but I'm saying there is probably a way to change stepping heights through modification
Jcw87  [developer] 15 Mar, 2022 @ 10:26am 
Originally posted by Gelliterate:
I'm also getting these weird errors on later maps

[gmDoom Maps] lua/doommap/hooks.lua:31: attempt to index local 'check' (a nil value) 1. P_RecursiveSound - lua/doommap/hooks.lua:31 2. P_RecursiveSound - lua/doommap/hooks.lua:45 3. P_RecursiveSound - lua/doommap/hooks.lua:45 4. P_RecursiveSound - lua/doommap/hooks.lua:45 5. P_NoiseAlert - lua/doommap/hooks.lua:53 6. v - lua/doommap/hooks.lua:62 7. unknown - lua/includes/modules/hook.lua:84 (x90)

Just an FYI, since I last posted in this thread, I discovered what was causing this problem. It was the continue keyword. Basically, gmod's implementation of continue was busted, and generated bad LuaJIT bytecode that allowed local variables to be freed while they were still being used. I happen to have my own LuaJIT continue implementation, so I fixed the issue there. During the brief window where code_gs was employed by facepunch, he used my implementation to fix it in gmod.
< >
Showing 1-15 of 15 comments
Per page: 1530 50