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.

Work in Progress / World Off Road

Author
Message
C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 2nd Jul 2011 15:14 Edited at: 2nd Jul 2011 15:16
Quote: "Everytime you add a force/torque to anything you should multiply it by the elapsed time, otherwise, when people lose fps they will also lose power/force and the physics/handling will be less consistant. Thats what they do in alot of th PhysX examples, but I must say that I have not tried it myself as of yet."

Yeah I thought it'd be something like that, I was just wondering about the update simulation and update render parts too... :S - Can't decide whether they'd need timer based stuff too or what. D:

Quote: "How are you getting on with the physics, did you get the wheel shape/heightfields working?"

I've been away the last few days doing various things so I haven't tried but last thing I remember thinking something along the lines of "This is really complicated for the fact we've already got a system working but it would be nice to get it in place for realistic turning and performance - it will also hopefully sort out the stupid suspension problem once and for all (you can't drive in a straight line for very long at the moment without hitting a bump and flipping over)" - As it is, I haven't even looked at or attempted to convert that last DarkGDK snippet yet so I don't have a verdict on the heightfields yet but in terms of wheels they just don't seem to like me. - I'll have a better report when I get back to work in a bit though, so check back soon.

@ Dark basic dude79
Yeah I'll let Blobby 101 deal with the postage and packing and pricing etc. for that sort of thing, he's in a better position (in the UK) to do that sort of thing and already has all the equipment. We'll work out the individual printing/burning costs and postage/packing etc. later and give everyone a proper idea of the price. - But let's not forget: this game isn't finished yet, so don't get too excited. xD - We've still got a fair few things left to do:
* The rest of the maps
* The remaining engine updates (both on my part and DarkDynamiX updates)
* Finishing off multiplayer
* Adding AI
* Polishing (menu stuff and lighting/texturing/shading)
(Not necessarily in any order ^ )

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 2nd Jul 2011 15:37
Quote: "I was just wondering about the update simulation and update render parts too... :S - Can't decide whether they'd need timer based stuff too or what. D:"


There is an overload of the 'simulate' function which allows you to put in your own time step.



Just use the top one if you want to keep it simple

The wheels shapes should fix on to the hull like any other shape(sphere/capsule), so its simple in theory. The problems come from the fact that the default orientation for the wheel shape is pointing down the z axis, although this can be fixed if your wheel model is the other way using 'fix object pivot'.

Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 2nd Jul 2011 23:01 Edited at: 14th Jul 2011 06:50
@C0wbox Sweet, i figured as much. Good luck with all of that!



C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 14th Jul 2011 02:23 Edited at: 14th Jul 2011 02:24
@ Matty H
Ok, I finally got round to converting that DGDK code to DBP and it seems to work
but I have a few questions now:
1. How would you suggest going about this heightfield creation on the .x objects WOR uses? - I can't export heightmaps from T.ED so it was never an option to begin with: WOR will always use .x terrains.

2. Where are these commands from?
I searched the World and Basic3D sections of the DBP help and couldn't see any reference to commands like make object terrain

3. What was dbsetupterrain supposed to do? (There's no DBP equivelant xD)



More general questions regarding WOR and DarkDynamiX:
1. I still don't really have a solution for those car wheels... :S I could do with some kind of command that allows you to properly tweak the density of a scaled object because I can't not scale those used in WOR and if I do, the wheels screw up. (I could also do with not having to rotate all the wheels 90 degrees but I spose that would be asking too much.)

2. When can I get these .dlls away from the .exe xD

@ Everyone
! Kinda got a bit snowed under there and haven't posted in a while.

I'm part way through setting up Dunes2. A large part of the work that needs to go ahead before v0.20 can come out is making new maps. So far I have a fully functional Dunes1 and a modeled Dunes2 (not setup within the engine yet)

Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 14th Jul 2011 05:44
Have you managed to implement my timer based movement code??



C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 14th Jul 2011 15:17
No, I'm not really trying to and don't trust it.

The reason being that a long time ago I tried to use TBM in all my projects. - All my projects which had a console.

If you press the console key mid movement, that stops the timer so it multiplies everything when you come out of the console and you go flying out the map.

If I can find a way to make a console without halting the program (i.e. without input) then I may, but it'll be a lot of effort given that the engine is quite complicated now.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 14th Jul 2011 15:25
Quote: "If you press the console key mid movement, that stops the timer so it multiplies everything when you come out of the console and you go flying out the map."

I have a possible solution to that, without seeing your code of course.

Whenever I've used TBM I store the previous time (from timer() or hitimer() which is more accurate) and when I pause the game I store how long passes between the moment I paused and the moment I started again and just added that to my 'previous time' variable. That worked pretty well.

Hope that helps!

C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 14th Jul 2011 16:03
Actually I'll probably need to find an alternative to input entirely so that when it comes to MP people who go into the console don't just disappear. xD

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 14th Jul 2011 17:16
Quote: "1. How would you suggest going about this heightfield creation on the .x objects WOR uses? - I can't export heightmaps from T.ED so it was never an option to begin with: WOR will always use .x terrains.
"


There are two ways I can think of but none are simple, usually terrain systems can return the height of any point with no work.

The first possible solution is to get the height for each vertex and use that data to build your height field.
The second would be to do a raycast straight down to return the height at any point. I am currently (slowly)working on adding user collision detection methods.

Quote: "2. Where are these commands from?
I searched the World and Basic3D sections of the DBP help and couldn't see any reference to commands like make object terrain

3. What was dbsetupterrain supposed to do? (There's no DBP equivelant xD)"


I presume the terrains may just be handled a little different in DBPro? There should be a terrain example somewhere, there is for GDK.
Quote: "

1. I still don't really have a solution for those car wheels... :S I could do with some kind of command that allows you to properly tweak the density of a scaled object because I can't not scale those used in WOR and if I do, the wheels screw up. (I could also do with not having to rotate all the wheels 90 degrees but I spose that would be asking too much.)"


I will take another look at the wheel shape when I get a chance, it might help if you could send me a model to test on.
I will fix the dll issue for the next release.

C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 14th Jul 2011 17:45 Edited at: 14th Jul 2011 18:38
@ Matty H
Hmm, I like the sound of that raycasting solution, I'll try that. - My experience with bitmaps should be sufficient for me to make a sort of terrain heightfield cooking application similar to the one I'd be making to cook the physical meshes of all the ingame props as well.

Quote: "I presume the terrains may just be handled a little different in DBPro?"

Well that was the weird part about it; there are terrain commands in the help but none of these particular commands featured. xD

It was almost as if you'd invented commands and DBP went "Yeah I know what these are supposed to do" - they're recognized and work fine, but are not the same terrain commands I've come across in other examples.

Quote: "it might help if you could send me a model to test on"

I like the sound of this approach so I've attached Blade in a .rar here:

Included in there is also:
Dynamic body.p (which is the cooked physical mesh)
Dynamic body.x (the model I used to cook that with)
and Blade.x (the complete look of Blade with the wheels attached (simply for reference))

You may also want this code which illustrates how I'm setting the cars up in WOR and shows how to scale them (it's no good if we find a solution for one scale then I try it in WOR with a different scale and it doesn't work again xD):


I sure hope you can get something working because the suspension is really starting to become a must-have in the current WOR maps now.

@ Everyone
More pics:


@ Matty H
Oh crap, I just realised, I can't actually use heightfields in WOR because I'm not using strict terrain collision: there will be overhangs. I may as well just keep it as it is and focus all my attention on getting the wheels working. (Suspension is really all WOR's cars need in my opinion now. )

I can't believe I didn't realise until I'd uploaded that last picture. xD

Attachments

Login to view attachments
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 15th Jul 2011 00:27
I just spent a couple of hours doing a vehicle example using your model along with a map I made a while ago(exe attached).

I done it in GDK, that way I could fix straight from the source code if there where any problems, but it worked great Although I have not got around to scaling the model down, but this should not be an issue, I will try it tomorrow.

Here is the code:





I cooked the car hull as a convex mesh and the level as a triangle mesh.
There is still alot more advanced things you can do with the handling, but this should get you started.

Attachments

Login to view attachments
C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 15th Jul 2011 02:49 Edited at: 15th Jul 2011 03:31
@ Matty H
That's great. !

However, can you also try and get it working for the Dynamicbody.x file I added to that .rar.

I don't actually use the models the cars use as their body model because some of them overlap the wheels (wheel arches and axels etc.) so I'm using a basic box shaped body for the cars and just sticking the wheels on that to make collisions a bit cleaner.

If you can get the cars to work at the correct scale with Dynamicbody.x as the central limb, I will love you forever and declare the WOR engine finished. - This means I can literally just do the maps, add MP, add AI and finish up. (Which was my goal for this summer about half a year ago xD)

EDIT:
Just finished converting it to DBP so I can play around with it:
and I've got a request to make of the plugin.

The command phy set max angular velocity is not affecting the wheels the same way as it used to with the old physical meshes I used as wheels.

I'm going to need this functionality (or an alternative) in order to implement this sort of system into WOR as I need to be able to set a cap on how fast the cars go.

At the moment, in this example, you can get up to ridiculous speeds where the slightest turn sends the car flying: something I don't want happening in WOR if I can avoid it.

As well as this, I've noticed the wheels aren't actually colliding with the walls I'm driving into (but seem to be supporting the car off the floor so they should be colliding with the map xD)

On that note, the wheels seem to be very small physically (they're only just holding the car off the floor) so maybe that's the issue, and in that case: why are the wheels not being set up to the same size as the models? :S

(Evidence to support this claim rests in the fact that when you drive over the yellow rumbley pad things, you can actually ground the car on the second strip and if you drive into the side of either the body's mesh collides with them and sends the car flying. :S )

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 15th Jul 2011 11:44
I will take a look for you, although I can suggest some improvements that will address some of your issues:

The shapes you use for the hull are very important, it can take some trial and error to get it just right. Wheel shapes only collide straight down, so the hull must prevent sideways collision with the wheel shapes. This will make the vehicle more stable and stop the wheels going through walls etc.

You should adjust the maximum steer angle in relation to how fast the vehicle is moving, when moving fast the max steer angle should be as low as 1-2 degrees.

I will look at the maximium angular velocity although the torque you apply to the wheels along with the linear damping for that vehicle will give you a maximum velocity. That said, I'm pretty sure there is a way to limit the velocity of the axle because I think thats how you implement gears. Low gears have high torque but low max angular velocity while high gears have low torque but high max angular velocity.

C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 15th Jul 2011 16:42 Edited at: 15th Jul 2011 17:22
Quote: "The shapes you use for the hull are very important, it can take some trial and error to get it just right. Wheel shapes only collide straight down, so the hull must prevent sideways collision with the wheel shapes. This will make the vehicle more stable and stop the wheels going through walls etc."

Ok, that's a little limiting and completely not what I expected these wheels to do... but I suppose if I just use the complete model (in this case Blade.x) as the body's physical mesh, it'll include the wheel areas too. :S

This isn't going to solve any collision errors though, it just means the body is going to collide with everything even more and jump about every time it or the wheels hits the tiniest of bumps.

Is there no way you can make the wheels behave like the old ones I was using where they too have a physical mesh but give them suspension and steering at the same time?

Also, why when I try to load Dynamicbody.p instead of BladeBody.cmesh does the vehicle suddenly start spazzing out?

EDIT:
I tried making Blade.x the convex mesh for the body but the code I'da thought would do it ... doesn't

The car just sits there and I can turn the wheels but not move anywhere. (It seems to be suffering from that heavy car thing I was getting when I tried scaling where even if you set the density down, it still won't move but just floats gently to the ground (giving the impression it's really light).)

EDIT2:
I just tried loading a map from WOR into the example to see how the car behaves on it and it's ok on the flat but as soon as the car touches some bumps it starts bouncing around all over the place.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 15th Jul 2011 22:42
Spent some time on this tonight, I have added more collision shapes and played with the suspension(alot). I also adjusted gravity slightly and moved the centre of mass. I have scaled the wheels down slightly too to stop them looking like they are going through the floor.

I think its an improvement but could still be made better with more time, what is really needed is a way to alter the values in real time to get the handling/stability you want.

I remember having to smooth my terrain a little when I done a test for a racing game, but that was without playing with suspension, I think the suspension is maybe the key to this problem.




Hope this helps.

Attachments

Login to view attachments
C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 16th Jul 2011 00:35 Edited at: 16th Jul 2011 00:39
Ok right, now I've converted it and seen what's what, that's a little more useful than what we had before. - The car doesn't instantly spaz out when it touches something now and the wheels can't clip anything noticabley (although I will tweak this in WOR slightly)

A few things though:
1. How can I stop it flipping the car so easily when you turn at high speeds? - I'm hoping just putting a cap on the speed will solve the majority of this issue but it seems like the wheels have far too much friction at the moment (friction which isn't being altered considerably by changing the command phy make material) :S
In an offroad racing game, I could do with some sort of drifting feel as the player goes round corners. (Something I'd achieved with the old wheel system, so a sudden change will just make it feel sticky xD)

2. When looking in debug view, the mesh you're using for the car isn't Blade or the Dynamicbody.x mesh is it? - Where has it come from?/What will happen if I make my own mesh? - What should I take into consideration when doing so?

3. Still no guarantee this will work at 10% scale as of yet. - I look forward to your work on scaling this example.

The code, so I don't lose it


Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 16th Jul 2011 01:03
Quote: "A few things though:
1. How can I stop it flipping the car so easily when you turn at high speeds? - I'm hoping just putting a cap on the speed will solve the majority of this issue but it seems like the wheels have far too much friction at the moment (friction which isn't being altered considerably by changing the command phy make material) :S
In an offroad racing game, I could do with some sort of drifting feel as the player goes round corners. (Something I'd achieved with the old wheel system, so a sudden change will just make it feel sticky xD)"


1. Add downforce or increase gravity.
2. Lower centre of mass.

Even with that you will still need to limit the max steer angle in relation to the speed of the vehicle. This code may make it more confusing or it might help


I have used that for steering with a joypad and it worked pretty well. 22 is the max steer angle when the car is still, the max steer angle decreases as the speed increases.

The materials do not affect the wheel shapes, but that is for a very good reason. The wheel shapes have their own commands to give you really good control if wheel slip and all kinds of things. But get ready for trial and error, I managed to get a great system which would slide the car when I used the handbrake, I will tey to help you when possible.


I created that convex mesh from the body model without wheels, I then added two rectangle shapes for wheel collsion. You could just use three rectangles, would probably work ok.

I will try scaling tommorrow

revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 16th Jul 2011 05:41
Quote: "If I can find a way to make a console without halting the program (i.e. without input)"


Hi Cowbox, you may want to look at this console that I made a while back.
C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 16th Jul 2011 19:35 Edited at: 16th Jul 2011 19:37
@ Matty H
Quote: "1. Add downforce or increase gravity.
2. Lower centre of mass."

I'd rather just change the friction xD - I don't want the car to feel all sticky like it does at the moment, especially as most of the terrains in WOR are things you'd generally slide around on: Sand/Snow/Wet grass/Ash

Quote: "The wheel shapes have their own commands to give you really good control if wheel slip"

I don't see a command that looks like it would do that. :S - Unless it's not in the help yet. xD

Quote: "You could just use three rectangles"

Yeah I'm planning on keeping it using the Dynamicbody.x I've been using all this time, but adding those 2 axle rectangles and scaling them according to wheel separation.

@ revenant chaos
xD That's a little more complicated than I needed.

I only need an alternative to input - I would probably be going to investigate entry$.

The WOR console is just a few lines of code that allow you to enter some words to change some variables essentially. - Snot a full blown Valve/id console. xD

revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 17th Jul 2011 08:52
Thats ok, I just figured I would offer.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 17th Jul 2011 12:19
The commands that control friction(sliding etc) are these:


The 'lat tire force func' is the sideways friction for sliding stc, I have not even touched the 'long ture force func', this would be for wheel spin etc.

We are at the limit of my knowledge now, I don't really know what to set the asymptote or the extremum to? There is some information here:

http://unity3d.com/support/documentation/ScriptReference/WheelFrictionCurve.html

Although I have found that you can just change the stiffness factor on the fly to get different effects. It starts at a value of 1000000 which is lots of grip, a value of 0 is no grip, I find for our example, varying it from around 10 to 5000 depending on velocity, steer angle etc can give some good results.

That said there are lots of ways to approach the problem, but at least you have full control over the grip of every wheel at any given time.

I have been playing around with different settings and methods of applying more/less grip, not really settled on a winner, I will keep playing with it and if I think I have found the best solution I will post the code.

I have had some fun playing around with it though, getting the car to spin out on corners etc

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 7th Aug 2011 19:32
Hi Cowbox,

Would it be ok if I upload the example I made for your model to the Dark DynamiX WIP? It would mean people having access to your model from that thread, thanks.

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 8th Aug 2011 03:23
Hey all,

It's a real shame I have such terrible internet, because I want to play the new version and it's too big!

I watched the trailer, though. One thing I couldn't fathom out was- well, what the heck are the little smileys coming out the wheels of one of the cars?! Just curious....

Looks great so far (except for the smileys)!

Clonkex (long-time fan of WOR)

Never lie -- The government doesn't like the competition.

Intel Core 2 Duo 2.8Ghz, Nvidia GeForce 9400 GT 512mb, 1gb ram.
C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 9th Aug 2011 01:14
@ Matty H
Yeah that's fine just so long as you credit the model to Soharix/WOR.

@ Clonkex
xD The smileys are only on the Happy races. - I added them just to lighten the mood a bit, and also added Death races to contrast them. - Both will look better come the next version. (Whenever that will be... :S)

Southside Games
14
Years of Service
User Offline
Joined: 1st Jan 2010
Location: Don\'t tell me what to do!
Posted: 9th Nov 2011 22:01
hey, what physics engine do you use? and hows it compare to dark physics?
Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 21st Dec 2011 09:26
I dont suppose WOR has died, has it?

Clonkex
Forum Vice President
13
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 21st Dec 2011 09:41 Edited at: 21st Dec 2011 09:51
That would be sad...

Maybe C0wbox went under a bus

Clonkex

Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 21st Dec 2011 11:26
Or maybe he was developing the game and doing just fine but then took an arrow to the knee...


Im not certain as to what that 'I was doing so and so but then I took an arrow to the knee' thing going around the Interweb but it's cool!

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 21st Dec 2011 22:09
He posted in my thread last month?
I belive he have his hands full with school ?

But he whas using java then for an raycaster?
Blobby 101
17
Years of Service
User Offline
Joined: 17th Jun 2006
Location: England, UK
Posted: 21st Dec 2011 22:19
He's pretty much moved away from DBP to java now unfortunately. We may still finish off WOR at some point in the future but there were several problems (physics engine and such I think) that make it unlikely.

Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 22nd Dec 2011 00:50
Ahh i see... I was excited for the finished version! But that's alright!

C0wbox
17
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 22nd Dec 2011 15:54
Yeah you're all basically right, I took an arrow to the knee, under a bus, while moving to Java and stopped WOR at the same time.

If WOR ever comes out, it'll be in OpenGL most likely as I don't see myself returning to DBP per se.

I may go use DarkGDK at some point, so conversion may be reletively quick from the old source code, but that still leaves the problem of the physics engine. - All engines out there are either ridiculous to use or missing 1 core feature like "mass alteration" or "friction" or "joints"...

So yeah, in the meantime, I'm basically making Java games and doing my uni work.

Dark Java Dude 64
Community Leader
13
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 23rd Dec 2011 06:43
Quote: "Yeah you're all basically right, I took an arrow to the knee, under a bus, while moving to Java and stopped WOR at the same time."
I knew it!!

WOR in OpenGL sounds nicer, and if you do it in Java then WOR will be cross platform, which would be awesome!

Quote: "So yeah, in the meantime, I'm basically making Java games and doing my uni work."
Awesome, and good luck with all that!

Your signature has been erased by a mod because of nyan cat avatar.

Login to post a reply

Server time is: 2024-03-28 23:42:56
Your offset time is: 2024-03-28 23:42:56