1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Civ 6 Multicore performance

Discussion in 'Civ6 - General Discussions' started by Cromagnus, Nov 3, 2016.

Thread Status:
Not open for further replies.
  1. Cromagnus

    Cromagnus Deity

    Joined:
    Sep 11, 2012
    Messages:
    2,272
    I see your point, but game engines are usually a vast conglomeration of parts glued together somewhat haphazardly. If you're picturing a clean, well-executed design that programmers were given time to make perfect, that's a fantasy world. Time constraints make it almost a certainty that what you ship is a major compromise.

    I do think more people would play huge maps if they performed better, but that's not the main reason people don't play them. Most people can barely handle the amount of juggling and micromanagement in a standard map. Those of us who would enjoy the larger maps, even if performance was ideal, are in the minority I think. /shrug

    But yes, in Civ 5, long turn times became a major reason I stopped playing Huge maps.
     
  2. TheMeInTeam

    TheMeInTeam Top Logic

    Joined:
    Jan 26, 2008
    Messages:
    25,844
    You really can't separate that from design OR performance. Especially in civ 5, the lag in unit commands compounds with 5x the number of units. Even in 6 the broken UI causes enough problems that scaling it up several times makes turns drag. "Juggling and micromanagememnt", yes, increased amount of RL time and effort between meaningful decisions. It is possible to allow the UI to curtail that (if you knew the controls, civ 4 made an extra 15 cities marginal in time investment if willing to cut a couple corners). Give trade routes competent UI + auto renew option, allow for waypoints before and after unit production, bring back civ 4's ability to pull up the city list (which not only let you see yields, but change the build from that screen, even for multiple cities if so desired), make turn times reasonable (so your not animation dependent solution at minimum) and we have a different ballgame.

    In regards to designing around the new rules in civ 6 and integrating the UI with how games play out, the developers barely even tried. I see no reason, given evidence we do have, to believe they tried with optimization significantly either. Yes, it boils down to cutting something in design...and that can be worth it.

    If the mechanical tedium-by-poor-design were stripped out of civ 6, managing another front or two at war would put an overhead of somewhere between 10 to 30 seconds per turn per front, depending on your ability to keep up. More importantly, it would minimize the number of inputs that don't matter and the waiting to make any inputs at all. Playing huge would only add a small percentage of extra inputs and wait time in such an environment, rather than slogging through basic, repetitive commands and doubling the play time or more to complete.

    Imagine something along the lines of "select a group of units and go here". Just that, in peace time, would save dozens of minutes across some playthroughs. It would be non-trivial to implement, but IMO more valuable than the religious victory condition and considering the art/design/videos/etc that went into that condition, would it have been more costly?

    I don't know, but it's the kind of thing where in my mind Firaxis is making its tradeoffs poorly within constraints. I can't, without evidence, tell you for sure what % of players avoiding huge maps do so because the UI is terrible, and what % do so because of performance. Both matter, and both boil down to the same problem: these things add so much time between interacting with the game in a meaningful way that people avoid playing it that way entirely.
     
  3. juanpavo

    juanpavo Warlord

    Joined:
    Nov 23, 2010
    Messages:
    131
    Location:
    Silicon Valley
    On a related note, has any game ever allowed a player to adjust how much time they are willing to wait or how much computation they will allow to be used for the AI turn?

    If I really want a better AI experience, I may want to choose to wait 2x (or longer) time for it. Or if I have a top of the line gaming rig, maybe I want the AI to more deeply analyze the situation, because my rig can handle it.

    Do any games do this?
     
  4. TheMeInTeam

    TheMeInTeam Top Logic

    Joined:
    Jan 26, 2008
    Messages:
    25,844
    You could in some of the chessmaster games, even forcing a move on the spot if desired. That's the only game I've played that let you cut AI ability in favor of speed as a setting/button press.

    AI has diminishing marginal utility of play quality from time added, from what I've gathered from people who actually make game AIs talk about it. Shaving time won't change much when the AI isn't even trying to win very effectively right now. There too you wind up getting more mileage out of RNGing it into a canned but effective overall strategy (even something as brute force as civ 4 culture or civ 6 religion), despite it executing it more poorly than a human. Making the AI reason and move like a human is something I've seen even great games overall who did the other things right struggle to manage. I'll give a pass there since it's 1) obviously not easy and 2) in contrast to UI/performance design considerations there aren't easy examples to point where someone else did it heaps better as precedent.
     
  5. juanpavo

    juanpavo Warlord

    Joined:
    Nov 23, 2010
    Messages:
    131
    Location:
    Silicon Valley
    Yes, chess was the only one that came to my mind.

    Another way of asking the question is: Are there some things that the AI is *not* doing because the designers determined the realtime cost would impact user experience? Perhaps not evaluating all the options, not being aware of all the other units in play, not looking ahead to the next move, etc. I'll leave this as an academic question, unless someone who is an AI designer can weigh in.
     
  6. Cromagnus

    Cromagnus Deity

    Joined:
    Sep 11, 2012
    Messages:
    2,272
    I'd love to see a developer give players an AI CPU scaler. There might be some PC games that scale the AI based on measuring CPU utilization, but I'm not aware of any. Nor can I recall any that let you drag a scaler or check a box to increase AI computation time.

    I did work on a single-threaded game back in the day where we had to limit the amount of time spent calculating AI paths because it was affecting the framerate. We gave I think 2ms to the pathfinder, and it would process as many AIs/frame as it could. If it ran out of time, it would stop what it was doing and finish the path the next frame. (Assuming the AI hadn't changed its mind about where it wanted to go)

    If there were enough AIs requesting paths, it could take as long as 0.25 seconds for a path to be found. Combined with the time it took for them to perform the animation transition blend decelerate, and accelerate, it made the AI feel unresponsive. On certain maps with a ton of active AIs it made the AIs look stupid. I had wanted to change the behavior code so that AIs had a semi-intelligent fallback behavior while they waited their turn for a path request, but we never had time, the game shipped, and the rest is history. I also wanted to make it steal idle cycles to catch up, (when rendering wasn't taking 95% of the frame time) but again, we ran out of time.

    "We ran out of time" is pretty much the reason for most things that suck in games. ;)
     
  7. TheMeInTeam

    TheMeInTeam Top Logic

    Joined:
    Jan 26, 2008
    Messages:
    25,844
    I've seen everyone from EU AI programmers to previous civ AI programmers and more say that there are *always* things the AI isn't doing due to realtime cost. It makes sense too, you have to draw the line somewhere wrt brute force computations.

    That impacts design too. You can make the AI perform much better or worse with the game's rule set. For example, in Cromangus' AI pathing example you could bypass that issue entirely if there just weren't enough AI path calculations to run afoul of the 2ms limit, which is a concession. Games are forced to make concessions all the time. It's not an easy choice. My frustration is that the standard in the strategy genre is consistently mis-prioritized, almost as if they forget that what separates strategy games from others is the strategy...IE the decisions they offer. The game should not get in the way of those decisions *by design*, it should support them.
     
    Cromagnus likes this.
  8. Gumbolt

    Gumbolt Phoenix Rising

    Joined:
    Feb 12, 2006
    Messages:
    23,318
    Location:
    UK
    Well in this instance the engine on how the Ai operate needs tweaking or upgrading. If you gave an Ai 2-3 settlers on civ 4 they mostly used them and knew how to expand. (Albeit poorly.) Now it seems the AI just don't know how to do the basics. Is it still the case that for Ai to work effectively a unit task has to be directly ahead or to one direction? So if the Ai/AI unit can't understand an instruction it will opt to do nothing or waht it thinks might be best? Is this why the Ai on civ 6 are failing to settle 5-10 cities? Or is it due to fact that the game now involves districts and other factors the Ai can't deal with. Harder to create algorithms with so many variables to compute. Especially without any conflict on the tasking.

    I can see the argument for cost vs perfecting the game code. Definately comes a point where more money spent adds little to the game. I doubt Firaxis is making huge amounts of money. Getting this out for the holiday season was critical. Especially if they want Civ 6 under the tree. Albeit on Steam it's all digital.
     
  9. Larsenex

    Larsenex King

    Joined:
    Oct 31, 2005
    Messages:
    763
    Location:
    Ventura CA
    Seriously, if Brad Wardel can do it with Gal Civ III (and he is doing it NOW!), it can be done here!

    See his note on performance increases with multi cores. 2 cores nothing, 4 cores 'noticeable', and 8 cores 'significantly'!

    http://forums.galciv3.com/480723
     
  10. Hajee

    Hajee Prince

    Joined:
    Nov 4, 2014
    Messages:
    342
    That is interesting how they are improving turn times in gal civ. I dont know how farixis does it here.
    But:
    "Instead of an AI player going through all its ships one at a time to do its pathfinding, I just split it off into the N-1 cores at a time to do it. That is, if you have an 8 core PC, it’ll do 7 ships simultaneously. "

    is very intriguing if CivVi engine does not do this, would the devs consider to do so?
     
    Larsenex likes this.
  11. Larsenex

    Larsenex King

    Joined:
    Oct 31, 2005
    Messages:
    763
    Location:
    Ventura CA
    I do know that the Gal Civ III is a custom engine from the ground up in 64bit. It may be that Civ VI is not so flexible.
     
  12. Wizard-Bob

    Wizard-Bob Always remember to Find Your FUN!

    Joined:
    Sep 7, 2010
    Messages:
    171
    Gender:
    Male
    Location:
    Florida
    However, it was well-advertised that Civ6 "is a custom engine from the ground up in 64bit." Are the games comparable as far as AI design is concerned?
     
  13. TheMeInTeam

    TheMeInTeam Top Logic

    Joined:
    Jan 26, 2008
    Messages:
    25,844
    Yes. Civ 6 had that option too. These choices are not easy but they are still choices.
     
  14. Cromagnus

    Cromagnus Deity

    Joined:
    Sep 11, 2012
    Messages:
    2,272
    I'll worry about pathfinding perf when next turn time isn't limited more by animation speed and DirectX perf than pathfinding. For all we know pathfinding is already multithreaded.

    As far as I can tell, next turns times are literally spent just waiting for animations to finish while my CPU sits mostly idle. They need to give us the Civ5 version of Quick Movement (no animation) back.
     
    TheMeInTeam and Hajee like this.
  15. Hajee

    Hajee Prince

    Joined:
    Nov 4, 2014
    Messages:
    342
  16. Cromagnus

    Cromagnus Deity

    Joined:
    Sep 11, 2012
    Messages:
    2,272
    Further confirmation that rendering is the bottleneck in the AI benchmark:

    6C/12HT: 19.5 seconds/turn DX11 (17.6 seconds in strategic view)

    I'll have to try that mod when I have time. Otherwise it's not much of an AI benchmark. ;)
     
  17. tekjunkie28

    tekjunkie28 Prince

    Joined:
    Oct 20, 2016
    Messages:
    334
    Gender:
    Male
    Are you saying the AI scalar as in the AI becomes more advanced with more cpu cores/headroom?
     
  18. Cromagnus

    Cromagnus Deity

    Joined:
    Sep 11, 2012
    Messages:
    2,272
    Well, yes and no. I meant more of a time consumption metric. Some people with slow machines might be ok with longer turn times to get smarter AI. And people with fast machines could crank up the slider without seeing their turn times increase.
     
  19. smartcanuck1988

    smartcanuck1988 Warlord

    Joined:
    Jun 16, 2016
    Messages:
    276
    GalCiv2 let you scale the AI that way. So some people might choose a less than genius AI in terms of pathfinding and what not for the sake of faster turn times if they run slower machines (although they can choose more thoughtful AI still, but will have to wait longer). Frankly I like that system. That said, I don't think some bottleneck or limit/cap on number of instructions per turn is what is forcing Firaxis hands in giving us adequate AI. Once we reach the adequacy level then maybe that AI slider will help blow our minds. The rendering being the bottleneck for AI benchmark is a sign of that.
     
  20. Gorbles

    Gorbles Load Balanced

    Joined:
    Nov 24, 2014
    Messages:
    5,320
    Location:
    UK
    "it works over there why doesn't it work over here" is a line that tends to give programmers anuerysms :)

    I'm not saying it's impossible, I'm just saying there are very likely reasons for the differences between the two games.
     
    Larsenex likes this.
Thread Status:
Not open for further replies.

Share This Page