More happenings

Little stuff added/changed/etc –

I finally fixed the “attack pattern” that ships with primary missile weapons do, they now circle their opponents (a re-use of the “patrol object” AI) and fire missiles, instead of standing still. Giving them a bit more mobility on the battle field, and overall making the battle more interseting and dynamic. Since this is pretty cool I might re-balance some ships – for example the Intrepid frigate has missile launchers as secondary weapons, I might make these primary, or maybe I’ll just tweak the Intrepid’s AI to use this attack pattern in combat… yeah that sounds better… I’ll make this moddable too :)

I tweaked the way that turrets decide when to fire at their targets. The way a turret decides if it will fire depends on whether it has a good chance of hitting its target, the way this is decided by the turret is by calculating the needed rotations (in radians/degrees) the turret needs to turn to face its target. The position that the turret tries to turn to is the object position (for example an enemy ship). But because the object is much bigger than a single point in space – often turrets wouldn’t fire when they actually could hit their targets (this is especially true the larger the ship is). To fix this I added a bit of code to do a ray test (imagine drawing a straight line from the turret and seeing what the line hits) – if the ray test results in a positive hit of the targeted object, the turret will fire. This is a simple thing, but because it fits into the “oh my god its so bad” category – if it wasn’t done, that I’m happy to have finally done this. I attempted this before, but it didn’t work because my orientation of the turret math was wrong – making the ray test always fail, I fixed this math when I put in turret and command modes (specifically for the cross hair markers for turrets) so I put the math in use here as well – love it when this happens :)

Not sure if this fits into the “small” category (it will depend on how much I get into this feature) – but late last night and today I spent adding in a rudimentary radar system. So that we are on the same page – I’m talking about a heads up display that shows you nearby objects (right now just ships) in a semi – 360 degree view. Kind of like a mini map – but 3d. Right now it is full of bad programmer art, but the basics are in. It is another one of those – “it should be added because this is a space sim” type situations. I hope that down the line when the HUD/GUI gets a make over that this will be a very cool looking feature. I played a few instant action games with it and it is a good addition.