Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
However . . . what about the situations where spawning another enemy could negatively affect the framerate? That's where the exhaust animation comes in. Instead of spawning a new enemy, the existing shield fighters will fire up their engines and accelerate towards the player. It's easier to make an existing enemy "harder" than to draw a new enemy on the screen.

Interesting, how do you determine that?  Do you just have a hard limit on the number of concurrently spawned enemies?

There's a counter variable that I use to keep track of how many times the main game loop iterates in one second. Usually it's well over 60 fps. But large graphics -- planets and capital ships -- are what really cause performance to take a hit.

To fix this, I will have some code along these lines:


IF fps > 60 THEN

    SpawnNextEnemy

ELSE

   IncreaseAttributeOfExistingEnemy    (make enemy go faster, etc)      

END IF


But like you mentioned, I have also experimented with hard limits on enemies:

IF NumberOfActiveCapitalShips > 2 THEN

     IncreaseAttributeOfExistingEnemy

ELSE

SpawnAnotherCapitalShip

END IF


Both ways get the job done and they can even be combined.

Interesting, I don't know if I have seen that approach before.  Theoretically then, faster hardware will tend to produce a different experience than slower hardware, because it will usually favor adding more ships over upgrading existing ones?  Have you done much comparison of older vs. newer hardware?

I haven’t done any hardware testing yet, but you make a good point. Ideally, the experience should be about the same regardless of what hardware one has. 

You could always split the difference.  Maybe if fps>60, alternate or randomly choose between a new ship and an accelerated one, instead of always spawning a new one.  That would close the potential gap a bit, and would also mix it up a bit more when performance isn't an issue.