Improvements to the Speed of Calculations?

Norm Koger's The Operational Art of War III is the next game in the award-winning Operational Art of War game series. TOAW3 is updated and enhanced version of the TOAW: Century of Warfare game series. TOAW3 is a turn based game covering operational warfare from 1850-2015. Game scale is from 2.5km to 50km and half day to full week turns. TOAW3 scenarios have been designed by over 70 designers and included over 130 scenarios. TOAW3 comes complete with a full game editor.

Moderators: ralphtricky, JAMiAM

CommC
Posts: 311
Joined: Sat Aug 03, 2002 8:48 am
Location: Michigan, USA

RE: Improvements to the Speed of Calculations?

Post by CommC »

"thousands of calculations" is indeed a trivially small number for modern computers.


"C++, integer arithmetic"

Well, that explains it. C++ is primarily a business language and while it is far better than Fortran, Visual Basic and similar, it is still a pretty slow, high level language. If more of TOAW's calculation intensive operations can be done using machine language calls (or another faster language) that might greatly speed things up.

I like where this thread is going, with brainstorming on ways to speed things up. I like the idea of simplifying the supply calculations as a potentially easy fix to the slowness observed.

User avatar
Captain Cruft
Posts: 3741
Joined: Wed Mar 17, 2004 12:49 pm
Location: England

RE: Improvements to the Speed of Calculations?

Post by Captain Cruft »

Hey that's the answer, just re-write the entire game in assembler! Better yet, blow the code onto a chip and get somebody to manufacture it on a PCI card. No digital download that way though ... [8|]

Sorry [;)]

Seriously, I don't think it's an issue of language. C/C++ are fast enough, indeed they are generally regarded as the fastest compiled languages in common use.

It's more a matter of algorithms and methodologies, like Ralph said.
User avatar
larryfulkerson
Posts: 42791
Joined: Sat Apr 16, 2005 9:06 pm
Location: Tucson, AZ,usa,sol, milkyway
Contact:

RE: Improvements to the Speed of Calculations?

Post by larryfulkerson »

ORIGINAL: CommC
C++ is primarily a business language....

Hmmmm....that's strange I'm a retired computer programmer, worked with computers for over twenty years and I've never heard it described that way. I've never thought of it that way. I have seen it used to build operating systems. I have seen it used to build some of the fastest games on the planet. CommC, my man, you've probably never met Cobol.
Russia’s 41st Army COLLAPSED in Pokrovsk — 25,000 Soldiers KILLED After a RIDICULOUS Russian Assault
https://www.youtube.com/watch?v=T_CtW3GqPQg
User avatar
ralphtricky
Posts: 6675
Joined: Sun Jul 27, 2003 4:05 am
Location: Colorado Springs
Contact:

RE: Improvements to the Speed of Calculations?

Post by ralphtricky »

ORIGINAL: Captain Cruft
Seriously, I don't think it's an issue of language. C/C++ are fast enough, indeed they are generally regarded as the fastest compiled languages in common use.

It's more a matter of algorithms and methodologies, like Ralph said.
Given that it's C++ in name only, and is still essentially C code, I don't think that it gets any faster than that. Even C++ with the modern compilers and a bit of attention to the design is going to be fast enough.

I can do a lot with the algorithms. The original code was written to be understandable and take up little memory. There also weren't a lot of published works on game programming when it was written.

Don't worry, there are a lot of concepts that I can borrow from the RTS and other communities. I've got all the game programming gems books to reference, plus some others.

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.
XPav
Posts: 549
Joined: Wed Jul 10, 2002 2:25 am
Location: Northern California
Contact:

RE: Improvements to the Speed of Calculations?

Post by XPav »

My first advice as someone who just spend the day figuring out why his own C++ code was running slow:

1) Don't trust yourself to guess why the code is going slow. Ignore your gut. Time your code.
2) See rule 1.

If you're not using Visual Studio 6.0 (the last version that had a profiler without going for the $$$ Edition), you can cobble together some timing classes that should work well. Start timer on construction, output tim on destruction when they fall out of scope. Helped me find my problems.

Sounds like Norm did a good job though with his original code, and the main thing making the huge scenarios run slow is, well, because they're huge.

Have fun.
I love it when a plan comes together.
User avatar
a white rabbit
Posts: 1180
Joined: Sat Apr 27, 2002 3:11 pm
Location: ..under deconstruction..6N124E..

RE: Improvements to the Speed of Calculations?

Post by a white rabbit »

..as far as speed goes, i'd say toaw3 is faster than toaw-acow

..based on the Imphal scen
..toodA, irmAb moAs'lyB 'exper'mentin'..,..beàn'tus all..?,
User avatar
ralphtricky
Posts: 6675
Joined: Sun Jul 27, 2003 4:05 am
Location: Colorado Springs
Contact:

RE: Improvements to the Speed of Calculations?

Post by ralphtricky »

ORIGINAL: XPav
If you're not using Visual Studio 6.0 (the last version that had a profiler without going for the $$$ Edition), you can cobble together some timing classes that should work well. Start timer on construction, output tim on destruction when they fall out of scope. Helped me find my problems.
Visual Studio 2005. The same tools still work, BTW. I've been doing more the Break and see where I am style of timing at the moment<g>. It is C code, so there are no objects. I plan to fix that for my own sanity over the next coupld of years.<g>
Sounds like Norm did a good job though with his original code, and the main thing making the huge scenarios run slow is, well, because they're huge.
That's a large part of it. He also has some algorithems that scale geometrically. 300x300 is 10 times bigger than 100x100. If you multpliy by the extra units, it gets even worse.
Have fun.
Oh, I definitely am. Picture scenario design on a HUGE scale<g>

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.
User avatar
a white rabbit
Posts: 1180
Joined: Sat Apr 27, 2002 3:11 pm
Location: ..under deconstruction..6N124E..

RE: Improvements to the Speed of Calculations?

Post by a white rabbit »

..is there any way to slow Elmer down ? esp when he's moving units, blink and he's attacking, how he got there remaining a mystery..
..toodA, irmAb moAs'lyB 'exper'mentin'..,..beàn'tus all..?,
XPav
Posts: 549
Joined: Wed Jul 10, 2002 2:25 am
Location: Northern California
Contact:

RE: Improvements to the Speed of Calculations?

Post by XPav »

ORIGINAL: ralphtrick
That's a large part of it. He also has some algorithems that scale geometrically. 300x300 is 10 times bigger than 100x100. If you multpliy by the extra units, it gets even worse.

Ahhh.... O(N^2)

Yay!
I love it when a plan comes together.
User avatar
ralphtricky
Posts: 6675
Joined: Sun Jul 27, 2003 4:05 am
Location: Colorado Springs
Contact:

RE: Improvements to the Speed of Calculations?

Post by ralphtricky »

ORIGINAL: XPav
ORIGINAL: ralphtrick
That's a large part of it. He also has some algorithems that scale geometrically. 300x300 is 10 times bigger than 100x100. If you multpliy by the extra units, it gets even worse.

Ahhh.... O(N^2)

Yay!
Yep. I'm thinking I can find some algorithms that are O(n log n) at worst, or teach it about land masses, and cut down on how big the search space is.

I can also do a lot to trade storage space for time, and avoid the calculation altogether.
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.
Post Reply

Return to “Norm Koger's The Operational Art Of War III”