Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Jetski physics engine [ search keywords: wave water boat ]

Author
Message
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 13th Dec 2004 02:21 Edited at: 8th Jan 2005 22:51
I was bored, so I thought I'd write a basic jetski physics engine. Just add a track, some opponent AI and some girls in bikinis, and you've got a wave-race type game.

Basically, the engine allows you to simulate any boat-like object which moves (reasonably realistically, hopefully) according to both user input and the wave motion.

You can adjust variables like power, amount of 'skid' through the water, wave properties, camera properties etc. in the code. It also incorporates a smooth chasecam, and a simple (but effective) mouse control steering system.

Use the up and down arrow keys to control the speed and the mouse to steer.

Have fun.







MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 13th Dec 2004 02:50
Hey, that's pretty nifty.

Nice job Ric.



A book? I hate book. Book is stupid.
(Formerly known as Yellow)
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 13th Dec 2004 15:09
Indeed. Great job

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Dec 2004 03:10
I really wish you would learn to indent more. I'll run the code when I get home. Oh, btw ric, I took your 3d wave example and applied it to a matrix object. I'll throw that up if I remember.

"eureka" - Archimedes
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 14th Dec 2004 07:08
Quote: "I really wish you would learn to indent more."


lol - I'll try to remember that!

Quote: "Oh, btw ric, I took your 3d wave example and applied it to a matrix object."


Ah - already did that, and updated the code snippet about a week ago. Nevertheless, it would be interesting to see if you managed to squeeze any more frames per second out of it than I did.

The jetski engine uses the very same wave matrix, by the way. (Although you probably didn't notice due to a lack of indentations, right? )


Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 15th Dec 2004 01:17
I think I got better frame rates with your standard matrix. I only recall getting around 34fps with my object. Seems like it should've been faster, I'll retest it.

"eureka" - Archimedes
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 15th Dec 2004 01:24 Edited at: 15th Dec 2004 01:35
Using your matrix object, though, it should give better flexibility for texturing and lighting, right? Maybe vertex manipulation rather than memblocks is the way to go ........


Monkey
19
Years of Service
User Offline
Joined: 16th Dec 2004
Location:
Posted: 16th Dec 2004 20:08
Hi Ric, I wann make something similar in J2ME and wanna find some simplified physics for the motion of a boat. Please can you help?
Thanks
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 22nd Dec 2004 23:38
wow thats really cool, and its all without media too!!!! I wish i could do that, but im not that good yet .
Gre4t
20
Years of Service
User Offline
Joined: 6th Nov 2004
Location:
Posted: 24th Dec 2004 11:55
I love it! My only criticism is that when you stop accelerating, and turn, it goes on forever.
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 27th Dec 2004 06:14 Edited at: 27th Dec 2004 06:16
@Gre4t - it doesn't do that on mine, but you should be able to tweak that by changing the value of friction in the code to a lower number. The problem is due to the program running at different speeds on different computers. I'm working on an update which will run the same on all computers.

@Monkey - I'll try to help, but I don't know what jtme is I'm making GT Powerboat Racer at the moment (see work in progress forum) which has made me think quite a bit about boat physics. If you want to contact me via email, we can talk. (Although give me a week - I'm away from home at the moment.)


Login to post a reply

Server time is: 2024-11-23 17:19:41
Your offset time is: 2024-11-23 17:19:41