#1  
Old 10-24-2012, 12:55 AM
Rasterman Rasterman is offline
Senior Member
iPhone 5s, iOS 7.x
 
Join Date: May 2010
Location: Tampa, FL
Posts: 264
Default A5 and a6 CPU

If I have a game that is 100% CPU bound, will making it double threaded and spread the work over 2 threads allow it to run faster? This would be my initial thought as aren't these CPUs dual core? But maybe they throttle down when boths cores are pegged? Or throttle up one core when only one is pegged? Does anyone know? Anyone have links to single vs dual threaded cpu benchmarks?
Reply With Quote
  #2  
Old 10-24-2012, 07:55 AM
MarkFromBitmenStudios's Avatar
MarkFromBitmenStudios MarkFromBitmenStudios is offline
Developer
iPad (4th Gen), iOS 6.x
 
Join Date: Apr 2011
Location: Austria, Europe
Posts: 130
Send a message via AIM to MarkFromBitmenStudios
Default

The best way to find out is asking Inspector.

Seriously, I'm also working on an RTS game that is pretty performance intensive (lots of AI calculation+lots of units eat up CPU cycles quickly). I have a multithreaded architecture and it runs quite well on dual cores but really considerably slower on single cores (e.g. iPhone 4). Inspecting with the almighty Inspector shows that on dual core machines, the load is really well distributed to both cores which is what you want.

Just fire up Inspector and load some performance inspection tools, incl. the one that shows the load on the individual cores and you'll see whether your game makes good use of the dual core or not and how its overall performance is. Then, using these insights, you can decide whether your architecture needs rework or not.

Overall, how much dual cores bring to the table depends on a lot of factors like prefetch misses and subsequent RAM access. If you don't have too many misses then there's going to be a considerable performance gain. OTOH, lots of misses will eat that up pretty quickly. A lot depends on how much stuff you're using that upsets the CPU's branch prediction (e.g. virtual functions in C++ or any kind of indirect jumps like completion handlers in objective-c come to my mind).
Reply With Quote
  #3  
Old 10-24-2012, 09:32 AM
Rasterman Rasterman is offline
Senior Member
iPhone 5s, iOS 7.x
 
Join Date: May 2010
Location: Tampa, FL
Posts: 264
Default

That answers my question right there. Since I must optimize to the lowest denominator and there are still a ton of iPhone 4 in use no point in doing multithreaded. Another question, do you find if one core on the a5 is faster than the a4 in a single threaded test?
Reply With Quote
  #4  
Old 10-24-2012, 09:49 AM
MarkFromBitmenStudios's Avatar
MarkFromBitmenStudios MarkFromBitmenStudios is offline
Developer
iPad (4th Gen), iOS 6.x
 
Join Date: Apr 2011
Location: Austria, Europe
Posts: 130
Send a message via AIM to MarkFromBitmenStudios
Default

I'd guess so yes. Overall, the A5 has ~56% more power than the A4 but at the end of the day, you gotta test your game on actual hardware to find out how fast it runs. iPhone 4/iPad 1 are really low-spec devices today if you have a complex game. I also target the iPhone 4 and it is a pain. I've done countless performance tweaks already. Its less powerful GPU paired with high resolution also adds to the overall performance problems, even if you are CPU bound.

There's really no way around modifying/disabling some (visual) parts of your game on the lower end devices or at least that's what I did. I'm querying the number of cores at runtime and then dynamically tone down or totally switch off expensive visual effects if I find only a single core.

It's pretty much the only way to keep the game running at an acceptable frame rate on less powerful devices while still using the horsepower of later device generations.

What are you working on btw, Machines at War?
Reply With Quote
  #5  
Old 10-25-2012, 12:14 AM
Rasterman Rasterman is offline
Senior Member
iPhone 5s, iOS 7.x
 
Join Date: May 2010
Location: Tampa, FL
Posts: 264
Default

You should try doing an rts on a 180mhz pocketpc, I was optimizing in asm those days. Yes working on machines at war 3, the last week I have added influence mapping to my AStar pathing system, this allows AI units to path around enemy units effectively. It's complex because I have 4 classes of attack types in my game and must track them separately.

What are you using for pathing in a space sim? Direct paths and calculating turn radii? I wonder if anyone has done a legit space nav physics. Even in star trek it's pretty fake, no point in turning or banking, just fire the maneuvering thrusters to orient your guns correctly then move forward.
Reply With Quote
  #6  
Old 10-25-2012, 03:16 AM
MarkFromBitmenStudios's Avatar
MarkFromBitmenStudios MarkFromBitmenStudios is offline
Developer
iPad (4th Gen), iOS 6.x
 
Join Date: Apr 2011
Location: Austria, Europe
Posts: 130
Send a message via AIM to MarkFromBitmenStudios
Default

Lol, I hear you. My first games were on 1MHz PCs (MHz, not GHz mind you), no RTS back then though. Was still a challenge to work with the limited horsepower and the 8 bit CPUs were a pain, too (3 registers and you had to implement integer multiplication and division on your own, lol). Everything's so much easier now.

I don't think legit space physics are a good idea from a game designer point of view. Usually playability > reality. Ontop of it, networked physics in an RTS with a lockstep simulation is a PITA.

I also have 4 classes in my game that need separate consideration in my influence map, even though there's no terrain as such. Bigger ships also have multiple weapon mount points with their own AI (e.g. turrets turn around and track small strikecraft while the front mounted laser beam tries to get a frigate in sights). Ontop of it, strikecraft is not static but entering dogfights with other strikecraft or doing passes on larger ships, so a lot of units are constantly on the move, changing targets, avoiding incoming fire, etc. Lot's of action!

For the movement, it's just standard steering algorithms with a bit of formations. I used to have a more physics based implementation in an early prototype but it felt actually worse. People are used to how spaceships behave from what they see in movies or other games.

It's like the famous flag on sailing ships from Schell's book on game design: actually, the flag should be facing away from the wind but people are used to flags on cars or motorboats so they expect the flag to face backwards and even though it's not realistic, any other direction felt strange.

BTW, since we both are going to release an RTS, maybe we should coordinate release dates so we don't cannibalize each other by releasing too close to each other.
Reply With Quote
  #7  
Old 10-25-2012, 12:37 PM
Rasterman Rasterman is offline
Senior Member
iPhone 5s, iOS 7.x
 
Join Date: May 2010
Location: Tampa, FL
Posts: 264
Default

Awesome, I always wanted to add multiple weapons per unit but that would be a huge change in my engine. 1MHz was way before my days, my first was 8MHz lol. I'm really close to release, Mac and Win versions will be out within weeks. I will probably have iOS done this year, but will probably end up waiting as once you get into Dec there is no point in releasing around Christmas.
Reply With Quote
  #8  
Old 10-26-2012, 04:26 PM
MarkFromBitmenStudios's Avatar
MarkFromBitmenStudios MarkFromBitmenStudios is offline
Developer
iPad (4th Gen), iOS 6.x
 
Join Date: Apr 2011
Location: Austria, Europe
Posts: 130
Send a message via AIM to MarkFromBitmenStudios
Default

Sounds like you started out on some Amiga or Atari ST maybe? Those were the days.

Anyway, I'm targeting spring, maybe March 2013 or so. Still 5 more missions in story mode missing and then come "the last 20%".

What I'm dreading the most is the beta and especially multiplayer balancing. I saw in your description that you got 130 units and techs. How the heck did you get over beta to balance it all out for multiplayer?

I DL'd your Windows Beta, looks cool. Reminds me a bit of Supreme Commander. Did you get a lot of multiplayer games going during beta to get enough statistics back for balancing it out?
Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 2012, TouchArcade.com, LLC.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Copyright 2008 - 2011, TouchArcade.com. Privacy Policy / DMCA Copyright Agent