Pi2repsilon
Posts: 42
Joined: 6/15/2020 Status: offline
|
quote:
ORIGINAL: zgrssd quote:
ORIGINAL: BlackRain Just curious what you all are experiencing. I am on turn 111 or somewhere thereabouts. It takes almost 2 minutes for each turn to process and for the next turn to begin. I feel like this is too long, anyone else experiencing this or longer end of turn times or is it just me that feels this way? After 111 turns, I have basically wasted around 3 hours of my play time just waiting for turns to process. If you think 2 minutes are bad, think of it from the POV of the AI: You turns can take 15 minutes easily, and that is just one player In all seriousness: The game is quite detailed, so a lot of calculation before a player is even allowed to make choices. The processing each AI has to do, scales exponentially with the number of AI's in the game. So I fear, this is a unavoidable part of a large planet game. Unavoidable? No. Economically not feasible to develop for this developer, perhaps. This problem for turn strategy games was largely solved decades ago, and it is simple in principle but the devil is in the details and depending on design it can be prohibitively expensive to design and implement. It can also be a memory-hog, depending on implementation. Where you see 15 minute player turn for the AI to be bored, I see 15 minutes to make AI calculations allowing lightning fast AI turns. The solution is to take advantage of the player's long turn times to calculate AI action calculations while the player is staring at the screen and taking his turn, stealing as many timeslices as possible where the player doesn't notice. The idea is that you do this for every AI player in sequence acting after the player, thus creating the orders that each AI will execute in turn when it is their turn. These calculations and simulated orders needed to make AI decisions are performed on a copy of the game state treated as if it was the AI's start-state (I simplify a bit). The first AI acting after the player gets a copy of the player's current game state, subsequent AIs get a copy of the previous AI's copy's end-state. You then need to design invalidation conditions; I.e. which actions taken by a player won't invalidate any AI planning (in games with incomplete/hidden information many actions fall in this category), which will invalidate only a few AI orders, which will invalidate a category of planned actions, which will invalidate all orders for an AI player and force it to begin from scratch. This is much harder design work than it might sound. Note that it cascades down the AI sequence: The player does something that invalidates the orders of some of the AIs, the changes they have to recalculate will invalidate that of AIs downsequence from them. And so on. So the AI governor handing out timeslices for AI planning calculations will frequently have to revisit some AI players upsequence that it was otherwise done with. With very strict invalidation making most player actions force complete recalculation you might as well drop the idea of using the player's turn to plan, with very loose invalidation the AI will perform many actions that are much poorer than it would if it didn't try to plan ahead this way. So the tricky part is to find a good balance. In practice that means that the more AI players you have and the further down the AI sequence they are, the more their plans will be invalidated and they'll have to do a full AI update with no advance planning once it is their turn in the sequence. So good sequencing with the most requiring AI opponents (largest, biggest action space) handled first makes this work better - but if your game requires a fixed player order this is not an option. Either way the AIs acting soonest after the player will have most of their planning already done in whole or in part when it is their turn. Moreover, while ideally your invalidation conditions are such that the AI's playing performance is as good as if you didn't try to plan ahead but just did all calculations when it was the AI's turn, in practice unless the game is designed from the bottom up with the idea of timeslicing AI during the player's turn, it probably won't be. It is a tricky balance deciding just how strict invalidation forcing recalculation you want to work with. You might end up concluding that the benefits aren't worth the effort, especially if your game wasn't designed in a framework based on this in the first place or you've got a very small development team. That's just a rough overview. ANYHOW, whenever you play a turn-based strategy or tactics game that has generally fast AI turns despite being very complex, they are probably employing a variant of forwards planning by timeslicing the player's turn for AI use. After all, why let all that processing power go to waste while the player is staring at the screen, moving the mouse cursor, or thinking up his own plans?
< Message edited by Pi2repsilon -- 6/15/2020 1:56:25 PM >
|