I’m creating a Scrolling Shooter/Shmup RPG that will be using a lot of unique enemies. I currently have an Event Director scripted that controls the spawning of enemies and objects. To speed things up in the long run, I was thinking about scripting a system that will use AddComponent to create unique enemies at run-time. I’d be adding various Movement and Combat scripts to a single prefab, which all enemies would derive from. In the long run, this would make creating new enemies an extremely fast process.
Now, before I decide to code the system… I’m wondering how much of an impact on performance this might make, as compared to making a ton of predefined enemies.
Example:
- Instantiate enemy prefab
- Modify common enemy values
- Add move script (Various curves, linear paths, and staged events)
- Modify values
- Add combat script (Various bullet patterns)
- Modify values