Allegro.cc - Online Community

Allegro.cc Forums » The Depot » SpeedHack post-releases

This thread is locked; no one can reply to it. rss feed Print
 1   2   3   4 
SpeedHack post-releases
Oscar Giner
Member #2,207
April 2002
avatar

Quote:

my pong game just has bouncing code (dx = -dx; dy = -dy)

mine too ;)

Krzysztof Kluczek
Member #4,191
January 2004
avatar

Quote:

What do they consist of?

Look at physics.cpp in my code. ;) What you can find there:
- 3D point - segment distance checking algo
- 3D point - triangle distance checking algo (I've disabled some parts of it)
- checking for collision with map (looping through triangles using algo above)
- collision algo with bouncing and friction based on velocity toward plane
- function for rotating ship based on time delta
- function allowing applying force to specific point of ship (not very well done and unused)
- function handling hover engines (unused)
- function handling ship movement (advanced sections commented out)
- function converting forward/up vectors to heading/pitch/roll angles

Ship is described as position/forward/up/velocity and angular velocity vectors which is way less limiting than heading/pitch/roll angle set.

Additionally, allstuff.h has tVector code with some basic vector operations.

A bit complex, but works nice. Unfortunately I was forced to change my idea since I couldn't make physically correct model of hovering aircraft and I had to make simpler model without gravity. :)

Bruce Perry
Member #270
April 2000

Oscar: http://dictionary.reference.com/search?q=cinematic ;D

There's a word 'kinematic', but I'm not sure it's what you meant. I don't know if there's a word for it; frictional forces are independent of velocity, and air resistance is proportional to velocity squared ...

I'm graduating and moving out this coming weekend, so I need to work hard to find accommodation now, and I also need to pack and prepare for the graduation ceremony. I won't be able to try (m)any more entries until next week ...

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

da_flo
Member #1,907
February 2002
avatar

Bruce Perry : As for air resistance, keep in mind that it is only an experimental law, which is only an approximation and is valid only in specific conditions. In fact, at low velocities, the frictional force created by a fluid like air is proportional to the velocity itself ( F = -lambda*v in vectors ), but at high velocities, a force proportional to the velocity squared is a better model.

Evert
Member #794
November 2000
avatar

Quote:

Can't tell if it's the proper way.

If, by proper, you mean realistic,

Quote:

There's the cinematic force that applies a force proportional to your actual speed.

Unless it's a dissipative force, a force that is proportional to your velocity (and directed along it) is unphysical.

Quote:

Collisions apply a force in the opposite direction of the collision angle.

The force should be in the direction of the surface normal.

Quote:

my pong game just has bouncing code (dx = -dx; dy = -dy)

This is correct if all collisions are axis-aligned.

Krzysztof Kluczek
Member #4,191
January 2004
avatar

Then maybe F = -lambda * (gamma * v)^(beta * v + 1) ? ;D

da_flo
Member #1,907
February 2002
avatar

With gamma and beta being variables depending on v ? :P

[EDIT]
And anyway what you wrote is mathematically awful, unless beta is a vector and you're taking the dot product. And even in that case that is awful, because in math when you multiply a vector by a scalar, the scalar should be on the left and the vector on the right :P
Yipee, some mathematical nitpicking ;D

james_lohr
Member #1,947
February 2002

Quote:

heh, i've never had the pleasure of doing a physics engine ebfore. What do they consist of?

:o. The very first thing I did after I was able to get into a graphics mode was to mess around with particle physics. That someone could have already made their own games before messing around with physics really amazes me!

My SpeedHack entry actually uses some pretty complicated rigid body dynamics (plr_physics.c,jnts.c and paths.c I think). The code's in a mess though :p. If you know what my code is usually like, then you can imagine what my speedhack code is like....

Goodbytes
Member #448
June 2000
avatar

Zaphos: Yes, it was the line of sight code. A really stupid mistake too... but it works now.

Quote:

Music was sort of FF7 Aeriesish which is nice and relaxing.

Thank you, I composed that piece myself... I call it "Ice crystals echoing through the cloudscape" ;)

So, to recap, everyone must download the fixed version of our game (which isn't overly unfair, as the fix involved only moving a single line of code) and play! Cause it's so good! I mean... well, it's sort of interesting, or semi-acceptable... and those gender-confused cannonball ghost and red slimey enemies that Zaphos and I drew are just very nice overall.


--
~Goodbytes

Oscar Giner
Member #2,207
April 2002
avatar

Bruce Perry: I meant [edit] the force applied by kinetic energy [/edit]. Isn't this kinetic force proportional to the speed multiplied by resistance?

Quote:

The force should be in the direction of the surface normal.

Yeah, that's how I implemented it :)

Krzysztof Kluczek
Member #4,191
January 2004
avatar

Corrected: F = -lambda * (gamma * v)^(beta * |v| + 1) :)

btw: James: your game is really hard, I can't pass second level (that hill after a rock). :P

Oscar Giner
Member #2,207
April 2002
avatar

Now I remember what I did. The kinetic force is the force that preserves the movement. The friction force is then a force inverse to the kinetic force multiplied by the friction coeficient (>=1). However, in my game, the mass of all objects is 1, so it end up that the friction force is proportional to the speed.

james_lohr
Member #1,947
February 2002

:-[:'(:'( >:(

I just downloaded the windows binarys and mine wasn't compiled properly 'cause it doesn't work.

I know it should work properly 'cause I just downloaded exactly what I submitted and compiled it myself and it worked fine.

This is so unfair!!

I hope Matthew does something otherwise it seems like such a waste.

Krzysztof Kluczek
Member #4,191
January 2004
avatar

You are not alone. I guess AllegroGL version they compiled our entries with was the buggy version since James Howard's game doesn't run for me too. I'd suggest using CVS version of AllegroGL.

james_lohr
Member #1,947
February 2002

You entry was great btw (best graphics of the lot I thought).

Let's protest! -I'm glad I have support. I'm sure Matthew will do something - he's a nice guy usually :).

Krzysztof Kluczek
Member #4,191
January 2004
avatar

Thanks! ;D Your was great too - best I've tried so far but I guess to difficult for me. :)

btw. What gfx card do you have? Mine is GeForce 2 and requires hacked version of AllegroGL to run.

james_lohr
Member #1,947
February 2002

Mines a Geforce 4 but as far as I know works fine with the usual version (latest) of AllegroGL.

James Howard
Member #262
April 2000
avatar

Quote:

James Howard's game doesn't run for me too.

:'(

Does your system support opengl properly? (ie allegrogl)

Has anyone else played my game yet? I'm quite proud of it, as it was the first time I had written and polished a game in such a short period of time. I'd be greatful of any comments.
You can download windows binaries here

I haven't had a chance to try all the games yet. My favourites so far are the pirate game, the hippy's trip and the raycaster one (forgotten its name)

edit: Krzysztof I can't play your game. It needs fmod.dll to run, which I then googled for and downloaded but now it just opens a window and then closes it again with no error message. I prob got the wrong DLL file or something. Where can I get a working one?

----
Check out my final year university project 'Warring States', a 3-D multiplayer RTS game:
http://warring-states.blogspot.com/

Paul Pridham
Member #250
April 2000
avatar

Bruce Perry, your game doesn't seem to work for me. I navigate the menus and start, the game screen comes up with some hoops and blue dots, the music is playing, and that's it; Arrow keys do nada. Is there some minimum CPU requirement for this? Perhaps I'm racing against your render loop and losing.

Krzysztof Kluczek
Member #4,191
January 2004
avatar

Quote:

Does your system support opengl properly? (ie allegrogl)

I guess it does since my entry is OpenGL one. ;) Binary you've posted works well. Really nice game although some extra map features would be nice. :)

Also ImLeftFooted's binary from winbin archive doesn't work for me - probably AllegroGL again. :P

james_lohr
Member #1,947
February 2002

James Howard:
I just played it. One word: Awesome! ;D. I really think that this yeah has had some of the best entries!

[edit] Your winbin from the SH site worked fine for me that's odd...

James Howard
Member #262
April 2000
avatar

I thought of adding extra levels but I ran out of time trying to tweak the AI. I could post the map editor if you're interested.

edit:

Quote:

One word: Awesome!

thanks ;D I thought your game was pretty damn good, although its frustrating as hell when you get sent back to the beginning if you fail a level. Those damn bees! ::) 2 thumbs up!
I got a copy of the fmod dll and can now play krzysztof's game. A bit hard to control at first but I love the graphics. Nice lighting effects!

----
Check out my final year university project 'Warring States', a 3-D multiplayer RTS game:
http://warring-states.blogspot.com/

BAF
Member #2,981
December 2002
avatar

I used stable versions of everything when i compiled. I was the one who compiled it, and they all run fine here. I don't know why they won't work for you guys.

Krzysztof Kluczek
Member #4,191
January 2004
avatar

AFAIK AllegroGL version 0.2.0 or 0.2.2 had some problems with some gfx cards (eg. mine).

jcnossen
Member #205
April 2000
avatar

There were about 4 entries (Hippy trip, speedhack(dustin), DJ Space Racer, Daikaracer) in the windows binary that didn't work for me, but did work after I compiled my own binary from the source ?!?. DJ Space Racer runs like half a second and then exits.

Hippy trip is my favourite so far, but there are lots of other high quality entries in there this year IMO and I didn't play them all yet.
James Lohr, how much of the code did you write in the weekend? It's like 150k of code! I must say I admire your productivity :D

 1   2   3   4 


Go to: