The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
December 07, 2021, 10:47:29 am
Home Help Search Login Register
News: Paul & Fred have reached a settlement with Stardock!

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Technical Issues (Moderator: Death 999)
| | |-+  Opengl modes don't work in Win98
« previous next »
Pages: [1] 2 3 Print
Author Topic: Opengl modes don't work in Win98  (Read 9306 times)
Yuptar
Frungy champion
**
Offline Offline

Posts: 51



View Profile
Opengl modes don't work in Win98
« on: September 06, 2006, 10:17:06 pm »

Yes, I'm still using a creaky old Win98 system. Smiley I can get the game to run in 640X480 'frame buffer' mode but anything higher (which the docs say requires opengl) will produce a white screen with no visible images. The game seems to be running, because I can hear the menu boops when using the arrow keys. But obviously this is useless when I get no visible feedback. The system is Win98 ('first' edition) with a Matrox G200 video card. This is a few years old, but it does have OpenGL according to the manual. Is it possible that updates to the standard since this was published are causing the problems? Is there possibly some updated DLL that I could get somewhere?

I'd really like to get OpenGL to work for the sake of the hardware acceleration. This system is 'only' a 400 Mhz K6-2 and the game uses just about all available CPU when in play mode.
« Last Edit: September 06, 2006, 10:18:40 pm by Yuptar » Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: Opengl modes don't work in Win98
« Reply #1 on: September 07, 2006, 08:08:51 am »

OpenGL support is typically provided under Windows by the display driver; grab the latest one for your card from Matrox's driver download page and install it. As far as I can tell, that should fix it.
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
Yuptar
Frungy champion
**
Offline Offline

Posts: 51



View Profile
Re: Opengl modes don't work in Win98
« Reply #2 on: September 07, 2006, 11:48:57 pm »

A little research shows that the G200 has always had problems with OpenGL. That seems to be this card's Achilles' heel. I'm using the latest driver that works on my system. The 'really' latest (and last) causes unexplained problems (like hard lockups). But what I've got is from 2001, not 1998, so it's got a reasonably competent OpenGL interface even if it is using a 'wrapper'. I suppose it would not really save much CPU given the cheat of simply redirecting OpenGL calls to DirectX calls. But I would like to be able to use the higher resolutions.  (Maybe they can extend the DirectX modes to higher resolutions by the time it reaches the 1.0 release?)

I have another system with a Matrox G450 card. On this one, the OpenGL mode doesn't go to a flat white screen, but it still has serious problems. Things get redrawn at wrong locations in the window, making it difficult or impossible to follow what is happening in the game. Going back to 'frame buffer' mode fixes this.

The thing is, the 3D screen savers that come with Windows 98 are also OpenGL and they all work perfectly on both systems. So it looks like something is not being done right with the setup or system calls in UQM. It's quite good for version 0.5 but plainly not done yet. Smiley Lots of little things seem to be unfinished or typoed. The debug log shows lots of unexplained errors:

Many instances of "Warning: Can't open 'lbm/mainmenu.ogg' " (when I've selected PC music and the .ogg files should not be required)

Many, many instances of "Trying to get undefined resource 00000000" (A really 'useful' error message! Tongue )

And then some ambiguous ones that I'm not sure are errors though they LOOK like errors:

"Thread 'Starcon2Main' blocking on 'DCQ'"
"Thread 'game clock' blocking on mutex 'Graphics'"
"Thread 'game clock' blocking on semaphore 'Clock'"

So I am looking forward to 0.6 and 0.7 and especially 1.0! Cheesy
Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Opengl modes don't work in Win98
« Reply #3 on: September 08, 2006, 01:12:11 am »

(Maybe they can extend the DirectX modes to higher resolutions by the time it reaches the 1.0 release?)
We're "abusing" OpenGL to scale the screen for us by giving it as a texture for one big 3D object. All DirectX calls go through SDL, and SDL does not have functions for 3D. Unless that changes, it's unlikely that there will be scaling to other resolutions.
It is however possible that some people come up with entirely new graphics, designed for a higher resolution mode, for which not scaling needs to take place.

Quote
I have another system with a Matrox G450 card. On this one, the OpenGL mode doesn't go to a flat white screen, but it still has serious problems. Things get redrawn at wrong locations in the window, making it difficult or impossible to follow what is happening in the game. Going back to 'frame buffer' mode fixes this.
Again, upgrade your driver. This is not an UQM problem.

Quote
The thing is, the 3D screen savers that come with Windows 98 are also OpenGL and they all work perfectly on both systems. So it looks like something is not being done right with the setup or system calls in UQM. It's quite good for version 0.5 but plainly not done yet. Smiley
Heh. Let me explain by analogy why this remark is so funny:
"The thing is, the toilets in my house also use the same water, and it works perfectly there. So it looks like something is not being done right with the teabag or teaspoon in your cup."

Quote
Lots of little things seem to be unfinished or typoed.
Unfinished things are why the project is still in alpha stage.
As for typos, please report those, so we can fix them.

Quote
The debug log shows lots of unexplained errors:

Many instances of "Warning: Can't open 'lbm/mainmenu.ogg' " (when I've selected PC music and the .ogg files should not be required)
It doesn't really look for the .ogg file. The main code asks the resource loader "give me lbm/mainmenu.ogg", and the loader gives it "lbm/mainmenu.mod" instead if PC music is selected. This is a stupid hack, and the relevant code will be replaced at some point.
It's a warning, not an error. And you shouldn't get it if you're using a release build.

Quote
Many, many instances of "Trying to get undefined resource 00000000" (A really 'useful' error message! Tongue )
It is useful to us. And it's also a warning, not an error, which you only get for debug builds.

Quote
And then some ambiguous ones that I'm not sure are errors though they LOOK like errors:

"Thread 'Starcon2Main' blocking on 'DCQ'"
"Thread 'game clock' blocking on mutex 'Graphics'"
"Thread 'game clock' blocking on semaphore 'Clock'"
Debug messages. Not even warnings, just informational. Should only turn up in debug builds. They tell us that one thread of the program is waiting for another one to catch up.

Quote
So I am looking forward to 0.6 and 0.7 and especially 1.0! Cheesy
As you should Tongue

Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Yuptar
Frungy champion
**
Offline Offline

Posts: 51



View Profile
Re: Opengl modes don't work in Win98
« Reply #4 on: September 08, 2006, 02:30:20 am »

I'm using the latest and last driver on the G450.  I haven't seen any threads on the Matrox support board where anyone is complaining that their OpenGL game doesn't work with their Matrox G450.

And I downloaded this game from the appropriate link on the download page at sourceforge, so if it's not a 'release' version then someone put the wrong thing on that link. I am definitely getting those debug messages.
Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Opengl modes don't work in Win98
« Reply #5 on: September 08, 2006, 03:52:03 am »

Hmm... we may have left those warnings on intentionally, to help debugging (after all, it's still alpha). I'm a Linux user myself, so I have little personal experience here.
Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: Opengl modes don't work in Win98
« Reply #6 on: September 08, 2006, 09:22:23 am »

The white screen is probably a case of the OpenGL implementation failing to accept the 512x256 texture UQM uses as its screen buffer. My good old OpenGL Programming Guide (for version 1.2) says OpenGL doesn't require textures larger than 64x64 (or 66x66 with borders) to work.

One solution that could work in this context is to use 64x64 tiles for the display instead of one big texture. LAB3D/SDL (an OpenGL port of Ken's Labyrinth) also uses textures as a screen buffer (albeit only for menus, the status bar and suchlike, not the ingame graphics); however, by default (i.e. unless you hack the source code), it uses tiling of small textures instead of one big one.

If LAB3D/SDL works (just grab the latest all-in-one package) and UQM doesn't, some changes to the texturing system may be in order. If LAB3D/SDL doesn't work, I'm inclined to agree that the display driver is broken.
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
Yuptar
Frungy champion
**
Offline Offline

Posts: 51



View Profile
Re: Opengl modes don't work in Win98
« Reply #7 on: September 08, 2006, 06:13:02 pm »

Well, I can't use the full latest drivers, but I extracted the G200icd.dll from the latest driver package and swapped it in. This made the G200/K6-2 system act like the G4500/Duron system. No more white screen, but things get redrawn in the wrong places in OpenGL mode.

This "Labyrinth" game works perfectly, though. Nothing gets put out of place in the graphics area or the menus. But then these menus aren't using a 'light bar' or drawing the menu in a designated place in/on the main display. They popup over the main display. Maybe using a restricted space for the menus makes the difference, or maybe the way it uses the API calls makes the difference.
« Last Edit: September 08, 2006, 06:15:57 pm by Yuptar » Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: Opengl modes don't work in Win98
« Reply #8 on: September 08, 2006, 06:26:55 pm »

Well, I can't use the full latest drivers, but I extracted the G200icd.dll from the latest driver package and swapped it in. This made the G200/K6-2 system act like the G4500/Duron system. No more white screen, but things get redrawn in the wrong places in OpenGL mode.
Interesting. In some cases, transplanting ICDs like that just makes things worse.

Quote
This "Labyrinth" game works perfectly, though. Nothing gets put out of place in the graphics area or the menus. But then these menus aren't using a 'light bar' or drawing the menu in a designated place in/on the main display. They popup over the main display. Maybe using a restricted space for the menus makes the difference, or maybe the way it uses the API calls makes the difference.
My guess is that the problem has to do with UQM using large textures (what's on the screen before the menus are drawn shouldn't really matter), but the G450 behaviour sounds plain buggy. The "white screen" behaviour I can find an excuse for, but putting stuff in the wrong place is just... odd.
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
Yuptar
Frungy champion
**
Offline Offline

Posts: 51



View Profile
Re: Opengl modes don't work in Win98
« Reply #9 on: September 09, 2006, 07:33:33 am »

Well, that's how I interpret what I am seeing. Perhaps the real problem is some sort of corruption of the textures in memory. Then when they get placed they look scambled, and that 'seems like' misplacement. I'll have to try to capture some images and post them somewhere. (Hmm, where?)
Logged
Yuptar
Frungy champion
**
Offline Offline

Posts: 51



View Profile
Re: Opengl modes don't work in Win98
« Reply #10 on: September 09, 2006, 10:01:34 pm »

Ok, here's an attempt to show what is happening:


First image: Even right after switching to OpenGL mode, you can see the 'light bar' in the main menu is malfunctioning. A piece of the screen from elsewhere is transposed on the selected menu item.


Second image: Here you can see the main problem. The 'frame' seems to get drawn the right way once, then drawn again slightly offset down and to the right a bit.


Third Image: System navigation has the same symptoms


Fourth image: And in hyperspace you get the same problem. But... in the system navigation mode the menus do still function. In hyperspace if you hit the space bar to replace the local view with the menu it gets scrambled.


Like this! Since you can see something in the extreme right edge of the images, I presume that the menu gets drawn 'off screen' in hyperspace. Argh...

So there's the result of about an hour's struggle with Imageshack. Whew...
Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: Opengl modes don't work in Win98
« Reply #11 on: September 10, 2006, 12:43:15 am »

OK, judging from the screenshots, what's happening is that when part of the screen is updated (e.g. the "Setup" entry in the main menu is blinking), the texture being used by the OpenGL implementation is updated with an area from the top-left part of the screen buffer instead of the correct area. Similarly, when the main window is updated, the status bar above it is copied into it and a little around the lower edge lost instead. Looking at the source code, it seems like the settings for GL_UNPACK_SKIP_ROWS and GL_UNPACK_SKIP_PIXELS are being ignored; we could circumvent this by doing the equivalent transformation with pointer arithmetic instead.

This quite clearly seems to be an issue with the OpenGL implementation (i.e. the Matrox ICD), but I may be able to create a patched executable that works for you. As the required changes shouldn't affect any cards that currently work correctly, it may even be prudent to make the corresponding changes to the main code, although I personally dislike circumventing bugs instead of fixing them.
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
Yuptar
Frungy champion
**
Offline Offline

Posts: 51



View Profile
Re: Opengl modes don't work in Win98
« Reply #12 on: September 10, 2006, 01:27:12 am »

Well, after going to the Matrox support boards and searching on "OpenGL" and these technical terms I find some entries. The scariest of which states "OpenGL only works properly with Intel chipsets, if you have a motherboard with a non-Intel chipset OpenGL will never work properly for you..." Ack!

But weirdly, The G200 system DOES use an Intel chipset. Hmm... but it's only a PCI board, not an AGP board. And the problem seems identical on the two systems, even though one is Intel and the other is not. So hopefully this can be circumvented by the work-around you are considering. That is disappointing if their is no other way, though. Drivers are supposed to handle details like that.

I hope no other weird things would crop up after this fix, though. Obviously it's not going to be worth the trouble to keep making special cases for older cards.
Logged
Yuptar
Frungy champion
**
Offline Offline

Posts: 51



View Profile
Re: Opengl modes don't work in Win98
« Reply #13 on: September 10, 2006, 08:42:21 pm »

OK, judging from the screenshots, what's happening is that when part of the screen is updated (e.g. the "Setup" entry in the main menu is blinking), the texture being used by the OpenGL implementation is updated with an area from the top-left part of the screen buffer instead of the correct area. Similarly, when the main window is updated, the status bar above it is copied into it and a little around the lower edge lost instead. Looking at the source code, it seems like the settings for GL_UNPACK_SKIP_ROWS and GL_UNPACK_SKIP_PIXELS are being ignored; we could circumvent this by doing the equivalent transformation with pointer arithmetic instead.

This quite clearly seems to be an issue with the OpenGL implementation (i.e. the Matrox ICD), but I may be able to create a patched executable that works for you. As the required changes shouldn't affect any cards that currently work correctly, it may even be prudent to make the corresponding changes to the main code, although I personally dislike circumventing bugs instead of fixing them.

Are those two functions you mention new for the 1.2 version of the OpenGL interface standard? I notice that you say above that your manual is for the 1.2 version. While reading the Matrox forums I saw more than once that they said these cards (all the Milllenium G series apparently) only have the 1.1 standard calls. So that may be why those two functions are being ignored. I hope there is an easy way to inventory what calls are being used and see if any other functions later than the 1.1 standard are used in UQM at present.

If it's only those two calls, as it seems because everything else seems to work, then you could add a compatibility switch to the config file where users could select whether to use the driver functions or the built-in pointer calculations for compatibility.

BTW, I noticed something about the config file(s). The 'bits per pixel' setting is not in the config file actually written by the program even though it is in the two sample 'version' configs that are supplied in the install. And the program barfs when you try to use --bpp on the command line. Is this an obsolete setting? Maybe it needs to be removed from the manual and the two sample configs given with the install.
« Last Edit: September 10, 2006, 08:46:23 pm by Yuptar » Logged
Novus
Enlightened
*****
Offline Offline

Gender: Male
Posts: 1938


Fot or not?


View Profile
Re: Opengl modes don't work in Win98
« Reply #14 on: September 10, 2006, 11:17:09 pm »

So that may be why those two functions are being ignored.
Nah, they should be in 1.1. Besides, LAB3D/SDL uses these calls too, for the same purpose; without them, the status panel won't update properly, the menus will become a big mess and so on. For some reason, they work in LAB3D/SDL but not in UQM.

Now, the fact that depending on which ICD you use, large textures are supported or not, suggests that the driver is doing some trickery to emulate large textures and getting confused in the process.

Quote
If it's only those two calls, as it seems because everything else seems to work, then you could add a compatibility switch to the config file where users could select whether to use the driver functions or the built-in pointer calculations for compatibility.
The pointer manipulation should produce exactly the same result as the SKIP parameters; they exist solely for the convenience of programmers who dislike pointer arithmetic. Changing the code used in UQM should have no ill effects on other systems.

Either way, I'll see about giving you a modified executable to try out tomorrow. If it works, we can think about putting the change in the standard version.
Logged

RTFM = Read the fine manual.
RTTFAQ = Read the Ur-Quan Masters Technical FAQ.
Pages: [1] 2 3 Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!