Turret system
Hey folks!
Recently I've started working on a turret system for my sub. So far it's coming out nicely and I'm quite happy with results. The main goals were to have a basic but still decent state machine for turret + handle all aiming via rotating the bones of the model. The last part was quite tricky, since acknex doesn't provide a good library for handling angular calculations. So far it seems to be working!
As for the state machine, it's quite simple. It contains only 4 states: PATROL, AIM, SHOOT, RELOAD. In PATROL state, turret each 0.25 second checks if target is within the shooting range + if it's visible. If target is visible, it switches to AIM state, where it tracks position of the target for a several seconds, while shooting is fully charged. If while doing so, turret losts the target, it still shoots the rocket into last known position of the target, so AIM state switches to SHOOT where rocket entity is actually is going to be created. After creating the rocket, state machine switches to RELOAD state, where turret sits for a couple of seconds before switching to either PATROL (if target is out of the range or not visible) or to AIM state (if target is visible) and the cycle continues.
So far this very basic state machine provides decent results. Next I'm planning to work on some visual effects, such as rocket's smoke trail, explosion and muzzle flash on the turret's gun.
Best regards!
gamedev
gamestudio
litec
devlog
developer struggles
acknex 8
programming
conitec
turret
bone rotation