Jump to content

  • Log In with Google      Sign In   
  • Create Account

How can I ensure that my game runs on every PC?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
18 replies to this topic

#1 Aliii   Members   -  Reputation: 1448

Like
0Likes
Like

Posted 30 October 2012 - 06:13 AM

I compiled a 32bit exe using minGW/mSys on my PC(Win7 64 bit)

It runs smoothly on my machine. I tried it on Win7 32 bit ...runs fine, but its not running on WinXP 32bit(x86 / x64). ....its running but it has 1 FPS:)

Its written in C++, Im not using any special tool or something except OpenGL and a few basic Winapi functions.
I had to link two dll-s statically, I dont remember which ones.
I have no idea whats wrong. Help! Thanks!

Sponsor:

#2 Olof Hedman   Crossbones+   -  Reputation: 2957

Like
2Likes
Like

Posted 30 October 2012 - 06:48 AM

Is it the same computer running XP?

If not, maybe the computer is just slow, and/or the graphics card sucks?
Even though your GL code might seem trivial, its very possible you do something that kills the performance on older cards.

To answer your direct question, it's basically "you can't".
Not every PC.
What you can do is decide on some minimum specification, and then make sure (with tests) that your code runs on this minimum specification.

Edited by Olof Hedman, 30 October 2012 - 06:51 AM.


#3 Aliii   Members   -  Reputation: 1448

Like
0Likes
Like

Posted 30 October 2012 - 07:04 AM

Thanks!
The XP one is a different computer.
My PC(Win7 64bit, i5, openGL version 3.3) - produces above 300FPS
My laptop(WinXP 32 bit, Core2Duo, OpenGL 2.1) - produces 1FPS:)
(I tried it under emulated XP on a machine with i7 ....it had 5 FPS ....weird)

Im actually quite confused about GL versions. I guess the 3.3 is what my GPU supports but that cant be the one that the compiler uses cause Im using fixed pipeline functions.(Which were removed in 3.2)

#4 Ashaman73   Crossbones+   -  Reputation: 8005

Like
0Likes
Like

Posted 30 October 2012 - 07:14 AM

Im actually quite confused about GL versions. I guess the 3.3 is what my GPU supports but that cant be the one that the compiler uses cause Im using fixed pipeline functions.(Which were removed in 3.2)

No, you need to explicit create a OGL 3 context to use it.

Update the drivers on the XP machine. Are you using shaders ? Are you using ARB extensions ? Which one ?

Get very sleepy, a very easy to use profiler which should pin down the bottleneck.

Edited by Ashaman73, 30 October 2012 - 07:23 AM.


#5 SuperVGA   Members   -  Reputation: 1118

Like
0Likes
Like

Posted 30 October 2012 - 07:24 AM

(I tried it under emulated XP on a machine with i7 ....it had 5 FPS ....weird)

Not at all. Emulating hardware accelerated graphics through software is often slow.
Try emulating another windows 7 machine inside windows 7, it will probably be slow as well.

Edited by SuperVGA, 30 October 2012 - 07:25 AM.


#6 Hodgman   Moderators   -  Reputation: 32008

Like
3Likes
Like

Posted 30 October 2012 - 07:25 AM

Whenever a GL application drops in performance by such a huge factor, my first suspicion is always that the GL driver has started emulating some feature in software mode -- many GL drivers will attempt to emulate via the CPU any features that they don't actually support, which allows programs to work​, albeit at 1FPS.

Double check that there's no errors (add glGetError after every GL call in a debug build), and/or use tools like GLIntercept or gDEBugger to check for errors in your usage of GL.

#7 Aliii   Members   -  Reputation: 1448

Like
0Likes
Like

Posted 30 October 2012 - 07:26 AM

"No, you need to explicit create a OGL 3 context to use it."
...what does that mean?Posted Image

Now I just want to use the old functions(from GL 1.6). Im not using shader or extensions, just the basic functions.

#8 L. Spiro   Crossbones+   -  Reputation: 14434

Like
0Likes
Like

Posted 30 October 2012 - 07:34 AM

Aside from the fact that you do need to update your drivers, it could be that you are getting such a slow framerate because you are using OpenGL incorrectly, putting it into an invalid state.
Do you check ::glGetError() religiously?

If the reason for that is because you are just doing something not supported by the OpenGL 2.1 core, in which case upgrading drivers is all you will need to do.
It could also be that you are simply not using OpenGL correctly period, but the drivers for nVidia accept some things ATI’s don’t and vice versa, so it works fine on one machine and not another.
In which case you should use gDEBugger to find out what it is.

It could also be that one driver is better at optimizing away redundant states than the others.
Do you manually optimize away redundant states? This should be one of your highest priorities.


And to answer the topic line, there is no way to make such a guarantee when using OpenGL. Vendors for Windows focus on getting their DirectX drivers right, often just doing the bare minimum to get OpenGL drivers working. Their levels of optimizations, features, and bugs varies widely between vendors and you are nowhere near guaranteed to get the same results on every machine no matter how closely you stick to the spec.


L. Spiro
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#9 Aliii   Members   -  Reputation: 1448

Like
0Likes
Like

Posted 30 October 2012 - 07:47 AM

Thanks!
To give more info: I compiled the app on my laptop. It worked both on my PC and laptop. I took the code and complied it on my PC, ....and now that exe from that same code is not working under XP properly.
I was not checking for errors cause the most advenced stuff im using is display lists and 2D textures.(Not even glut i think, ...i cant check it now, im at work:))

I also tried to replace the gl headers with the ones from my laptop but it made no difference.

#10 SimonForsman   Crossbones+   -  Reputation: 6325

Like
0Likes
Like

Posted 30 October 2012 - 07:55 AM

Thanks!
To give more info: I compiled the app on my laptop. It worked both on my PC and laptop. I took the code and complied it on my PC, ....and now that exe from that same code is not working under XP properly.
I was not checking for errors cause the most advenced stuff im using is display lists and 2D textures.(Not even glut i think, ...i cant check it now, im at work:))

I also tried to replace the gl headers with the ones from my laptop but it made no difference.


does the laptop have dual GPUs ? (Intel + AMD/nvidia) and if so, did you update the drivers for both the Intel and the AMD/nvidia GPU ? it is unfortunatly not uncommon for laptops to ship without OpenGL drivers for some reason (Which causes Windows to fall back to a software driver (which supports OpenGL 1.1 but really is slow as ....).

Also , make really sure that you didn't put opengl32.dll in your programs folder.
I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

#11 Aliii   Members   -  Reputation: 1448

Like
0Likes
Like

Posted 30 October 2012 - 08:21 AM


Thanks!
To give more info: I compiled the app on my laptop. It worked both on my PC and laptop. I took the code and complied it on my PC, ....and now that exe from that same code is not working under XP properly.
I was not checking for errors cause the most advenced stuff im using is display lists and 2D textures.(Not even glut i think, ...i cant check it now, im at work:))

I also tried to replace the gl headers with the ones from my laptop but it made no difference.


does the laptop have dual GPUs ? (Intel + AMD/nvidia) and if so, did you update the drivers for both the Intel and the AMD/nvidia GPU ? it is unfortunatly not uncommon for laptops to ship without OpenGL drivers for some reason (Which causes Windows to fall back to a software driver (which supports OpenGL 1.1 but really is slow as ....).


It has a single integrated ATI, ....i couldnt find proper drivers for this card, only some hacked "Omega drivers". ....thats what it uses now.
It shouldn have 1 fps even if its software rendered. An another laptop(emulated XP) with i7 and GeForce540 produced 5FPS. Theres something really wrong there:)

#12 SuperVGA   Members   -  Reputation: 1118

Like
0Likes
Like

Posted 30 October 2012 - 08:45 AM



Thanks!
To give more info: I compiled the app on my laptop. It worked both on my PC and laptop. I took the code and complied it on my PC, ....and now that exe from that same code is not working under XP properly.
I was not checking for errors cause the most advenced stuff im using is display lists and 2D textures.(Not even glut i think, ...i cant check it now, im at work:))

I also tried to replace the gl headers with the ones from my laptop but it made no difference.


does the laptop have dual GPUs ? (Intel + AMD/nvidia) and if so, did you update the drivers for both the Intel and the AMD/nvidia GPU ? it is unfortunatly not uncommon for laptops to ship without OpenGL drivers for some reason (Which causes Windows to fall back to a software driver (which supports OpenGL 1.1 but really is slow as ....).


It has a single integrated ATI, ....i couldnt find proper drivers for this card, only some hacked "Omega drivers". ....thats what it uses now.
It shouldn have 1 fps even if its software rendered. An another laptop(emulated XP) with i7 and GeForce540 produced 5FPS. Theres something really wrong there:)


... Sigh... But if it's emulated then it won't matter much if it's a GeForce540 or a 3DFX Voodoo.
What makes you think that it shouldn't run with 1fps in emulated mode?

#13 Aliii   Members   -  Reputation: 1448

Like
2Likes
Like

Posted 30 October 2012 - 05:04 PM

Lol! This was the problem: I had a 256x257 texture, which is not OK for older GL versions.(Now it runs on 60-80 FPS on the laptop)
I tried the recommented tools, Gdebugger and VerySleepy ....they are awesome. Thanks!

BTW the original question is still open. How can I ensure that it runs properly(or as much properly as it possible) on every PC? What should I link statically? What dll-s should I put or not put in the games folder? Im not much less clueless about that.

#14 Aeramor   Members   -  Reputation: 1209

Like
0Likes
Like

Posted 05 November 2012 - 03:34 PM

If you're making a game, don't worry about it yet, at some point you will get it out to testers and there will be platform and GPU and to a lesser extent even CPU related issues that crop up and would be very difficult to see in advance as a single programmer with limited resources and available test machines.
These are bugs, to be solved later, don't let them slow you down now. Typically unless you are doing something really really wrong you will find it faster by just continuing to forge ahead, and by the time you do have to solve these bugs you will know your code inside and out and be a better programmer more apt to deal with these types of issues.

-Aeramor

CTO at Conjecture, Inc.


#15 mhagain   Crossbones+   -  Reputation: 8285

Like
0Likes
Like

Posted 06 November 2012 - 06:34 AM

BTW the original question is still open. How can I ensure that it runs properly(or as much properly as it possible) on every PC?


The simple answer is this: you can't.

"Every PC" covers an enormous range of hardware and software configurations, from the most basic and primitive to turbo-charged gaming PCs and workstations, and all points in between. It is just not possible to write a program that is guaranteed to run on all of them.

OpenGL is not software. If you want to run fast and run well you are entirely at the mercy of the hardware installed on a PC; if that hardware is horrible then you just won't run fast or run well; you're lucky if you run at all.

As you've just discovered, OpenGL can be capable of emulating certain features in software, depending on the driver, but - as you've also just discovered - this is often not a desirable state of affairs.

OpenGL may have a reputation for being easy, but that doesn't mean that you get to skip reading documentation. So you need to grab an OpenGL spec (available on http://www.opengl.org), read it, understand it, know what you can do and what you cannot do, know what causes errors and what doesn't.

What your objective should be is to pick a reasonable baseline, declare that you're not even remotely interested in supporting anything below that baseline, then make that your target hardware requirement. There's no point in picking a fight that you can't win, and "run on every PC" is such a fight; choose reasonable and achievable objectives instead.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#16 CuriosityKills   Members   -  Reputation: 114

Like
0Likes
Like

Posted 13 November 2012 - 04:05 PM

> How can I ensure that it runs properly(or as much properly as it possible) on every PC?

You test your product on as many different system types that meet your minimum specifications as possible. Since testing costs money, you might make do with testing a few representative systems, and then you open it up to Alpha users, who expect some risk in return for free gameplay.

This will provide some level of assurance, however, non-trivial software always has bugs.

Edited by CuriosityKills, 13 November 2012 - 04:08 PM.


#17 Erik Rufelt   Crossbones+   -  Reputation: 3644

Like
0Likes
Like

Posted 13 November 2012 - 04:26 PM

Even though you can't ensure it will run on everything, it sounds like your game is quite likely to run on most PCs, since you don't use many advanced features and it runs both on Win7 64 and XP 32.
One thing you probably want to test is running it on a machine that doesn't have any development tools installed, to find out what libraries might be missing. If you discover something that doesn't work, you can create an installer that includes the necessary libraries, or try to link them statically.

Edited by Erik Rufelt, 13 November 2012 - 04:26 PM.


#18 Hexmind   Members   -  Reputation: 292

Like
0Likes
Like

Posted 17 November 2012 - 01:52 PM

I find that discussion very interesting. I use an old computer for my development. That way I make sure my game will run smoothly on most computers, and perform awesomely on newest ones. My game runs at 100 frames a second or so on my PC. Was I ever pleased when I tested my game on my girlfriends PC. I had a whooping 2200 frames a seconds! And her PC is 3 years old, running Windows 7. Mine btw is 7-8 years old running XP. I think it just makes sense to use a slower machine to develop (and test the game periodically on other machines). Not only for speed but for video card features as well. I'm aware I'm not helping you with your immediate issue here, but wish you best of luck and patience in having your game runs smoothly on older machines. Cheers!

#19 VanillaSnake   Members   -  Reputation: 132

Like
0Likes
Like

Posted 18 November 2012 - 02:52 AM

There is a way to make sure you code runs on majority of pc's: use an engine. With a well written engine, most of the pc to game interaction is abstracted so that in order to make sure your game runs on a lot of pc's simply test an engine by itself to see how it handles different fallbacks in cases where a function is not supported etc. You can try to write such an engine yourself but to ensure system wide compatibility you would have to be very knowledgeable in multiple API's and be sufficiently knowledgeable of the particular OS that you're working on (even if the os is a part of windows family). So it's highly suggested to forgo building such an engine and use an already available one. I'm currently starting to learn Unity and so far loving every bit. Not only will your code most likely work on 95% of machines that support Unity (and it's been tested on millions and millions of machines by now) but you can also add a grantee* that it will work on Mac, Android, iPhone, Flash Player, and Linux starting in Unity 4. Not sure if it's the answer you're looking for since you probably want to stick with dealing with a raw API and doing everything in c++ but I'm simply saying that yes it's possible to a certain degree using certain tools.

Edited by VanillaSnake21, 18 November 2012 - 02:53 AM.

You didn't come into this world. You came out of it, like a wave from the ocean. You are not a stranger here. -Alan Watts

 

Time flies like an arrow; fruit flies like a banana. - Old Wise Eastern tribesman saying





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS