Spritekit game experiencing significant lag on iPad simulatorSpritekit game lagging even at 60fpsSpriteKit game physics laggingHow to resolve an unwanted collision in a complicated SpriteKit simulation?Swift, spritekit: How to restart GameScene after game over? Stop lagging?Swift: Deallocate GameScene after transition to new scene?Node movement lag in Spritekit, XcodeAdMob Interstitial Ad in SpriteKit GameTroubles with performance issues in SpriteKit platformer gameSpriteKit spawn objects inside view frame across devicesprevent Spritekit nodes with the same Catagorymask from colliding
Efficiently merge lists chronologically without duplicates?
Reading two lines in piano
Did Darth Vader wear the same suit for 20+ years?
Etymology of 'calcit(r)are'?
How can Iron Man's suit withstand this?
Are there cubesats in GEO?
Why is quantum entanglement surprising?
Adding two lambda-functions in C++
Avoiding cliches when writing gods
What's the correct term for a waitress in the Middle Ages?
How is it possible that Gollum speaks Westron?
How to supress loops in a digraph?
What is in `tex.print` or `tex.sprint`?
You've spoiled/damaged the card
How to pass a regex when finding a directory path in bash?
What is the purpose of building foundations?
How do photons get into the eyes?
Pay as you go Or Oyster card
Pronoun introduced before its antecedent
Sharing one invocation list between multiple events on the same object in C#
How would you say “AKA/as in”?
Java guess the number
What's the correct term describing the action of sending a brand-new ship out into its first seafaring trip?
How bad would a partial hash leak be, realistically?
Spritekit game experiencing significant lag on iPad simulator
Spritekit game lagging even at 60fpsSpriteKit game physics laggingHow to resolve an unwanted collision in a complicated SpriteKit simulation?Swift, spritekit: How to restart GameScene after game over? Stop lagging?Swift: Deallocate GameScene after transition to new scene?Node movement lag in Spritekit, XcodeAdMob Interstitial Ad in SpriteKit GameTroubles with performance issues in SpriteKit platformer gameSpriteKit spawn objects inside view frame across devicesprevent Spritekit nodes with the same Catagorymask from colliding
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
Background:
I am a high school computer science teacher and I wanted to come up with an engaging/fun assignment that tests my students' programming knowledge. I have very little experience programming iOS games with SpriteKit, but I thought it would be an interesting way to integrate many of the curriculum concepts in a competitive environment.
The Game:
Each student will play one another in a head-to-head battle where they are expected to program the artificial intelligence of a spaceship that can move and fire missiles towards their enemy. Each player starts with 20 points and every time they get hit by a missile their total decreases by one, until a player hits zero and the game is over. Each player gets only 10 missiles so they must use them wisely. The missiles replenish if they go outside of the view boundaries or they hit the other opponent.
The Problem:
I've done this assignment for several consecutive years with only minor changes each year. However, this year during testing the game drops to around 9fps once the game begins. Obviously this takes away much of the fun of the game and makes debugging painful because of the lag.
Code Structure
Nodes
There are only a couple of SKLabelNodes that are used to display the player name and score.
The spaceships are both nodes and they each contain an array of 10 missiles which are also Nodes. Both the spaceship and missiles have their own individual classes that define their properties and behaviour.
There is also a background image used.
In total, there are only 24 objects that are added to the GameScene and this never changes.
Classes
- Initial View Controller (PlayerPickerViewController) - this allows the user to select who is Player 1 & Player 2. It then chooses the name of the (student) class to use as well as the image for their spaceship.
There is a struct that has a static object for each spaceship so that they can be accessed in different classes. - Game's View Controller (GameViewController) - this takes the GameScene and makes it show up inside this view controller
- Game Scene (GameScene) - handles all of the initial set up for the game including creation of variables and adding nodes to the view.
- Spaceship and Missile classes - these handle the methods and properties that define the behaviour of a spaceship and the missiles (i.e. movement, firing, size, etc.). Students may not modify this code so that they are working all within the same game conditions.
- Student Classes ("their last name".swift) Inside this class, there are two functions that students must program (one for player1 and one for player2). This is where students define the strategy for moving and shooting. Every frame, the appropriate function is called to move the player.
When the players are chosen in the PlayerPickerViewController the game understands which of the student classes needs to be called each frame (based on their name and the name of the class which are named exactly the same).
When I build and test the game on my personal MacBook Pro the game runs as is expected to (without lag). However, each student is working on a Mac with the following specs:
- iMac(21.5 inch, Late 2013)
- Processor 2.9 GHz Intel Core i5
- Memory 8 GB 1600 MHz DDR3
- Graphics NVIDIA GeForce GT 750M 1024 MB
It seems to me that even though the computers are getting a bit older, they should still be able to handle this simplistic of a game with only 20+ nodes.
Would changing the simulator make a difference (i.e. iPad Pro 12.9 inch 3rd generation to a 6th generation iPad)?
I appreciate any help you can give me in order to solve this lag issue.
Thank you.
Here is a link to the game if you are interested in seeing the code and how the classes interact with one another. The GAME
It isn't the most recent edition, but it is extremely similar to what the students are currently using.
ios swift sprite-kit skspritenode
add a comment |
Background:
I am a high school computer science teacher and I wanted to come up with an engaging/fun assignment that tests my students' programming knowledge. I have very little experience programming iOS games with SpriteKit, but I thought it would be an interesting way to integrate many of the curriculum concepts in a competitive environment.
The Game:
Each student will play one another in a head-to-head battle where they are expected to program the artificial intelligence of a spaceship that can move and fire missiles towards their enemy. Each player starts with 20 points and every time they get hit by a missile their total decreases by one, until a player hits zero and the game is over. Each player gets only 10 missiles so they must use them wisely. The missiles replenish if they go outside of the view boundaries or they hit the other opponent.
The Problem:
I've done this assignment for several consecutive years with only minor changes each year. However, this year during testing the game drops to around 9fps once the game begins. Obviously this takes away much of the fun of the game and makes debugging painful because of the lag.
Code Structure
Nodes
There are only a couple of SKLabelNodes that are used to display the player name and score.
The spaceships are both nodes and they each contain an array of 10 missiles which are also Nodes. Both the spaceship and missiles have their own individual classes that define their properties and behaviour.
There is also a background image used.
In total, there are only 24 objects that are added to the GameScene and this never changes.
Classes
- Initial View Controller (PlayerPickerViewController) - this allows the user to select who is Player 1 & Player 2. It then chooses the name of the (student) class to use as well as the image for their spaceship.
There is a struct that has a static object for each spaceship so that they can be accessed in different classes. - Game's View Controller (GameViewController) - this takes the GameScene and makes it show up inside this view controller
- Game Scene (GameScene) - handles all of the initial set up for the game including creation of variables and adding nodes to the view.
- Spaceship and Missile classes - these handle the methods and properties that define the behaviour of a spaceship and the missiles (i.e. movement, firing, size, etc.). Students may not modify this code so that they are working all within the same game conditions.
- Student Classes ("their last name".swift) Inside this class, there are two functions that students must program (one for player1 and one for player2). This is where students define the strategy for moving and shooting. Every frame, the appropriate function is called to move the player.
When the players are chosen in the PlayerPickerViewController the game understands which of the student classes needs to be called each frame (based on their name and the name of the class which are named exactly the same).
When I build and test the game on my personal MacBook Pro the game runs as is expected to (without lag). However, each student is working on a Mac with the following specs:
- iMac(21.5 inch, Late 2013)
- Processor 2.9 GHz Intel Core i5
- Memory 8 GB 1600 MHz DDR3
- Graphics NVIDIA GeForce GT 750M 1024 MB
It seems to me that even though the computers are getting a bit older, they should still be able to handle this simplistic of a game with only 20+ nodes.
Would changing the simulator make a difference (i.e. iPad Pro 12.9 inch 3rd generation to a 6th generation iPad)?
I appreciate any help you can give me in order to solve this lag issue.
Thank you.
Here is a link to the game if you are interested in seeing the code and how the classes interact with one another. The GAME
It isn't the most recent edition, but it is extremely similar to what the students are currently using.
ios swift sprite-kit skspritenode
I wasn't clear if the student's code was running in a simulator or on a device - sounds like the simulator. The FPS that you get through a simulator is often signficantly lower than what you see in an actual device, so what's already running (an in particular, if multiple simulators are running) can have a profound impact on the FPS.
– heckj
Mar 24 at 15:49
Yes, the students are running their code on a simulator. They each have an individual computer (Mac) that they build, debug, test their code on. We don't have enough devices (iPads) to deploy the game to for testing. So, every time they make a modification to their strategy, they run their code on their on Mac computer inside the simulator which is frustratingly laggy.
– M. Black
Mar 24 at 19:13
What OS is the Mac? Apple dropped OpenGL support, so you may be experiencing bugs in Metal that were not present in OpenGL
– Knight0fDragon
Mar 25 at 13:28
I don't see and clear "smoking gun" that would be the heart of this problem, so I don't have a clear answer for you. I think a resolution could be found by going through something of a debugging process on your spritekit view - and there's a pretty decent technote on the process of spritekit debugging: developer.apple.com/library/archive/technotes/tn2451/….
– heckj
Mar 25 at 16:53
add a comment |
Background:
I am a high school computer science teacher and I wanted to come up with an engaging/fun assignment that tests my students' programming knowledge. I have very little experience programming iOS games with SpriteKit, but I thought it would be an interesting way to integrate many of the curriculum concepts in a competitive environment.
The Game:
Each student will play one another in a head-to-head battle where they are expected to program the artificial intelligence of a spaceship that can move and fire missiles towards their enemy. Each player starts with 20 points and every time they get hit by a missile their total decreases by one, until a player hits zero and the game is over. Each player gets only 10 missiles so they must use them wisely. The missiles replenish if they go outside of the view boundaries or they hit the other opponent.
The Problem:
I've done this assignment for several consecutive years with only minor changes each year. However, this year during testing the game drops to around 9fps once the game begins. Obviously this takes away much of the fun of the game and makes debugging painful because of the lag.
Code Structure
Nodes
There are only a couple of SKLabelNodes that are used to display the player name and score.
The spaceships are both nodes and they each contain an array of 10 missiles which are also Nodes. Both the spaceship and missiles have their own individual classes that define their properties and behaviour.
There is also a background image used.
In total, there are only 24 objects that are added to the GameScene and this never changes.
Classes
- Initial View Controller (PlayerPickerViewController) - this allows the user to select who is Player 1 & Player 2. It then chooses the name of the (student) class to use as well as the image for their spaceship.
There is a struct that has a static object for each spaceship so that they can be accessed in different classes. - Game's View Controller (GameViewController) - this takes the GameScene and makes it show up inside this view controller
- Game Scene (GameScene) - handles all of the initial set up for the game including creation of variables and adding nodes to the view.
- Spaceship and Missile classes - these handle the methods and properties that define the behaviour of a spaceship and the missiles (i.e. movement, firing, size, etc.). Students may not modify this code so that they are working all within the same game conditions.
- Student Classes ("their last name".swift) Inside this class, there are two functions that students must program (one for player1 and one for player2). This is where students define the strategy for moving and shooting. Every frame, the appropriate function is called to move the player.
When the players are chosen in the PlayerPickerViewController the game understands which of the student classes needs to be called each frame (based on their name and the name of the class which are named exactly the same).
When I build and test the game on my personal MacBook Pro the game runs as is expected to (without lag). However, each student is working on a Mac with the following specs:
- iMac(21.5 inch, Late 2013)
- Processor 2.9 GHz Intel Core i5
- Memory 8 GB 1600 MHz DDR3
- Graphics NVIDIA GeForce GT 750M 1024 MB
It seems to me that even though the computers are getting a bit older, they should still be able to handle this simplistic of a game with only 20+ nodes.
Would changing the simulator make a difference (i.e. iPad Pro 12.9 inch 3rd generation to a 6th generation iPad)?
I appreciate any help you can give me in order to solve this lag issue.
Thank you.
Here is a link to the game if you are interested in seeing the code and how the classes interact with one another. The GAME
It isn't the most recent edition, but it is extremely similar to what the students are currently using.
ios swift sprite-kit skspritenode
Background:
I am a high school computer science teacher and I wanted to come up with an engaging/fun assignment that tests my students' programming knowledge. I have very little experience programming iOS games with SpriteKit, but I thought it would be an interesting way to integrate many of the curriculum concepts in a competitive environment.
The Game:
Each student will play one another in a head-to-head battle where they are expected to program the artificial intelligence of a spaceship that can move and fire missiles towards their enemy. Each player starts with 20 points and every time they get hit by a missile their total decreases by one, until a player hits zero and the game is over. Each player gets only 10 missiles so they must use them wisely. The missiles replenish if they go outside of the view boundaries or they hit the other opponent.
The Problem:
I've done this assignment for several consecutive years with only minor changes each year. However, this year during testing the game drops to around 9fps once the game begins. Obviously this takes away much of the fun of the game and makes debugging painful because of the lag.
Code Structure
Nodes
There are only a couple of SKLabelNodes that are used to display the player name and score.
The spaceships are both nodes and they each contain an array of 10 missiles which are also Nodes. Both the spaceship and missiles have their own individual classes that define their properties and behaviour.
There is also a background image used.
In total, there are only 24 objects that are added to the GameScene and this never changes.
Classes
- Initial View Controller (PlayerPickerViewController) - this allows the user to select who is Player 1 & Player 2. It then chooses the name of the (student) class to use as well as the image for their spaceship.
There is a struct that has a static object for each spaceship so that they can be accessed in different classes. - Game's View Controller (GameViewController) - this takes the GameScene and makes it show up inside this view controller
- Game Scene (GameScene) - handles all of the initial set up for the game including creation of variables and adding nodes to the view.
- Spaceship and Missile classes - these handle the methods and properties that define the behaviour of a spaceship and the missiles (i.e. movement, firing, size, etc.). Students may not modify this code so that they are working all within the same game conditions.
- Student Classes ("their last name".swift) Inside this class, there are two functions that students must program (one for player1 and one for player2). This is where students define the strategy for moving and shooting. Every frame, the appropriate function is called to move the player.
When the players are chosen in the PlayerPickerViewController the game understands which of the student classes needs to be called each frame (based on their name and the name of the class which are named exactly the same).
When I build and test the game on my personal MacBook Pro the game runs as is expected to (without lag). However, each student is working on a Mac with the following specs:
- iMac(21.5 inch, Late 2013)
- Processor 2.9 GHz Intel Core i5
- Memory 8 GB 1600 MHz DDR3
- Graphics NVIDIA GeForce GT 750M 1024 MB
It seems to me that even though the computers are getting a bit older, they should still be able to handle this simplistic of a game with only 20+ nodes.
Would changing the simulator make a difference (i.e. iPad Pro 12.9 inch 3rd generation to a 6th generation iPad)?
I appreciate any help you can give me in order to solve this lag issue.
Thank you.
Here is a link to the game if you are interested in seeing the code and how the classes interact with one another. The GAME
It isn't the most recent edition, but it is extremely similar to what the students are currently using.
ios swift sprite-kit skspritenode
ios swift sprite-kit skspritenode
asked Mar 24 at 14:58
M. BlackM. Black
1941217
1941217
I wasn't clear if the student's code was running in a simulator or on a device - sounds like the simulator. The FPS that you get through a simulator is often signficantly lower than what you see in an actual device, so what's already running (an in particular, if multiple simulators are running) can have a profound impact on the FPS.
– heckj
Mar 24 at 15:49
Yes, the students are running their code on a simulator. They each have an individual computer (Mac) that they build, debug, test their code on. We don't have enough devices (iPads) to deploy the game to for testing. So, every time they make a modification to their strategy, they run their code on their on Mac computer inside the simulator which is frustratingly laggy.
– M. Black
Mar 24 at 19:13
What OS is the Mac? Apple dropped OpenGL support, so you may be experiencing bugs in Metal that were not present in OpenGL
– Knight0fDragon
Mar 25 at 13:28
I don't see and clear "smoking gun" that would be the heart of this problem, so I don't have a clear answer for you. I think a resolution could be found by going through something of a debugging process on your spritekit view - and there's a pretty decent technote on the process of spritekit debugging: developer.apple.com/library/archive/technotes/tn2451/….
– heckj
Mar 25 at 16:53
add a comment |
I wasn't clear if the student's code was running in a simulator or on a device - sounds like the simulator. The FPS that you get through a simulator is often signficantly lower than what you see in an actual device, so what's already running (an in particular, if multiple simulators are running) can have a profound impact on the FPS.
– heckj
Mar 24 at 15:49
Yes, the students are running their code on a simulator. They each have an individual computer (Mac) that they build, debug, test their code on. We don't have enough devices (iPads) to deploy the game to for testing. So, every time they make a modification to their strategy, they run their code on their on Mac computer inside the simulator which is frustratingly laggy.
– M. Black
Mar 24 at 19:13
What OS is the Mac? Apple dropped OpenGL support, so you may be experiencing bugs in Metal that were not present in OpenGL
– Knight0fDragon
Mar 25 at 13:28
I don't see and clear "smoking gun" that would be the heart of this problem, so I don't have a clear answer for you. I think a resolution could be found by going through something of a debugging process on your spritekit view - and there's a pretty decent technote on the process of spritekit debugging: developer.apple.com/library/archive/technotes/tn2451/….
– heckj
Mar 25 at 16:53
I wasn't clear if the student's code was running in a simulator or on a device - sounds like the simulator. The FPS that you get through a simulator is often signficantly lower than what you see in an actual device, so what's already running (an in particular, if multiple simulators are running) can have a profound impact on the FPS.
– heckj
Mar 24 at 15:49
I wasn't clear if the student's code was running in a simulator or on a device - sounds like the simulator. The FPS that you get through a simulator is often signficantly lower than what you see in an actual device, so what's already running (an in particular, if multiple simulators are running) can have a profound impact on the FPS.
– heckj
Mar 24 at 15:49
Yes, the students are running their code on a simulator. They each have an individual computer (Mac) that they build, debug, test their code on. We don't have enough devices (iPads) to deploy the game to for testing. So, every time they make a modification to their strategy, they run their code on their on Mac computer inside the simulator which is frustratingly laggy.
– M. Black
Mar 24 at 19:13
Yes, the students are running their code on a simulator. They each have an individual computer (Mac) that they build, debug, test their code on. We don't have enough devices (iPads) to deploy the game to for testing. So, every time they make a modification to their strategy, they run their code on their on Mac computer inside the simulator which is frustratingly laggy.
– M. Black
Mar 24 at 19:13
What OS is the Mac? Apple dropped OpenGL support, so you may be experiencing bugs in Metal that were not present in OpenGL
– Knight0fDragon
Mar 25 at 13:28
What OS is the Mac? Apple dropped OpenGL support, so you may be experiencing bugs in Metal that were not present in OpenGL
– Knight0fDragon
Mar 25 at 13:28
I don't see and clear "smoking gun" that would be the heart of this problem, so I don't have a clear answer for you. I think a resolution could be found by going through something of a debugging process on your spritekit view - and there's a pretty decent technote on the process of spritekit debugging: developer.apple.com/library/archive/technotes/tn2451/….
– heckj
Mar 25 at 16:53
I don't see and clear "smoking gun" that would be the heart of this problem, so I don't have a clear answer for you. I think a resolution could be found by going through something of a debugging process on your spritekit view - and there's a pretty decent technote on the process of spritekit debugging: developer.apple.com/library/archive/technotes/tn2451/….
– heckj
Mar 25 at 16:53
add a comment |
1 Answer
1
active
oldest
votes
Start by running the game on a device to narrow down the problem and make sure the problem is with the Simulator.
Profile your game with Instruments on one of the iMacs. That would let you see what is causing the frame rate to be so low.
Choose Product > Profile in Xcode to profile your project in Instruments. Choose the Time Profiler instrument from the list of templates. The following article shows how to use the Time Profiler instrument:
Finding the Slow Spots in Your Code with the Time Profiler Instrument
Since your students have to test the game on their Macs, an alternative is to make a Mac version of the game. The game would run better natively on a Mac than the iOS Simulator. The SpriteKit code is the same on both Mac and iOS. The main difference is handling mouse events on Mac instead of touch events on iOS. Xcode has a cross-platform game project template that lets you make a game that runs on both Mac and iOS.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325101%2fspritekit-game-experiencing-significant-lag-on-ipad-simulator%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Start by running the game on a device to narrow down the problem and make sure the problem is with the Simulator.
Profile your game with Instruments on one of the iMacs. That would let you see what is causing the frame rate to be so low.
Choose Product > Profile in Xcode to profile your project in Instruments. Choose the Time Profiler instrument from the list of templates. The following article shows how to use the Time Profiler instrument:
Finding the Slow Spots in Your Code with the Time Profiler Instrument
Since your students have to test the game on their Macs, an alternative is to make a Mac version of the game. The game would run better natively on a Mac than the iOS Simulator. The SpriteKit code is the same on both Mac and iOS. The main difference is handling mouse events on Mac instead of touch events on iOS. Xcode has a cross-platform game project template that lets you make a game that runs on both Mac and iOS.
add a comment |
Start by running the game on a device to narrow down the problem and make sure the problem is with the Simulator.
Profile your game with Instruments on one of the iMacs. That would let you see what is causing the frame rate to be so low.
Choose Product > Profile in Xcode to profile your project in Instruments. Choose the Time Profiler instrument from the list of templates. The following article shows how to use the Time Profiler instrument:
Finding the Slow Spots in Your Code with the Time Profiler Instrument
Since your students have to test the game on their Macs, an alternative is to make a Mac version of the game. The game would run better natively on a Mac than the iOS Simulator. The SpriteKit code is the same on both Mac and iOS. The main difference is handling mouse events on Mac instead of touch events on iOS. Xcode has a cross-platform game project template that lets you make a game that runs on both Mac and iOS.
add a comment |
Start by running the game on a device to narrow down the problem and make sure the problem is with the Simulator.
Profile your game with Instruments on one of the iMacs. That would let you see what is causing the frame rate to be so low.
Choose Product > Profile in Xcode to profile your project in Instruments. Choose the Time Profiler instrument from the list of templates. The following article shows how to use the Time Profiler instrument:
Finding the Slow Spots in Your Code with the Time Profiler Instrument
Since your students have to test the game on their Macs, an alternative is to make a Mac version of the game. The game would run better natively on a Mac than the iOS Simulator. The SpriteKit code is the same on both Mac and iOS. The main difference is handling mouse events on Mac instead of touch events on iOS. Xcode has a cross-platform game project template that lets you make a game that runs on both Mac and iOS.
Start by running the game on a device to narrow down the problem and make sure the problem is with the Simulator.
Profile your game with Instruments on one of the iMacs. That would let you see what is causing the frame rate to be so low.
Choose Product > Profile in Xcode to profile your project in Instruments. Choose the Time Profiler instrument from the list of templates. The following article shows how to use the Time Profiler instrument:
Finding the Slow Spots in Your Code with the Time Profiler Instrument
Since your students have to test the game on their Macs, an alternative is to make a Mac version of the game. The game would run better natively on a Mac than the iOS Simulator. The SpriteKit code is the same on both Mac and iOS. The main difference is handling mouse events on Mac instead of touch events on iOS. Xcode has a cross-platform game project template that lets you make a game that runs on both Mac and iOS.
answered Mar 25 at 20:07
Mark SzymczykMark Szymczyk
14.5k24556
14.5k24556
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55325101%2fspritekit-game-experiencing-significant-lag-on-ipad-simulator%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I wasn't clear if the student's code was running in a simulator or on a device - sounds like the simulator. The FPS that you get through a simulator is often signficantly lower than what you see in an actual device, so what's already running (an in particular, if multiple simulators are running) can have a profound impact on the FPS.
– heckj
Mar 24 at 15:49
Yes, the students are running their code on a simulator. They each have an individual computer (Mac) that they build, debug, test their code on. We don't have enough devices (iPads) to deploy the game to for testing. So, every time they make a modification to their strategy, they run their code on their on Mac computer inside the simulator which is frustratingly laggy.
– M. Black
Mar 24 at 19:13
What OS is the Mac? Apple dropped OpenGL support, so you may be experiencing bugs in Metal that were not present in OpenGL
– Knight0fDragon
Mar 25 at 13:28
I don't see and clear "smoking gun" that would be the heart of this problem, so I don't have a clear answer for you. I think a resolution could be found by going through something of a debugging process on your spritekit view - and there's a pretty decent technote on the process of spritekit debugging: developer.apple.com/library/archive/technotes/tn2451/….
– heckj
Mar 25 at 16:53