In a shooter game (real time) one wants to have several different types of projectiles the enemy robots and player can fire.
An easy way to do this is to just have several different set types of guns that fire several different set types of projectiles with the correct velocity, damage, blast radius and other special effects. No problem doing that. Player or enemy wants to fire, just check the direction they are facing and create the projectile that corresponds to the gun they are wielding. Then when the projectile hits, go ahead and apply the correct effects (hp loss, knockback, etc...)
It gets more difficult when you don't have projectile types. When you want the player to be able to customize their gun in between levels. To mod their gun as they see fit. Add silencer, more velocity, higher rate of fire, etc...and I also want to create various weapons for the robots on a procedural basis. Think Long Range Exploding Pulse Stun Cannon w/Silencer.
When the shooter fires, I can easily pass the correct data with a standard function FIRE (facing, velocity, damage, specialFX1, specialFX2...). No problem.
The issue is getting that data transferred to the target upon colliding with the projectile. I can check every cycle for a collision, then check for the exact instance of the projectile object, and then transfer that data over, but that seems overly complex and processor intensive.
Then there is the secondary question about weather or not having procedurally created weapons on the enemy robots can in any way lead to interesting game play. Will it just seem haphazard and confusing? It will likely lead to weapons that don't make sense, though careful management of the RNG can alleviate that somewhat. I don't know of a game that does it well. I was planning to go the Random Realms route and describe the new enemy robot in between levels, so the player has a heads up.
Any thoughts on either the programming of this or the design choice?