Debugging bullets?
I have a game with some ships, and some AI... they shoot at each other.
I had a problem with the game crashing, so I started removing actors from the scene to try and narrow it down.
I am now bare bones, just controls and the player on a black screen.
I am about 70% less ram (40-50mb range now) and the crash still occurs.
Firing the bullets (which is spawning an actor) makes the game crash faster.
In this slimmed down version, it is much more difficult to get the game to crash, however...
I guess this is a 2 part question.
1: does anyone have any experience with bullets? Even after turning off all rules and deleting all the actors, firing the bullets still seem to make the game crash. (not quickly, but this problem quickly compounds itself with 6-10 AI firing as well)
2: Anyone figured out a clever alternative to spawning for something like bullets?
Total MB used seems to fluctuate upwards the longer the game is played. Its much worse in the full version.
In the slimmed down version, I see "game engine" slowly but steadily tick .1 up. after about 10MB worth, suddenly it drops about 10MB but at that time the "Other" seems to jump up about 10MB.
I have used the game salad debugger, instruments to monitor resources, and console and can't seem to get any information of any use except that the type of error is a SIGSEGV
I had a problem with the game crashing, so I started removing actors from the scene to try and narrow it down.
I am now bare bones, just controls and the player on a black screen.
I am about 70% less ram (40-50mb range now) and the crash still occurs.
Firing the bullets (which is spawning an actor) makes the game crash faster.
In this slimmed down version, it is much more difficult to get the game to crash, however...
I guess this is a 2 part question.
1: does anyone have any experience with bullets? Even after turning off all rules and deleting all the actors, firing the bullets still seem to make the game crash. (not quickly, but this problem quickly compounds itself with 6-10 AI firing as well)
2: Anyone figured out a clever alternative to spawning for something like bullets?
Total MB used seems to fluctuate upwards the longer the game is played. Its much worse in the full version.
In the slimmed down version, I see "game engine" slowly but steadily tick .1 up. after about 10MB worth, suddenly it drops about 10MB but at that time the "Other" seems to jump up about 10MB.
I have used the game salad debugger, instruments to monitor resources, and console and can't seem to get any information of any use except that the type of error is a SIGSEGV
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
One when self.time = 3
And another rule to destroy if they leave the playable area.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I was worried you were gonna say recycle is better and my head would explode.
My bullets did contain rules to pass damage from actor to actor, and Move.
then I made duplicate bullets, like AI1Bullet, AI2Bullet but made them identical otherwise. Removed everything from the Bullet except the 2 destroy conditions.
Now when an AI or the Player runs collides with AI1Bullet it takes damage = game.AI1BulletDmg (game attribute declared by AI1).
Long story short, bullets are almost empty now, it helped performance but the crash persists.
Edit:
You said you hadn't created a game with a lot of bullets before. I don't know if this is a lot of bullets either. I added counters on spawn and destroy at one point and in during combat with multiple ships, there are roughly 80 bullets "alive" at a time.
Heres a short Video.
In GSC my framerate is always 60fps+
on the iPad, it stays above 50 for the most part.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
after 9 hours of converting actors and bullets, testing and retesting and adding a few other tweaks I came to realize that recycling doesn't seem to help at all.
(I started with just player and player bullets, didn't see a difference so I made changes to the AI as well). I also removed all spawning and timers for a test, didn't help.
So with Recycled Bullets, No Timers, No Spawning and everything removed from the scene except the player character, the bullets and a button... it took 8 hours of constantly firing bullets, but it crashed. (8 hours would be fine, but its essentially an empty scene, and like I said before when I add more, the problem quickly compounds itself.)
I built this game on the cross-platform controller template by GS.
The bullets are the same.
And my game is crashing frequently, even though it's running smoothly.
I'm also spawning and destroying my bullets (which I plan to make a recycling system later).
I currently have no idea what's causing the crash. It happens sometimes even after 5 or 10 seconds when I'm just running along without much going on in the game.
It's happening on multiple levels.
I seem to have been experiencing these problems especially since upgrading to Game Salad 0.10.0, but I'm not really sure if that's relevant to the problem.
Is there a way to identify what is causing a crash?
I'm going to look into using the Debugger, and hope I can get it to tell me something...
http://gamesalad.com/blog/question-of-the-week-using-the-debugger
If the scene is too large, then maybe the calculations just break the system, for some reason?
Did you end up solving your problem, @3itg?
So can one assume that means it's memory related?
Does the game process everything in exactly the same way when running on iPad 2 (crashing) and the Macbook Pro (running fine)?
Should I assume it's something to do with system resources, and not game logic?
I had a big level about 130 actors that all had a reasonable number of behaviours.
Each one checks to see if it's within about 500 pixels of the player, and only does it's behaviours if it is.
But it would always crash on iPad 2, and iPod Touch 4, after moving around the level a bit.
So I've cut it back to a limit I've set for myself, of about 70 actors. Hopefully that'll see me through reliably.
(How many actors do you have in your scene, @3itg?)
How would you then send that information out to each actor to know whether it's "on" or "off"?