Monday, November 16, 2009

shadows


So, I've fiddled around with a few of my algorithms, and I've now got properly functioning light sources that cast shadows and are dynamically updated when things move through them. Here is an image of two agents on opposite sides of a bright light. You can see the shadows that they each cast.

LOS & lights


So, I've done a bit more work with LOS and lightsources. Here is a screen shot of everything in action as it currently is. Agent's lights follow them around, but the other lights are static for the time being. The gray shape is the ship, the darkness at the bottom is a spot that can't be seen by either agent yet. It appears that my LOS algorithm is rather permissive, or whatever.

Sunday, November 1, 2009

Shared vision, memory

There. I've implemented shared vision and agent memory, both of which are things that can be turned on and off (for whatever reason). I've also been slowly de-cluttering code that I haven't touched in a while. As of right now, the only two things that determine if an agent can see a tile are the following two things.
1) is there sufficient light
2) is it within whatever the agent's sight distance limit is.

I'll actually utilize LOS for vision as soon as I can design a proper ray-casting algorithm that makes sense and can be used for other stuff, such as lights and such.

I'm trying to decide on a way to standardize the color scheme of things. As it is now, some characters can be impossible to see if the level of light (which affects the darkness of the background colors) makes the background color too close to the foreground color.

The shared vision is a simple boolean matrix, as is the individual agent's vision matrix. Currently, the memory matrix is also a boolean one, which allows the agent to see the current happenings of an index, even if it's changed since it was last seen. I'll eventually change this, but it's not a worry right now. I'll also need to start keeping track of units and equipment and other agents that the selected agent can see, for use in targeting, etc.

So, this is where I am now.