Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

demaxism

macrumors newbie
Original poster
Jan 3, 2013
1
0
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
ric2.png


ric1.png
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
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.
 

blueshogun96

macrumors regular
Nov 24, 2012
112
2
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?
 

Sayer

macrumors 6502a
Jan 4, 2002
981
0
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.
 

kthielen

macrumors newbie
Mar 10, 2011
4
0
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-proper-framerate-independent-game-loop/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.