Advertisement

My space shooter (WIP) - now with Mac OS X support

Started by February 18, 2009 04:54 PM
56 comments, last by Sander 15 years, 7 months ago
Quote: Original post by Sander
Quote: Original post by Dmytry
I have some question... what is the common method of handling situation when settings make game (including in-game UI) entirely unusable? Like a video mode that does not show up on display.
I'm popping up "do you see it?" dialog with timeout.


I think that's the best way of handling it. I've seen many games that do not handle it at all.

Quote: Also, list of available video modes. Anyone knows why it would be bad idea (on some displays) to only list those of available video modes which are smaller than desktop mode, and have approximately same aspect ratio?


I don't know. Doing that makes no sense to me. I have often used monitors in e.g. 1280x1024 mode while the hardware was capable of much more (like 1600x1200) simply because the lower resolution was much easier on the eyes when doing typical desktop tasks like reading e-mail and browsing websites. In such a scenario I'd definitely would want to be able to run the game at the higher resolution.

Ahh. Yes, i see... was it CRT displays?
I myself had no CRT display since 2004 and I really hate blurry look of LCD at lower than native resolutions. I might want to play game at less than native resolution for speed, but not my desktop.
Quote:

One thing you may want to do is dual monitor support. For fullscreen mode you should give the user the option of either using one monitor (and which one) or span all available monitors. Some people prefer to use all their monitors while other people don't. E.g. with two monitors the crosshair would be on the edge between the two monitors, making playing difficult. That problem doesn't exist when using three monitors where the crosshair would be in the center of the middle monitor.

Thanks, I sort of forgot about dual display entirely.

Two displays are difficult yes, not sure what to show on second display. Side view would have been asymmetric. Hmm, when I add 3d "radar" view, I could display radar and similar stuff on second display.

Ideally I could make simple gui where you position the displays (which can be at angle to each other) and your head (top-down view), then use correct projection for all displays.
Quote:

On Linux there's also the problem that under certain configurations only one of the monitors in a multi-head setup has hardware accelerated 3D. But you could simply ignore this. Such configurations are uncommon and primarily limited to the closed-source ATI drivers using an older Xinerama-style multi-head setup. Merged framebuffer setups or newer XRandR-based setups should always be accelerated on all heads.

Thanks for the information, I was wondering about that too.

scratt: in the bundle directory ( Polynomial.app/Contents ) there should be log.txt , that's the log I'm interested in.

Also, how garbage looks? Random data or anything similar to benryves's screenshot?

I'm going to actually try improve look on the cards with no interpolation on half-float textures, I have a shader which could emulate interpolation... wont look as good though, and real interpolation in a shader could be slow.

[Edited by - Dmytry on March 4, 2009 4:50:49 AM]
Quote: Original post by Dmytry
Quote: Original post by Sander
I have often used monitors in e.g. 1280x1024 mode while the hardware was capable of much more (like 1600x1200) simply because the lower resolution was much easier on the eyes when doing typical desktop tasks like reading e-mail and browsing websites. In such a scenario I'd definitely would want to be able to run the game at the higher resolution.

Ahh. Yes, i see... was it CRT displays?
I myself had no CRT display since 2004 and I really hate blurry look of LCD at lower than native resolutions. I might want to play game at less than native resolution for speed, but not my desktop.


Yes, that was with CRT.

Quote:
Thanks, I sort of forgot about dual display entirely.

Two displays are difficult yes, not sure what to show on second display.


Simply leaving it blank is good for starters. Or put your game's logo on it :-) You could do fancy things like 3D maps but then you would be disadvantaging people who have only 1 monitor (and thus won't see the map).

Simply being able to configure what monitor(s) the game itself is displayed is already a big benefit.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

Advertisement
Quote: Original post by Sander
Quote: Original post by Dmytry
Quote: Original post by Sander
I have often used monitors in e.g. 1280x1024 mode while the hardware was capable of much more (like 1600x1200) simply because the lower resolution was much easier on the eyes when doing typical desktop tasks like reading e-mail and browsing websites. In such a scenario I'd definitely would want to be able to run the game at the higher resolution.

Ahh. Yes, i see... was it CRT displays?
I myself had no CRT display since 2004 and I really hate blurry look of LCD at lower than native resolutions. I might want to play game at less than native resolution for speed, but not my desktop.


Yes, that was with CRT.

Quote:
Thanks, I sort of forgot about dual display entirely.

Two displays are difficult yes, not sure what to show on second display.


Simply leaving it blank is good for starters. Or put your game's logo on it :-) You could do fancy things like 3D maps but then you would be disadvantaging people who have only 1 monitor (and thus won't see the map).

Well, it would be in corner of main view too, maybe with configurable size .
Quote:

Simply being able to configure what monitor(s) the game itself is displayed is already a big benefit.

Hmm... what do you think about simple hack then: I can provide option to use arbitrary half or third of screen, and suggest it to user when width>2*height .
I'm using GLFW and I don't really know how to open non-spanning full-screen window (on Linux and Windows (and os x especially)).
Though probably that is kind of feature which is going into post-release fixes (judging by stats, rather small % of my website visitors use dual screen, and it is still playable on dual screen if you use windowed mode).
Quote: Original post by Dmytry
scratt: in the bundle directory ( Polynomial.app/Contents ) there should be log.txt , that's the log I'm interested in.

Also, how garbage looks? Random data or anything similar to benryves's screenshot?


Oh.. I looked in Contents and missed the log file completely! Duh!

Anyway.. The garbage is just un-initialized video memory by the looks of it.

There's a shader linking error, and some FBO issues..

Shader 'plankpoint_v.glsl' compile failed, log:
ERROR: 0:14: '=' : assigning non-constant to 'const float'
ERROR: 0:15: '=' : assigning non-constant to 'const float'
ERROR: 0:20: '=' : assigning non-constant to 'const float'
ERROR: 0:21: '=' : assigning non-constant to 'const float'
ERROR: 0:22: '=' : assigning non-constant to 'const float'
Shader 'plankpoint_f.glsl' compiled successfully
Link failed, log:
ERROR: One or more attached shaders not successfully compiled
(0):set uniform: error invalid operation


TestTextureFrameBuffer::TestTextureFrameBuffer
glGenTextures: success
glBindTexture: success
glTexImage2D: success
glTexParameteri: success
creating half-float texture: success
glGenFramebuffersEXT: success
glBindFramebufferEXT: success
glFramebufferTexture2DEXT: success
glCheckFramebufferStatusEXT: success
framebuffer not complete, status:
GL_FRAMEBUFFER_UNSUPPORTED
creating framebuffer: success

The full log is on my iDisk for you.
http://idisk.mac.com/scratt-Public?view=web

From memory the x1600 has some issues with NPOT and / or certain formats of FBO.
Feel free to 'rate me down', especially when I prove you wrong, because it will make you feel better for a second....
Quote: Original post by scratt

Oh.. I looked in Contents and missed the log file completely! Duh!

Anyway.. The garbage is just un-initialized video memory by the looks of it.

There's a shader linking error, and some FBO issues..

Thanks for good report.
Quote:

Shader 'plankpoint_v.glsl' compile failed, log:
ERROR: 0:14: '=' : assigning non-constant to 'const float'
ERROR: 0:15: '=' : assigning non-constant to 'const float'
ERROR: 0:20: '=' : assigning non-constant to 'const float'
ERROR: 0:21: '=' : assigning non-constant to 'const float'
ERROR: 0:22: '=' : assigning non-constant to 'const float'
Shader 'plankpoint_f.glsl' compiled successfully
Link failed, log:
ERROR: One or more attached shaders not successfully compiled
(0):set uniform: error invalid operation

Holy gods of opengl...

Anyone else ever encountered it? I have exactly that error on os x 10.4.11, mac mini, with intel GMA 950 . I just assumed intel GMA didnt have working glsl compiler.
Perfectly valid piece of shader code:
// (C) 2009 Dmytry Lavrov. All rights reserved.uniform float brightness;uniform float interp_t;attribute vec3 old_vertex;/*a/(e^(b/T)-1)f = frequencya=2hf^3/c^2b=hf/k*/const float min_temp=1000.0;const float max_temp=30000.0;const float temp_q_a=log(min_temp);const float temp_q_b_inv=(log(max_temp)-temp_q_a);const float t_white=6000.0;const float b_r=22135.0;const float b_g=26159.0;const float b_b=31972.0;const float a_r=exp(b_r/6000.0)-1.0;const float a_g=exp(b_g/6000.0)-1.0;const float a_b=exp(b_b/6000.0)-1.0;

fails to compile.
I even checked in GLSL specification, it is valid to use math functions with constant arguments in constants. I cant imagine serious compiler which wouldn't know constness of expressions - surely, you want to track constness in compiler at least for optimization purposes?

In case you wonder what shader does. It converts temperature to color with correct intensity according to Plank's law (on just 3 wavelength, but that is good enough for me). I probably will replace it with texture lookup eventually, it was experimental.
Quote:
glCheckFramebufferStatusEXT: success
framebuffer not complete, status:
GL_FRAMEBUFFER_UNSUPPORTED
creating framebuffer: success

The full log is on my iDisk for you.
http://idisk.mac.com/scratt-Public?view=web

From memory the x1600 has some issues with NPOT and / or certain formats of FBO.

Aww, looks like it does not support half-float RGB framebuffer. Not sure I can do anything about it, emulating half float frame buffer with rgbe format of some sort (r,g,b,exponent) is probably too slow, and I cant read back when blending.

[Edited by - Dmytry on March 5, 2009 8:25:44 AM]
Updated - now handles many explosions much better. Also, has a lot of unique enemy models (generated). A lot of bug fixes and likely a few new bugs.
Press F2 to save screenshot from inside game (useful on osx and linux).
Advertisement
intel GMA 950 doesnt support glsl

see the table here for what ogl versions the onboard intel stuff has

http://en.wikipedia.org/wiki/Intel_GMA
It runs fine. Thanks for the screenshot function :-) There's a small problem with the (reported) resolution though. The menu correctly says that 2560x1024 is my native (dual-screen) resolution, but when hitting fullscreen it only does one monitor (1280x1024).

In windowed mode I can maximize it over two screens though, and that looks quite cool on two 19" monitors :-) Click the image for full-size.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

This topic is closed to new replies.

Advertisement