Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 3, 2013, 06:33 AM   #1
demaxism
macrumors newbie
 
Join Date: Jan 2013
Just made a simple pixel style game, but seems slow

pretty like the old-fashion low resolution game, with pixel charactor, like the 1980's NES games,
I just made a simple such old fashion game on the app store, but seems run slow , occationally below 50fps. what wondered me is how could a low-spec 8-bit NES game run in full fps, however my game is in unstable speed, even with dual-core modern machine...? maybe is my machine's problem, anyone try it? its free on app store. name is "Rock in Code"
here is some screen shot


demaxism is offline   0 Reply With Quote
Old Jan 3, 2013, 11:25 AM   #2
gnasher729
macrumors G5
 
gnasher729's Avatar
 
Join Date: Nov 2005
The speed of the software obviously depends on the developer. We don't know what you are doing, so it's hard to say what the problem or problems are.
gnasher729 is offline   0 Reply With Quote
Old Jan 3, 2013, 06:54 PM   #3
kage207
macrumors 6502a
 
Join Date: Jul 2008
Have you ever heard of complexity? Or Big O Notation?
__________________
MBA 13", i5 1.8GHz, 8GM RAM, 128GB SSD
These are amazing products that enrich our lives that we see as toys, remember that they are expensive and should be used as tools to reach our dreams~
kage207 is offline   0 Reply With Quote
Old Jan 3, 2013, 10:30 PM   #4
blueshogun96
macrumors member
 
Join Date: Nov 2012
Can you post some code from your drawing routines? It's hard to tell what the problem is when you aren't giving any information as to what your code is actually doing.

Are you using OpenGL, SDL, what?
blueshogun96 is offline   0 Reply With Quote
Old Jan 4, 2013, 01:47 AM   #5
Sayer
macrumors 6502a
 
Sayer's Avatar
 
Join Date: Jan 2002
Location: Austin, TX
You need to use "Instrumets" in Xcode on your game to see where the performance problems really are. Many times the slow code is not at all what you may think it is. Maybe you are allocating and releasing a lot of memory blocks over and over in a tight loop instead of allocating once and reusing them, who knows.

To learn how to use Instruments you can go to the Mac Dev Center at https://developer.apple.com/ and watch, for free, the "Development Videos" from WWDC 2012 for the "Learning Instruments" session. And you should probably look at the "Optimizing 2D Graphics and Animation Performance" session videos.

All of this is totally free and you can watch it over and over as much as you need to. Also there are sample code projects that go with the sessions so you can download and look at the exact same code as that used in the sessions.
__________________
Obama is a true statesman whose experience as a state senator, half-term US Senator & guest lecturer in a Constitutional Law class has fully prepared him to take control of our nuclear arsenal.-Me
Sayer is offline   0 Reply With Quote
Old Jan 4, 2013, 09:12 AM   #6
kthielen
macrumors newbie
 
Join Date: Mar 2011
What does your fundamental game loop look like?

Assuming that you're not inadvertently doing some crazy processing (which a profiler would tell you, as suggested by Sayer), this is probably down to a problem with the design of your basic game loop.

Could you summarize your technique? Are you rendering frames on a timer? NSTimer? Do you expect to get called 50 times per second (hence 50fps)? If so, you might want to study how timer invocations happen (you're likely not being called that often). As well, you might want to consider how these oddly-spaced game-steps affect your update logic. For example, if you assume that you step the game every N milliseconds, but actually you're stepping it every N+dt milliseconds, then eventually those dts accumulate to the point where you've missed several steps that should have happened.

You might get something out of this thread and the commentary linked to in it:

http://www.gamedev.net/topic/629618-...ent-game-loop/
kthielen is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Is the graphic performance different between i7 and i5 on MBPR 13" ?? Doublepower Buying Tips and Advice 4 Nov 22, 2013 08:52 PM
A Game a Few Friends and I Made : Celluloids - An Explosive Chain-Reaction Game Fullmetul iPad Apps 0 Oct 18, 2012 10:02 PM
Graphic performance decreased significantly bRADYPUS MacBook Pro 3 Oct 8, 2012 03:45 PM
Suden game performance issues, Any game drops to low fps after 10-15min LaDirection Mac and PC Games 8 Oct 5, 2012 12:55 AM
Poor Graphic Performance after Upgrade to 10.8 brgnewman Mac Pro 10 Aug 11, 2012 03:54 AM

Forum Jump

All times are GMT -5. The time now is 05:02 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC