Improvements to the Speed of Calculations? (Full Version)

All Forums >> [Current Games From Matrix.] >> [World War II] >> Norm Koger's The Operational Art Of War III



Message


RyanCrierie -> Improvements to the Speed of Calculations? (6/23/2006 2:17:33 AM)

Since from what I've been hearing, the AI has become really really good, perhaps next up should be looking into the code in an attempt to speed up the supply calculations, et al for really big scenarios when you first load them up.

I find that with COW, it takes a while for big scenarios to do supply calculations for the first turn, etc.




Bloodybucket28th -> RE: Improvements to the Speed of Calculations? (6/23/2006 3:25:46 AM)

I recall reading somewhere that while Elmer takes his turn in some of the larger scenarios, you'd better find something to do while he ponders...While this might not be all bad depending on what that something else might be[:o], I'm curious to know what TOAWIII users are seeing in this regard. Does the speed of more modern computers pretty much make the wait a thing of the past?




Captain Cruft -> RE: Improvements to the Speed of Calculations? (6/23/2006 3:33:44 AM)

It's not Elmer that takes the time, it's "inter-turn Housekeeping". Namely, calculating supply values for every hex on the map, amongst other things.

I have a very un-modern PC, viz. a PIII-500. Even with this steam-powered equipment the inter-turn wait has not exceeded c.1.5 hours, which was for Fire in the East and Europe Aflame.

The thing is, because TOAW III is a well-behaved Windows application, there is nothing to stop you going off and surfing the web or doing whatever else while you're waiting for the calcs to finish. At least that's been my experience.




Bloodybucket28th -> RE: Improvements to the Speed of Calculations? (6/23/2006 4:22:38 AM)

Wow, an hour and a half? That sounds like a loooong time, but it sure must help to run it on a faster machine or with the non Supersized ("Welcome to Bucket O' Battalions! Would you like fries with your Eastern Front Blizzard Biggie Burger?") scenarios.

Besides, I might get some stuff done around the house if it does take that long.




Captain Cruft -> RE: Improvements to the Speed of Calculations? (6/23/2006 4:39:58 AM)

LOL. I'm up for some of those burgers ;)

I suppose I was merely trying to illustrate the worst case, and illustrate that this game is playable even with equipment well below the official minimum requirements.

If your PC was bought within the last 5 years it will be at least twice as fast as mine, and I would imagine any recent PC will zip through the same calcs in short order.




ralphtricky -> RE: Improvements to the Speed of Calculations? (6/23/2006 5:46:36 AM)

They're still slower than they should be. I've identified two calculations that can take a long time, the supply calc, and the reconstitution check.

That's all I'm going to say about it. [;)]

Ralph




Bloodybucket28th -> RE: Improvements to the Speed of Calculations? (6/23/2006 7:06:06 AM)

A Gumpism from Dr. Frankentrickey, who gave Elmer life!

Or perhaps he is more in the role of Dr. Jones:

"Old programming language, very dangerous. You go first!"




geozero -> RE: Improvements to the Speed of Calculations? (6/23/2006 8:26:57 AM)


quote:

ORIGINAL: ralphtrick

They're still slower than they should be. I've identified two calculations that can take a long time, the supply calc, and the reconstitution check.

That's all I'm going to say about it. [;)]

Ralph



It sound like you have a firm grip on the two major time consuming calculation issues. Look forward to seeing these improved.




Erik2 -> RE: Improvements to the Speed of Calculations? (6/23/2006 10:15:33 AM)


quote:

ORIGINAL: Captain Cruft

It's not Elmer that takes the time, it's "inter-turn Housekeeping". Namely, calculating supply values for every hex on the map, amongst other things.
.....
I


I have one 1km scenario of Crete (300x300 hexes) wich I'm testing for play against the PO.
Elmer does take a very long time pondering his moves as the Allies, this may be related to that there are a lot of individual ships to keep track on. Moving as the Germans is fairly quick.

Erik




Szilard -> RE: Improvements to the Speed of Calculations? (6/23/2006 11:03:02 AM)

Not the most important point, but anyway: I think Elmer might just be good enough now to make testing of scenarios via multiple AI vs AI runs something worth doing, before human vs human etc testing. I'm thinking in terms of *lots* of test runs - 50, 100? - depending on the scenario. Obviously, the faster you can make things, the more runs & the better the testing (hopefully).






glvaca -> RE: Improvements to the Speed of Calculations? (6/23/2006 2:25:56 PM)

on a AMD 3600Mhz with 1GB Ram, the pre-calcs for the FitE scenario takes about 15-20m.
You can do something else while the check is in progress but you will probably lose the "in progress" screen so you have no idea where he's at.
While on the subject, TOAW III is very robust and I have yet to experience a crash even with several instances of the game open at the same time. Good job!
Best,
Glenn




ralphtricky -> RE: Improvements to the Speed of Calculations? (6/23/2006 11:41:30 PM)

quote:

ORIGINAL: Erik Nygaard


quote:

ORIGINAL: Captain Cruft

It's not Elmer that takes the time, it's "inter-turn Housekeeping". Namely, calculating supply values for every hex on the map, amongst other things.
.....
I


I have one 1km scenario of Crete (300x300 hexes) wich I'm testing for play against the PO.
Elmer does take a very long time pondering his moves as the Allies, this may be related to that there are a lot of individual ships to keep track on. Moving as the Germans is fairly quick.

Erik

If you care to email me a copy, I'll try to take a look at it later.

Ralph




ralphtricky -> RE: Improvements to the Speed of Calculations? (6/23/2006 11:43:42 PM)

quote:

ORIGINAL: geozero
It sound like you have a firm grip on the two major time consuming calculation issues. Look forward to seeing these improved.

Well, some people were complaining that the computer had crashed. That's getting a bit too slow, so I had to look into it.

Ralph




CommC -> RE: Improvements to the Speed of Calculations? (6/24/2006 11:14:18 PM)

15 or 20 min for any calculations for a game as simple as this one is simply unacceptable. With the speed of modern computers, the slow down is not due to computational capacity of the computer, but simply poor programming. I hope Matrix will put a priority on improving this.





Erik2 -> RE: Improvements to the Speed of Calculations? (6/25/2006 12:46:12 AM)

So you think the game is simple?
Have you looked at a good researched scenario in the editor?
There are a lot of details there that the system needs to calculate for each side each turn,
especially if you play against the PO.
Believe me, there's nothing simplistic about TOAW.




a white rabbit -> RE: Improvements to the Speed of Calculations? (6/26/2006 6:34:19 PM)


quote:

ORIGINAL: CommC

15 or 20 min for any calculations for a game as simple as this one is simply unacceptable. With the speed of modern computers, the slow down is not due to computational capacity of the computer, but simply poor programming. I hope Matrix will put a priority on improving this.




..simple ?!?!?..

..roflmao...




geozero -> RE: Improvements to the Speed of Calculations? (6/26/2006 6:52:31 PM)

Speed of the game turn is relative to the Computer you use, specifically RAM and Processor type and speed. This is true for any game, there's no mystery here.

If you have a Pentium 2 with 256MB Ram it will be immensely slower than if you are using a new P4 with 2GB ram (which is what I have).

I think most people that have played the series will agree that the game is not simple. But I think the statement is valid in terms that the game is not graphical intensive, there is no 3D rendering and things like that which chew up a lot of processing power.

I'm not a programmer, bu I think it is probably written in older computer language with long and complex math calculations, etc.  The code might be messy.  It could likely be tightened up, but would require a new re-write entirely, thus a true NEW game. 

Until that  happens, all I can suggest is upgrade your PC, get as much RAM as possible, run it under a fast processor and WinXP (God forbid you are still using Win98 or Win95).

In any event there is always the other choice while waiting for turn completion....

Heat up a pizza and pop open another beer.[:D]




golden delicious -> RE: Improvements to the Speed of Calculations? (6/26/2006 9:02:08 PM)


quote:

ORIGINAL: geozero

If you have a Pentium 2 with 256k Ram it will be immensely slower than if you are using a new P4 with 2MB ram (which is what I have).


Presumably you mean 256 MB and 2 GB respectively. My old Atari ST had 1 MB of RAM, and that was 18 years ago.




geozero -> RE: Improvements to the Speed of Calculations? (6/26/2006 9:31:04 PM)


quote:

ORIGINAL: golden delicious


quote:

ORIGINAL: geozero

If you have a Pentium 2 with 256k Ram it will be immensely slower than if you are using a new P4 with 2MB ram (which is what I have).


Presumably you mean 256 MB and 2 GB respectively. My old Atari ST had 1 MB of RAM, and that was 18 years ago.



My bad. Post edited.

BTW - I used a Commodore which only booted up from a 5.25" floppy.




golden delicious -> RE: Improvements to the Speed of Calculations? (6/26/2006 9:52:03 PM)


quote:

ORIGINAL: geozero

BTW - I used a Commodore which only booted up from a 5.25" floppy.


That's nothing. Before the ST we had a Commodore which loaded of cassette tapes. Those were the days.




Chuck2 -> RE: Improvements to the Speed of Calculations? (6/26/2006 10:03:09 PM)

quote:

ORIGINAL: golden delicious


quote:

ORIGINAL: geozero

BTW - I used a Commodore which only booted up from a 5.25" floppy.


That's nothing. Before the ST we had a Commodore which loaded of cassette tapes. Those were the days.


You had a computer when you where 3-years-old? [&o]




golden delicious -> RE: Improvements to the Speed of Calculations? (6/26/2006 10:07:19 PM)

quote:

ORIGINAL: Chuck2

You had a computer when you where 3-years-old?


I have two older brothers.




CommC -> RE: Improvements to the Speed of Calculations? (6/27/2006 4:21:00 AM)


quote:

ORIGINAL: Erik Nygaard

So you think the game is simple?
Have you looked at a good researched scenario in the editor?
There are a lot of details there that the system needs to calculate for each side each turn,
especially if you play against the PO.
Believe me, there's nothing simplistic about TOAW.



Yeah, the large scenarios can be complex in that they include a lot of detail for the player to keep track of, but in terms or numbers of calculations, it is only a 2D game. 3d games require a lot more calculations and much more complex coding. TOAW3's code must be written in a very inefficient language or have major problems to take so long to make so few calculations.






golden delicious -> RE: Improvements to the Speed of Calculations? (6/27/2006 4:43:19 AM)


quote:

ORIGINAL: CommC

Yeah, the large scenarios can be complex in that they include a lot of detail for the player to keep track of, but in terms or numbers of calculations, it is only a 2D game. 3d games require a lot more calculations and much more complex coding. TOAW3's code must be written in a very inefficient language or have major problems to take so long to make so few calculations.


The throwaway remark that it's "only a 2D game" really misses the level of depth in TOAW. For example, the replacement calculations for the larger scenarios have to consider the demans of thousands of units for around a dozen different items each. That is a hugely complicated calculation.




geozero -> RE: Improvements to the Speed of Calculations? (6/27/2006 5:53:35 AM)

quote:

ORIGINAL: golden delicious


quote:

ORIGINAL: CommC

Yeah, the large scenarios can be complex in that they include a lot of detail for the player to keep track of, but in terms or numbers of calculations, it is only a 2D game. 3d games require a lot more calculations and much more complex coding. TOAW3's code must be written in a very inefficient language or have major problems to take so long to make so few calculations.


The throwaway remark that it's "only a 2D game" really misses the level of depth in TOAW. For example, the replacement calculations for the larger scenarios have to consider the demans of thousands of units for around a dozen different items each. That is a hugely complicated calculation.


It's not a throw away comment.

From this link http://www.cygnus-software.com/papers/x86andinfinity.html I give you the following:


Modern microprocessors, such as the Pentium 4 and the Athlon, can do floating point calculations at a tremendous speed. Floating point addition takes three to five clock cycles, so at 3 GHz a Pentium 4 can do about 600 million additions per second. Better yet, the floating point unit is heavily pipelined, meaning that many operations can be going on simultaneously. If your code is well designed and if there aren't too many dependencies, these processors can do a floating point add every cycle - so that 3 GHz Pentium 4 can actually do about 3 billion additions per second! That's pretty amazing considering that these calculations are being done with up to 19 decimal digits of accuracy. Wow.


Therefore, it comes down to a few points:

*** Well written and tight code.

*** A fast code language.

*** A fast processor.

*** Adequate RAM.

The first two are software dependent. Therefore, we can conclude that if TOAW is taking more than 30-60 seconds per turn, the code is bad, broken, or it's just not a fast language.

The last two points are user dependent. If you are not using a fast processor with adeuqte RAM your turns will simply take longer. Although it's a cliche, having the latest drivers for everything on your PC greatly helps.

SO, no, it's not a throw away comment. It's legit. Factual. Period.




ralphtricky -> RE: Improvements to the Speed of Calculations? (6/27/2006 7:30:47 AM)

quote:

ORIGINAL: geozero

quote:

ORIGINAL: golden delicious


quote:

ORIGINAL: CommC

Yeah, the large scenarios can be complex in that they include a lot of detail for the player to keep track of, but in terms or numbers of calculations, it is only a 2D game. 3d games require a lot more calculations and much more complex coding. TOAW3's code must be written in a very inefficient language or have major problems to take so long to make so few calculations.


The throwaway remark that it's "only a 2D game" really misses the level of depth in TOAW. For example, the replacement calculations for the larger scenarios have to consider the demans of thousands of units for around a dozen different items each. That is a hugely complicated calculation.


That's not why it takes to long, that's a very quick calculation. The slow part is going over the entire map and figuring out how far away the point is from where it's supposed to reappear, friendly supply, cities, etc. It's in finding exactly the right place to put that unit![8D]
quote:



It's not a throw away comment.

From this link http://www.cygnus-software.com/papers/x86andinfinity.html I give you the following:


Modern microprocessors, such as the Pentium 4 and the Athlon, can do floating point calculations at a tremendous speed. Floating point addition takes three to five clock cycles, so at 3 GHz a Pentium 4 can do about 600 million additions per second. Better yet, the floating point unit is heavily pipelined, meaning that many operations can be going on simultaneously. If your code is well designed and if there aren't too many dependencies, these processors can do a floating point add every cycle - so that 3 GHz Pentium 4 can actually do about 3 billion additions per second! That's pretty amazing considering that these calculations are being done with up to 19 decimal digits of accuracy. Wow.


An interesting point that has no relevance for several reasons.

You can typically take advantage of the pipelining in 3D matrix operations and libraries, A typical program won't see much advantage because of it.

The minimum requirements aren't a P4

There are no floating point operations in TOAW III. None. Zip. Nada.

There aren't any memory allocations either, outside of the sound system.
quote:



Therefore, it comes down to a few points:

*** Well written and tight code.

Mostly, it is. This was designed many years ago, so there are some algorithms like the path-finding algorithm that need to be rewritten. It's not a bad algorithm, but there's a later one (A*) that's more efficient. The code is actually pretty tight for the most part. There were some design decisions that went for low memory usage instead of speed. There are local optimizations, like eliminating redundant checks, and moving temporary values out of a global array that can speed things up.[;)]
quote:


*** A fast code language.

C++, It's got most of the optimizations turned on, future upgrades will turn on the rest of them. C++, integer arithmetic, bitblts, no memory allocations. It doesn't get much faster than that.[:-]
quote:


*** A fast processor.

Read the minimum requirements.
quote:


*** Adequate RAM.

Without the sound ligrary, it only takes something like 24Meg.
quote:


The first two are software dependent. Therefore, we can conclude that if TOAW is taking more than 30-60 seconds per turn, the code is bad, broken, or it's just not a fast language.

It's also some incredibly complicated processing. Searching for a patch between hexes on a 300x300 grid isn't always quick, especially if there's an island involved. Switching to A* will help some with that, but there is still going to be a lot of processing happening.
quote:


The last two points are user dependent. If you are not using a fast processor with adeuqte RAM your turns will simply take longer. Although it's a cliche, having the latest drivers for everything on your PC greatly helps.

SO, no, it's not a throw away comment. It's legit. Factual. Period.

New paragraph...

Read the above inline comments. It's Legit, It's Factual, it has absolutely no relevance.[:'(]

The difference between 2D and 3D games isn't what you seem to think it is. I could easily slap a 3D front-end onto TOAW, the graphics card would take the brunt of the speed hit, you wouldn't notice a thing. The supply calculations are what take up the majority of the time. How many RTS games calculate supply lines the way that TOAW does?

Ralph Trickey




geozero -> RE: Improvements to the Speed of Calculations? (6/27/2006 8:27:36 AM)

Fair enough.

On any given map 50% or more of the hexes are never used. 

Is there a way to avoid checking supply on hexes where no activity has taken place (i.e., no units have moved into or out out of)?  Seems that would speed things up.[:D]




Szilard -> RE: Improvements to the Speed of Calculations? (6/27/2006 8:38:53 AM)

The optimal-reentry-point issue should be easy to fix. Delete "optimal", and just do something like: on/adjacent to unit's formation HQ; or if none, on/adjacent to a cooperative HQ close to evaporation position; or if none, on/adjacent to a nearby supply point; or if none, don't reconstitute.

You could argue that if the formation HQ happens to be 100's of km away, it wouldn't be realistic. But you can say the same thing about salvaged equipment from an evaporated unit being available as replacements for a distant, unrelated unit.

Supply paths bug me: in real life, there's nothing which corresponds to finding the optimal supply route to every point on the map. It'd be more realistic and also inherently faster to model something like (not necessarily optimal) supply lines connecting units and HQs. But I guess an easier fix might be to trace optimal routes to just on-map units, rather than to every single hex, which I assume is what happens now.




ralphtricky -> RE: Improvements to the Speed of Calculations? (6/27/2006 8:49:55 AM)

There are a lot of things I can do. Probably the biggest help for the supply lookups is to look into rewriting it using the newer A* pathfinding algorithms. I'll have to write all that first, of course.[;)]

As a short term fix, I also might look into moving things out of this 300x300x48 array, and into a 300x300 array. Then things like clearing the array, etc. might be faster[;)]





JAMiAM -> RE: Improvements to the Speed of Calculations? (6/27/2006 8:58:23 AM)


quote:

ORIGINAL: Szilard

The optimal-reentry-point issue should be easy to fix. Delete "optimal", and just do something like: on/adjacent to unit's formation HQ; or if none, on/adjacent to a cooperative HQ close to evaporation position; or if none, on/adjacent to a nearby supply point; or if none, don't reconstitute.

I don't know about that being an "easy" fix, since it would require a major departure from the current model of a 1-4 week window, and fixed position, for the reconstituted units appearing. Now, if sufficient equipment is available, then it is pulled, committed to a unit, and the unit is stuck on the scheduled reinforcements track to appear at a specific position, at some point in time 1-4 weeks away. To have it dependent upon "finding" an HQ to reappear next to, when the time comes for it to show up on the map, and failing that either redump the equipment into inventory, or continually be reassigned a new reconstitution point based on HQ's that may or may not still exist on the map, seems to me to be inherently more problematic.




Page: [1] 2   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
1.921875