VERLET CAR Engine Feedback

Community Forums/Showcase/VERLET CAR Engine Feedback

Stevie G(Posted 2006) [#1]



I've been working on this on and off for quite a few months now. The cages should be unbreakable .. please don't prove me wrong!!!

You can control the truck using dual analogues ( ps2 specific config) where left analogue is for steering and right for throttle. Alternatively use the usual arrow keys. The trucks will self-right themselves if crashed.

Press SPACE bar to reset the demo, ESCAPE to exit.

The demo includes a track mesh which I borrowed for testing purposes. I hope the creator ( not sure which of DMC / Miracle / BotBuilder ) doesn't mind. I don't intend to use it in any game.

There are 40 bodies in the demo ( 30 x Cones, Boxes, haybails and 10 trucks ).

I think I've accurately re-created suspension and drive models but I'd like to improve the tyre friction / slip if anyone has any suggestions?

Collisions could be better but they are sufficient for my purposes. Also, excuse the ( sometimes ) dodgy camera and placeholder graphics .. they serve their puspose only .. although I do quite like the retro look.

I've locked the FPS to 60 but interested what everyone gets if lower. Hope you like.

Cheers
Stevie

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

p.s. If anyone would like to play using analogues and the current configiration for stick 2 doesn't suit , let me know what joy commands should be used and I will implement as options.


polygoon(Posted 2006) [#2]
OK, got left stick steering and right stick throttling. But (there's always a but isn't there!) Right stick is using horiontal axis, and that's way too confusing for my abilities! ;O) Stick is logitech dual analogue USB.

When I used to run radio control I preferred steering on right and throttle on left, with forward being forward and back being reverse. I can see this is likely to be quite a lot of fun once you're able to be a bit more in charge of it! Nice work.

Also, just for the hell of it I tried a USB logitech momo racing wheel force feedback, wheel steers fine[1], throttle is jammed on full, and there is no reverse - just had to give it a try though! ;O)

[1] well it's a bit odd, but then it's got massive "throw" as it's from a wheel, so it would be inclined to be a bit strange anyway I'd imagine.

As for locked at 60fps - I was getting 63 most of the time! Maybe that's within your expected tolerance limits though. That on an old ti4200, and I've not tried it on the fx5900xt yet, but since it's been limited then there'e not all that much point.

Thanks very much for some fair fun. Seemed nice and smooth. I bet it'd play really nice if the user could configure the controls so you get a whole working set you can cope with.


Stevie G(Posted 2006) [#3]
http://www.blitzbasic.com/Community/posts.php?topic=55011

See this thread and if you ( or anyone else ) can post details of which joypad commands you would like to use for turning and which for throttle then I can implement all the variations to allow everyone to play the demo as it was meant.

Glad you liked.

Cheers
Stevie


Bouncer(Posted 2006) [#4]
This is really fun!... Only complaint is that the cars flip on their side too easily... and make them go faster! ;)


Stevie G(Posted 2006) [#5]
Cheers.

Yeah ... I need to build some form of friction dependant on wheel load ..... I'm getting there. Making them go faster is obviously easy once I have this in place.

I'm pretty sure that it was your Rc racing demo a year or so back that got me into this verlet stuff :)


Pongo(Posted 2006) [#6]
I just posted a newer version of some code for figuring out the sticks. (in the thread mentioned above) Now it just has to get an interface and the ability to write out an .ini file and we could all make some use out of it.


polygoon(Posted 2006) [#7]
Controller: Logitech Dual Action
sticker on underside says:
p/n 863227-0000
m/n G-UD8
PID: VV442 or W442 (no/poor spacing, inappropriate font choice by maker so impossible to be sure which was intended)

Joyx: left stick lateral -1 <-> +1

Joyy: left stick longitudinal -1 <-> +1 (throttle forwards reverse backwards please)

Joyz: right stick lateral -1 <-> +1 (steering please)

JoyPitch: not used

JoyRoll: right stick longitudinal -180 <-> +180

JoyYaw: not used

It'd help if others said what was on their underside sticker as it would help identify with some certainty.

The program was very flickery, so I'd be grateful if another can double check same model if at all possible - it was clearing and rewriting in such a way as it got hard to read reliably the further down the page one went. Others may fair better with this on another machine.

Hope this helps, thanks very much for trying to help out on this.

Happy to test further by all means just ask away!


polygoon(Posted 2006) [#8]
Just saw these other posts, an ini file you can alter in notepad would be good, then user could support themselves by trial and error if need be (armed with a good JS reader program that is! They are not quite as easy to write as it looks I've found, but I'm a graphics bod not a real coder at all by now! ;O). Saves bugging the author about it so much too!


Stevie G(Posted 2006) [#9]
Ok cheers ... I'll add a few new methods tomorrow.


polygoon(Posted 2006) [#10]
Cheers, you're a *<-- star! ;O)

Anything which means we have less need to bug you about it has to be a good thing I suspect. Far prefer you had time to be creative like you do!

////////////////////////////////////////////////////////
[edit]
I just tried the new code in the other thread, method 2 was as far as I got as it was by then tracking the tops of my sticks perfectly! Spot on! Nice util too!
[/edit]
///////////////////////////////////////////////////////


IPete2(Posted 2006) [#11]
Hey Stevie -- very nice -

I think I recognise this course it is from a demo done a couple of years ago - I loved that one too.

What I like about this is the speed and the number of vehicles you have going. Although the screen res needs to be higher for it to 'look good' if you know what I mean.

IPete2.


degac(Posted 2006) [#12]
nice!
On my AthlonXP3500+Geforce6600GT I run to 62-63 fps


Vorderman(Posted 2006) [#13]
Pretty cool - I really like the retro chunky colours look, I think you should keep that look and feel and avoid the typical (and very dull) photorealistic textured look.

Needs more speed or power - once you stop on the upward spiral it's really hard to get going again, and you need loads more speed for the jumps and ramps.

Once it's faster we can better judge how the cars handle.


fredborg(Posted 2006) [#14]
Very nice! It reminds me a bit of this: http://www.blitzbasic.com/Community/posts.php?topic=40575&hl=tinyracers :)

But it looks like yours is a bit less wobbly. Well done!


Stevie G(Posted 2006) [#15]
@ Fredborg
Yeah .. that's the one that inspired me!! Sorry I forgot that it was you who did it .. apologies!! Maybe I'll stick in some ariels too.

@ Vorderman
Agree about the power ... I think speed is fine. The problem is that the vehicle center of mass verlet is quite heavy and therefore hinders your ability to climb slopes at a low speed. I need to work on that but don't really want different gears etc.. if I can avoid it. Atm I'm simply applying a max-traction force to the wheels based on the throttle position. Any suggestions?

@ Polygoon ... I've implemented Pongo's 4 x joypad configs and will upload a new version shortly.


big10p(Posted 2006) [#16]
This is great, Stevie. For some reason, my truck is constantly in reverse, though, even when no keys are being pressed.


Stevie G(Posted 2006) [#17]
New version uploaded with different joypad configs .. please try this for me and let me know what isn't supported as per Pongo in the other thread ..

Hit keys ..

1 = PS2
2 = XBOX360
3 = LOGITEC 1
4 = LOGITEC 2
5 = KEYS

Cheers
Stevie


Matty(Posted 2006) [#18]
Quite a bit of fun. Tried it on my old machine (AMd K-6 500 Mhz, Geforce 2MX (32 MB Video Ram 256 MB System RAM Win98SE)


Frame rate maximum of 40 fps when I zoom off into the distance with only the ground and my car in view.
Frame rate minimum of about 19 fps when the game first starts.
Frame rate usually hovers around 30 frames per second.

Pretty good for my old machine, better than a lot of the physics demos I've tried on it.

I used the standard PS2 style controller setup (power wave dual analogue control).

Found it a little tricky to turn without toppling over when traveling at what seemed to be a rather low top speed.

The blocky look of the cars reminds me of children's toys..the track adds to that image a little as well.


EOF(Posted 2006) [#19]
I too like the look of the vehicles. Reminds me of Tonka toys (chunky and solid cars). Are you planning on keeping this look?

The physics of the game feels right to me. Can't really complain but I'll go along with what others have said regards how easy the vehicle flips and the power/speed tweaks needed.

Look forward to the next update.


polygoon(Posted 2006) [#20]
I've just found out that I have now officially become an old duffer as I can't get used to the sticks being this way around. Throttle is backwards and sticks are swapped left for right. Good fun though. Thanks for the changes.

Might be good if some of the scenery were to be see through when you are close to it, as sometimes you just can't see your vehicle to know what to do with it next. Especially if you drop between a ramp and a half pipe. Depends on which way the vehicle is pointing of course.


Stevie G(Posted 2006) [#21]
@Polygoon ... which set up do you use 1-4 and I'll add another. I may have made a mistake with the throttle setup on that configuration .. unfortunately I can't test this?

Just done some more camera views and added about .33% acceleration. Will upload the new file shortly.

Stevie


Stevie G(Posted 2006) [#22]
New upload. Added 33% more power to truck and improved the drag.

Cameras ..

F1 - Rear
F2 - Side
F3 - Zeplin
F4 - Far ( use keypad 4 / 5 to rotate view )
F5 - Overhead

Please try ... want to make sure it feels right before I proceed.

Cheers
Stevie


polygoon(Posted 2006) [#23]
I think I was using 3 (first logitech?) Functions are on opposite sticks, and throttle works back for forward and forward for back!

I noted those I would like on my findings post above.

If we had the editable ini file system I could have fixed this easily for myself! Not griping, just trying to save you some work in the long term.

Thanks for the changes!

It may be that I could reverse things if I had logitechs software running, but it's a one shot deal with that. When you first ever use the controller you either have it as normal, like I did in this case, or you have it with their software like I did on another machine. I chose one of each so I could test more thoroughly if the need arose. The need seems to be arising now! I'll try and find five minutes to check it out over on the other machine as soon as I can.

Logitech might have done well to make that choice one you could easily change your mind over, but that's their problem really, since it only affects their reputation.


Stevie G(Posted 2006) [#24]
Polygoon, creating a .ini file is not so easy but I'll get round to it eventually.

Can you please try this new version.

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

Joypad option 6 should be what your after? Just want all to play it as it should be played.

Cheers
Stevie


polygoon(Posted 2006) [#25]
6 did it fine! Way cool! ;O) Now I'm just rusty, but it's fun fixing that bit! I can't quite get to the top of the ramp yet, but I only had two short attempts as I was just testing! ;O)

I guess the wheel would be next thing, but frankly I reckon that might be a bit tricky to get right from your stand point.

I will have a go at analysing what it does output with that tester program later though - could be quite a lot of fun!

Oh and BTW, just tried reversing the dual analogues controls using the Logitech software, does not work! I shall go check in windows next as it may be game/system specific. Shall probably take a little sleuthing on that one.

Thanks for the work! ;O)


Vorderman(Posted 2006) [#26]
The extra power is much better.

I think you need some sort of speed-dependent steering reduction - it's very twitchy as you speed up - in SRX I reduce the maximum steering lock allowed as the speed increeases.

I'm also using an exponential steering system, so towards the centre of the stick movement the steering wheels move less, then as you move the stick further towards the limits (towards 1 or -1) the steering wheels turn at an increasing rate towards full lock - this also makes it less twitchy when trying to make minor corrections to your direction of travel.

Any chance of a lower-centre-of-gravity vehicle with a higher top speed, such as a race car? (I still can't jump far enough from the ramps!) Might also be fun to experiment with different sized wheels front to back (dragster style or vice-versa).


Stevie G(Posted 2006) [#27]
Thank you very much for the Tips Vorderman .. I will try and implement them as soon as. The twitchy steering kind of annoyed me too :)

I like the idea of a drag racer & rally type vehicle .. should be easy enough to implement. Will just need alot of tweeking.

Thanks again.

Stevie


EOF(Posted 2006) [#28]
The look and feel of your demo would make for a great remake of Amiga Skidmarks or Micro Machines ...



* EDIT

I tend to get lots of polygon clashing/fighting going on especially if I change to cameras 2,3, and 4. It seems as though the mirrored floor is battling with everything else.
A selection of screen grabs to clarify things:



Stevie G(Posted 2006) [#29]
Yeah, I believe Skidracer is already doing a remake of this .. although he is taking his time.

Looks like a z-order issue in the pictures above. I'll set the entityorder on the mirror plane which should get rid of this.

Stevie


polygoon(Posted 2006) [#30]
UPDATE on WHEEL findings! ;O)

Logitech momo racing force:
[edit]
Base sticker claims:
M/N E-UH9
P/N 863203-1000
PID YE5141FD1
[/edit]
Joyx steering -1 left lock +1 right lock

Joyy -1 full throttle (effectively full forward stick) + full brakes (effectively full backward stick)

Note, not absolute 0 at centered or without feet on pedals - its a small figure and from memory in the second, third and fourth decimal places or there abouts. I'd imagine it could vary from unit to unit, and even on the same unit, and also from computer to computer, so some means of establishing center or "at rest" would make lots of sense. I'd guess it could be negative or positive in various situations.

Pressing brake and throttle reveals that they seem affect each other. (and so effectively move what would be the center point if you see what I mean)

I'm not aware of any means of calibration as such: as it's a USB unit and possibly optical too then this might well be expected behaviour I'd guess.

Certainly explains why it moves on it's own and this can not be prevented as things are so far!

It's a long shot of course, and I'm only offering it for the sake of completeness. ;O)


Stevie G(Posted 2006) [#31]
Due to Vordermans stips steering is much improved at high speeds. I didn't like the gradual steering to lock though but included a reduced lock related to the speed. Thankyou!!!

I'll add in your wheel config in the next update .. probably tomorrow at some stage. I want to add another type of car ... faster / lower to the ground with smaller wheels and see how this works.

I've got a good feeling about this one :)

Cheers
Stevie


Vorderman(Posted 2006) [#32]
re. Jim Brown's z-fighting, which I also have when running the demo program - I get a similar effect in SRX if I set it to 16bit, but not in 32bit - is the demo running in 16bit?


Stevie G(Posted 2006) [#33]
Yes it's running in 16bit ... just a habbit 'cos I find it runs a bit faster and I can't really tell the difference between the two.

I know that z-order precision is lowered in 16 bit mode but it should be ok now that I've set the entityorder of the mirror plane.

Stevie


polygoon(Posted 2006) [#34]
OH BTW, in present version (test16.exe) I get no poly clashing at all - all cameras just fine.

Speed is enough to get into trouble with if you're not careful, steering seems ok, and enough to have trouble if you push things too far.

Sometimes possible to get stuck under something, but hey, that's life! ;O)

Wishlist item - remember settings you like or had last time.

Boy you can do some daft stuff in this thing - what a hoot! ;O)

Not had this sort of fun since RC electric cars were just starting to become a reality. Blimey, those really were the days! Oh, now there is a RETRO thought if ever I had one! ;O)


Vorderman(Posted 2006) [#35]
imagine a retro-looking RC cars game (with all types of RC car from dune buggies to monster trucks) in a highly detailed flat-poly coloured environment such as a dead-end street or the back garden, which you play from the proper RC viewpoint of standing still and looking at your car....it'd be really cool.

I can't stand these RC games where the camera is fixed behind the car - why make it an RC game then??? It's just like any other racing game.


EOF(Posted 2006) [#36]
100% agree with you. I can thinks of lots of features for an RC game:

* obstacles which can break away (think LEGO here)
* challenges like time-limited laps, bridges to jump over
* courses set out through a variety of locations (bedroom, garage, playground, school class room)
* pickups/collectibles (fuel, turbo charge, and the usual stuff)
* avoid road surfaces like oil patches, holes in the ground

I've always wanted to play this sort of 'fun' game. Hence the mention Skidmarks and Micro Machines.


Grisu(Posted 2006) [#37]
I have the same visual bugs as Jim mentioned above (test16, X850xt-pe).

Nice job so far.


Stevie G(Posted 2006) [#38]
@ Jim & Vorderman ... I agree completely ...

Although it may be difficult to have collapsable obsticles ... do you mean like a brick wall you can smash through? Not sure if this will be possible in the current engine .. then again I could always give it a go.

If anyone fancies building a simple race track ( preferrably flat shaded 'cos I like the look ) then please feel free .. I'd be interested in seeing how the vehicles handle cambers etc... and more bumpy ground. For info the truck is 10x10x14 units in size if anyone fancies helping with some tests?

I've got a couple of gameplay ideas which I plan on implemeting today .. will post a new build later.

Cheers
Stevie


polygoon(Posted 2006) [#39]
Say I got a track together in lightwave format, I could at present get that into DirectX (I'm quite well rehearsed in that format) Or 3ds.

How to get that translated into a format you can make use of is the problem I have right now.

I've made some test tracks in the past as experiments, but not had anywhere useful to put the output before.

"Flat shaded" to me means just no bit maps, is that what you had in mind? or are you after a particular specularity, shine, reflection, translucency, transparency & diffuse etc. by any chance?

The more I know the easier it'll be to try and help out, and get it right.


Stevie G(Posted 2006) [#40]
By flat shaded ... I mean untextured , uncoloured & unwelded with normals specific to that polygon .. not averaged etc.. or blended.

Not to worry though as I have an function which unwelds and recalculated normals .. quite handy.

It'd be good on a .b3d format but I'm sure I could load a .x or .3ds file.

Just implemented a new car ... you should see the jumps you can pull off in this baby :)




polygoon(Posted 2006) [#41]
Hehe, looks like fun, shall go tinker with some track objects.

Oh and if I make objects rather than a whole track in one shot, you would have the chance to add them if you like, or not if you don't and also we can find out how it will work much quicker. Initially at least, debugging a single object is always going to be quicker! I'll try with directx 7 binary format and mail it to you when I've got one done.

Got a slightly evil idea: what is the length of the wheel base on these cars?


polygoon(Posted 2006) [#42]
First small segment of test track is now in your mail box. Hope it shows up fine.

You can probably break this one up fine, I have another version which is pre broken, but they are a nightmare to make as it's the exact opposite of what a good 3d model should be and most model making software is not keen on doing it!


Stevie G(Posted 2006) [#43]
Cheers. As long as I can add them together without too much hastle ... not planning in implementing an editor for a while yet.

The truck is 10x12 ( wheel radius 4 ) , cop car is 10 x 10 units ( wheel radius 2 ).

Stevie


polygoon(Posted 2006) [#44]
I made it so that it's center is it's leading edge as you approach it, therefore heading and pitch would be very easy and natural (intuitive) to set/fix.

What I wanted to know was the distance between the tyre contact points on a flat surface, or distance between front and rear axle is, I guess, another way to ask it!

Wanted to make bumps that get it out of synch with itself and make it harder to predict which way it might bounce when travelling over the collection of bumps. Evil or what? ;O)


Stevie G(Posted 2006) [#45]
Front and rear axles are 12 units appart on truck as above.

Stevie


polygoon(Posted 2006) [#46]
8 between bumps should keep it pretty busy then! ;O)

We shall see! :)


Stevie G(Posted 2006) [#47]
New upload ..

Hit Tab to swap between Truck , Cop Car and Tank.

There's a few new obsticales courtecy of Ian and Troy.

3d bit issue resolved also.

The collisions for the Cop Car and Tank are a bit ropey and sometimes get stuck but just hit SPACE to reset. The cop car needs some work .. especially for the wheel slip when turning .. I'll get there though!

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

Please let me know what you think.

Cheers
Stevie

Also, hit 7 to use a steering wheel if you have one.


Baystep Productions(Posted 2006) [#48]
I find this entertaining, and you say engine, so I look forward to using it eventualy?

But as a note, I used a Logitech Dual Action Controler and found that on the right analog, left is accelerate and right is reverse. And I couldn't figure out how to change the controls.


polygoon(Posted 2006) [#49]
If it's the same base sticker number as mine, reported above, then numeric 6 works fine. (PID: VV442 or W442)

This thing is becoming addictive!! ;O)

[edit]
As you say though, that throttle is reversed on option 3
OOPS! ;O)
[/edit]


polygoon(Posted 2006) [#50]
Just tried the wheel setting and it's correct, but the nature of the game has rather more shifted to the RC side of things now, and the quicker reactions needed are not best served by a wheel sadly.

It works nicely enough, although it could use some tweaking; the amount of steering is at first quite little, and then it ramps up a bit too strong, fairly soon afterwards, you never quite know when it will lkick in! That can be a bit off putting, as you don't feel you can trust it enough. I've got the feeling that's the nature of a wheel to a great extent. Ceratinly good to have the choice though! Thanks muchly.

Thanks for trying Stevie, the rest of it has been great fun, and I'll concentrate more on experiments with track building during Sunday. That has possibilities by the bucket load! ;O)

Aren't police cars annoying!? ;O) Tanks are funny!


Vorderman(Posted 2006) [#51]
re. the graphics corruption that Jim Brown demonstrated - in another thread Beaker mentioned the problem with having the camerarange near and far values far apart - I have been having identical corruption in SRX and I just tried changing my camerarange values - the piccy below shows the change in graphics when going from a near value of 0.01 to 0.1 - it's completely solved the corruption I was having -



Grisu(Posted 2006) [#52]
Jepp, that worked! Nice job Vorderman!


Stevie G(Posted 2006) [#53]
Cheers Vorderman. I'll have a fiddle with it.


I find this entertaining, and you say engine, so I look forward to using it eventualy?



I must have rewritten this thing 10 times so it's optimised to hell and takes minutes to add a new vehicle object now. As anyone who's done this kind of thing will tell you it then takes alot of tweeking to get things working ... that's the pain in the arse part. I'm not really keen on getting into the nitty gritty of vehicle physics but I'll eventually build a vehicle / object editor ... don't hold your breath though ;)

Stevie