Thursday 28 March 2013

Transitional Forms

Perfect - managed to finally get a handle on all that "pop" going from one control handler/animation set to the next.

There's still some cleanup for sure, but I had a real issue when you performed a hop up onto platform, window climb through, etc... and those are all fluid now, even switching between unarmed and armed looks great.

It all came down to how i was using LookAt and the weights being applied.  Before it was either 0f or 1f - off or on, and that created situations where after a hopup you'd see the character "snap" into another pose.

Now I'm using transitional blending/weighting, so when I go from the DefaultHandler -> HopUpHandler for instance, i'm lerping back to 0 or 1 as needed.  This creates a much smoother experience and i'm finally feeling like theres some light at the end of the animation tunnel.

So, its not perfect however, there is still a bit of slop with vaulting I'll have to look into and climbing ladders is busted atm, those are my priorities atm.

After that, back to weapon bloom/clipping issues and overall combat "feel".

The crouching animations need help, badly - so that's going to be the focus for my animator here is to redo these animations so they look right and movement is more fluid/looks better.

I'll need to stop being picky soon though, it's almost time to start considering how i'll be handling wearing armour in the game.  Or perhaps some combat enhancements like zooming and moving right mouse button to zoom toggle instead of melee alt attack.  Perhaps I'll use 'F' for melee attack (as a default of course).

I'd like to package up the TPC so I'm able to import it into my project.

One thing that's really an impediment right now is my environment.  Without a 3d modeller on hand here it's getting very difficult to do more advanced testing in a potential "game environment" as opposed to my happy little playground.

There are a few other bugs to work out though, my grounding code works but the detection of being grounded while walking off a ledge is annoying - you can get multiple fall/land events if you hit the edge just right.  I believe this issue comes from not giving a time buffer or some means of delaying falling a bit more so that the edge detection is not such an issue... perhaps an "hop forward" animation might seal the deal, but then what if the user is just trying to edge up to look over the roof edge and it fires :).

Another bug, which imo is more unity physics related, is the problem of capsule colliders vs an overhanging collider.  So if you have something about eye height, and you run into it, the capsule collider gets pushed "downwards" into the ground.  Do this aggressively enough, and you'll find yourself stuck or falling through the ground.

Ugh.

That will be interesting to deal with, it has to do with rigidbody interactions i'm sure, but for now i'm focused on gameplay elements so it'll have to wait.

Monday 25 March 2013

New Beginnings!

Alright, so Unity3D 4.1.1 changes incorporated into my project - check!  Lots of smoothing to do, from what I can tell it's going to take some tweaking of specific transitional cases in the animation state machine, right now i'm not too worried about the aesthetics so much as getting everything working together well enough to "play".

I think the TPC is there now, definitely a lot of tweaking to do STILL, but at this point it's close enough for me to move forward with the game proper I believe.  I'll probably bounce back to smoothing and fixing animation stuff for some time yet, but wtf - looking solid and the framework for the TPC is really good, should go the distance with some refactoring as things progress.

So for the next phase, I'm going to focus back on weapons again - a few things i'd like to fix:

1. Shooting originates with the camera, which is ok for me, but it needs to start the raycasts forward more so that if you have the camera behind a wall and shoot it shoots "from the player" instead of from the camera.

Now, I've been down this path before, and you'd think the "easy" approach here is just to raycast from the weapons muzzle ... maybe i'll try that again, but the issue with it is that it really throws the player off in terms of expected hit locations, especially shooting around obstacles.  The other issue is preventing the player from shooting through walls by clipping their gun through them.  The latter is not a huge issue, i'll originate the ray from the players center of collider.

Will have to playtest and figure out what works best, atm i am partial to the idea of raycasting from camera center but moving the ray forward to be inline with player as starting pt .... not sure yet.

2.Bloom - right now it uses that animation curve i spoke of earlier.  So the problem I have is say the first 50% of the curve is flat, no bloom, then it starts to bloom right?  When the player stops shooting it starts to recover, but once it hits the tail end of that 50% it "looks" normal again, when they shoot it goes back up and blooms all over without resetting.  I'd like to incorporate some kind of "stabilization time" where it will just jump back to 0% so the player does not need to wait a while at a seemingly "stable" point to shoot reliably wrt bloom.

Friday 22 March 2013

Back On Track

Alright, so my logger is functionally complete with documentation - just awaiting final graphics to submit it to the asset store and see how that flies!

Back to the game, after work here - tonight will involve looking into some pickup/drop animations to make grabbing items in game a bit more fluid.  I still have some issues regarding strafing left/right then letting go of movement while disarming a weapon (you walk forward a bit).  It makes sense in the animation tree, by problem is in figuring out a means of resolving the problem, may need some flag or to ensure the hSpeed/vSpeed lerp much faster so we transition into an Idle state sooner.

Planning on posting an updated webplayer sometime this week and back on to ironing out animation blips and blops!

Thursday 14 March 2013

Directional Synchrocity

So, I downloaded Unity 4.1 today and WOW what a difference.  Noticed a few things, first was that they improved the console somewhat so you can filter out warnings and errors, which makes it the perfect companion for a new asset i'm preparing:

Enhanced Unity Logging:


Looking good! I just need to handle log size overflow, export to CSV, some minor appearance tweaks and a bug with the end of list vs scrolling.  After that i'm going to build for and release as a 3.5+ asset (or try anyhow) .... thinking of offering this as a $15-20 asset, if you have suggestions on that let me know.

Now as for the game, Unity 4.1 brings one HUGE thing to the table, 2D parameters for bloody blend tress!  Excellent!!  This is huge, essentially it takes out all the animation slop and delays I was having AND makes blend trees so much less onerous, especially for lower body blends and directional movement.

Take a look, this is BEFORE:


And this is AFTER:


And YES, they are functionally equivalent!!! Well ok, I forgot to add the PS_Run state back for sprinting, so tack on one simple node for that - but that is all, 5 nodes + 8 transitions vs 14 nodes and ... a boatload of transitions!

Ok, back to finishing up my logger and then back to playtime with the third person controller and reworking some animation bits to get it smoother and cleaner, woot!  Oh and before I forget, combat camera curve view is done, will showcase that as well in a new web player, would appreciate some feedback on that one!

Wednesday 13 March 2013

Tools

Working on packaging up a tool I wrote during Nightfall's development, to help me keep track of what's going on during execution of the game, will do a reveal here in the next week when it's ready for submission to the asset store :)!

Friday 8 March 2013

A View to a Kill

Camera code refactoring is the main focus for the next week here, I'm allotting a good chunk of time to this task, it's one that i've been dreading for a while now - my maths r' broken!  Anyhow, so far I'm making some progress, simplified my existing camera and now i'm working on a nice elliptical rotation for looking up and down - that or some x offset to avoid clipping through or having your character block your view when looking at extreme angles up and down.  Always a blast, will post a new web player when the camera code is complete!

Tuesday 5 March 2013

Trigger Happy

Alright, so still busy on the work front but did sneak in some time last night to get some effects and shooting handled in the game.  Implemented a raycast based firing system, seems most logical to me since it avoids object creation and collision/rigidbody issues.  It's turning out really well actually, there are some aspects that need to be addressed like having "ignored" colliders for instance, so that a window frame (which has a box collider for interaction) is ignored by the raycast.  That's not too difficult, so all good there. The real challenge to making this clean for networking down the road, but for now i'm using a BulletImpactManager and the Crosshairs to manage where bullets go and land, when networking comes into play, i'll refactor into a ShotManager or something which synchronizes with other clients over the network.

A new build is up, 1-6 to select weapon (5 is rifle which shares a holster with 6 shotgun, so it is not available): http://logicwell.com/nightfall/tpc.html

Now for a pic:


Monday 4 March 2013

In My Crosshairs

Works been insane, preparing for a big demo next week - however I found some time to start roughing in my crosshairs/shooting code.  So I want to allow for weapons to lose accuracy as you shoot, have different recovery times and min/max accuracy rates as well as defined accuracy loss, many not just linear.

So here's what things look like in game now:


You can see my crosshairs (epic 5m effort in GIMP lol) - as you shoot they 'bloom' out.  But what surprised me was how to make this happen in unity3d - using an AnimationCurve.  It turned out really well (in my opinion!).  Basically I use the curve and a time index (0 - 1), to determine where on the curve to find the accuracy, 0 being no shots fired/full aim, and 1 being spray and pray mode.

Here is what the weapon script looks like thus far (see below) - you can see how the curve looks for a given weapon, in this case my shotgun is pretty much linear for loss of accuracy, and its degrade rate basically jumps 0.5 on the time scale with each shot (2 shots quickly brings you to worst aim rate for the shotgun).  The recover rate is fairly fast though, so pausing between shots for just a second will keep aim predictable - otherwise get up close and personal :).

What's cool is that I can edit the curves so that weapons have a "dead zone" - for instance the first 3-4 shots of a pistol hardly adjusts its accuracy at all, after that things start to go hairy.  A SMG on the other hand gets 2-3 shots before accuracy starts going haywire.  My plan is to give each weapon a distinct feel in this area, rifles for instance will definitely have really high max accuracy but lose it after 1-3 shots (depending on weapon, upgrades, etc).

And yes, there might just be upgrades - for certain there will be skills to enhance your ability with certain weapon groups .. but i'm considering upgrades.  Not sure on that yet, it may obfuscate the game a bit more than i'd like, will determine that as I get further along here .. perhaps skills to adjust handling and recovery rates, etc... and mods to manage sound, clip length and such.




Friday 1 March 2013

War With Mecanim

I'm not even sure if I'm winning or not lol, lots of work/tweaking done, not a whole lot of game dev time this week due to day job, but did get some animations back from Ryan and finished my epic struggle with mecanim blending, still lots to do there and with look blending, but it's coming along, view the latest build at: http://logicwell.com/nightfall/tpc.html