04-02-2009, 05:25 PM,
|
|
slowDan
Junior Member
|
Posts: 21
Threads: 1
Joined: Mar 2009
|
|
Different surfaces?
I've been playing around trying to get the squeal sound to stop when the car moves off the track and onto grass. I haven't quite succeeded yet, but I have managed to figure out a way to make the squeal stop when the car turns upside down. Which is a start!
I've noticed though, that there seems to be no way to figure out what sort of surface the wheel is on, apart from checking if its on a Bezier patch rather than a model. (The only other thing I can think of is finding the bump and resistance parameters from the track model?) This obviously makes it tricky to play a different sound for grass and gravel for example. Are there any plans to add another way of flagging these kind of changes, or have I missed something?
|
|
04-02-2009, 07:51 PM,
|
|
joevenzon
Administrator
|
Posts: 2,679
Threads: 52
Joined: Jun 2005
|
|
Re: Different surfaces?
slowDan Wrote:I've noticed though, that there seems to be no way to figure out what sort of surface the wheel is on, apart from checking if its on a Bezier patch rather than a model. (The only other thing I can think of is finding the bump and resistance parameters from the track model?) This obviously makes it tricky to play a different sound for grass and gravel for example. Are there any plans to add another way of flagging these kind of changes, or have I missed something?
I've got issue 1 and issue 24 open which rely on a way to determine the driving surface. What I was thinking is, if it's a bezier patch, assume it's asphalt, otherwise if it's a collision with models, check the TRACK_OBJECT object to get the material type. Currently the TRACK_OBJECT doesn't have a material type, but this can be added by adding a flag for each track object in its list.txt file that defines the surface type (the listedit tool makes this easy enough). So, you are pretty much on the right track.
|
|
04-05-2009, 12:11 PM,
|
|
slowDan
Junior Member
|
Posts: 21
Threads: 1
Joined: Mar 2009
|
|
Re: Different surfaces?
I've got my little bit of code sorted for stopping the squeal sounds when the wheels leave the ground. I've diffed and saved the resulting files here. Let me know if I've done anything wrong, I'm not entirely sure what I'm up to! :lol:
Its a fairly simple integer array added to the car (one for each wheel). If the wheel collision check fails it sets the flag. When the sounds update if the flag is on the gain is set to 0.0. I made the flag an int so that if and when material types get added the int can represent the material the wheel is currently on.
|
|
04-07-2009, 02:38 PM,
|
|
slowDan
Junior Member
|
Posts: 21
Threads: 1
Joined: Mar 2009
|
|
Glad to help out. I'll give it a proper test as soon as I can.
joevenzon Wrote:If you're interested in extending this to different driving surfaces: I'll give it a go. Might take a little while but I'll get around to it soon!
|
|
04-07-2009, 09:39 PM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
joevenzon Wrote:I updated the "rouen" track with a new parameter for surface type and marked up the grass objects with the grass surface type, so it's ready as a test track. No rush; there's not really a schedule or anything. hmm, at this rate we won't be able to keep track of all those parameters. i think this is the right time to do a bit of restructuring. now that we are we introducing support for surfaces, can we move the friction coefficients, drag, bump wavelength and amplitude (did i miss anything?) to a per surface value in a separate file (something along the lines of coefficients.txt (response, physics?) which will look something like:
Code: [surface] [index]
{
coeff_1
coeff_2
.
.
.
coeff_n
}
[next_surface]
{
}
etc.
that will probably simplify things quite a bit. or at least i think so.
--alex--
|
|
04-08-2009, 10:28 AM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
joevenzon Wrote:Would this file be per track or for the whole game? I can see pros and cons either way, but I'm kind of leaning toward the one file for the whole game approach. i would go with a per track file. it would be easy enough to copy the file between tracks and this way you would have a lot more flexibility. some tracks are bumpier, more slippery, etc. than others.
--alex--
|
|
04-09-2009, 11:43 AM,
|
|
FFuser
Member
|
Posts: 147
Threads: 10
Joined: Jul 2005
|
|
What about a global game file that is loaded first and then (if it exists) the track file. If entries with the same name exists in the latter just override them.
Then you don't have to copy the file 50 times and apply change 50 times but you have the full flexibility.
Of course this is a little harder to implement...
|
|
04-09-2009, 12:14 PM,
|
|
slowDan
Junior Member
|
Posts: 21
Threads: 1
Joined: Mar 2009
|
|
That sounds like the way to go to me. Someone is always going to come up with a new surface to drive on but it would be handy to have the basics covered.
|
|
04-09-2009, 12:49 PM,
|
|
alex25
Senior Member
|
Posts: 531
Threads: 42
Joined: Jun 2006
|
|
FFuser Wrote:What about a global game file that is loaded first and then (if it exists) the track file. If entries with the same name exists in the latter just override them. for any one track there could exist more than one grass or asphalt surface. how would you handle that in a general way? my favourite is neurburgring where i ended up defining quite a few surfaces for the track itself (different bumpiness, friction coefficients, etc.) not to mention the side roads, pit lanes, escape lanes and so on. every track that i worked on has multiple materials for any type of surface. personally i think that by putting everything into one file we would lose a lot of flexibility when it comes to making tracks. tracks are just as different from each other as are cars. an engine file for an F1 car won't be really useful to a fiat 500. a "road" surface for a F1 circuit is completely different from a "road" surface for dirt racing for example (even though we don't have any dirt tracks yet) or even a regular road.
--alex--
|
|
04-09-2009, 06:35 PM,
|
|
FFuser
Member
|
Posts: 147
Threads: 10
Joined: Jul 2005
|
|
alex25 Wrote:FFuser Wrote:What about a global game file that is loaded first and then (if it exists) the track file. If entries with the same name exists in the latter just override them. for any one track there could exist more than one grass or asphalt surface. how would you handle that in a general way?....
--alex--
I don't know what current system is, but it seems that my system is the best of the 2 worlds (one global file, or one file per track). Of course I don't know anything about the format.
|
|
04-10-2009, 08:47 AM,
|
|
FFuser
Member
|
Posts: 147
Threads: 10
Joined: Jul 2005
|
|
joevenzon Wrote:How about this:
* the objects/list.txt file calls out a surface type id for each object (like "road" or "grass-01" or whatever)
* there is a global file that defines parameters for some basic surfaces as some basic IDs (like "grass")
* each track can optionally define its own list of parameters, and any surface IDs that overlap with the global file get overwritten
Thats more or less what I had in mind...
So seems ok for me
|
|
|