A5 and a6 CPU

Discussion in 'Public Game Developers Forum' started by Rasterman, Oct 24, 2012.

  1. Rasterman

    Rasterman Well-Known Member

    May 10, 2010
    309
    0
    16
    Game Monger
    Tampa, FL
    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?
     
  2. MarkFromBitmenStudios

    MarkFromBitmenStudios Well-Known Member

    Apr 4, 2011
    133
    0
    16
    IT Architecture, Development Project Manager
    Austria, Europe
    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).
     
  3. Rasterman

    Rasterman Well-Known Member

    May 10, 2010
    309
    0
    16
    Game Monger
    Tampa, FL
    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?
     
  4. MarkFromBitmenStudios

    MarkFromBitmenStudios Well-Known Member

    Apr 4, 2011
    133
    0
    16
    IT Architecture, Development Project Manager
    Austria, Europe
    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?
     
  5. Rasterman

    Rasterman Well-Known Member

    May 10, 2010
    309
    0
    16
    Game Monger
    Tampa, FL
    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.
     
  6. MarkFromBitmenStudios

    MarkFromBitmenStudios Well-Known Member

    Apr 4, 2011
    133
    0
    16
    IT Architecture, Development Project Manager
    Austria, Europe
    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. :D
     
  7. Rasterman

    Rasterman Well-Known Member

    May 10, 2010
    309
    0
    16
    Game Monger
    Tampa, FL
    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.
     
  8. MarkFromBitmenStudios

    MarkFromBitmenStudios Well-Known Member

    Apr 4, 2011
    133
    0
    16
    IT Architecture, Development Project Manager
    Austria, Europe
    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?
     

Share This Page