Thursday, November 10, 2011

Week 3 - Game start

This is week 3 and we have officially started production on the game.  My task for this week is to work on the lighting aspect of the stealth system, or make sure that the character is easier to detect if he's standing in brighter light.  I've been struggling with this and it's been somewhat frustrating.  But I think I have a very nice way of doing things, that takes care of multiple facets.  I had started with trying to replicate what other people had done, namely they all had their code trying to trace between the pawn and the light to see if they were being hit.  I wasn't able to get this to work at all.  What I decided on makes is to utilize spotlights and their inner/outer cone properties.  Now, all of this is theoretical at this point as I haven't been able to code it in or find the variables to work with it in unrealscript, but the idea is there.  Using this, I can make the outer cone at 50 degrees and the inner cone at 10.  The character will then have 4 levels of light detection, 1 being not noticeable and 4 being anything can see you.  I will make it so the code performs a check between the light, the character, and the ground below it to get an angle.  This is compared to the angle of the cone.  If he is greater then the outer cone, he's outside the light and at 1.  If he's in the outer half of the cone, or 30-50, then the character is at 2 detection. In the 10-30 range he's at 3 detection and standing in the heart of the spotlight, anything under 10, will result in being a level 4.

I haven't started coding yet because I'm still trying to learn the last bit to make sure I know how to do everything, but this method should garner the desired result.  From this base, It's a matter of working it into the AI that if the player's detection variable is set to 1-4, then the AI will detect him sooner or later.  It also means stealth will almost always reduce your detection variable by at least 1 level.

That said, we still have no issues in group.  Things are going smoothly from what I've heard in everyone else s portion.  Everything from last week was done and turned in when it was needed.  This week, I can see my section bleeding over to next week, but aside from that things are looking up.

That's all for this week.  Next week should be the finishing of the stealth elements and possibly the implementation of our first weapon or two.

No comments:

Post a Comment