Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

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.