Shooter with no spawning bullets.
UtopianGames
Member Posts: 5,692
I have been testing a shooting game that doesn't use spawn bullets and destroy bullets.
As most know spawning a lot of bullets really effects performance (even on the iPad) so during my bout of toothache (not had a lot of sleep for a week) i decided to give it a go and i reckon it's very possible to make a fast smooth action packet Shooter with GS.
Darren.
As most know spawning a lot of bullets really effects performance (even on the iPad) so during my bout of toothache (not had a lot of sleep for a week) i decided to give it a go and i reckon it's very possible to make a fast smooth action packet Shooter with GS.
Darren.
Comments
Excited to see more and more workarounds
I'm guessing that each bullet has a numeric identifier and is called back to the blue rectangle's x,y positions and is given its velocity again ONCE the game variable matches it's unique number. Once it hits an enemy it goes off screen, turns invisible, and is stopped so that it can be called by the shooter again. So yeah like TShirt said, they're never destroyed or spawned, always on the screen. Recycling
This is all theory, but its making good sense in my head at the moment x]
I also have the 10 hidden bullets with movable off so it should work with high fps.
Edit...running at 60fps on 2nd gen touch when moving and shooting as fast as i can (it won't run so smooth when you have enemies moving and shooting and BGs scrolling or whatever but fps is good so far:P).
Darren.
I need to add this to my shooter but would like to know how you did the timing after the actor was told to move to start x/y.
Does each bullet have an after 0.1, after 0.2 type of setup?
You are a god send :-)
set game.turretX and game.turretY to actor who wants to shoot the bullet.
set game.counter to value 1 to max bullets (10)
have max-bullets (10)x bullet actors on screen and in each one...
if self.active = true then
do fire move process
else
init the setup of actor so move it off screen and wait.
endif
for each bullet actor duplicated on scene...
if game.counter=1 then self.active = true
As the turret will have a timer like every 0.5, game.counter=game.counter + 1, each bullet actor will get called into action every 0.5 seconds if its self.active = false. it just needs to loop from 1-10 every 0.5.
I have seen some discussion of the perils of spawning actors ... and the fps. Is there a lower limit that you would attempt on a 2nd gen Ipod?
Also if in your opinion what I am attempting to do above by spawning is the wrong route ... any chance you could let me know if this new solution is going to be a part of the platform you are selling or a different deal. Got a feeling I might be wasting my time in the wrong direction.
thanks.
I do think spawning a lot of actors is a bad thing and it looks like this method is better but it's early days atm.
No it wont be part of my platform template pack.
Imo 30 fps for a shooter is pretty good going using GS but im sure with a few tweaks it could rise to 45 fps.
Darren.
Only problem now it seems to crash faster on the ipad than the old spawn/destroy method.
For me, I will have to make a decision on dropping gamesalad for shooters as no matter what I do, it's always unstable on the ipad.
Tomorrow I will add a few enemies to your platform template and leave it running overnight to see how it runs. I will add a few particles to see if there is a leak there.
Gs helpdesk have one of my crap concept games which crashes after 180 seconds. Its been with them a couple of weeks and they have not yet isolated the problem. It's one of those things where I would avoid all the unstable rules if I knew which ones they were. :-(