PDA

View Full Version : Space Barrage


aaronsullivan
2004.07.13, 01:44 AM
Well, I came in last place in "21 days" because 3 out of 4 computers couldn't run my game. It might be time to do some beta testing. :lol:

The polish on the game has been significantly enhanced, the first stage is much easier now and it's even using Arekkusu's latest glAArg update. The non repetitive game with much variation in enemies and stages is being reserved for a shareware version. Also, this isn't quite feature complete, but it's close.

the game:
http://homepage.mac.com/aaronsullivan/projects/SpaceBarrageBeta.zip

Please respond here with crash logs, results, and comments about anything having to do with the game. My main purpose is to weed out these bugs that prevent people from playing! If anyone wants to try the windows version let me know.

Please try changing resolutions using the option button at the title screen.

If you don't want to read the read me, here are the short instructions:

Surround the white ships (they are yours) and shoot the red ones (they want to kill you) before they reach the blue boundary line.

Mouse button is your primary action button (place shield, shoot missile, etc.)
Spacebar or right Mouse button is your secondary button (rotate shield section, etc.)

Close window, press escape and use quit buttons, or just apple-Q to quit.

My wife loves this game and plays it almost daily. Can you beat her record?

arekkusu
2004.07.13, 02:22 AM
Works fine on 1.25 GHz 15" Albook's LCD:

+ app icon!
+ window/fullscreen options, nice UI
+ Font vastly better ;)
+ explosions!
+ more lighting effects

- still uses 100% of CPU (Cmd-F says fps:442, I think this is a bit overkill... please sync to VBL)
- music is delayed now during shield rebuilding... intentional?
- when placing new weapons, there's a bit of delay between the lighting glow around the cursor and the weapon being placeable. would be better if the two things started at the same time.
- no app menu, can't hide window
- GL window contents lost when minimized to Dock

My housemate would very much like to try out the Window port. :)

aaronsullivan
2004.07.13, 02:48 AM
-I'm pretty sure SDL won't let me sych to the VBL... at least last time I checked...
-SDL also limits me on my menu items... including hiding the window. :(
-Music delay is intentional... so the end of the music matches the last second remaining... After the first entire stage the music always matches the time. However, it is abrupt sounding when it starts from silence and I'd like to fix that... also the end of the combat music abruptly stops.
-Ah, yes... the lighting glow where your cursor is... that is distracting, I'd hate to make the cursor completely disappear and I don't want players to think they can place the gun yet... hmm...
-I know I've seen topics about the GL window contents and the Dock... I'll have to look into implementing this with SDL...
-Give me a day or so on the Windows port... I want to recompile with the latest version, etc. and it's late here. :)

+You know it was suprisingly unintuitive to get the app icon to work. :shock:
+The window/fullscreen options were the first thing I worked on right after the contest. I'm hoping it will help with compatibility problems.
+I'd love to have way more explosions and lighting effects, too, but it just isn't a priority yet!
+Glad you like the font. :) My wife did most of the work on that.

Thanks for the feedback!

arekkusu
2004.07.13, 03:15 AM
Ah, yeah, I guess SDL limits your options for the app menu and minimization events.

But you should be able to get VBL sync with a bit of OS specific code. Sometime after SDL creates your GL context, try:

#if defined(__APPLE__)
const long VBL = 1;
CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, &VBL);
#endif

Mazilurik
2004.07.13, 11:47 AM
Still doesn't work for me; the music plays, but nothing draws in the window. I'm running 10.3.4 on a G4/933 (Quicksilver) with a GeForce4 Ti card and a 17" Apple LCD.

aaronsullivan
2004.07.13, 02:08 PM
Thanks for the tip arekkusu, I'll try it out.

Mazilurik, if you'd like to risk it, I'd be curious if a fullscreen context would make a difference (I'd doubt it though.) To change it, change the prefs.txt file in the data folder. Make the first 1 a zero instead (meaning not windowed.)

Now I need at least a couple more bad results to see what they have in common. For instance, Carlos, although I know it didn't work on your system, I don't know what didn't work. :) You have a "400MHz G4, with Radeon original card, and 1.3Gb of RAM" and you mentioned dual displays and LCDs... do you have an LCD or dual display setup?

I'll have to hit the SDL list, too.

ThemsAllTook
2004.07.13, 02:46 PM
Crash on startup. Log:

**********

Date/Time: 2004-07-13 13:28:51 -0400
OS Version: 10.2.8 (Build 6R73)
Host: Bendezium.local.

Command: SpaceBarrage
PID: 708

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0xbff7ff60

Thread 0 Crashed:
#0 0x902347f8 in FSPathMakeRefWithOptions(unsigned char const*, unsigned long, FSRef*, unsigned char*)
#1 0x9025b4c8 in GetDomainRootRef
#2 0x90261aac in FindTopLevelFolderForDomain
#3 0x9025d170 in ResolveSpecialFolder
#4 0x90238168 in FindFolderGuts
#5 0x9024d894 in ResolveRelativeFolder
#6 0x90238188 in FindFolderGuts
#7 0x9024d894 in ResolveRelativeFolder
#8 0x90238188 in FindFolderGuts
#9 0x90247ef0 in FSFindFolder
#10 0x9026742c in GetPathFromSearchDirectoryInfo
#11 0x902622b0 in GetDirectoryModificationDate
#12 0x9025d710 in CacheFMMapData
#13 0x90262244 in IntlFCOpenComponentData
#14 0x96a867d8 in InitializeKeyboardLayoutCache
#15 0x96a86720 in GetKeyboardLayoutCountInCache
#16 0x96a0763c in CreateKeyboardLayoutList
#17 0x96a00cdc in GetKeyboardLayoutList
#18 0x969d0038 in KLGetKeyboardLayoutWithIdentifier
#19 0x96a82bb8 in GetKCHR
#20 0x96a82af8 in xSwapKybd
#21 0x9024f4c0 in LMGetKeyCache
#22 0x30050084 in QZ_InitOSKeymap (SDL_QuartzEvents.m:157)
#23 0x300094cc in SDL_KeyboardInit (SDL_keyboard.c:79)
#24 0x300086e8 in SDL_StartEventLoop (SDL_events.c:225)
#25 0x3003ea64 in SDL_VideoInit (SDL_video.c:272)
#26 0x300494cc in SDL_InitSubSystem (SDL.c:74)
#27 0x30049700 in SDL_Init (SDL.c:166)
#28 0x0002e67c in sb_Screen::init(unsigned short, unsigned short, unsigned short, unsigned short, unsigned short, int, char const*) (sb_Screen.cpp:40)
#29 0x0000c850 in SDL_main (main.cpp:38)
#30 0x000036e0 in -[SDLMain applicationDidFinishLaunching:] (SDLMain.m:196)
#31 0x97dfab40 in _nsNotificationCenterCallBack
#32 0x901684c4 in _postNotification
#33 0x90165bd8 in _CFNotificationCenterPostLocalNotification
#34 0x9318a720 in -[NSApplication _sendFinishLaunchingNotification]
#35 0x93161624 in _requiredAEEventHandler
#36 0x91b56570 in aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned char*)
#37 0x91b590cc in dispatchEventAndSendReply(AEDesc const*, AEDesc*)
#38 0x91b56478 in aeProcessAppleEvent
#39 0x96a83778 in AEProcessAppleEvent
#40 0x9308e0a8 in _DPSNextEvent
#41 0x930a0158 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#42 0x930b1d88 in -[NSApplication run]
#43 0x00003634 in CustomApplicationMain (SDLMain.m:176)
#44 0x00003a34 in main (SDLMain.m:277)
#45 0x00002a98 in _start (crt.c:267)
#46 0x8fe19154 in _dyld_start

PPC Thread State:
srr0: 0x902347f8 srr1: 0x0200f030 vrsave: 0x00000000
xer: 0x00000000 lr: 0x9025b4c8 ctr: 0x9025b4a0 mq: 0x00000000
r0: 0x00000000 r1: 0xbff802e0 r2: 0x88002248 r3: 0x902d3750
r4: 0x00000000 r5: 0xbff81400 r6: 0x00000000 r7: 0x00000000
r8: 0x00233010 r9: 0x9025b488 r10: 0x00233290 r11: 0x00000008
r12: 0x90003a40 r13: 0x00000000 r14: 0x00000000 r15: 0x00000000
r16: 0x00000000 r17: 0x00000000 r18: 0x00000000 r19: 0x00000000
r20: 0x96b0ae64 r21: 0x00000008 r22: 0x00000000 r23: 0x00000000
r24: 0xbff81400 r25: 0x00000001 r26: 0xffff8002 r27: 0xbff81400
r28: 0xffff8002 r29: 0xbff81400 r30: 0x00000000 r31: 0x9025b448

Alex Diener

aaronsullivan
2004.07.13, 07:39 PM
ThemsAllTook, is this on your 1GHz PowerBook G4?

I haven't actually sat down to my code yet, but I'm just trying to compile some info.

ThemsAllTook
2004.07.13, 09:17 PM
Yup, that's the one. 1GHz G4, 512MB RAM, ATI Radeon Mobility 9000 (64MB VRAM), Mac OS X 10.2.8.

Alex Diener

Zwilnik
2004.07.13, 09:55 PM
Ran nicely on my 1ghz Powerbook 17" with 2nd display. (in windowed mode, haven't tried fullscreen yet, trying to avoid getting hooked on it before finishing ABE ;) )

It takes a couple of games to get the hang of what's going on (maybe set up the first level as a tutorial with much longer times to set up shields, deploy guns etc. or do a seperate short tutorial level), but Space Barrage is really rather fun and addictive.

If you're planning on expanding the game further, why not add power ups that you have to collect by surrounding in shields (the same as you have to do for your ships) ?

Mazilurik
2004.07.13, 10:23 PM
Mazilurik, if you'd like to risk it, I'd be curious if a fullscreen context would make a difference (I'd doubt it though.) To change it, change the prefs.txt file in the data folder. Make the first 1 a zero instead (meaning not windowed.)

Nope, doesn't fix it (although quitting still works nicely ;) ).

aaronsullivan
2004.07.14, 02:12 AM
VBL sync is now a go. Thanks again. I looked into patching the dock minimize thing, but... yeah. It looks as though I can hack the SDL_main file to give me a quit menu item, but I need to do a little cocoa research.

Also, here is a link to the windows version for anyone who wants to try:
http://homepage.mac.com/aaronsullivan/projects/SpaceBarrageBETA_W.zip
(homepage.mac.com wasn't loading at the time I tried this)

I tried glAArg 0.2 with the windows version... but there were some ...UNPACK_APPLE... GL calls that it didn't like.

Unfortunately, that's all I had time for tonight. My wife and I were celebrating our 8 year anniversary between work hours today! :D

arekkusu
2004.07.14, 02:21 AM
glAArg doesn't contain the text UNPACK_APPLE anywhere. Update your glext.h perhaps?

Anyway, congrats to you and Amy, and I will notify the housemate here of the windows beta. :)

aaronsullivan
2004.07.14, 02:24 AM
trying to avoid getting hooked on it before finishing ABE ;) )
Please finish ABE first. :) Very much looking forward to it. :D
maybe set up the first level as a tutorial
The plan is to have a short demo mode, to have the first level easy (it's painfully easy for the experienced player right now) and to be able to start at later levels (every 4) once you have completed them. All tentative.
If you're planning on expanding the game further, why not add power ups that you have to collect by surrounding in shields (the same as you have to do for your ships) ?I do plan on making a shareware version (already planned in some detail) with much more variation and power ups, but I hadn't thought of getting new ones by surround them with shields. I really like the idea, though! Thanks!

I'm using this version to iron out the major bugs and get people hooked. I'm anxious to share all the ideas for the shareware version... but :ninja:

It's more fun that way and I need to stay focused on fixing these HUGE bugs!

arekkusu
2004.07.14, 02:28 AM
Oop, you mean GL_UNPACK_CLIENT_STORAGE_APPLE. Hmm. Yeah, that doesn't cause a problem for me in mingw with the latest glext.h, but it's not going to actually *do* anything on non-Mac platforms, so I ought to #if around it. Whoops!

aaronsullivan
2004.07.14, 02:31 AM
glAArg doesn't contain the text UNPACK_APPLE anywhere. Update your glext.h perhaps?
Sorry, I was using sloppy shorthand, the offending lines use:
glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 1);
I'll have to look into updating glext.h.

[we had simultaneous messages here. ;)]

Mazilurik
2004.07.14, 06:11 PM
I spent some time looking at the source (read: commenting out large blocks of code at random) and figured out that removing the lines "glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);" and "glAlphaFunc(GL_GREATER, 1/255.0);" (in setUpOpenGL() in main.cpp) allows the game to draw to screen; it's ugly, but at least it's playable. I would assume that these lines themselves aren't at fault (I don't know OpenGL, but based on a quick Google search they seem to be innocuous), but this should at least give an idea of what the problem is.

arekkusu
2004.07.14, 07:28 PM
It's time to compare GL implementations.

Mazilurik, could you try pasting this code into SpaceBarrage? Let's check that the drawing environment is sane on your Geforce 4Ti.

In sb_Phase_Title.cpp, after sb_Phase_Title::draw()'s glMatrixMode(GL_MODELVIEW) call:

{ // sanity check framebuffer and env info
printf("GL err was %04x\n", glGetError());

GLint r, g, b, a, depth, sten, aux, dbl;
glGetIntegerv(GL_RED_BITS, &r);
glGetIntegerv(GL_GREEN_BITS, &g);
glGetIntegerv(GL_BLUE_BITS, &b);
glGetIntegerv(GL_ALPHA_BITS, &a);
glGetIntegerv(GL_DEPTH_BITS, &depth);
glGetIntegerv(GL_STENCIL_BITS, &sten);
glGetIntegerv(GL_AUX_BUFFERS, &aux);
glGetIntegerv(GL_DOUBLEBUFFER, &dbl);
printf("framebuffer: rgba %d %d %d %d, depth %d, stencil %d, aux bfr %d, double bfr %d\n",
r, g, b, a, depth, sten, aux, dbl);

GLint a_test, a_func; float a_ref;
glGetIntegerv(GL_ALPHA_TEST, &a_test);
glGetIntegerv(GL_ALPHA_TEST_FUNC, &a_func);
glGetFloatv(GL_ALPHA_TEST_REF, &a_ref);
printf("alpha testing: %d, func %04x ref %f\n", a_test, a_func, a_ref);

GLint blend, b_src, b_equ, b_dst;
GLfloat b_c[4];
glGetIntegerv(GL_BLEND, &blend);
glGetIntegerv(GL_BLEND_SRC, &b_src);
glGetIntegerv(GL_BLEND_EQUATION, &b_equ);
glGetIntegerv(GL_BLEND_DST, &b_dst);
glGetFloatv(GL_BLEND_COLOR, b_c);
printf("blending: %d, src %04x equ %04x dst %04x color %.2f %.2f %.2f %.2f\n",
blend, b_src, b_equ, b_dst, b_c[0], b_c[1], b_c[2], b_c[3]);

GLint logic, logmode, mask[4], cull, cullmode, front, draw;
glGetIntegerv(GL_COLOR_LOGIC_OP, &logic);
glGetIntegerv(GL_LOGIC_OP_MODE, &logmode);
glGetIntegerv(GL_COLOR_WRITEMASK, mask);
glGetIntegerv(GL_CULL_FACE, &cull);
glGetIntegerv(GL_CULL_FACE_MODE, &cullmode);
glGetIntegerv(GL_FRONT_FACE, &front);
glGetIntegerv(GL_DRAW_BUFFER, &draw);
printf("draw env: logic %d logmode %04x, mask %d %d %d %d, cull %d cullmode %04x frontface %04x, drawbuffer %04x\n",
logic, logmode, mask[0], mask[1], mask[2], mask[3], cull, cullmode, front, draw);

printf("GL err was %04x\n", glGetError());
printf("***\n");
}


Then build it, run for just a second, quit, and look in Xcode's log window.

On my system, I get:

GL err was 0000
framebuffer: rgba 8 8 8 8, depth 16, stencil 0, aux bfr 0, double bfr 1
alpha testing: 1, func 0204 ref 0.003922
blending: 1, src 0302 equ 8006 dst 0303 color 0.00 0.00 0.00 0.00
draw env: logic 0 logmode 1503, mask 1 1 1 1, cull 0 cullmode 0405 frontface 0901, drawbuffer 0405
GL err was 0000

aaronsullivan
2004.07.14, 07:30 PM
Wow, I'm a bit baffled by that!
I assume by ugly you mean completely opaque and unaliased?
It might have to do with the order of things. Hmm... I really appreciate your digging into the code! Thanks. :D It's killing me that I haven't had more time to work on this specific issue.

Okay, now a thanks to arekkusu, too. :) That's it I'm gonna break down and check out my code on my iBook right in the middle of this class. :sneaky:

Mazilurik
2004.07.14, 07:52 PM
Arekkusu: I get the same results when I run it on my system.

Aaron: Yes, the "ugliness" is just the fact that it renders how one would expect it to render without blending. It actually looks okay, just not nearly so good as the screenshots. Excellent game, by the way. :)

arekkusu
2004.07.14, 09:03 PM
Hrmmm. I know blending (and glAArg's usage of it) definitely works on GeForce 4Ti, because I've run the Antialiasing test on that card in Apple's lab. On every card, actually.

Mazilurik, if you don't mind helping narrow this down, could you try:
1) running (the Vectorized contest version of) Shoot Things (http://homepage.mac.com/arekkusu/SW/shootthings.html) on your system to verify that it works in a window? (I expect there is still a problem with fullscreen mode on your card-- hit Esc after launching to go to a window.)
2) Commenting out the glBlendFunc and glAlphaFunc lines separately?
3) Leaving them both in but changing the alpha test to i.e. glAlphaFunc(GL_GREATER, 0.5);

thanks...

aaronsullivan
2004.07.14, 09:31 PM
I have a quick test for you, too, Mazilurik. (should we start paying you now? ;) )
It's a little test app that uses the same framework as Space Barrage but with no glAArg. Maybe we can isolate this a little.
http://homepage.mac.com/aaronsullivan/projects/isotest.zip
It's just an isometric looking thing with one diagonal row of squares and an elevated ramp with a sprite over it. arrow keys rotate, mouse wheel zooms in and out... but the question is, do you see anything?

Mazilurik
2004.07.14, 09:32 PM
Mazilurik, if you don't mind helping narrow this down, could you try:
1) running (the Vectorized contest version of) Shoot Things (http://homepage.mac.com/arekkusu/SW/shootthings.html) on your system to verify that it works in a window? (I expect there is still a problem with fullscreen mode on your card-- hit Esc after launching to go to a window.)
It doesn't draw in fullscreen mode, but windowed mode works perfectly. (On a vaguely related note, I'm surprised Shoot Things didn't do better in the voting; besides being quite a good game, it had the best title out of all the entries...)
2) Commenting out the glBlendFunc and glAlphaFunc lines separately?
Already tried it; the game only draws if both are removed.
3) Leaving them both in but changing the alpha test to e.g. glAlphaFunc(GL_GREATER, 0.5);
The game still doesn't draw anything. (I kind of wish that I could give more helpful feedback than "Nope, that doesn't work either..." ;) )

Edit: Yes, that test app works; it took a bit of coercion to get it to find libpng, but it does actually draw into the window. As for paying me, I certainly wouldn't be disinclined toward such a thing... ;)

arekkusu
2004.07.14, 09:48 PM
Aaron:
dyld: /Users/arekkusu/Desktop/isotest/isotest.app/Contents/MacOS/isotest can't open library: libpng12.0.1.2.5.dylib (No such file or directory, errno = 2)


Mazilurik:
Thanks very much for the testing. To confirm-- you're building Aaron's old (contest entry) version of SpaceBarrage, right? The one that only runs in fullscreen mode? I wonder if the blending problem only happens in fullscreen mode, and is the same thing that is breaking Shoot Things.

Could you try building Shoot Things? Comment out the same lines, in ShootGLView.m, initGL:.

Edit: oh, no, you said that the new build doesn't work in a window, either. Hrm.

Mazilurik
2004.07.14, 11:49 PM
For whatever reason, isotest.app expects libpng to be in the /usr/lib directory; the correct version of the library is included in the frameworks folder in the app bundle, but the program doesn't find it.

I tried all of your previous suggestions in windowed mode (by commenting out the SDL_FULLSCREEN flag). As you may expect, it didn't work.

Shoot Things does work in fullscreen when I build it with those two lines removed. (As a side note, I would like to officially take back what I said about Space Barrage's ugliness without blending and alpha tests; it pales in comparison with looking at Shoot Things under the same conditions, which very nearly causes me physical pain.)

arekkusu
2004.07.15, 12:00 AM
(heh-- yes Shoot Things draws a lot of quads, alpha blending is very important...)

Extremely interesting results-- this indicates that something is wrong with the blending and/or alpha test state on Geforce 3/4Ti/FX (those are the only cards Shoot Things doesn't work on in full screen mode) but Aaron has managed to get SDL to do the same thing in windowed mode, somehow.

I'm not sure how this state difference is being triggered, yet. The thing to do would be to use OpenGL Profiler to break inside any draw function, and dump ALL the gl state out and compare it to a machine that is working (any ATI card, or GF 2MX/4MX.) This is hard to do without two machines right in front of you, though...

aaronsullivan
2004.07.15, 12:11 AM
Oops... for anyone else that wants to try it for any reason, that isotest.app relies on that library even though it doesn't use it. :/ Quickest fix is to download:
http://homepage.mac.com/aaronsullivan/projects/libpng.zip
unzip it, and put in //usr/lib/ ( use Go->Go To Folder-> //usr/lib )

As for the results so far:
Hmm... I am so confused. :lol:

It does appear that some problem arises where I'm doing some setup for glAArg, though, since all the other code that isotest uses is close to identical concerning OpenGL and SDL... and I'm using alpha testing and blending in it. You could try the isotest in fullscreen (change the first one in the prefs file to a zero.)

Mazilurik
2004.07.15, 12:29 AM
Okay, now this is weird:

I tried running Space Barrage in the OpenGL Profiler (with alpha testing and blending enabled) to see if I could get any information out of it, and while I was messing around with breakpoints and buffer views and such, I noticed that the game was actually working, with everything drawing properly. I even figured out how to reproduce it: start the game from the Profiler, open the Alpha Buffer view window, set a breakpoint for glFlush, then continue until it breaks again; the correct alpha now appears in the alpha buffer and the game draws properly in its window. I can then get rid of the breakpoint and play the game normally, although the mouse is inexplicably inverted.

My limited experience in dealing with profilers tells me that this sort of thing isn't supposed to happen...

arekkusu
2004.07.15, 12:45 AM
No, it shouldn't. The profiler is stomping whatever state was wrong, so now it's a Heisenbug :(

Let's see. Another approach would be to dump all the state introspectively, like in the code sample I gave above (but a lot more of it.) Possibly the texture matrix is getting trampled or something else that glAArg expects set up a certain way.

Let me get these VBO's wrangled and then I'll cook up some more debug code...

aaronsullivan
2004.07.15, 07:03 PM
The whole mouse inverted business is from a bug (apparently in Apple code according an SDL guy) that effects the version of SDL I was using... it only effects windowed mode. You are just noticing it now because, well... now you can see something. ;) I'm using a CVS build for the latest Space Barrage version. I'm going to set up a link to the source code to the latest version. If you're going to dig into code it might as well be the latest. :)
(next post)

aaronsullivan
2004.07.15, 07:22 PM
Here's the source to the latest version:
http://homepage.mac.com/aaronsullivan/projects/SpaceBarrageBETA_src.zip

Mazilurik
2004.07.15, 08:56 PM
In the new version, the ships and guns don't draw when the rest of the graphics are working (either by building without alpha testing and blending or by using the OGL profiler to "fix" the bug).

aaronsullivan
2004.07.16, 01:09 AM
Interesting... I draw the ships and guns with display lists in this version. Sigh.

aaronsullivan
2004.07.16, 02:18 AM
ThemsAllTook, if you are still checking out this thread, please try running this little test app and see if it crashes on you:
http://www.createmacgames.org/forum/viewtopic.php?t=163
Um... you'll need this
http://homepage.mac.com/aaronsullivan/projects/libpng.zip
unzipped and in //usr/lib
to make it work. :/ There is some more info about this app and file in posts #22 and #27

arekkusu
2004.07.16, 02:36 AM
Aaron, not sure how familiar you are with display lists but I took a peek in sb_VectorShape.cpp and there are two problems:

1) display lists use the current state at the time you call the list, for things like the bound texture. So if you want to make a list that draws fuzzy lines, you either have to put the texture commands inside the list, or make sure to set the right state every time before you call the list.

2) with glAArg, you need to make sure you build your display lists using immediate mode. that means you need to glAADisable(GL_VERTEX_ARRAY_RANGE_APPLE) (or the new GLAA_VERTEX_ARRAY constant in the current release) before you build a list, and reenable it afterwards. otherwise, the list doesn't actually contain any GL commands, because all glAAVertex2f etc has done is calculate values into glAArg's internal VAR buffer. See the Shoot Things source (Sprite.c, roid_dr) for an example.

Fixing the second thing here makes the ships/guns show up again for me, although to make sure they look as you intended you'll need to fix the first thing too.

[Edit: 1) originally also mentioned color state, which is true for normal GL vertex submission, but currently glAArg always submits glColor calls in immediate mode (to match the VAR submission) so as long as you've specified the current color, it doesn't matter if it is inside the list or not; glAAVertex2f will implicitly specify the color.]

arekkusu
2004.07.16, 02:49 AM
Oh, also CPU usage dropped from 100% to like 13%, so hooray! :)

And I've put in a reservation for some lab time next week to look at the GL state issues on the problem machines.

aaronsullivan
2004.07.16, 03:26 AM
arekkusu:
1 - thought I had taken care of that as I quickly learned what was happening. :) At first I wanted to have the flexibility of changing colors/texture bindings... BUT with glAArg I'm stuck with what is called in the display list at the time... that's why I have the three different display lists for each shape etc... that was a late addition.

2 - this is the confusing part. If you remember, I couldn't even enable GL_VERTEX_ARRAY_RANGE_APPLE. Yet, it was acting like I had (I had to constantly glAAflush() etc.) :) Recently, I found that including the glext.h directly in the file allowed me to enable it in my setup code... so I was playing with it right before I put the source code online. I didn't see that the display lists stopped working I presume because the aging video card in my iBook can't use VARs(?)

Fixing the second thing here makes the ships/guns show up again for me, although to make sure they look as you intended you'll need to fix the first thing too. I can't change and upload the source tonight, but I believe that if Mazilurik just comments out the glEnable(GL_VERTEX_ARRAY_RANGE_APPLE) like I used to have it, the shapes can show up as intended again...

aaronsullivan
2004.07.16, 03:29 AM
Oh, also CPU usage dropped from 100% to like 13%, so hooray! :)
Thanks for that VBL syncing code... I swear that had come up on the SDL list as a non controllable factor with GL. :rolleyes:

arekkusu
2004.07.16, 03:44 AM
re: colors in display lists, that is very useful feedback for me. Really, you could consider glAArg's immediate mode forcing of color setting to be a bug, since you are absolutely correct that it breaks that usage of display lists. I considered changing this a while ago, but it means a bit of extra state tracking to add to glAArg. I'll probably do it at some point, but there are higher priority problems first...

re: GL_VERTEX_ARRAY_RANGE_APPLE, the official 0.2 release added a GLAA_VERTEX_ARRAY define to avoid any possible glext.h problems with that enum (on other platforms for example.)

re: VBL, given the number of extensions for this (WGL_EXT_swap_control and so on) and the availability of OS specific APIs for it, I'm surprised that SDL doesn't wrap this functionality. Oh well!

ThemsAllTook
2004.07.16, 10:40 AM
ThemsAllTook, if you are still checking out this thread, please try running this little test app and see if it crashes on you:
http://www.createmacgames.org/forum/viewtopic.php?t=163
Um... you'll need this
http://homepage.mac.com/aaronsullivan/projects/libpng.zip
unzipped and in //usr/lib
to make it work. :/ There is some more info about this app and file in posts #22 and #27

Err... MapCritter? Yeah, I can run it, but somehow I have the feeling you linked to the wrong thread... Especially considering you're referring to posts #22 and #27, when there are only 10 posts in the thread. :???:

Alex Diener

aaronsullivan
2004.07.16, 12:11 PM
Ugh. This whole thread feels like a comedy of errors. (pun intended) ;)
Here's the link I meant to paste. That will teach me to stay up that late. :lol:
http://homepage.mac.com/aaronsullivan/projects/isotest.zip
also the posts I'm talking about (22 & 27) are in THIS thread.
Thanks, ThemsAllTook

ThemsAllTook
2004.07.16, 05:47 PM
Yes, after installing libpng, I was able to run it. Seems to work OK.

Alex Diener

aaronsullivan
2004.07.16, 06:10 PM
re: VBL, given the number of extensions for this (WGL_EXT_swap_control and so on) and the availability of OS specific APIs for it, I'm surprised that SDL doesn't wrap this functionality. Oh well!
Well, I looked it up on the SDL newsgroup and it was discussed... Sam suggested someone patch it about a year ago... and no one did. :/ Wish I had the confidence and time to do it right, but I don't. This fix will do for now, and Windows sync's automatically, so...

aaronsullivan
2004.07.16, 08:09 PM
Yes, after installing libpng, I was able to run it. Seems to work OK.
Thanks! Now I need to take a close look at the code for that isotest and see the differences. If I'm reading the crash log right, however, OpenGL doesn't even get involved before the crash! So, even though the primary difference between the Space Barrage code that crashes your computer and the isotest that doesn't is the use of glAArg it seems it might be something else.

arekkusu
2004.07.19, 03:42 PM
For the glAArg "black screen" on GF3/4Ti/FX, it's the *texture matrix*, nothing to do with blending or alpha test. For some reason those cards reset it to the identity when the ctx comes up the first time, AFTER you've done your GL init. Workaround for now is to just always set the matrix in your GL render.

aaronsullivan
2004.07.19, 03:58 PM
For the workaround, do you mean set the scale
i.e.
glMatrixMode(GL_TEXTURE);
glScalef(0.125/phf, 0.125/phf, 1.0);
each frame?

arekkusu
2004.07.19, 04:24 PM
Yes, code as of glAArg 0.2.1 (with optimized texture layout) is:

// must force this to be setup because GF3/GF4Ti/GFFX reset it for unknown reasons
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glScalef(0.25/phf, 0.25/phf, 1.0); // glAArg requires rectangle coordinate setup


The requirement for doing this will go away once I add variable texture size to glAArg (so you can make a fuzzy line with a 32x32 px texture and a solid one with a 128x128 px texture for instance.) But this is the workaround for now. Note that this behavior isn't specific to glAArg; it just happens to use the texture matrix. Any other application that uses it should have the same problem on these three cards!

Mazilurik
2004.07.19, 04:38 PM
Just for corroboration and a sense of closure, everything works properly (in fullscreen and windowed) if I put
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glScalef(0.125/phf, 0.125/phf, 1.0); before currentPhase->draw() . (The glLoadIdentity() call does seem to be necessary.)

I also ran across two smaller bugs:
-When several sounds are being played simultaneously (not sure of the exact number), the audio tends to break up; I don't think this happened with the contest version of the code.
-The level number changes while the "Stage x Complete" text is still on-screen, a fraction of a second before the next stage actually begins. I'd imagine that this one should be fairly easy to fix. :)

arekkusu
2004.07.19, 04:55 PM
Mazilurik, thanks for the confirmation. glLoadIdentity is required because otherwise the matrix will get smaller and smaller every frame.

aaronsullivan
2004.07.19, 05:00 PM
:D That's great news! Thanks, arekkusu for continuing to develop glAArg because I'd never have figured that out.

Also, to Mazilurik for not having to be asked. ;) I was just about to send a quick update for you to test. :lol:

The simultaneous sound thing... I think it may have to do with the quality of the shield destruction sound. (a very compressed bassy sound) There is no sound for it in the 21 days version, but in this version there are many, many overlapping sounds once you start getting pummelled. I haven't looked into that yet.

As for the level switch thing... I know. I did try an easy fix once but it didn't work so I went on to more important things. It really nags me though, so I think I'll look into it right now. [EDIT: fixed]

So, what's your high "score" Mazilurik? What stage have you reached? :)

I have a few updates I'd like to make before the next release, and then the "crash at launch" bug will be the big priority.

Mazilurik
2004.07.19, 06:05 PM
I think I'm just hearing the new shield sound; I replaced shieldSection.aiff with a silent AIFF and the "problem" went away. Now that I actually know what it is, it doesn't really bother me, although it does tend to overpower the other sounds a bit when there are a lot of enemies.

My highest score was in my most recent game, where I reached Stage 9 and then was completely and utterly destroyed; after the first wave I had exactly two shield tiles, and there were still about four or five enemies left...

aaronsullivan
2004.07.19, 07:51 PM
That's pretty good. Every four stages there is a major jump in enemies, so I think stage 8 is the second big jump. I'm contemplating giving a count of the total incoming enemies for the entire stage. Nice and threatening. (However, putting a number on it might diminish the impact of seeing all those ships line up.)

I'd like to fix the sound thing because, at first, it actually gives the illusion that your speakers are being blown out. Not a pleasant experience. It's hard to let go of a particular sound, though... you get attached after 1000+ games. :)

As a challenge... someone may have passed stage 20. ;)

Malarkey
2004.07.20, 05:20 AM
Sadly, I still can't get any graphics going on this game. I thought for sure when I saw it loading up in windowed mode that I'd finally be able to play it at home but no... :cry:

I checked the console also. Nothing popped up in there, as far as I could tell. I'm trying to run it on a 1.8Ghz G5, OSX 10.3.4, and a GeForce FX 5200 with 64MB of RAM.

aaronsullivan
2004.07.20, 10:27 AM
Malarkey, this is for you. :)

Update: 0.9.1
http://homepage.mac.com/aaronsullivan/projects/SpaceBarrageBeta.zip
Anyone that has a GeForce card a blank screen should be able to play the game now. I have not tried to fix the crashing bug, but I'd like to see if anything has changed (please try this version out ThemsAllTook. :) )

There are numerous tiny tweaks and optimizations. Please try this on older machines and give feedback on choppiness of gameplay at later levels... press '5' to switch to stage 15 at anytime (you'll notice much more enemies the next time they appear.) I'm also looking for any little inconsistencies, unexpected behaviors, and interface problems.

arekkusu
2004.07.20, 05:36 PM
0.9.1. looks good here (level 16 kicked my butt.) I noticed though that the enemies can run into and overlap each other. As intended?

aaronsullivan
2004.07.20, 07:48 PM
Ah, yes. The overlapping enemies is not really intended. However, I tend to like it. :) They do TRY to avoid overlapping, so it's not too rampant, but it does give them some more breathing room, so the barrel of monkeys effect is reduced. (If they could overlap easily, there would likely be places where there were 4 or 5 easily destroyed enemies.) I used to know exactly why they still overlap, but I forget now. What do people think? Does it harm the game to have some overlapping?

ThemsAllTook
2004.07.20, 09:37 PM
(please try this version out ThemsAllTook. :) )

Still crashes on startup.

**********

Date/Time: 2004-07-20 16:39:55 -0400
OS Version: 10.2.8 (Build 6R73)
Host: Bendezium.local.

Command: SpaceBarrage
PID: 1883

Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0xbff7ff90

Thread 0 Crashed:
#0 0x902347f8 in FSPathMakeRefWithOptions(unsigned char const*, unsigned long, FSRef*, unsigned char*)
#1 0x9025b4c8 in GetDomainRootRef
#2 0x90261aac in FindTopLevelFolderForDomain
#3 0x9025d170 in ResolveSpecialFolder
#4 0x90238168 in FindFolderGuts
#5 0x9024d894 in ResolveRelativeFolder
#6 0x90238188 in FindFolderGuts
#7 0x9024d894 in ResolveRelativeFolder
#8 0x90238188 in FindFolderGuts
#9 0x90247ef0 in FSFindFolder
#10 0x9026742c in GetPathFromSearchDirectoryInfo
#11 0x902622b0 in GetDirectoryModificationDate
#12 0x9025d710 in CacheFMMapData
#13 0x90262244 in IntlFCOpenComponentData
#14 0x96a867d8 in InitializeKeyboardLayoutCache
#15 0x96a86720 in GetKeyboardLayoutCountInCache
#16 0x96a0763c in CreateKeyboardLayoutList
#17 0x96a00cdc in GetKeyboardLayoutList
#18 0x969d0038 in KLGetKeyboardLayoutWithIdentifier
#19 0x96a82bb8 in GetKCHR
#20 0x96a82af8 in xSwapKybd
#21 0x9024f4c0 in LMGetKeyCache
#22 0x30050084 in QZ_InitOSKeymap (SDL_QuartzEvents.m:157)
#23 0x300094cc in SDL_KeyboardInit (SDL_keyboard.c:79)
#24 0x300086e8 in SDL_StartEventLoop (SDL_events.c:225)
#25 0x3003ea64 in SDL_VideoInit (SDL_video.c:272)
#26 0x300494cc in SDL_InitSubSystem (SDL.c:74)
#27 0x30049700 in SDL_Init (SDL.c:166)
#28 0x0002e638 in sb_Screen::init(unsigned short, unsigned short, unsigned short, unsigned short, unsigned short, int, char const*) (sb_Screen.cpp:46)
#29 0x0000c5dc in SDL_main (main.cpp:38)
#30 0x00003310 in -[SDLMain applicationDidFinishLaunching:] (SDLMain.m:196)
#31 0x97dfab40 in _nsNotificationCenterCallBack
#32 0x901684c4 in _postNotification
#33 0x90165bd8 in _CFNotificationCenterPostLocalNotification
#34 0x9318a720 in -[NSApplication _sendFinishLaunchingNotification]
#35 0x93161624 in _requiredAEEventHandler
#36 0x91b56570 in aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned long, unsigned char*)
#37 0x91b590cc in dispatchEventAndSendReply(AEDesc const*, AEDesc*)
#38 0x91b56478 in aeProcessAppleEvent
#39 0x96a83778 in AEProcessAppleEvent
#40 0x9308e0a8 in _DPSNextEvent
#41 0x930a0158 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#42 0x930b1d88 in -[NSApplication run]
#43 0x00003264 in CustomApplicationMain (SDLMain.m:176)
#44 0x00003664 in main (SDLMain.m:277)
#45 0x000026c8 in _start (crt.c:267)
#46 0x8fe19154 in _dyld_start

PPC Thread State:
srr0: 0x902347f8 srr1: 0x0200f030 vrsave: 0x00000000
xer: 0x00000000 lr: 0x9025b4c8 ctr: 0x9025b4a0 mq: 0x00000000
r0: 0x00000000 r1: 0xbff80310 r2: 0x88002248 r3: 0x902d3750
r4: 0x00000000 r5: 0xbff81430 r6: 0x00000000 r7: 0x00000000
r8: 0x00233010 r9: 0x9025b488 r10: 0x00233290 r11: 0x00000008
r12: 0x90003a40 r13: 0x00000000 r14: 0x00000000 r15: 0x00000000
r16: 0x00000000 r17: 0x00000000 r18: 0x00000000 r19: 0x00000000
r20: 0x96b0ae64 r21: 0x00000008 r22: 0x00000000 r23: 0x00000000
r24: 0xbff81430 r25: 0x00000001 r26: 0xffff8002 r27: 0xbff81430
r28: 0xffff8002 r29: 0xbff81430 r30: 0x00000000 r31: 0x9025b448

Alex Diener

arekkusu
2004.07.20, 10:02 PM
Hrm. Just guessing here (don't have SDL source to look at) but ThemsAllTook, what's your drive name? And disk format (HFS, UFS?) Where's the app sitting when you run it?

ThemsAllTook
2004.07.20, 10:11 PM
Drive name: Macintosh HD
Format: HFS
Location of SpaceBarrage when I was running it: /Users/adiener/Desktop/SpaceBarrage/

That all seems pretty normal, right?

Alex Diener

arekkusu
2004.07.20, 10:40 PM
Mazilurik (or anyone with GF3/GF4Ti/GFFX), could you grab this test case (homepage.mac.com/arekkusu/bugs/glTextureMatrix.dmg) and see if the results are the same in windowed and fullscreen? It dumps the texture matrix to console, it should be identical in both cases.

I'm going to submit this to radar as the bug sample but I didn't have time to write it yesterday in the lab, so I can't verify that it breaks the same way as Shoot Things/Space Barrage.

Mazilurik
2004.07.20, 10:55 PM
It seems to work properly (i.e. it doesn't break). It does behave a bit unusually, though; the first time I put it into fullscreen, it draws one large icon, but subsequent times it draws the square of four icons like in windowed mode. Here's the console output:

2004-07-20 21:49:25.482 glbug[7475] view init
2004-07-20 21:49:25.503 glbug[7475] gl init with share (null)
2004-07-20 21:49:25.504 glbug[7475] Texture matrix initialized for <NSOpenGLContext: 0x1017b0>:
2004-07-20 21:49:25.504 glbug[7475] 2.000000 0.000000 0.000000 0.000000
2004-07-20 21:49:25.504 glbug[7475] 0.000000 2.000000 0.000000 0.000000
2004-07-20 21:49:25.504 glbug[7475] 0.000000 0.000000 1.000000 0.000000
2004-07-20 21:49:25.504 glbug[7475] 0.000000 0.000000 0.000000 1.000000
2004-07-20 21:49:25.613 glbug[7475] reshape
2004-07-20 21:49:25.615 glbug[7475] draw
2004-07-20 21:49:25.615 glbug[7475] Texture matrix in use for <NSOpenGLContext: 0x1017b0>:
2004-07-20 21:49:25.615 glbug[7475] 2.000000 0.000000 0.000000 0.000000
2004-07-20 21:49:25.615 glbug[7475] 0.000000 2.000000 0.000000 0.000000
2004-07-20 21:49:25.616 glbug[7475] 0.000000 0.000000 1.000000 0.000000
2004-07-20 21:49:25.616 glbug[7475] 0.000000 0.000000 0.000000 1.000000
2004-07-20 21:49:25.649 glbug[7475] launched
2004-07-20 21:49:27.597 glbug[7475] gl init with share <NSOpenGLContext: 0x1017b0>
2004-07-20 21:49:27.598 glbug[7475] Texture matrix initialized for <NSOpenGLContext: 0x13f9f0>:
2004-07-20 21:49:27.598 glbug[7475] 2.000000 0.000000 0.000000 0.000000
2004-07-20 21:49:27.599 glbug[7475] 0.000000 2.000000 0.000000 0.000000
2004-07-20 21:49:27.599 glbug[7475] 0.000000 0.000000 1.000000 0.000000
2004-07-20 21:49:27.599 glbug[7475] 0.000000 0.000000 0.000000 1.000000
2004-07-20 21:49:27.600 glbug[7475] reshape
2004-07-20 21:49:27.601 glbug[7475] draw
2004-07-20 21:49:27.601 glbug[7475] Texture matrix in use for <NSOpenGLContext: 0x13f9f0>:
2004-07-20 21:49:27.601 glbug[7475] 2.000000 0.000000 0.000000 0.000000
2004-07-20 21:49:27.601 glbug[7475] 0.000000 2.000000 0.000000 0.000000
2004-07-20 21:49:27.601 glbug[7475] 0.000000 0.000000 1.000000 0.000000
2004-07-20 21:49:27.601 glbug[7475] 0.000000 0.000000 0.000000 1.000000
2004-07-20 21:49:30.641 glbug[7475] quit
2004-07-20 21:49:30.650 glbug[7475] reshape

arekkusu
2004.07.20, 11:18 PM
Err, that's the expected (i.e. broken) behavior-- one large icon in fullscreen mode on those nvidia cards. That's the bug. But, your console log doesn't show that-- the fourth matrix should be the identity. Is that the tail of a longer log? Is the identity in there near the start? It sounds like it's breaking like I expect...

I think the reason this is broken on certain cards is because the fullscreen drawable creation is delayed a bit until it is actually drawn into. So it works after the first time you go fullscreen, because in this test case only one fullscreen context is ever created, and the state is set correctly the second time. In Shoot Things the context has to be created on the fly so it (used to be) broken every time. I guess SDL does the same thing. Now, why some state (like glEnable(GL_TEXTURE_2D)) sticks and some doesn't, I have no idea.

Mazilurik
2004.07.20, 11:37 PM
Ah, I was assuming that it wouldn't draw anything to screen; I read through the code comments and it seems that everything is breaking perfectly. The log I posted is a complete run of the application (I cleared the console beforehand to make sure I got the entire thing); it consistently outputs the same matrix.

arekkusu
2004.07.20, 11:49 PM
OK, thanks. This is extremely weird though-- it thinks the matrix is correct when it clearly isn't? Your log is identical to mine but I get four icons in fullscreen mode on Radeon9600. Bizarre.

Testing help much appreciated. Working on the Shoot Things default frame now...

[Edit: sample app has been submitted to RADAR. We'll see what Apple/nvidia have to say.]

arekkusu
2004.07.21, 02:07 AM
Aaron, here's an minor, obscure bug. If I run on my Powerbook, the res might be 1280x854. Then quit, attach a second monitor, make it the primary display at say 1280x1024. Run again. Now Space Barrage comes up at 1280x854 in 1280x1024 res and the top of the display is empty. And none of the boxes are checked in the options, because the old mode doesn't exist on the new display. :)

Maybe check for the non-existing case and default to the user's desktop display res? Or fall back to a window?

Malarkey
2004.07.21, 04:20 AM
Malarkey, this is for you. :)

Update: 0.9.1
http://homepage.mac.com/aaronsullivan/projects/SpaceBarrageBeta.zip
Anyone that has a GeForce card a blank screen should be able to play the game now. I have not tried to fix the crashing bug, but I'd like to see if anything has changed (please try this version out ThemsAllTook. :) ).

Woo! I actually get graphics now. Cool. :)

aaronsullivan
2004.07.21, 09:24 AM
Maybe check for the non-existing case and default to the user's desktop display res? Or fall back to a window?
Unfortunately, SDL gives me no reasonable way to check what the desktop display res is. I tried to get that for awhile. I could, however, check for the non-existing case and default to 800x600 in a window. That's a good idea, thanks.

EDIT: Pretty sure it's fixed now, I did a test with a weird resolution and the only unfortunate side effect is that it has to change resolutions twice in that particular scenario. (can't seem to avoid this as I have to init the screen before checking the available resolutions in SDL.) Also, it has made me rethink my screen and prefs code a little. One more thing to refactor for the shareware version. ;)

I want to make a few more updates before posting the new version.

aaronsullivan
2004.07.22, 07:10 PM
You should have seen my face when the Windows version of Space Barrage came up with a blank screen! GASP! Anyway, it was an easy fix. I forgot to update the texture scaling to 0.25 instead of 1.25. My jaw is sort of sore from hitting the ground, though.

Update coming soon.

arekkusu
2004.07.22, 07:23 PM
Heh. Yes, side effect of optimization, don't forget to read the docs! :)

aaronsullivan
2004.07.22, 08:00 PM
I read your email and the docs and thought about it on several occasions but my time to code is so scattered right now that I'll be making many more goofy mistakes. Just expect it. ;)

Your documentation has been great, though, Arekkusu. Very clear and up to date.

aaronsullivan
2004.07.24, 07:55 PM
I'm going to be releasing another update with one new feature within the hour... but I had this idea about the bug that is causing crashes. Would I be off base to think that perhaps including SDL and SDL_mixer frameworks in the app bundle without preparing the frameworks correctly could cause this problem?
As far as I know those frameworks are built to be stored in a library folder (user's or system's) not built in the fashion described at this link:
http://cocoadevcentral.com/articles/000042.php

I sort of shrugged it off as I had never encountered anyone having a problem when I read that way back. Before I persue that I'm just looking to see if anyone thinks that is a possibility. Anyone with a lot of framework bundling experience care to comment? :)

(The relevant crash log is here (http://www.idevgames.com/forum/showpost.php?p=62851&postcount=57) )

aaronsullivan
2004.07.24, 09:53 PM
Update 0.9.2
You can destroy your own shields now, and I'm interested how that effects gameplay for anyone. Also, there are a couple optimizations, especially for anyone with the big showstopping studdering on the PC version in later levels. Here are the links:
Mac Version:
http://homepage.mac.com/aaronsullivan/projects/SpaceBarrageBetaMac.zip
Windows Version:
http://homepage.mac.com/aaronsullivan/projects/SpaceBarrageBetaWin.zip

Arekkusu, if you'd test out your monitor switching thing out that would be helpful. It should definitely be fixed. Also, if you could get Scott in on this, I'd like to see if he has the slow down problems he had before. Thanks!

arekkusu
2004.07.25, 11:58 PM
The monitor switch case I gave is fixed here, but housemate got into an infinite loop switching resolutions, until he trashed prefs. And, if I edit the prefs to a non-existent res like 1281x854 it crashes, so you might want to bulletproof that a bit more.

Shield friendly fire doesn't appear to affect gameplay at all, unless you're really clumsy maybe?

I did manage to hit an enemy just as the counter went to zero, and he stuck drawn yellow just about to explode while I rebuilt. Then he blew up as soon as the next round started...

aaronsullivan
2004.07.26, 12:08 AM
Thanks for checking it out. I'm definitely itching to get this basic game polished off, so I can move on to a more exciting dynamic version.

The monitor switch case I gave is fixed here, but housemate got into an infinite loop switching resolutions, until he trashed prefs.
Woah. Interesting. I admit that I didn't even test that on the PC. He was simply trying a different resolution from the option screen? Fullscreen, I assume?
And, if I edit the prefs to a non-existent res like 1281x854 it crashes, so you might want to bulletproof that a bit more. Windows version or Mac?
Shield friendly fire doesn't appear to affect gameplay at all, unless you're really clumsy maybe?
Actually it is meant to benefit the player. There are circumstances in which it helps to clear out some troublesome shield fragments.

Did your housemate have a chance to check on slowdown/temporary freezes in the later stages?
I did manage to hit an enemy just as the counter went to zero, and he stuck drawn yellow just about to explode while I rebuilt. Then he blew up as soon as the next round started... This is a known issue I'm working on. I'm surprised it hasn't been noticed earlier. It can actually effect gameplay when it is the last enemy in the third wave as you should be able to skip the shield building phase and just go to the next stage but the game forces the player to finish the shields. Very bad. :(

arekkusu
2004.07.26, 12:30 AM
He said it gave an alert just launching, tried to change res, and went into a loop. His laptop is 1600x1200. Still has slowdown, can't tell if it's sound effect related or not. Sound is crackly, though.

Crash editing prefs is on Mac. Looks like in glAAInit, around glGetString(GL_EXTENSIONS). I'm already checking for a null string there, so presumably there's no gl context when you're calling glAAInit-- don't do that!

aaronsullivan
2004.07.26, 01:04 AM
He said it gave an alert just launching, tried to change res, and went into a loop. His laptop is 1600x1200. Still has slowdown, can't tell if it's sound effect related or not. Sound is crackly, though.
Okay that sounds like a fun bunch of problems.
Crash editing prefs is on Mac. Looks like in glAAInit, around glGetString(GL_EXTENSIONS). I'm already checking for a null string there, so presumably there's no gl context when you're calling glAAInit-- don't do that! I'm certainly not trying. :) It shouldn't even get that far in the code. SDL should quit... but I've obviously messed up something with my new resolution testing/switching. I know that SDL's screen behavior on the mac when given an unusable fullscreen setup is to just use a portion of the screen (that awkward result you got before.)

I'm not sure what SDL does in that situation on Windows now that I think about it. Just to confirm, he was trying the same idea by forcing a non standard resolution by changing the prefs file?

arekkusu
2004.07.26, 01:18 AM
No, his loop was out-of-the-box launching the app. Fix was to delete the prefs file.

aaronsullivan
2004.07.26, 03:17 AM
:blink:
Glad I asked. :) I've been waiting for a good Windows bug. :p

aaronsullivan
2004.07.26, 03:57 AM
The windows thing isn't quite as odd as I thought. In my rush to get the windows version released I left the prefs set to fullscreen rather than windows. Perhaps you rhousemate has no native 800x600 fullscreen mode on the laptop? (seems a bit odd, but possible.) Of course, it shouldn't have had am infinite loop, but at first I couldn't figure out how the windowed default would try to change resolution and all that.

I just noticed on my PC that it wasn't successful switching from fullscreen to windowed and I didn't see anything obvious, so I'll have to look into it more.

arekkusu
2004.09.01, 11:46 PM
(As a side note, I would like to officially take back what I said about Space Barrage's ugliness without blending and alpha tests; it pales in comparison with looking at Shoot Things under the same conditions, which very nearly causes me physical pain.)

Rehashing an old thread here but thought I'd mention that Shoot Things (Day 22) (http://homepage.mac.com/arekkusu/SW/shootthings.html) has debug switches for blending and alpha test built into it, so you can see just how ugly it looks:

Launch Shoot Things
Ctrl-d to enter debug mode
'b' toggles blending
'a' toggles alpha test
'd' toggles the collision overlay
Ctrl-d to leave debug mode

aaronsullivan
2004.09.02, 01:14 AM
Fun. I kind of like having just the collision overlay showing, it's like an Atari 2600 flashback. :)

Since this thread bubbled up. I'd just like to mention that I'm temporarily putting SpaceBarrage on hold while I work on a uDevGames entry: Snowball (http://homepage.mac.com/aaronsullivan/projects/snowball.html)

The beta versions of SpaceBarrage are still available here:
Space Barrage site (http://homepage.mac.com/aaronsullivan/projects/SpaceBarrage.html)

I'm still interested in any bug reports or feedback if anyone wants to try it out and hasn't. There is a Mac and Windows version (and the windows version pref problem is fixed.)