VERLET Car Engine v2

Community Forums/Showcase/VERLET Car Engine v2

Stevie G(Posted 2006) [#1]

PlayGround

RaceTrack

250 vehicles!!

Just a quick update of my Verlet Physics engine. Quite a lot has changed but it’s now in a better structure so that I can actually make something out of it!!

CONTROLS
=========

SPACE = reset simulation
BACKSPACE = Swap between playground & racetrack
CURSORS = Throttle / Steering
F1 = Change Car
F2 = Change Camera
F2 = Reverse Camera View
ENTER = Special Action

JOYPAD ( Analogue only / Current setup is for PS2 but can be altered via JOYPAD.exe)

Left Stick = Steer
Right Stick = Throttle
Button1 = SELECT = Change Car
Button2 = TRIANGLE = Change Camera
Button3 = R2 = Reverse Camera View
Button4 = R1 = Special Action ( Tank fires / cop car siren / knightrider turbo )

CONFIGURATION ( see CONFIG folder )
=================================

JOYPAD.exe
Change sticks / buttons / deadspots etc..

SETUP.cfg
Can change screen settings / shadows onoff / number of vehicles / no of objects / CameraRange multiplier / Players ( 1 or 2 ).

CHANGES
========

Train removed ( temporarily ) until I get it working better. Sorry :(
Knightrider car
Transit Van
Slight update on overall vehicle graphics
Barrier Object

New Camera … very similar to GFA’s. Works better IMHO
Simple Shadow system ( can be turned off in Setup.cfg )
Tiling system demo .. still in the works ( graphics unfinished too ) but you get the general idea of how I see it working.

KNOWN ISSUES
=============

Shadows are naff but serve their purpose
Sometimes cars can’t selfright … fix in the works ( just press space )

Hope you like. Feedback welcome and please quote FPS if you can be arsed.

Cheers
Stevie

http://www.steviegoodwin.plus.com/Engine_Test2.zip

Oh, and for a bit of fun, test your machine to it’s limit by increasing the vehicles in the setup.cfg file … I can get 100 + 12 objects running at 30fps :)))


big10p(Posted 2006) [#2]
Groovy! I'll give this a whirl tomorrow, Stevie. I'm so jealous of the great stuff you do. I really need to get my hands dirty with verlets, soon. :)

P.S. Are you creating your models in-code, out of primitives?


Stevie G(Posted 2006) [#3]
I'm re-uploading it big10p as I has max vehicles too high. Give me 5 mins.

Yeah, creating vehicles in code using primitives then save them in my own format ... no good at modeling but I've got some good mesh functions to cull unwanted polys , colour and piece them together. It's painstaking but I'm getting quicker all the time.

[EDIT] If you need any help with verlets etc.. give me a shout. I've thought of nothing else for around a year now!!

Stevie


big10p(Posted 2006) [#4]
S'OK, Stevie. I won't be downloading 'til tomorrow, anyways. ;)

P.S. Are you a coder by trade? Just wondering 'coz you pump out some great stuff. I loved Z-Virus (that was yours, right?). :)


Stevie G(Posted 2006) [#5]
Yeah, that was mine ... thanks :)

I'm not a coder by trade ( I wish ) .. I'm actually a business analyst for a bank :(

Always wanted to make some spare cash with coding .. even get something published for once. May seem a bit strange but it's kind coments like this that spur me on!

Upload Done.

Stevie


Zenith(Posted 2006) [#6]
Those are great models, especially for "hard coding" them, congrats so far Stevie. :)


big10p(Posted 2006) [#7]
Yeah, this is really nice, Stevie. I still have the problem of my vehicle being permanantly in reverse, though. I guess this is a problem my end - maybe my joypad is interfering - because I don't think anyone else has reported this problem.

So, this is your own verlet physics engine? It seems nice and fast. Any plans on releasing this as a separate lib?


JBR(Posted 2006) [#8]
Great stuff Stevie, I get 30 to 35fps at 100+12

P4-3Gz
9800 Pro

Marg


Stevie G(Posted 2006) [#9]
Big10p .... it must be a joypad thing ....check out your configuration. Give me a shout if it's not. 'Mon the Scots!!!!! Happy Days!!!


Mikele(Posted 2006) [#10]
"Yeah, creating vehicles in code using primitives then save them in my own format "

You are real 3DArtist... I like hovercrafts!
Great stuff!

62-65 fps (P4/2.4 GF4200Ti)


Stevie G(Posted 2006) [#11]

You are real 3DArtist...


You must be joking ... :o)

@ big 10p. Yeah, all my own ... will release this as a lib eventually [ I've had a good few e-mails about it :) ] but not until I've done something with it myself.

Cheers for comments guys, much appreciated!!

S.


John J.(Posted 2006) [#12]
This is really really nice! The physics are amazingly fun (and easy to drive). Excellent work!


wizzlefish(Posted 2006) [#13]
Great engine!


Kalisme(Posted 2006) [#14]
WOW... amazing work...
I really hafta get back into physics engine programming...
this is really well put together and very fast
I imagine this engine could easily be used for a fun and playable game


Mikele(Posted 2006) [#15]
You must be joking ... :o)

No! I really like your models. Not everyone can do it like you - simple, colorfull and funny (Lego-style).


Avrigus(Posted 2006) [#16]
Yes I have to agree with Mikele, the visual style of the vehicles is very nice :-)

I would also be very interested in this library, do you plan to make it free or commercial? How easy is it to implement the verlet physics onto vehicles using your system?


Stevie G(Posted 2006) [#17]

No! I really like your models. Not everyone can do it like you - simple, colorfull and funny (Lego-style).



Thanks mate ... off to make some more.


Stevie G(Posted 2006) [#18]
I will release this at some stage for a small fee ( it's been alot of hard work!!) but won't be for a while I'm afraid.

It's all very easy to be honest. I can model and set up a new vehicle in a couple of hours. Maybe it's not so portable atm as I do hard code vehicle stats into the functions. This is just temporary until I build an editor and decide on a file format for them.

Without going into too much detail, each object in the game is a rigid body type and the vehicle type extends this.

Atm, to create a vehicle you first set a constant which references this rigid body type and call a function like so ...

const B_Monster = 1
VEHICLEcreate( B_Monster )

Within this function there is a call to BODYcreate( B_Monster ) which specifies the visual body( mesh) / pointmass / constraint / collision set up for this rigid body type. Each rigid body has 9 pointmasses and 36 constraints in a cube formation for stability. I've no need for anything more fancy than that.

You then setup the vehicle's stats such as engine power / drive type / tyre type etc....

In the main loop the physics update is like so ...

POINTMASSupdate
CONSTRAINTupdate
BODYupdate
VEHICLEupdate

That's about it really.

Stevie


Red Ocktober(Posted 2006) [#19]
don't ever apologize for charging for your work...

--Mike


big10p(Posted 2006) [#20]
Stevie, I can confirm my reversing problem is caused by my joypad. Works fine when I unplug it.

@ big 10p. Yeah, all my own ... will release this as a lib eventually [ I've had a good few e-mails about it :) ] but not until I've done something with it myself.
Fair enough! ;)


Bouncer(Posted 2006) [#21]
This just keeps getting better... keep up the great work!


Craig H. Nisbet(Posted 2006) [#22]
I want this. This is cool!!


fredborg(Posted 2006) [#23]
Groovy :)

It slows to around 32/35 fps with 100 cars on my box.


Dirk Krause(Posted 2006) [#24]
I love the art as much as the physics, I wonder what story could be in there. The Formula 1 pilot even bends his head into the right direction, cool!

But one thing - until you get the train back in, I hate it!!

:-))

great stuff, and one buyer here, when you sell the code.


Rob Farley(Posted 2006) [#25]
Wonderful!

This would make a rubbish race game, however, you could try and do some kind of puzzle game where you need to use the different vehicles to move stuff around to make a path for other ones, or use the off road to get to places the race car can't to push a button to make something happen... or something!

The reason I say this is that it reminds me of bob the builder or something similar.


Stevie G(Posted 2006) [#26]
Thanks again folks .. really appreciate the comments. 'm gonna stick with the graphics as everyone seems to like them :)

But one thing - until you get the train back in, I hate it!!


I liked the train too ... so it will be back in there .... it's taking a fair bit of effort to get it stable on the new track tiles. I'll get there though.


This would make a rubbish race game, however, you could try and do some kind of puzzle game where you need to use the different vehicles to move stuff around to make a path for other ones, or use the off road to get to places the race car can't to push a button to make something happen... or something!


Can't say I agree about the race game. I've play tested the 2 player mode with mates for hours and it was a hoot knocking each other off the track etc.. I don't want it to be JUST another racer though as they're 10 a penny.

I was thinking of a similar idea to what you mention but still thrashing things about in my head. Simplicity is the key.

Cheers
Stevie


Ross C(Posted 2006) [#27]
Hehehe, mighty cool man! You gotta make summit out of this!


John J.(Posted 2006) [#28]
This would make a rubbish race game, however, you could try and do some kind of puzzle game where you need to use the different vehicles to move stuff around to make a path for other ones, or use the off road to get to places the race car can't to push a button to make something happen... or something!


Why? Does it seem too arcade-ish? Too difficult? Too easy? I think this is perfect physics for a racing game.


n8r2k(Posted 2006) [#29]
hi. I love this, its so addicting, great phisics, cool graphics, lego style, you should make the tank actually do damage to things it hits.


RifRaf(Posted 2006) [#30]
I like it too.. if you sell your system, and its plug and play with easy setups.. ill buy it. I see alot of kart/car games being made with this sytem if you release it.


Stevie G(Posted 2006) [#31]
hi. I love this, its so addicting, great phisics, cool graphics, lego style, you should make the tank actually do damage to things it hits.


If you're talking about visible damage then this aint going to happen. When the engine is complete it should be easy enough to do yourself if you want/need it.

I plan on having a tanx style sub game but it'll be more a case of an increasing damage bar which effects the vehicle handling and eventually blows up.

I'll probably create a simple vehicle editor which allows you to set everything up and save the vehicle setting which can then be loaded in game as a blueprint. The blueprint can then be copied for multiple versions of that vehicle. Obviously, this is not ode or tokomak but it will be much easier to implement into your own projects.

Currently testing a new friction system where you can specify 2 x lateral friction vars for tires and these are interpolated between depending on speed ... should give less sluggish control at lower speeds. If it doesn't work the way I want then I'll go back to what I had. Looking good so far though.

Stevie


n8r2k(Posted 2006) [#32]
Sounds cool. I have noticed one thing about it though, i dont think you are empasizing on AI but i noticed that alot of cars end up getting stuck over the rivet on the racetrack and i have to knock/blast them out, also the tank tires got stuck on the overpass and i had switch from racetrack to playground to get unstuck.


monkeybot(Posted 2006) [#33]
Nice .very quick.good stuff


Stevie G(Posted 2006) [#34]

Sounds cool. I have noticed one thing about it though, i dont think you are empasizing on AI but i noticed that alot of cars end up getting stuck over the rivet on the racetrack and i have to knock/blast them out, also the tank tires got stuck on the overpass and i had switch from racetrack to playground to get unstuck.



Yeah, ai was very much an afterthought in this demo but can you explain what you mean in more detail ... or show me a picture?

BTW space resets the simulation :)


n8r2k(Posted 2006) [#35]
it would be easeir to understand if i could get video of it, but basically, i when i was with the tank on the racetrack on the overpass, i backed up wierd and got the back wheels over then quickly accelerated again, but one of the wheels got caught under the overpass.

Solution maybe to make overpass a bit thicker???? i dont know, i have little almost none exp with 3d, just like to look at it mostly,

heres some imgs:





hope it helps with your neat project


Stevie G(Posted 2006) [#36]
Got you now, I know about this .... and working on a fix as we speak.

Cheers

Stevie


mrtricks(Posted 2006) [#37]
Excellent, truly excellent! Really fun and sturdy physics, feels solid. I also really love the graphical style. I'd love to see this turned into a sort of cartoon GTA or something... It made me nostalgic for the time when 3D was new, and I used to want to live in a little enclosed world made up of fladshaded polygons...

Or a Super Sprint type racing game, or the similar one where you had weapons. Super Cars maybe?

When PPU's are as commonplace as GPU's, oh boy, programming's going to be fun!

I couldn't figure out how to play on the racetrack though.

Default settings: 62fps
100+12: 20fps


Grisu(Posted 2006) [#38]
Nice new stuff.
The Knight Rider looks cute... :)

Only two little glitches found:

1. Spawning:
You should check where the car is spawned.
I spawned right on top of the trees which was funny...

2. Zooming in on cars from the top:
I have blooby/blackish car models when the camera moves down
to the car? (ATI card)
Once it is "near" the car, everything works fine!


Stevie G(Posted 2006) [#39]
I couldn't figure out how to play on the racetrack though.


Hit Backspace


Only two little glitches found:

1. Spawning:
You should check where the car is spawned.
I spawned right on top of the trees which was funny...

2. Zooming in on cars from the top:
I have blooby/blackish car models when the camera moves down
to the car? (ATI card)
Once it is "near" the car, everything works fine!



I don't really check the spawning but this will be fixed eventually .. not high on list of priorities atm.

Not sure what your issue is re the camera, can you post a picture? I don't have this issue ... if anyone else had it let me know. Can't see it being a problem to resolve though.

Cheers
Stevie


Grisu(Posted 2006) [#40]
This is what it looks like when the cam is zoomed onto a tank eg:



All cars on screen are kind of shadowed somehow.


Murilo(Posted 2006) [#41]
I get that too.


Pongo(Posted 2006) [#42]
did you try running in 32 bit mode? check the config file.


sampyxis(Posted 2006) [#43]
Hi Steve,
This is great - my kids just spent an hour on it.

If you do release it - a car editor would be great - adding some water - and a networked version (all requests from the kids) ;-)

They love it - great job!


Grisu(Posted 2006) [#44]
32 Bit fixes ir!

Another issue:
3. car shadows flicker when driving... looks wired?


Stevie G(Posted 2006) [#45]
Strange that I don't get this visual problem even in 16 bit mode.

Another issue:
3. car shadows flicker when driving... looks wired? 


Even when you're stopped dead? Not here so not sure what the issue is?


Grisu(Posted 2006) [#46]
They simply don't look "natural". Screenshot won't help much here. As the "flickering" is only when moving the cars.

No big deal, maybe someone else got that as well.


Stevie G(Posted 2006) [#47]
Of course they don't look natural ... the size of the shadow map is limited to the maximum power of 2 within the screenheight. It's a simple render to texture system so texel scale would be the reason for this "flicker".

I think they give a limited feeling of depth and this is the best I can do until someone releases a stencil system. I'm hoping Lens system will help me out in this respect.

Stevie


Zenith(Posted 2006) [#48]
I get the problem also, forgot to mention.