PA's server really needs to be multicore.

Discussion in 'Planetary Annihilation General Discussion' started by squishypon3, March 6, 2015.

  1. squishypon3

    squishypon3 Post Master General

    Messages:
    7,971
    Likes Received:
    4,356
    I'm worried if PA doesn't get a multi-core server it may be snuffed out by a new competitor within the same broad genre and very similar niche genre... A new full scale RTS.



    I don't mean to call "DOOOOOooom!!!" But.. y'know, it's a bit scary. And I say this as someone really hyped for Ashes of the Singularity... PA's server _NEEDS_ to use all the cores it possibly can or you'll never become close to competing with this, even with a super computer of the future. Ex. Supcom is still limited even so many years after its initial release.

    Uber pls.. ;3;
  2. squishypon3

    squishypon3 Post Master General

    Messages:
    7,971
    Likes Received:
    4,356
    Also yes, I realize that was just a tech demo, but considering they have all of these units all completely done and their graphics are all done. It's a lot of work that's already finished.
    maxcomander and Remy561 like this.
  3. duncane

    duncane Active Member

    Messages:
    364
    Likes Received:
    191
    Besides the mountain terrain I wasn't impressed. It looked like a video of Supcom.

    But yes it would be nice if PA could use more cores ...
  4. killerkiwijuice

    killerkiwijuice Post Master General

    Messages:
    3,879
    Likes Received:
    3,597
    Just spent 20 minutes looking for the quote by a dev on multicores but couldn't find it. Pretty sure it had to do with something along the lines of "You can't just add multicore support to a game."

    But in that video there weren't even 1000 units it seems and it was probably running on a super high machine.
    Bsport and zihuatanejo like this.
  5. mjshorty

    mjshorty Well-Known Member

    Messages:
    871
    Likes Received:
    470
    whoa what is this game? looks awesome!
  6. g0hstreaper

    g0hstreaper Well-Known Member

    Messages:
    686
    Likes Received:
    553
    "New game" it looks like Sup com....PA IS A BRAND NEW RTS! :p
    nosebreaker likes this.
  7. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    You can. But doing so is difficult. You need to dispatch work into multiple queues, and you need to to manage writing data back. First one is the easy part, second one is causing all the trouble as multiple threads writing to the same data like to break the integrity.
    And multithreading doesn't happen automatically. You have to perform the splitting and merging manually, and stacking several multithreaded systems on top of each other without creating choke points is also difficult.
    In the end, it basically means rewriting large parts of the outer code structure.

    Right now, a bottleneck in the PA server during massive PvP matches appears to be writing out to the Chronocam history, so that's probably the next component which needs to be optimized further.
    Bsport and Schemya like this.
  8. Schemya

    Schemya New Member

    Messages:
    25
    Likes Received:
    23
    Where exactly did they say that the sim is heavily multithreaded ? I didn't see anything from a simulation perspective that isn't possible easily right now in Supcom or PA : there aren't that many units in that video and they're not even moving. And I've read the FAQ : http://www.ashesofthesingularity.com/game/faq . Am I missing something ?

    I did get however that they are paid by AMD to try and sell people a technology called "mantle", which is nice for them I guess.

    The "height map" looks cool, but I suspect it wouldn't be that much fun gameplay-wise if shots are blocked. It seems very few people play on bumpy maps in PA because of that. If shots aren't blocked then does it even affect gameplay (units speed and pathing maybe) or is it just cosmetic (which is good too I guess) ?

    The scale feels a bit better than PA to me but not by much : cliffs are still tiny. Maybe it wouldn't be fun otherwise…

    OT :
    From the FAQ : "The Singularity is a theory of the future development of humans and AI, popularized by futurist Ray Kurzweil. As our minds become increasingly augmented by artificial enhancements, there will come a point where the un-augmented human brain can no longer comprehend the advancements being made."

    I've always found it odd that people are waiting for this to happen. Even scientists individually cannot understand the technology behind most of what we use everyday already… Having a PhD in physics (for example) helps, sure, but not nearly enough. At the rate we progress right now, nobody could have a complete and deep understanding of most devices we use before thousands of new ones appear with thousands of research papers. Even if you spend your life trying. It's going too fast. Knowledge is heavily parallelised and people are specialized. It has been like this for years. Being a complete savant is no longer possible. One human brain alone is not much. Maybe two centuries ago…

    Or are they talking about advancements based on highly complex and indivisible ideas ?
    "Descartes seeks to ascertain the true method by which to arrive at the knowledge of whatever lay within the compass of his powers; he presents four precepts: […]
    The second, to divide each of the difficulties under examination into as many parts as possible, and as might be necessary for its adequate solution."
    I've never found anything that cannot be divided to understand it. I'm not sure it's even possible. Maybe you wouldn't be able to understand the big picture, but that's already (almost ?) the case for some mathematical proofs (computer-assisted proofs) or some devices.
    jeffwadsworth likes this.
  9. Schemya

    Schemya New Member

    Messages:
    25
    Likes Received:
    23
    Maybe having a sim thread by planet would be a bit easier to achieve ? Has any RTS ever had a fully functional multithreaded sim ? I think there is a (dead ?) project for spring. I guess it doesn't work that well or it makes the sim code too complex.

    Anyway, you'd think that if they had succeeded for Ashes of the Singularity they would boast about it.
    Last edited: March 6, 2015
  10. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    It depends on the networking model. Classic multiplayer RTS games all used a synchronous network model, that means every single client runs the very same simulation and only user interactions are transmitted over the network.

    The benefit is, that you need only little bandwidth, entirely unrelated to the complexity of the simulation itself of the number of units. The drawback however is, that the simulation needs to follow the rules of Determinism Replica, which means that a certain set of actions must always lead to the precise same outcome.
    This is quite difficult to achieve when multithreading, as it means you must withhold a tight coupling between parallel tasks or the outcome will differ slightly, and these tiny errors accumulate over time, resulting in a desync. Preventing these requires careful modeling of causal dependencies inside the simulation which is damn hard task and requires both perfect understanding of the used algorithms and a lot of patience.

    If however, the entire game is either solely singleplayer, or if you have a central server which runs the sim and the clients are merely viewers which get a stream of ingame events, then you can do multithreading quite easily as it doesn't matter if the game is fully deterministic any more.
  11. cdrkf

    cdrkf Post Master General

    Messages:
    5,721
    Likes Received:
    4,793
    Actually in very large games (the 40 player FFA) the main bottleneck in those situations is the recon data as it has to be implemented for all the players.

    I'd be curious to know if it would be possible to separate out some of the *specific functions* of the server simulation into their own dedicated thread? I would have thought the recon data could be treated pretty much separately to most of the other stuff?
  12. cdrkf

    cdrkf Post Master General

    Messages:
    5,721
    Likes Received:
    4,793
    I like the look of this game, but to those thinking 'this is Sup Com 3' I'd say read up on it :p

    It's not going to *play* anything like TA / SupCom / PA, lets be clear on that. They're going to divide a large map up into zones, each zone containing a power generator you can capture. I think it will be very much like solar systems in sins. Once you control the generator, you'll be able to build a bit of a base there and gain access to the resources of the zone.

    The base building / expansion side is going to be very limited / simplified compared to the games we're used to. They're also going to include a tech tree similar to sins. I'm guessing the units will be produced at a high rate to reach the numbers they're talking about.

    Also out of interest is they're planning on grouping squads of units into 'meta units' which you can move about like a platoon in the Total War games. Interesting idea, however I can't help but think it kinda negates the points of 1000's of units if you then combine them and turn them into 10's of units instead :p I guess the system does sound flexible (as it's up to you if you do this or not).

    The game is also limited to 4 players. I don't think PA has much to worry about, different style of game imo. That said I am all for multi threading the simulation. That I think is PA's Achilles heel if Uber intend this to be a long term platform. There were lots of ideas on this in the early days, the most likely candidate was a thread per planet- I think this could still be a good plan and I hope at some point they look at it again. I also think client performance could use another pass (I really don't get stable FPS on my rig, its CPU limited and this is on an FX @ 4ghz, ok not as good per core as your latest Intel kit however not exactly a toaster either).
    xankar and mered4 like this.
  13. blightedmythos

    blightedmythos Active Member

    Messages:
    405
    Likes Received:
    202
    The effects and mountains look better then PA, but besides that it looks pretty hollow.
  14. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    No, not in that way. The point is, intelligence calculation requires positions to be stable, or otherwise it could accidentally read numbers which are in the progress of being updated and that would result in digital garbage. However, the range checks themselves could easily be dispatched to multiple threads during the intel update phase so that can increase multi core utilization as well.

    And there is also a different type of optimization possible in that case, and that is loosening the intelligence update frequency even further, respectively falling back to more fuzzy algorithms which have different run time characteristics.

    The intelligence system as it is, just isn't exactly made to support large armies clashing. If I read the tech posts right, then it should scale quite well with large planets and spare intelligence events, but having a large number of units with huge vision radius each in the same area is about the worst case possible as it bloats the data structures, even if the actual computations remain cheap and trivial.
  15. zihuatanejo

    zihuatanejo Well-Known Member

    Messages:
    798
    Likes Received:
    577
    The server IS multithreaded right now, but the sim calculations are all run on one thread. So for very large games, what impacts the server more than anything else is the simulation of thousands of units at once.

    Custom games that have been hosted have shown the server utilising many cores at once. Multithreading the simulation is a huge, huge task though, so huge it might not even get done :(
  16. squishypon3

    squishypon3 Post Master General

    Messages:
    7,971
    Likes Received:
    4,356
    He talks about it being multicore about 1 minute into the video.

    Plus units are moving in the video, and he very clearly says there are a couple thousand units on screen. =P
    maxcomander likes this.
  17. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    From what I have seen so far they only talk about how they use DX12 to use multiple cores to talk to the GPU. That is something that PA cannot do, as it uses too old levels of OpenGL. However Uber has implemented a system where they have multiple threads thinking about the requests, write them in a queue and one "dispatcher" thread writes them to the GPU.
    In the video they are not talking about wether the simulation is multithreaded or did I miss that?
    Basically they are talking about how the client side has good multithreaded. Surprise! PA's client uses many cores as well. The server is the hard part.

    But sure the game looks interesting.
    xankar, Schemya and Sorian like this.
  18. perfectdark

    perfectdark Active Member

    Messages:
    378
    Likes Received:
    170
    As there's no real interplanetary combat, units are either fighting on one planet or another, it seems odd not to have built it from the bottom up to split processing by planet. I understand planet smashing and how it all happens in a real 3d world, but that's not really needed in my opinion it would be just as effective being a pre-rendered cut scene.

    I say it seems odd because if processing isn't split then it obviously limits the game massively. If processing was split and inter-planetary interactions were handled differently then imagine having a game with 100 players that doesn't slow down, now that really would be awesome.

    Limiting the game to 10 players and whatnot in this day and age really upsets me as I really thought games would have massively improved by this stage but maybe the technology just isn't there. Supcom 2 came out 5 years ago, was limited in complexity due to consoles, and you could have a max of 8 players. 5 years later we've only managed to add 2 players? What happened to Moores Law? (yes I understand the concept, but you would have expected at least 16 players at launch after 5 years of technological progress.

    Maybe more advancements are still to come, but being as Uber got their money from kickstater, I wouldn't be surprised if they pulled the plug on development leaving the directors with a tidy sum each before they actually run out of money to spend, and I don't blame them. I just hope they get it finished to a decent enough state that modders can easily add mods to the standard game so the game can live on forever.
    elvisior likes this.
  19. squishypon3

    squishypon3 Post Master General

    Messages:
    7,971
    Likes Received:
    4,356
    Wat, we've done 20 - 40 player matches. And in fact we do them quite often.
    maxcomander likes this.
  20. MrTBSC

    MrTBSC Post Master General

    Messages:
    4,857
    Likes Received:
    1,823
    singularity looks good .... but that is it ....
    the only difference in gameplay will likely be that there will be no commandertype unit ... and if they put a commandcenter or single important structure like in grey goo in it i will slap them ...
    lorewise it looks to be another arm vs core thing ...
    Last edited: March 6, 2015

Share This Page