Hi!
So as the title suggest I'm currently working on updating a RTS-style game (Its not pure RTS, but there's lots of mechanics from it). Actually, I'm in the process of overhauling the Tech Tree / upgrade system. However, I found out that the old system we use at the moment is hard-coded for everything. This means that if I want to increase damages for towers for example, I have to check if the player has a specific tech and then changes the values as I see fit.
Something like
if(hasTechnology(TechEnum.ARTILLERY) {
damages += ARTILLERY_BONUS_DAMAGES;
}
There are some technologies that simply add modifiers but some also change the behaviors of units/structures. (Like unlocking the siege tank ability in StarCraft 2). So my question is how would you implement a system like this without having to hardcode techs/upgrades in the code? My initial idea was to create multiple Interfaces that I'd implement on the various Structures/Units and the techs would simply interact with these interfaces. My implementation didn't work too well since I ended up with a ton of interfaces and most of them were simply used for one specific line of code.
Thanks for your time :)
Tyggerr