Space-Shooter project, two days to go

Published February 26, 2011
Advertisement
A little late with this entry, but here we go! So, yesterday I stumbled into some problems that slowed me down...

First, realistic mass calculation for rigid bodies proved to be very hard to control. I ended up with some asteroids that would go into a spin frenzy and fly away faaaaast! I would then have some other, bigger asteroids that wouldn't feel the impact of gun shots at all!

Perhaps choosing that asteroids should be made of pure iron ore wasn't such a good idea :P but it was simply too difficult to control this beast. I ended up starting back at scratch, where everything had a mass of 1.0f. I then started tweaking a uniform asteroid value, until I landed on something that was ok to work with. 100.0f felt ok. I then added randomness to an asteroid's mass based on the random scale it gets when spawned, but with clamping control of the upper and lower limits. I got my control back, and the angular and linear physics reactions to collisions now feels good.

Still an issue is the fact that I use an AABB vs AABB for collision detection, then I calculate the collision response based on a spheric shape (direction of impulse spawned by collision + offset position of collision)... With asteroid, that's neither "boxy" nor "spheric", this ends up looking a bit strange. I'd have to have some kind of convex collision shape to make this work realistically, but there's just no time for implementing such detection algorithms now!

After I got physics to a stable place yesterday, I was going to quickly implement some UI elements into my libRocket-driven gui system that Bill had made. Well, I got the strangest crash, glGetUniformLocation returning -1 on me for no apparent reason. After some testing, I found that glGetError was returning 1281 on me... after some detective work I pinpointed the location to the previous UI element's render function, that tried to glUseProgram(67)... this was weird, because I could bind both uniforms and attributes to that shader program, and it had linked ok and everything...

well, I didn't get any wise last night and went to sleep. Whether I managed to solve it, and todays efforts will come later this evening... but needless to say, I didn't get anywhere close to where I wanted to be yesterday... with simulator-level collision detection remaining on my TODO list, time is running out FAST!
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement