Sunday, July 12, 2009

LOS and Memory


So, I've got properly working LOS and a rudimentary implementation of memory. My LOS uses variable fields of vision, which adjust depending on what species you are and what you're doing. (if your unit is set to sprint, you'll get tunnel vision, if you're standing motionless, you've got the whole round to look around so you'll get an FOV bonus. In the image I've provided, the unit is facing south, after first facing east. You can see the void that the '%' creates in the 'X' unit's vision. The unit's memory is separate from the other unit's memory, but I'm going to impliment a static variable that they can all share, such that assuming they aren't radio-silent, they'll be able to know what the other units are seeing. (radiosilence would likely improve one's stealth ability/ make them quieter, but cut them off from their other comrades... but that is something to do in the future)

I'm really thinking that I need to swap my output methods soon, as i'm in desparate need for color/variation in darkness. You wouldn't know, but I'm currently differentiation between what the unit sees 'now' and what they 'remember', which would be done justice if I could render the current vision brighter, as is commonly done with roguelikes. One thing that might be problematic, though it's the same as I remember from X-Com, is that if something changes to the map (IE, a door opens/closes) in a portion where the unit visited but can no longer see, this change will show up in their memory... which doesn't seem altogether fair.

2 comments:

droid factorial said...

Map: Yes, I remember that glitch. Usually I would notice the doors opening/closing as I was searching for the last cowardly sectoid that had hidden in a building I had already passed.

So the tedious endgame was shortened by flaws in concealment of information - two flaws annihilate each other. You don't have to fix every defect (but still structure your code so that you can fix it if you need to).

Radio silence: Yeah, I think there is some potential here. "Jones, take 4 men with sniper rifles, flank left and provide cover fire."

This would help them get avoid detection and would give them something useful to do without requiring orders. Jones would be able to lead, I mean all soldiers know those funky hand signals and X-Com has access to technologies that allow radio communication without interfering with a soldiers hearing or stealth.

Radio silence modeled this way would have two costs: removal of units from player control and removal of their FOV from the group FOV, in return for the benefit of increased stealth and autonomous action. This of course depends on writing an AI that interacts well with player controlled units, and can predict what situations would warrant breaking silence.

If you use the classic turn structure, then ordering silence to units would give them one turn after player's where they would use any remaining TU's to get into position (if they wanted to). After that they would take their turn before the player's so that the player, if they see them, will know what position they will take, and the silent units would be able to take shots on the players turn. (They can still see other soldier's LOS, they just don't transmit their own).

Unrelated: Yesterday I was talking with a friend about how terrible the latest transformers movie was. I tried to convince him that an X-Com movie would be awesome. He tried to convince me that it would never happen.

abagoforanges said...

Well, to 'fix' the problem with being able to see those doors open/close, I'd have to change the agent's memory from a boolean array of (see this) to an array that actually stored whatever it physically saw there. I don't think it would be difficult... actually, I could likely do it right now.

But, I plan to have detailed sounds/sights... so you wouldn't be able to see a door open/close in some far away building, but if an agent heard a suspicious sound, it would show up on the map in the area it likely originated from.

With radio silence, I don't plan (at least not yet) for the user to only be able to control one unit... but it will basically cut them off from one another... no shared vision, no sending one guy way ahead, spotting an alien, and then having some guy MC it. (at least, not with radio-silence)

Though, you bring up having some of the friendly agents be controlled by the computer. I'll keep that in mind for an option of play down the road... would be a little closer to a typical rogue-like... not that I'm TOO worried about this.

The first novel I ever started to write was largely influenced by X-COM... Not that it was any good. I would watch an X-Com movie :-)