July 2, 2013

Progress Update 2

In this post, the lighting engine, items and the smart phone.

LIGHTING ENGINE

So it is basically done. I don't think there are any bugs in it, any that were obvious are already fixed and I tested it extensively.

Here's how it works:
Most of the effect is achieved with a subtract color blending. First, draw the whole scene normally. Second, change the draw target to a white surface. Subtract ambient light (Example: If ambient light is blue, surface is red). Subtract any light that is in there (After drawing the shadow casters on the lights themselves). Subtract the whole result from the scene. That gives you the following:

Car with headlights and two shadow casters

 Same car, brake lights on (They will get new graphics too)

The first screenshot has 5 lights and 3 shadow casters, the second screenshot has 7 lights.

Now since GM:Studio doesn't compile the code yet, all these loops are pretty slow. The FPS drops to about 45 with the car's headlights that casts both static and dynamic shadows, and that's only with 3 shadow casters.

On a bright note though, this is also with the car physics and everything else going on in the background.

Bonus: I paid special attention to make the engine easy to use and intuitive, so I will most likely release the it for everyone to use in their projects, free of charge. Stay tuned.

ITEMS

Laying the ground work for the items at the moment, got most basic items types worked out: Crafting materials, light sources, batteries and ammunition. Left to do are consumables, weapons and weapon attachements (For firearms).

The item system will be volume and weight based. Volume will dictate how much stuff you can carry around (Or put in the car trunk) and weight will affect car physics and your energy requirements to move around.

SMART PHONE

It requires power. You start the game with a rechargeable battery in the phone, but I'm guessing it's going to be quite hard to find a reliable power source to charge it back, so to help the gameplay, every battery will fit in any device that requires power. Once your smart phone runs out of battery (And let me tell you, that light it has drains it quite fast) just remove it (Keep it in your inventory because it's rechargeable!) and put another one in that has charge.

Now this will have some good uses in the game. You will find the minimap (Something not unlike Google Maps), it has a light (View screenshot below), most likely other features as I think of them. Maybe I should've put more thought into this. I'm sure more will come.

A bonus feature about the smart phone, if time allows it, is to have an API so that anyone can make apps for it, and then share them through an in-game global server accessed through the phone itself.

Smart phone light

No comments:

Post a Comment