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

A Zillion Fixes

Sign in to follow this  


We are gearing up for a private beta demo in 3 weeks, including the first couple of levels of the game, along with the cloning functionality, and the power-up system.

Yesterday I got the first digsite level working, besides the initial intro section. The digsite level was initially completely indoors, but I wanted to make it a bit more varied, so I added two outdoor areas as well.

The final outdoor area is the hangar where you find the spaceship, and the hanger doors open above you, so I wanted shadows cast from the doors. That called for adding a light to the level, so at first I added a directional light.

That caused problems in the indoor areas of the level, where door entities that go through walls when opening are visible to the light, because they both lie 'outside' of the level, and the indoor areas of the level don't have a skin around them.

So, instead, I added the capability of restricting lights to a box, like a cell, room or trigger box. When lighting the level, the box will be used to cut off lighting influence earlier than it really would. This way interior areas of the level wouldn't be screwed up, as long as they stay out of the light's box. I changed the light from a single directional light, to a point light in each area, and restricted each light to the nearest cell.

Shadowing for the main character still didn't work right, however, so I had to add some flags to the lights, which required adding a version field to the lights so I wouldn't break existing levels. My new requirement is that every serialized object has a version field in it, so I can add things without breaking levels, which is rare, but still happens. I should probably add a dword flags field to each object as well to keep per-object boolean flags that come up more and more over time.

The issue with the shadowing was due to an optimization. For each light, I generate an index list and bounding box info for each world chunk that is partly lit by the light. This actually looks at the lightmap texels to include only tris that are actually getting some light, so backfaces from the light's POV aren't included.

This reduces fill & draw calls when rendering dynamic shadows on entities like the player, doors, bridges, etc, but has the problem that interior walls ( like a hallway ) without anything between them and the light won't cast shadows.

So, I added an option to the lights to mark them as casting backface shadows, in which case I draw all faces between the light and the shadow caster, without looking at the per-light info structure. Now, the shadowing on entities works in those cases.

Last week I added the cloning station & menu to the ship level, and numerous other fixes here and there to the editor and the game.

Today I am putting in the power-up effects, and might have some interesting screenshots coming up from those...
Sign in to follow this  


Recommended Comments

There are no comments to display.

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, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!