How to make a model based enemy not poke through walls?

Sprites, textures, sounds, code, and other resources belong here. Share and share-alike!
Forum rules
Before posting your Resource, please make sure you can answer YES to any of the following questions:
  • Is the resource ENTIRELY my own work?
  • If no to the previous one, do I have permission from the original author?
  • If no to the previous one, did I put a reasonable amount of work into the resource myself, such that the changes are noticeably different from the source that I could take credit for them?
If you answered no to all three, maybe you should consider taking your stuff somewhere other than the Resources forum.

Consult the Resource/Request Posting Guidelines for more information.

Please don't put requests here! They have their own forum --> here. Thank you!
Post Reply
User avatar
Enjay
 
 
Posts: 27140
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

How to make a model based enemy not poke through walls?

Post by Enjay »

OK, so I have a model that I want to use on an enemy. The model is longer than it is wide. However, things in Doom are square (viewed from above). This means that I can either have the model longer than the underlying actor, narrower than the underlying actor or a compromise combination of both. I've gone for the last option and it works pretty well most of the time. However, it comes a bit unstuck when the enemy is behind a grate or bars or something. If the monster moves close to the bars, the front end pokes through the bars.

Here is basically what I have (plan view):

Image

The green square is the underlying Doom actor, the red lines are the edges of the model and the dashed line is some midbars or something.

I want to be able to use this as a plug-in mod that can work with any level so I don't want the underlying actor to be any wider than it is ATM (meaning that I can't make it longer either). If I scale the model so that it is shorter it looks ridiculous and if I scale the whole thing down evenly it loses all its presence. To complicate matters further, it needs to be able to shoot fireballs out of the front so an actor constantly being spawned in front of the monster might be problematic (but there are ways around that).

So, I'm just looking for suggestions as to how I might stop this thing poking its nose through walls.

Any ideas :?:
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: How to make a model based enemy not poke through walls?

Post by Nash »

There's no easy way around this. Some commercial games solve this via an active collision routine that constantly checks to make sure the actor won't poke through level geometry by pushing them away...
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US
Contact:

Re: How to make a model based enemy not poke through walls?

Post by LilWhiteMouse »

Have you considered moving the model back? It's ass end will clip walls worse, but might be the lesser of two evils?
[EDIT] And in my experience, I've noticed that monsters rarely turn their back to a wall, unless to face the player in which case you wouldn't see it anyway.
[EDIT2] This is what I did with the AT-ATs in Chibi Rebellion, to get around the perspective rendering issues.
User avatar
Enjay
 
 
Posts: 27140
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: How to make a model based enemy not poke through walls?

Post by Enjay »

I have tried pushing the model back. However, I already found a few places where the monster would frequently poke its back through the wall (eg if the monster is in a fairly small alcove with midbars on the open edge, the monster turns around a lot and its back end pokes through - the alcove is big enough to accommodate the whole length though).
Post Reply

Return to “Resources”