A hole that players go into but enemies walk over?

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
User avatar
Enjay
 
 
Posts: 26868
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

A hole that players go into but enemies walk over?

Post by Enjay »

Lemme explain the title.

I have a map where, after a bombing raid on an area, there are various bomb craters in the ground. They are just simple regular-shaped sectors that lower when the bombs fall to create holes in the ground.
They are not that deep - the player can drop into one and get out easily. They are mostly for visual effect.
However, they are deep enough that enemies will not go into them, and will try to walk around them (which sometimes blocks their progress).

So, I would like the enemies to walk over the holes. It wouldn't look that bad (especially with the enemies that are in the map because they are quite large), and would look better than them avoiding the holes and getting all snarled up on each other as they try to walk around.

I know that I could change the step height of the enemies, but I don't want to do that because it would cause problems elsewhere. It may be the only solution though.

Ideally, I could cover the holes with an invisible 3D floor that the enemies can walk on, but players would just fall through to the lower floor (i.e. into the hole). I don't think such a thing exists though.

So, any suggestions? It may just be something that cannot be done, but no harm in asking.
User avatar
dileepvr
Posts: 10
Joined: Fri Feb 02, 2024 9:18 am
Graphics Processor: nVidia with Vulkan support

Re: A hole that players go into but enemies walk over?

Post by dileepvr »

Is it important for the player to be able to drop into them? Dragonfly was just mentioning in a new video that MBF21 (and Boom?) formats have a line special called "242: Create Fake Ceiling and Floor" that can decouple visual depth from physical depth.
User avatar
dileepvr
Posts: 10
Joined: Fri Feb 02, 2024 9:18 am
Graphics Processor: nVidia with Vulkan support

Re: A hole that players go into but enemies walk over?

Post by dileepvr »

UDMF has it as "209: Transfer Heights".
User avatar
Enjay
 
 
Posts: 26868
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: A hole that players go into but enemies walk over?

Post by Enjay »

Thanks for the suggestion. I'm aware of those specials (and have used them before) but, yes, it would certainly be best if the player could go into the holes.

The idea is that after the bombing, the ground is pock-marked and (slightly) harder for the player to cross. I also intend spawning a few items in the holes that the player can pick up (who knew that bombs dropped health and armour? :lol: ). So, dropping into the holes and having to do a little hop to get out is really what I'm looking for, but (as I mentioned) the enemies look quite big so it's OK for them to be able to cross the holes without dropping in. At the moment, they don't even try to cross them.
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: A hole that players go into but enemies walk over?

Post by Jarewill »

You could try using the invisible bridge actors with a custom CanCollideWith override:

Code: Select all

Class InvisibleBridge2 : InvisibleBridge
{
	Override bool CanCollideWith(Actor other, bool passive){
		If(other&&other.bISMONSTER){Return 1;} //Solid to monsters
		Return 0; //Non solid to everything else
	}
}
User avatar
Enjay
 
 
Posts: 26868
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: A hole that players go into but enemies walk over?

Post by Enjay »

Oooh, yes, that should work. I can configure the bombing ACS script and map geometry to spawn them and fit them in appropriately.

I had wondered if I could use the bridge actors somehow, but it didn't even dawn on me to think that your suggestion might be possible. Much appreciated.
User avatar
Chris
Posts: 2968
Joined: Thu Jul 17, 2003 12:07 am
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: A hole that players go into but enemies walk over?

Post by Chris »

I'm curious how that would affect pathing. Does the enemy AI consider objects they can walk on as a valid path, or would it still try to avoid the holes since the map geometry has the lowered floor?
User avatar
Enjay
 
 
Posts: 26868
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: A hole that players go into but enemies walk over?

Post by Enjay »

:( Unfortunately, the answer seems to be that they are reluctant to walk onto the bridges. The can walk on them if you place them on a bridge, but they try to walk around if they don't start on a bridge.

I've "solved" the problem by changing the shape and size of the bomb holes making them wider and sloped in a way that enemies will happily walk directly into them. To reveal the holes, I no longer drop the floors with a script as the bombs fall. The holes are there when the map starts, but I cover them with a solid 3D floor. When the bombs drop, the 3D floor is lowered to below the floor to reveal the hole.


It actually works quite well, and the holes actually look better, but it's a lot easier for the player to traverse the bombed area now. Maybe that's not a bad thing. :shrug:

Return to “Mapping”