unbelievable slowly

Do you need help? Ask here!

Bug reporting belongs here: http://developer.wz2100.net/newticket
Mr. Impact
Greenhorn
Posts: 8
Joined: 06 Dec 2007, 12:42

unbelievable slowly

Post by Mr. Impact »

Hi

I tried to play Warzone 2.0.8 on this Computer:

AMD 1600 MHz
ATI 9600 XT
512 MB RAM
Windows 2000
DirectX 9c

This Game is unplayable at this Computer!

It is unbelievable slowly. Perhaps 0.1 Frames/sec!  :o

I tried different graphic-drivers with no success!

Exactly the same problem @

PII-400 MHz
Voodoo-3 3000
256 MB RAM
Windows ME
DirectX 9c


The Original Warzone (Pumpkin) works very well on both machines!

Any Idea?

much greez

Mr. Impact
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: unbelievable slowly

Post by DevUrandom »

Giel wrote: If you are using Windows and experience bad performance, please try the fixed exe instead, which has a workaround for ATI drivers switching into software mode!
Mr. Impact
Greenhorn
Posts: 8
Joined: 06 Dec 2007, 12:42

Re: unbelievable slowly

Post by Mr. Impact »

Hi, DevUrandom

Thank You for the fast reply.

Next weekend I will test the new exe with the first listed Computer.

I will write my experience in this forum.

The PII with the Voodoo-Card was tested with the new File, but it won´t work.  :'(

much greez

Mr. Impact
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: unbelievable slowly

Post by Buginator »

Mr. Impact wrote: Hi, DevUrandom

Thank You for the fast reply.
Next weekend I will test the new exe with the first listed Computer.
I will write my experience in this forum.
The PII with the Voodoo-Card was tested with the new File, but it won´t work.  :'(
much greez

Mr. Impact
I don't think a 3dfx card would be able to handle the game.

For ATI, also try newer drivers.  It seems that most all ATI people are having issues with the slow down, but none of the Nvidia people.  That points to a ATI problem with the drivers.  They just released 7.12, so maybe they have fixed it.
and it ends here.
User avatar
OvermindDL1
Trained
Trained
Posts: 35
Joined: 22 Dec 2007, 06:58
Location: NM, USA

Re: unbelievable slowly

Post by OvermindDL1 »

Greetings.  I downloaded this project for the first time a couple of hours ago.  I had this same issue (along with the mouse one in the first thread I posted in), and the fix does work for me, however (as I am an insatiably curious programmer) I looked at the normal executable real quick (just a quick profile, I may download the code and debug into it here soon).  Oddly enough, the majority of the time was not spent in the Warzon2100 process, it was not even number two in the list, or three, but rather number four (for this test I just started it up, launched a tutorial game, and exited, which normally would take all but 3 seconds, this took a few minutes due to how slow it is):

Code: Select all

Module Name     		Total % 	Timer samples 	
atioglxx.dll    	       	35.81   	14351         	
processr.sys    	       	34.31   	13748         	
ntkrnlpa.exe    	       	6.05    	2426          	
warzone2100.exe 	       	4.50    	1802          	

4 modules, Total: 32327 samples, 80.68% of total session samples
Now obviously post of the time is being spent in the OpenGL part of the ATI drivers (which I cannot profile into very easilly), with the next most being spent inside processr.sys (again, cannot easilly profile into).  ntkrnlpa.exe seemed to be (understandably) mostly taken up by memory and synchronization handling, no surprise:

Code: Select all

CS:EIP     	Symbol + Offset                            		Total % 	Timer samples 	
0x805b19f6 	NtFreeVirtualMemory                        	       	0.80    	322           	
0x8050080c 	ZwYieldExecution                           	       	0.55    	219           	
0x8053fcf8 	KeReleaseInStackQueuedSpinLockFromDpcLevel 	       	0.42    	170           	
0x80518a28 	MmTrimAllSystemPagableMemory               	       	0.34    	136           	
0x80616e64 	LsaDeregisterLogonProcess                  	       	0.26    	105           	
0x80544c00 	KiDispatchInterrupt                        	       	0.26    	103           	

6 functions, 424 instructions, Total: 1055 samples, 43.49% of samples in the module, 2.63% of total session samples

In the warzone2100 executable, a tremendous amount of time (3.56%, the next highest being only 0.04%) being taken up by SDLNet_Read32:

Code: Select all

CS:EIP   	Symbol + Offset      	64-bit 	Total % 	Timer samples 	
0x585a20 	SDLNet_Read32        	       	3.58    	1434          	
0x5cd6e7 	SDLNet_Read32+294087 	       	0.17    	69            	
0x5cd6ee 	SDLNet_Read32+294094 	       	0.16    	66            	
0x5cd2e2 	SDLNet_Read32+293058 	       	0.04    	17            	
0x5df333 	SDLNet_Read32+366867 	       	0.03    	11            	
0x5de298 	SDLNet_Read32+362616 	       	0.03    	13            	
0x5d87eb 	SDLNet_Read32+339403 	       	0.03    	11            	
0x5ccd32 	SDLNet_Read32+291602 	       	0.03    	14            	
0x5ccd30 	SDLNet_Read32+291600 	       	0.03    	14            	
0x5ccd2a 	SDLNet_Read32+291594 	       	0.03    	14            	
0x5ccd20 	SDLNet_Read32+291584 	       	0.03    	12            	
0x5a2571 	SDLNet_Read32+117585 	       	0.03    	13            	
0x5a2561 	SDLNet_Read32+117569 	       	0.03    	11            	
0x5a253f 	SDLNet_Read32+117535 	       	0.03    	11            	

1 function, 13 instructions, Total: 276 samples, 15.32% of samples in the module, 0.69% of total session samples
That is the profile of it and its usage in order of time taken, the top 13 are displayed as they were the most, they are all pretty well like that however.  What is interesting here is a couple reasons, first, not enough time is taken up to account for a slowdown, so this is not really an issue, definitely something with the OpenGL code no doubt is the reason for the slowdown.  Second, for just being a network function to read an int32 it seems to take up a rather tremendous amount of time, even extracting an int32 from a bitstream is faster, and that should be slower.  Third, why is this function being called at all in single player (tutorial of all things)?

Overall, it seems the code has an odd slowdown in relation to some SDL functionality.  The SDLNet_Read32 is seemingly being called needlessly, and even for being called it seems to slow, however this does not account for the main issue as to why there is a frame being rendered once every 3 to 10 seconds.  That is obviously due to the way OpenGL is handled, which I could probably take a look into as all my 3d programming takes place on this very computer, in this operating system install, and all in OpenGL, and I have never ran into a speed issue on my Radeon x1950xt (it consistently outperforms all the other brands I have installed in other computers here for my OpenGL code), so there is obviously something being done in the code to cause this software mode switch (which I could try to debug into the code if I get time to download it and watch the gpu profiler to see what instruction is causing the switch to take place).

I do have to ask though, what possessed whom-so-ever to choose SDL?  All my encounters with it have been that it tries to make things look easier to use, but ends up being so freakishly harder then if you just do it yourself with other libraries, not to mention it does have quite a few bugs that have bit me in the rear...
Image
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: unbelievable slowly

Post by Buginator »

OvermindDL1 wrote: That is the profile of it and its usage in order of time taken, the top 13 are displayed as they were the most, they are all pretty well like that however.  What is interesting here is a couple reasons, first, not enough time is taken up to account for a slowdown, so this is not really an issue, definitely something with the OpenGL code no doubt is the reason for the slowdown.  Second, for just being a network function to read an int32 it seems to take up a rather tremendous amount of time, even extracting an int32 from a bitstream is faster, and that should be slower.  Third, why is this function being called at all in single player (tutorial of all things)?

Overall, it seems the code has an odd slowdown in relation to some SDL functionality.  The SDLNet_Read32 is seemingly being called needlessly, and even for being called it seems to slow, however this does not account for the main issue as to why there is a frame being rendered once every 3 to 10 seconds.  That is obviously due to the way OpenGL is handled, which I could probably take a look into as all my 3d programming takes place on this very computer, in this operating system install, and all in OpenGL, and I have never ran into a speed issue on my Radeon x1950xt (it consistently outperforms all the other brands I have installed in other computers here for my OpenGL code), so there is obviously something being done in the code to cause this software mode switch (which I could try to debug into the code if I get time to download it and watch the gpu profiler to see what instruction is causing the switch to take place).

I do have to ask though, what possessed whom-so-ever to choose SDL?  All my encounters with it have been that it tries to make things look easier to use, but ends up being so freakishly harder then if you just do it yourself with other libraries, not to mention it does have quite a few bugs that have bit me in the rear...
Hi, thanks for the input.

What profiler are you using?  Also, have you tried the latest ATI drivers, the 7.12 series?

The main reason SDL was chosen was because it was the only one that supports macs & windows & linux & some others.

I also think in the original code, it was doing the network calls in SP games.  Yeah, it shouldn't do it, but there are lots of 'weird' things going on in the codebase.

For the openGL slowdown, I think the issue was that we were using:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 3);  And that would cause the software fallback with ATI drivers.
so it was changed to glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 3); to 'fix' it.

Most of the other calls are pretty normal openGL 1.x calls.

I would be curious to see how this version of warzone runs on your machine:
http://svn.gna.org/svn/warzone/trunk
and it ends here.
User avatar
OvermindDL1
Trained
Trained
Posts: 35
Joined: 22 Dec 2007, 06:58
Location: NM, USA

Re: unbelievable slowly

Post by OvermindDL1 »

I get an alert when a new driver comes out, so I always stay updated (kind of a necessity for what I program, I like to see if things break with new drivers...).

Just as a test, have you tried glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 1000); just to see if it causes a slow-down on systems where people experience it?

Are there any dependencies I should download to compile the trunk, or is it all self-contained?

EDIT1:  I used to use a few different profiler's, but anymore I pretty much just use CodeAnalyst.  It is far more useful then what I showed earlier when the symbols and source code of the app you are profiling are on the computer though.

EDIT2:  I downloaded the trunk, got sdl 1.2.12 (latest stable).  And my compiler appear incapable of full C99 support (varidic macros to be exact...), may need to change those before I can do anything...

EDIT3:  Also unable to find physfs.h, script_lexer.lex.c, script_parser.tab.c, probably a few others...

EDIT4:  And no SDL is not the only thing that supports Win/Mac/*Nix, there are other, vastly better things, not an all-in-one like SDL is, but easier to use and made well.
Last edited by OvermindDL1 on 22 Dec 2007, 09:29, edited 1 time in total.
Image
cybersphinx
Inactive
Inactive
Posts: 1695
Joined: 01 Sep 2006, 19:17

Re: unbelievable slowly

Post by cybersphinx »

OvermindDL1 wrote:Now obviously post of the time is being spent in the OpenGL part of the ATI drivers
Not surprising, as it renders in software.
with the next most being spent inside processr.sys
Whatever that may be, probably also something to do with the software rendering.
In the warzone2100 executable, a tremendous amount of time (3.56%, the next highest being only 0.04%) being taken up by SDLNet_Read32
Which isn't that much, especially considering that it's running roughly a hundred times slower than it's supposed to. Run at the usual speed, the profile might look completely different.
Third, why is this function being called at all in single player (tutorial of all things)?
I think the netcode always runs, to have less different codepaths between single and multi player.
I do have to ask though, what possessed whom-so-ever to choose SDL?  All my encounters with it have been that it tries to make things look easier to use, but ends up being so freakishly harder then if you just do it yourself with other libraries, not to mention it does have quite a few bugs that have bit me in the rear...
It is simple, tested, available on all platforms (and was three years ago when work on the source began) and there are way more important things to do than exchange the backend again.
OvermindDL1 wrote:Just as a test, have you tried glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 1000); just to see if it causes a slow-down on systems where people experience it?
Why? Evidently ATI regards GL_TEXTURE_MAX_LOD as not important enough to support it in their driver (which I can understand, as the difference to GL_TEXTURE_MAX_LEVEL is a) not very obvious, and b) quite useless, imo). And I set it to 3 for a reason, even if 1000 worked, we could just omit the complete line.
EDIT1:  I used to use a few different profiler's, but anymore I pretty much just use CodeAnalyst.  It is far more useful then what I showed earlier when the symbols and source code of the app you are profiling are on the computer though.
A good profile might be interesting, though currently the graphics engine is the main problem - no change to any other code will make much difference.
EDIT3:  Also unable to find physfs.h, script_lexer.lex.c, script_parser.tab.c, probably a few others...
You need libphysfs, flex and yacc for that.
EDIT4:  And no SDL is not the only thing that supports Win/Mac/*Nix, there are other, vastly better things, not an all-in-one like SDL is, but easier to use and made well.
As far as I remember SDL was the least of our problems, I see no reason to use anything else.
We want information... information... information.
User avatar
Buginator
Professional
Professional
Posts: 3285
Joined: 04 Nov 2007, 02:20

Re: unbelievable slowly

Post by Buginator »

OvermindDL1 wrote: I get an alert when a new driver comes out, so I always stay updated (kind of a necessity for what I program, I like to see if things break with new drivers...).

Just as a test, have you tried glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 1000); just to see if it causes a slow-down on systems where people experience it?

Are there any dependencies I should download to compile the trunk, or is it all self-contained?

EDIT1:  I used to use a few different profiler's, but anymore I pretty much just use CodeAnalyst.  It is far more useful then what I showed earlier when the symbols and source code of the app you are profiling are on the computer though.

EDIT2:  I downloaded the trunk, got sdl 1.2.12 (latest stable).  And my compiler appear incapable of full C99 support (varidic macros to be exact...), may need to change those before I can do anything...

EDIT3:  Also unable to find physfs.h, script_lexer.lex.c, script_parser.tab.c, probably a few others...

EDIT4:  And no SDL is not the only thing that supports Win/Mac/*Nix, there are other, vastly better things, not an all-in-one like SDL is, but easier to use and made well.
On the GNA site, you can get most of the stuff you need: http://download.gna.org/warzone/development/
Then you would still need to get quesoGLC (http://quesoglc.sourceforge.net/),  & popt (http://gnuwin32.sourceforge.net/packages/popt.htm).
Of course, the lexer stuff as was mentioned, you need Bison & flex.

Which compiler you using?  There is a .sln file for VS available.
and it ends here.
User avatar
OvermindDL1
Trained
Trained
Posts: 35
Joined: 22 Dec 2007, 06:58
Location: NM, USA

Re: unbelievable slowly

Post by OvermindDL1 »

I guessed on the flex and so forth when I noticed some files with the same name but a different extension, never heard of libphysfs, however I found it, makes sense why I have not heard of it since I use a different type of thing for the same purpose in my projects.

And it makes sense why I have never seen that ATI issue, never used that instruction (not entirely sure what it is for, mip-level restriction?  I generally handle my own mipmaps).  SDL, however, I have had worlds of problems with.  Tend to avoid it now if at all possible.  If I can get this code-base to compile though, I will test making my own window and just passing SDL the handle to see if that fixes the mouse issue.

As for another profile on the working exe here:

Code: Select all

Module Name                    	64-bit 	Total % 	Timer samples 	
processr.sys                   	       	54.96   	22359         	
warzone2100-clamp_maxlevel.exe 	       	8.19    	3331          	
ntkrnlpa.exe                   	       	7.98    	3246          	

3 modules, Total: 28936 samples, 71.13% of total session samples
And yes, apparently processr.sys is just the Idle loop, and I have two cores so it tends to remain about 50%.  I am not used to it showing up in my profiles since most things I profile are heavy multi-threaded executables.  Always learning something...

Either way, wz2100 itself:
And of the app itself, I need to build with the symbols...  (this was taken 30 seconds after the game was launched so it is in the main rendering loop, for thirty seconds):

Code: Select all

CS:EIP   	Symbol + Offset 	Thread ID 		Total % 	Timer samples 	
0x5124cf 	NO SYMBOL       	          	       	0.17    	101           	
0x5124f5 	NO SYMBOL       	          	       	0.16    	96            	
0x42d2d2 	NO SYMBOL       	          	       	0.13    	79            	
0x5124e2 	NO SYMBOL       	          	       	0.12    	73            	
0x5124d5 	NO SYMBOL       	          	       	0.12    	75            	
0x42a283 	NO SYMBOL       	          	       	0.10    	58            	
0x5124f0 	NO SYMBOL       	          	       	0.09    	53            	
0x5124dd 	NO SYMBOL       	          	       	0.09    	54            	
0x58fc70 	SDLNet_TCP_Open 	          	       	0.05    	28            	

9 functions, 16 instructions, Total: 617 samples, 19.91% of samples in the module, 1.03% of total session samples

Most of the time this one is spent inside the kernal though:

Code: Select all

CS:EIP     	Symbol + Offset                            	Thread ID 		Total % 	Timer samples 	
0x805b19f6 	NtFreeVirtualMemory                        	          	       	1.07    	645           	
0x8050080c 	ZwYieldExecution                           	          	       	0.58    	350           	
0x8053fcf8 	KeReleaseInStackQueuedSpinLockFromDpcLevel 	          	       	0.45    	270           	
0x80544c00 	KiDispatchInterrupt                        	          	       	0.29    	177           	
0x80518a28 	MmTrimAllSystemPagableMemory               	          	       	0.27    	165           	
0x80545d0c 	InterlockedDecrement                       	          	       	0.23    	138           	
0x8051625c 	MmIsNonPagedSystemAddressValid             	          	       	0.19    	113           	
0x80616e64 	LsaDeregisterLogonProcess                  	          	       	0.18    	109           	
0x8053fcc0 	KeAcquireInStackQueuedSpinLockAtDpcLevel   	          	       	0.17    	100           	

9 functions, 828 instructions, Total: 2067 samples, 54.83% of samples in the module, 3.44% of total session samples
Most of the app time is spent in ATI's OpenGL handling, specifically this one function

Code: Select all

CS:EIP     	Symbol + Offset 	Thread ID 		Total % 	Timer samples 	
0x690d6250 	atiPPHSN        	          	       	4.49    	2704          	

1 function, 1326 instructions, Total: 2704 samples, 82.84% of samples in the module, 4.49% of total session samples
Although the app is plenty fast enough as it is (makes sense considering the age), it is only taking up 14.46% of the cpu time over both my cores (double that to about 29% for a single core).  On slower computers (more along the lines of when this game was released), it would still fare well, but it is spending most of its time in the OpenGL API, which would hurt it on those older systems.

Considering it is more then fast enough for modern systems, I do not think any real time should be spent on making it faster, just fixing bugs and adding features (and fixing bugs those features will invariably introduce of course).  Although you can probably guess what bug I am wanting fixed. :)  I doubt I will have any more time to work on it for a few days though.

EDIT (new post right before I posted):  I think I have everything I need now, already have flex and bison windows builds (what parameters do you use to build your files?), and never heard of quesoglc, will take a look when I get some more time.

I am using Visual Studio 2k3.  I own a license to 2k5 standard, however dealing with the 2k5 CRT is not fun the few times I have used it, so I am sticking with 2k3 until I am forced to otherwise.  I made my own project by down-grading the 2k5 project so that is all fine, and changed the varidic macro's to something more useful for that compiler.  Only build errors/warnings I have right now is that missing header and couple of missing files.

And use the popt method of command-line parsing is by far the best, although I usually use boost::program_options, same command-lin syntax, just a different way of working with it, few more options, less dependencies, and so forth.
Last edited by OvermindDL1 on 22 Dec 2007, 21:52, edited 1 time in total.
Image
Giel
Regular
Regular
Posts: 725
Joined: 26 Dec 2006, 19:18

Re: unbelievable slowly

Post by Giel »

OvermindDL1 wrote: And yes, apparently processr.sys is just the Idle loop, and I have two cores so it tends to remain about 50%.  I am not used to it showing up in my profiles since most things I profile are heavy multi-threaded executables.  Always learning something...
Yup, warzone currently only uses a single thread.
OvermindDL1 wrote: Although the app is plenty fast enough as it is (makes sense considering the age), it is only taking up 14.46% of the cpu time over both my cores (double that to about 29% for a single core).
I think that if you'd disable one of your cores you'd get a similar load on that one to your 14.46%. I.e. Warzone itself would _not_ use any more CPU time, your OS & drivers might though.
OvermindDL1 wrote: On slower computers (more along the lines of when this game was released), it would still fare well, but it is spending most of its time in the OpenGL API, which would hurt it on those older systems.

Considering it is more then fast enough for modern systems, I do not think any real time should be spent on making it faster, just fixing bugs and adding features (and fixing bugs those features will invariably introduce of course).  Although you can probably guess what bug I am wanting fixed. :)  I doubt I will have any more time to work on it for a few days though.
Currently cleaning up code and fixing bugs are our top priority. Adding new features is also done from time to time. That doesn't mean though that if we see a good way of speeding up WZ (without it going at the cost of clean code) we won't implement it.
OvermindDL1 wrote: I am using Visual Studio 2k3.  I own a license to 2k5 standard, however dealing with the 2k5 CRT is not fun the few times I have used it, so I am sticking with 2k3 until I am forced to otherwise.  I made my own project by down-grading the 2k5 project so that is all fine, and changed the varidic macro's to something more useful for that compiler.  Only build errors/warnings I have right now is that missing header and couple of missing files.
So vs2k3 doesn't support __VA_ARGS__ in macros then ? I wish you luck with compiling then, since some of the most used macros we use depend on it (e.g. debug() and ASSERT()). I could otherwise suggest you to use MinGW instead of MSVC, you can use this in combination with the Code::Blocks IDE if you wish, or otherwise the Makefile.raw buildsystem could be used. The Makefile.raw system requires you to use a terminal to compile though... (You'll only need to hit "mingw32-make -f Makefile.raw" in the root of the source tree)
OvermindDL1 wrote: And use the popt method of command-line parsing is by far the best, although I usually use boost::program_options, same command-lin syntax, just a different way of working with it, few more options, less dependencies, and so forth.
Well you do know that Boost is entirely C++ right ? And we're currently only using C, and until all of us agree to using C++ we'll stick with C. Otherwise I must agree boost::program_options is really nice...
"First make sure it works good, only then make it look good." -- Giel
Want to tip/donate? bitcoin:1EaqP4ZPMvUffazTxm7stoduhprzeabeFh
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: unbelievable slowly

Post by DevUrandom »

ColaTurka
New user
Posts: 2
Joined: 26 Dec 2007, 23:08

Re: unbelievable slowly

Post by ColaTurka »

Hi There! I've come across this wonderful project only yesterday using google to try revive the great experiences of this game. Thank you for the oppertunity. However I've come across this problem of it being very slow at the menu and game also with an ATI graphics card and I do not know how to fix it  :(. I downloaded the game and the fix for it but it says it is an unkown file type. Please help I'm desperate to start! Sorry for my ignorance.

Thanks in advance

Ekin
User avatar
DevUrandom
Regular
Regular
Posts: 1690
Joined: 31 Jul 2006, 23:14

Re: unbelievable slowly

Post by DevUrandom »

The exe was 7.3MB big, so I compressed it via 7zip to 1.7MB. If you install 7zip you will be able to extract the exe, which you then will put into the Warzone 2100 directory and run. (You don't need to rename it or replace the old exe. This will even make a 2.0.8-to-2.0.10 patch not work.)
We'll release a 2.0.10 version which fixes these issues for all OSes as soon as we have sorted out a MacOSX sound related issue.
ColaTurka
New user
Posts: 2
Joined: 26 Dec 2007, 23:08

Re: unbelievable slowly

Post by ColaTurka »

THANK YOU!