Rewritten weapon handling code

A project log for LZRTag - Flexible DIY Lasertag

An easy to build, program, modify and use AVR and ESP based Lasertag system for everyone!

XasinXasin 01/26/2021 at 14:340 Comments

Well, looks like we had a bit more free time on our hands than expected, and way more fun with the set of audio files we bough from the Unity Store.

Seriously, check this soundpack out, it is gorgeous <3

Either way, the weapon handling code we had been using up until now simply wasn't flexible enough to incorporate some of the other weapon behaviours. We had been using a fairly hard-coded state-machine that wouldn't be able to do anything but regular gunshots, so no energy weapons, charging up or machine-gun style spinning up.

What to do about that... Oh yes, rewrite the whole thing from scratch!

Well, after having gotten some extra motivation and free time after finishing up some university homework, we are now officially done, and just look at her beauty! ((It's being tested on #The WuffCorder since it has a far better speaker and I had the code ready) :>))

The new code is also fairly independent of the rest of the Lasertag codebase, meaning that it should be easy enough to pull out and reuse in other projects if any one of you so desires ^^

There's still some awkwardness to fix up, such as the ESP barely being able to keep up with this amount of OPUS Audio Decoding. If we want the real deal to not glitch out we might have to make use of both cores in parallel for decoding, that means fun multi-core synchronizing... Plus the memory requirements are huge, so the next version will have to see a WROOM Module, probably with an ESP-S3 too so we can make use of the vector instructions...

Whew, this is getting me pretty excited already <3