ralphtricky
Posts: 6685
Joined: 7/27/2003 From: Colorado Springs Status: offline
|
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! 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
_____________________________
Ralph Trickey TOAW IV Programmer Blog: http://operationalwarfare.com --- My comments are my own, and do not represent the views of any other person or entity. Nothing that I say should be construed in any way as a promise of anything.
|