Jump to content
Sign in to follow this  
  • entries
    235
  • comments
    509
  • views
    172534

When One Door Closes...

Sign in to follow this  
SimmerD

62 views

Tonight I got the doors operating in the game. It still needs some cleanup, but they basically work. A door right now can be any shapes or entity, but mainly I expect to use AABBs as the bounding shapes for mostly rectangular doors. But, you could set up a statue or boulder as a 'door' and the engine would know how to slide it to the side to let characters pass.

Interface-wise, right now, when the player presses the space bar, any door within 1 meter of his bounding box in any direction is opened if its closed, and vice-versa. Later on, we will add keys and other conditions so you can't just get through any door.

It seems very simple, but it is very cool to watch the lighting & shadowing change when the door opens or closes. Physically, the doors are set to be 'kinematic' objects, in that they can push other things out of the way, but they don't receive any forces or impulses. This way they can't be blocked by objects in the way. If there is a barrel or boulder in the path of a closing door, it usually will naturally get pushed out of the way by the motion of the door. I have exaggerated the door's mass to magnify this effect, but it still occasionally happens that an object is between a flat area of the door and a flat area of the wall, such that it doesn't get pushed out of the way in time, and sort of becomes embedded in the door.

I might be able to detect this case and stop the door, or cause it to bounce back and open again, but there is the convenience factor of the doors just consistently working. Definitely a gameplay vs visual consistency issue. I am also considering detecting closing doors as a special case, and giving objects that interact with them an extra push normal to the closing direction.

Right now, I have implemented just left->right doors, but the other combinations won't be long in coming, so right->left and up->down, and n/s doors should be along shortly.

AI-wise, since I don't expect opening & closing doors to be an extremely frequent scenario, when a door finishes opening or closing, I will cancel the paths of all enemy characters to they can re-path, and then either break or re-create the navigation links that the door blocks.



Sign in to follow this  


3 Comments


Recommended Comments

Wouldn't it be a fairly neat gameplay mechanism to be able to block doors with objects? Presumably some doors are slower than others to open - such that you could, if you knew you were gonna leave in a hurry, block it open so that you didn't have to waste time waiting around?

Maybe it's just the brief description of your AI... but it sounds like you're not going to let them open/close doors? or did I read that wrong?

As for the moving doors... you gonna have any animated transitions at all? I could see some good uses for ancient doors/crypts/tombs having magic-like transitions from opening/closing [smile]

Keep up the good work!
Jack

Share this comment


Link to comment
"Wouldn't it be a fairly neat gameplay mechanism to be able to block doors with objects? Presumably some doors are slower than others to open - such that you could, if you knew you were gonna leave in a hurry, block it open so that you didn't have to waste time waiting around?"

Well, doors open pretty fast, so waiting doesn't seem like a big deal.

We have discussed blocking doors with objects. Some problems with it include :

What if an object inadvertently blocks a door such that your character can't get through? What about the AI? Will it be able to figure out how to get through your barricade?

"Maybe it's just the brief description of your AI... but it sounds like you're not going to let them open/close doors? or did I read that wrong?"

I think the answer will be that any humanoid type creature will be able to open or close a door. I don't forsee the AI closing doors, though. If the door is locked, they'll have to have the right key.

"As for the moving doors... you gonna have any animated transitions at all? I could see some good uses for ancient doors/crypts/tombs having magic-like transitions from opening/closing"

Not sure what you mean by transitions. Do you mean like alpha blended particle effects, etc? If so, I definitely want to have dust, etc. There won't be too much magic in the first episode, so we probably won't have other effects on the doors.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!