Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views


Sign in to follow this  



Today I've been working on getting Doors into the engine. The main gameplay purpose of doors is to restrict the player from going to certain parts of a level. It's also a nice reward to be able to get through a door once that initially blocked your character from proceeding.

Doors will work like so : In the editor, each door will have an entry for a key name, and a skeleton key type that will open it, as well as a lockpicking skill level, and a strength rating. The player can get through the door by :

a) Having the right key. A particular key may open more than one door, or no doors at all. You can carry any # of keys.

b) Using a skeleton key of the right type. There won't be a master key for all doors in the game, rather, many doors on
a particular level may open with the same skeleton key type, but take different keys in the normal case. Using a skeleton key may break the key, but chances of this are reduced on lower lock strength doors and with higher lock picking skill.

c) Picking the lock. Picking easy locks is faster if you are better. If you can't pick the lock in 10 seconds, you can't open it. No point trying it again without upping your skills.

d) Forcing the door with strength. Another option is to break the lock itself, requiring great strength. This is another way to open doors, if your character is strong but not agile enough to be good at lock picking.

Inspecting the door will reveal what type of key opens the door, and possibly the lock-picking and strength ratings.

The idea is to restrict players from going through the whole level easily, but never forcing them to be stuck. If a monster
had a certain key to a door, but drowned in the bottom of a pool or fell off a cliff where the player can't follow, we don't want the player being stuck from completing the level, and not knowing why he can't find the key.

The lock picking, door forcing, and skeleton keys are all mechanisms to force your way through a locked door, possibly requiring the player to buy a skeleton key, or to increase his skills before opening it, but never getting him totally stuck.

Today I added axis aligned bounding box collision objects to the collision system, and got them colliding vs spheres & capsules, so right now I can add a door to a level, and successfully block the character with it.

One problem that the doors have, though, is their large size.

Most 'entities' in the game are very small, like the characters, who are 1x2x1 meters in size, wheras a door may be 4x4x1 meters
in size. Right now, entities are lit per-vertex, and the shadowing is done on a global basis for the whole object via CPU ray-casting. This works fine for small characters, but looks wrong for large things like doors.

Note how the door is not receiving shadow on the lower left, nor from the character :

Another problem is since the lighting is per-vertex, you can't have decals on the doors. Even if I did add decals to the doors, I would need to change the code so they would stick to the door if the door moved to open or close.

I don't want to add a completely special category for doors, so instead, I will probably implement optional shadow receiving for
entities. Right now, the entities cast shadows by creating a frustum from their bounding sphere pointing away from the light. For receiving shadows, they would need to use a frustum starting at the light and going towards their bounding sphere. Any objects in this frustum would have their depth rendered to the shadow map. This way the objects could receive shadows from the environment, other entities, and optionally themselves.

This will imply that I add a path for entities to be rendered with the rest of the per-pixel-lit scene as well.

On another note, I just upgraded my DSL service to double the speed, and my bill went down by $13. Gotta love those promotions...
Sign in to follow this  


Recommended Comments

If you character isn't particularly good at lock picking, yet they keep trying (effectively practicing) will their skills increase slightly?

Regarding shadows and large objects... is it not feasible to have a high-tesselation version of the door when it's in view?

Good work on the DSL promotions [grin] They kept doing things like that for us last year. Came home from work one day and the router was claiming we had a 2.2mbit line (instead of a 1mbit). Seemed they just decided to upgrade it for free...


Share this comment

Link to comment
When you create decals, couldn't you have them know about the parent-space of the entity (or parent-frame if you will)? In which case, when the door/entity moves (ie. it's transform moves/rotates etc.) the decals are automagically rendered in the correct location ie. by pre-transforming the decal transform by the parent space transform when rendering?

Share this comment

Link to comment
jollyjeffers :
Yes, there will be tracking of how much you use a skill, but also you will increase via training. One idea we had was to make it so you could increase yourself up to say skill level 1, and then you hit a wall, until you get training for level 2. The training also gives you a slight skill bonus, so say you get skill 1.1. Then you use it to go higher.

I like this logically, but I'm not sure if I like it gameplay-wise.

Yes, this is exactly how I will do it. I do have a concept of parents right now, but I'm not using it for this yet.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!