mr_flappypants
Conscript
Posts: 13
Joined: Sat Aug 13, 2011 3:39 am

A big WOW and a question about 'slow' turns

Sat Aug 13, 2011 3:55 am

Hello. I just purchased this game the other day and gave it a test run. From what I've been able to tell... what an incredible game!! I LOVE it. I'm looking forward to spending more time figuring out how the game works. I won't go into detail as my experience with this game is very limited at the moment but man its got some great potential (as in, a lot of stuff is there that I don't even know about yet!)

Now... as I've read on the various forums and such, yes the time between turns is pretty slow. Its slow enough to where its really cutting into my gaming time (which I don't get a lot of :D ). I understand that this game is 'computationally expensive' just like say Hearts of Iron. Here is where I start to get somewhat confused...

I am a computational scientist. I deal with high-end computers all the time that run quantum software packages all the time (as in high-level cutting edge ab inito computations). As a theoretical chemist, we ALWAYS are talking about 'Computational Expense'. The less expensive a computation, the better... depending on what kind of accuracy you're looking for. These computations ARE REALLY INTENSIVE. I mean, super intensive. I'll spare you the details. That being said... it makes me wonder how a strategy game such as PON can really take nearly 2 minutes (or more depending) to have the AI resolve its turn (and all inclusive computations). I mean I would imagine that the game isn't dealing with complex integrals, Fourier Transforms, etc. I would imagine that the game is dealing with simple arithmetic calculations (a combination of your everyday addition, subtraction, multiplication, and division). A CPU today can handle what...? Millions of these types of computations a second? How much is the game having to make??

I a really big idiot when it comes to programming and I will admit I don't know jack about game development. I know people love to tout the whole "well its a computationally intensive game... so that is why it is slow." But given my previous paragraph I'm more inclined to not align with this school of thought. I propose another theory. Perhaps the code just isn't optimized. I'm really trying to strike up some discussion about 'optimal code' vs. '# of calculations' because today's computers, ones that can handle some really high-end software (which granted is typically veeerry optimized) should be able to handle a strategy game such as this. (Oh I hope I didn't bite myself in the foot with that last sentence). Again I'm not claiming to know anything about programming so I'm just an idiot trying to compare red apples and... green apples.

I should probably list my specs in here for a benchmark:
AMD Phenom II X4 965 3.4GHz
8GB RAM
ATI Radeon 4890 1GB

So, in conclusion, is there perhaps a better way to describe why the game is slow in between turns (or during turns) other than "its computationally intensive" or is THAT REALLY what it is? And if it IS that way, then how come today's tech feel like last decade's tech?

User avatar
Laruku
General of the Army
Posts: 619
Joined: Wed Feb 06, 2008 10:46 pm

Sat Aug 13, 2011 10:11 am

One of the reasons, as far as I know, is the saving of the turns. There is a 24 savegames, one per turn, slowing the process. But it shouldn't... My guess, as yours, is the not optimal use of the code.

montgomeryjlion
Captain
Posts: 177
Joined: Sat Mar 06, 2010 4:18 am

Sat Aug 13, 2011 12:33 pm

If you check the release notes for the latest patch, there is a switch that enables you to get rid of all the older saved games.
This does speed up things quite a bit, so I'd recommend you try it.

User avatar
yellow ribbon
Posts: 2245
Joined: Sun Jun 26, 2011 5:42 pm

Sat Aug 13, 2011 1:41 pm

release notes ?!

if u r still talking about the patch 1.01i (beta) and mean the possible mod of the system.opt (what was, i believe, wrongly stated by devs to be the system.ini in one thread at Paradox forum)

sysBackupNum = 1

i would claim, i havent seen it on AGEOD forum (or missed it)... i got this from Paradox forum only and not all of us are hanging around in both places.

save games problem was annoying, overwriting older saves in backup folders and shuffling the overwrote files to the recycle bin was not that much of the time...

i am using old AMD2 2Ghz, 2GB DDR2 RAM, and a reserve of 4 GB virtual RAM on the HDD, whith an old 256MB graphic card

this overwriting caused me a lot of temporary memory blocked by older saves, thats all, and of course all old files in the recycle bin blocked HDD

people who are using a whole HDD and not only a small partition for the game, shall not have the problems nowadays

i do have the same rates per turn, as many describe it.

shorter than 2,5-3 minutes in the first years (then it would start to overwrite files), about 4 minutes after 10 years, about 7 minutes in the 1870s...

and be aware some do have this high end computers and still have this rates per turn

just, i dont understand this long turn calculation from the very beginning, some threads are reporting...

have programmed it to have 3 backup folders, nothing differs so much but of course the phase between AI turns planing and processing to next turn (your little coal-fired-oven-icon

would say, gained less than a minute....

PS:

please dont compare Paradox games with AGEODs engine... whoever played old HOI2 know how lame it was and how much had to be changed for the speed in IC and even much much more in DH-versions

for me, i am nearly as fast in turn speed as with AACW. thus, i am used to work in the background or read a book, paint my flat or even cook my meals...
ok, i play just two to three turns an hour for game is game and life is life... ;)

mr_flappypants
Conscript
Posts: 13
Joined: Sat Aug 13, 2011 3:39 am

Sat Aug 13, 2011 4:12 pm

Laruku wrote:One of the reasons, as far as I know, is the saving of the turns. There is a 24 savegames, one per turn, slowing the process. But it shouldn't... My guess, as yours, is the not optimal use of the code.


Ah yes this could be an important piece of the puzzle. Whenever we (my lab) run jobs that are hard drive I/O intensive, the job speed tanks because the CPUs are waiting on the read-write processes constantly. The latency for HD I/O is enormous when compared to just RAM. A few ms of wait time really isn't much but when added up over the course of days, well it becomes a huge problem.

So is there a way to disable the autosave feature or something?

User avatar
yellow ribbon
Posts: 2245
Joined: Sun Jun 26, 2011 5:42 pm

Sat Aug 13, 2011 4:29 pm

a minimal invasive way is there...

go to your HDD,

then to your chosen location

/VGN/settings

look for "system"-file

and add the command:

sysBackupNum = 1

number describes how many backup folders shall be used... here, 1

:bonk:

mr_flappypants
Conscript
Posts: 13
Joined: Sat Aug 13, 2011 3:39 am

Sat Aug 13, 2011 11:30 pm

Okay I went ahead and tried that. I really cannot tell if there is a speed difference or not. Checking the Windows log files PON isn't doing any intensive I/O operations to disk that I could see. Anyone out there running this thing on an SSD? If so chime in with how your game is performing so we can either verify or eliminate the I/O variable.

eschatzy
Civilian
Posts: 1
Joined: Mon Aug 15, 2011 6:39 pm

Mon Aug 15, 2011 7:17 pm

I have a ssd. My turns range from 3 to 5 minutes with the first year. What I have noticed using "Process Explorer" is that there are very few reads and writes. But there are more writes then reads. There is a point in the processing of the turn that I see any where between 4 to 80 MB being written to disk. But this is a small blip and is done very fast.

What I do see is that my CPU is almost always pegged at around 50%, with the occasional drop as turn processing switches between tasks.

I have stopped playing until a see some level of improvement in performance in the turn processing, which makes me sad because I really like this game.

System Specs:
* Intel Core 2 Duo processor P8600. (2.4GHz, 1066mHz FSB)
* SSD: Vertex 2
* RAM: 8 GB DDR3
* Video: ATI Mobility Radeon 3650 HD with 256 MB DDR3

Feltan
Private
Posts: 23
Joined: Sun Jun 26, 2011 4:34 pm

Mon Aug 15, 2011 7:43 pm

I am going to assume that the PoN is essentially an application sitting on top of an embedded database/memory structure. I suspect the issue is the SQL (or SQL-like language) that puts data into the database and recalls it. It isn't the CPU that is saturated, rather it is the efficiency of the SQL.

Regards,
Feltan

NightmareGWJ
Civilian
Posts: 2
Joined: Mon Aug 15, 2011 8:52 pm

Mon Aug 15, 2011 9:17 pm

No, there's no SQL. Every thing is in text files. Go to where the game is installed and look in the VGN folder. All the files except the graphics are in plain text and editable by a text editor.

To comment on the OP, it appears that the answer is poorly optimized, nonconcurrent code. PoN is built on the 3rd generation AGE engine (I think it's the same generation engine as RUS and maybe ROP - WiA is version 2.0 if I recall correctly). As the scope of each succeeding AGEOD game has increased, the underlying engine has apparently not been updated to take advantage of multicore processors to handle the increased complexity. From my (admittedly limited) experiments, it appears that PoN is a single-threaded game. What this means in simplistic terms is that all the processing for the entire game happens serially (one thing after another). Highly scalable and/or computationally expensive applications are usually multi-threaded (or concurrent, to throw some CS jargon in here), which allows each core of the computer to independently handle computations. Effectively, if you have a 4-core CPU, PoN will only take advantage of 1 of them. This, coupled with the default 24 save backups is why the turn resolution is so slow.

Sadly, I don't see how the game gets much faster. AGE would need to be rewritten from scratch with concurrency built in to achieve substantive speed improvements. Writing concurrent applications is hard to do correctly and is not something you really can patch in after the fact. I do think the devs are attempting to alleviate the speed issues as best they can (i.e. the sysBackupNum setting in the latest patch), but short of rewriting the engine, it will only get marginally better.

That being said, PoN is unlike anything else out there right now. I think this fact alone overcomes its performance issues and makes it well worth playing.

mr_flappypants
Conscript
Posts: 13
Joined: Sat Aug 13, 2011 3:39 am

Mon Aug 15, 2011 10:20 pm

eschatzy wrote:I have a ssd. My turns range from 3 to 5 minutes with the first year. What I have noticed using "Process Explorer" is that there are very few reads and writes. But there are more writes then reads.


Yeah I figured as much. I had checked the Process Explorer and didn't see much I/O activity.


NightmareGWJ wrote:To comment on the OP, it appears that the answer is poorly optimized, nonconcurrent code.


Also what I had expected. You are mostly correct about my software's efficiency when it comes to parallel computing, however, there are programs out there such as CFOUR and Molpro that can have a 'hard' time running in parallel for certain applications which does significantly increase the computational expense.

I think that this theory of non-optimized efficiency of the game engine needs to be discussed and given more weight in the grand scheme of things. To say that the program is 'computationally intensive' just doesn't give justice (assuming this is the correct theory which has some strong supporting evidence). I'm not bashing the game entirely, but I am pointing out the obvious... that the game is lacking in 'Computer Efficiency' which negatively affects gameplay due to the long turn cycles. Its an honest point to bring up and discuss I think. At its most basic level... PoN is a pretty phenomenal game. But I make the point once again... for those of us who have limited time playing games, it really does chew up a lot of time waiting on the AI to iterate through the turns which is really sad. I've nothing negative to say (as of yet) about the game other than that. I want to commend the devs on a job well done as far as I can see on my limited knowledge of the game. Its just... I think some code optimization should take a priority in the upcoming patches as that alone would significantly improve the game overall. But as previously mentioned... if the game engine needs a revamp then it may not be feasible at all.

I was wondering if a developer could weigh in on this. I would be very interested to hear their take on this theory. That is all.

Warmest regards to the devs and all who have replied in such a helpful and wonderful manner,

Flappy

NightmareGWJ
Civilian
Posts: 2
Joined: Mon Aug 15, 2011 8:52 pm

Mon Aug 15, 2011 11:27 pm

there are programs out there such as CFOUR and Molpro that can have a 'hard' time running in parallel for certain applications which does significantly increase the computational expense.

Sure, there are problems that are quite difficult to parallelize. It may be that PoN's model is one of those.

I am sure there are optimizations to be made that will have some impact on the performance short of an engine re-write. I just question how much impact any optimization may have - if processing a turn goes from 2 minutes to 1:45, that's a 12.5% savings (which as these things go, is pretty big) but 1:45 is still a long time to wait between turns.

In any case, it is an interesting topic to ruminate about (perhaps while waiting for a turn to process :) )

mr_flappypants
Conscript
Posts: 13
Joined: Sat Aug 13, 2011 3:39 am

Tue Aug 16, 2011 2:30 am

if processing a turn goes from 2 minutes to 1:45, that's a 12.5% savings


Which IS huge. 15 seconds isn't much by itself but considering the 1600+ turns in a game that could potentially save you a little over 6 1/2 hours in waiting time. Now THAT is a lot.

User avatar
Pocus
Posts: 25669
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Tue Aug 16, 2011 9:35 am

The issue is mainly about the fact that PON uses a dedicated thread for map handling and the main thread for all the rest, thus creating bottlenecks and lag when the AIs must be computed. The solution is both obvious in theory and complex in practice: have the AIs done on others threads (than the main thread), but as some of you may know, multi-threading an application that is not designed from the start for it is very tricky and time consuming.

There is no such thing as SQL use in the game. The game has its own way of accessing data, which is not the problem here.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

erwin_rommel
Civilian
Posts: 2
Joined: Mon Nov 24, 2008 8:51 pm

turn processing time

Tue Aug 16, 2011 11:16 am

Pocus despite of "multi-threading an application that is not designed from the start for it is very tricky and time consuming" do you think that in future patches you will do it? I mean we can expect an improvement in turn processing time? Otherwise an amazing game... Spain will be playable in the next future? Thanks

User avatar
Sir Garnet
Posts: 935
Joined: Sat Jul 16, 2011 8:23 pm

Tue Aug 16, 2011 2:39 pm

Cutting my 8-9 minute total processing time even by a couple of minutes is less important than the quality of the GAME itself, which is where I think resources should go - and I would fear compromises.

mr_flappypants
Conscript
Posts: 13
Joined: Sat Aug 13, 2011 3:39 am

Tue Aug 16, 2011 3:12 pm

Sir Garnet wrote:Cutting my 8-9 minute total processing time even by a couple of minutes is less important than the quality of the GAME itself, which is where I think resources should go - and I would fear compromises.


You must have a lot of free time you can devote to playing games. I apologize in advance if I assume too much. I for one have very limited time to devote to playing games. A game such as this is very attractive to me, however, because of the lengthy time in between turns, it really reduces the amount of time I'm actually PLAYING the game. Its a personal issue and doesn't apply to everyone but it IS obvious that I'm not the ONLY one who is being negatively affected by this. To say that the 'QUALITY' of the game (where the term 'quality' is explicitly devoid of 'GAME TURN LENGTH') is more important is a bit rash don't you think? If we took this theory to an extreme (I'm doing this to make a point), you would be 'okay' with a game that was superior in gameplay even if it took you an entire day/week/month to iterate through a turn. This of course isn't good. Now lets reduce that back down to your 8-9 minute wait. At 1600+ turns for a GC game that comes to... OVER TWO-HUNDRED HOURS just waiting on the AI to do its thing. That is over a WEEK in pure waiting for an entire game. That is a lot. I think you misjudge the importance of streamlining the backend of this game.

Pocus, thanks for weighing in. As asked by another poster, optimizing the game engine is difficult... okay... but is it feasible? Is it something that is being considered or should we, the game players, just not anticipate such things and move on? I'm not passing judgement on whatever the case may be, you guys know best as to how this can play out. If it seems like it just wouldn't be feasible then so be it. I do like the game and by now you know that I'm not biased with some sort of anti-ageod agenda here. I suppose that should go without saying but I want to be careful how these things come across since we communicate in pure textual format.

User avatar
Sir Garnet
Posts: 935
Joined: Sat Jul 16, 2011 8:23 pm

Tue Aug 16, 2011 10:47 pm

I'm very busy. The secret to processing time is not waiting but instead doing something else useful. I do feel sorry for those who have no alternative to staring at the game as it processes its turn.

mr_flappypants
Conscript
Posts: 13
Joined: Sat Aug 13, 2011 3:39 am

Wed Aug 17, 2011 2:28 am

Sir Garnet wrote:I'm very busy. The secret to processing time is not waiting but instead doing something else useful. I do feel sorry for those who have no alternative to staring at the game as it processes its turn.


I've tried 'alt-tabbing' away from the game and doing other things and the AI does progress through its turn but at times it seems to 'hang' indefinitely meaning, I have to alt-tab back into the game for the AI to proceed at certain points (supply phase?). Could the devs at least make sure that the AI is progressing properly even if the game is not the active window (for now)?

gekkoguy82
Major
Posts: 205
Joined: Fri Aug 17, 2007 4:58 pm
Location: Nashville, TN

Wed Aug 17, 2011 2:36 am

Sir Garnet wrote:I'm very busy. The secret to processing time is not waiting but instead doing something else useful. I do feel sorry for those who have no alternative to staring at the game as it processes its turn.


+1

good time to do the laundry or dust the house. Makes me feel productive while play :D

mr_flappypants
Conscript
Posts: 13
Joined: Sat Aug 13, 2011 3:39 am

Wed Aug 17, 2011 5:41 am

gekkoguy82 wrote:+1

good time to do the laundry or dust the house. Makes me feel productive while play :D


Whats sad is that there is actually ENOUGH TIME in between turns to do stuff like that. :mdr:

User avatar
SonOfAGhost
Sergeant
Posts: 90
Joined: Tue Jun 28, 2011 12:12 am
Location: Soviet Socialist Republic of Canuckistan

Wed Aug 17, 2011 7:39 am

mr_flappypants wrote:I've tried 'alt-tabbing' away from the game and doing other things and the AI does progress through its turn but at times it seems to 'hang' indefinitely meaning, I have to alt-tab back into the game for the AI to proceed at certain points (supply phase?).


I alt-tab every turn that I don't leave the room. It halts at the end of the supply phase, not during. Combat and movement are the next phase so it's actually a good thing to halt there so you don't miss seeing those results when you tab back and it resumes.

Maybe an inconvenience when there's not much going on, but absolutely necessary once you're fighting on multiple continents, and some of those in multiple thatres. The time saved having it run through automatically would be lost many times over trolling through the 2-400 messages I get every turn to figure out what happened.

Cohnman5
Corporal
Posts: 47
Joined: Sun Aug 14, 2011 5:14 pm

improve for the next patch

Wed Aug 17, 2011 10:39 pm

Maybe an inconvenience when there's not much going on, but absolutely necessary once you're fighting on multiple continents, and some of those in multiple thatres. The time saved having it run through automatically would be lost many times over trolling through the 2-400 messages I get every turn to figure out what happened.[/QUOTE]

It would be nice in the next patch to make time between turns faster. Should not be to difficult to turn on multiple core CPU's. :wacko:

User avatar
Rafiki
Posts: 5811
Joined: Thu Aug 24, 2006 9:19 am
Location: Oslo, Norway

Wed Aug 17, 2011 10:59 pm

Cohnman5 wrote:It would be nice in the next patch to make time between turns faster. Should not be to difficult to turn on multiple core CPU's. :wacko:

We understand your concerns, but I'm afraid you cant' expect any quick resolution to this. As Pocus said earlier:
Pocus wrote:(...) as some of you may know, multi-threading an application that is not designed from the start for it is very tricky and time consuming.
[CENTER]Latest patches: AACW :: NCP :: WIA :: ROP :: RUS :: PON :: AJE
Visit AGEWiki - your increasingly comprehensive source for information about AGE games
[SIGPIC][/SIGPIC]
[/CENTER]

User avatar
SonOfAGhost
Sergeant
Posts: 90
Joined: Tue Jun 28, 2011 12:12 am
Location: Soviet Socialist Republic of Canuckistan

Thu Aug 18, 2011 8:02 am

Cohnman5 wrote:It would be nice in the next patch to make time between turns faster. Should not be to difficult to turn on multiple core CPU's. :wacko:


My comment you quoted was about halting when alt-tabbed being a good thing, not about turn processing time. I'm a hardware guy, not software, all I can contribute to that side of things is basic trouble shooting and observation skills :)

Cohnman5
Corporal
Posts: 47
Joined: Sun Aug 14, 2011 5:14 pm

More RAM?

Sat Aug 20, 2011 10:06 pm

Rafiki wrote:We understand your concerns, but I'm afraid you cant' expect any quick resolution to this. As Pocus said earlier:


Perhaps, we should all upgrade to 12 GB of RAM? Would this speed up PON? Game is still great to play, just a little slow and a little too difficult There is a switch that can be added to the system file sysBackupNum = 1. This will speedup turn processing and allow you to delete all backups except one :mdr:

User avatar
Pocus
Posts: 25669
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Mon Aug 22, 2011 1:31 pm

This is not a RAM problem, but a CPU load problem. When computers with several cores were released, people were happy, thinking they would get soon twice, then quadruple processing power. This is not true... For that developers must program differently with a technique that is known to be an hornet's nest or which is at least quite time consuming to make it right (one of the first advice you get when you start multi-threading an application is: if you can avoid doing it, don't do it! Then the second one will be: keep multi-threading to the minimum possible).
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Hobbes
Posts: 4438
Joined: Sat Mar 11, 2006 12:18 am
Location: UK

Mon Aug 22, 2011 7:06 pm

I look after one program at work that uses multi-threading, luckily it rarely goes wrong but when it does it's a nightmare to fix.

PBEM :)

Cheers, Chris

Return to “Pride of Nations”

Who is online

Users browsing this forum: No registered users and 11 guests