Outerra forum

User mods, screenshots & videos => Vehicles => Topic started by: bugsblake on May 24, 2013, 10:20:20 pm

Title: Ford Mustang Bullet
Post by: bugsblake on May 24, 2013, 10:20:20 pm
hi all!

got my first car into outerra thanks to the help from a couple of people here!  ;D so though i would share it!

the handling needs some tweeking and the mat file and textures still need doing but its almost 3:30am here and my eyes are burning! so will update this post again when its finished.

for now here the car so you can have a play! :D hope you like it!

updated! http://www.mediafire.com/?un10htuyd49im1d (http://www.mediafire.com/?un10htuyd49im1d)

EDIT: just came back to say lol at the "needs tweeking" just drove it myself and its like its on bloody ice skates! but its late and first go at this! if anyone else wants to have a crack at the handling file PLEASE feel free! otherwise wait for the update! ;)
Title: Re: Ford Mustang Bullet
Post by: M7 on May 25, 2013, 01:37:18 am
Just played with it quickly. it has great potential, very nicely built. On the .js, i only set the driver position and on the matlb i added some glass and chrome. There's a little problem with the inside of the roof though.

Did you built it yourself?
Title: Re: Ford Mustang Bullet
Post by: bugsblake on May 25, 2013, 07:24:02 am
hi. thanks for that M7! :D looks sweet! i did notice the inside of the roof just before i passed out! no i didnt model it, was given over 100 of theses cars from a friend :) i have done some basic models in 3ds max over the years but im not able to knock up such beautiful models like this! but i can edit them quite well! my friend is away on holiday for a couple of weeks so will have to have a go at fixing the roof myself. any ideas on the best way to fix it would be sweet! :) otherwise i'll just have a go and see what i can do! all my models are in 3ds max format. im guessing outerra cant do 2 sided mats? or am i wrong? anyway will crack on with it again in a bit, just need a while to wake up! :D thanks for all your help ;)

oh yh, i noticed the car is called chassis! can i use a helper and call that mustang_bullet? will outerra like/not like that? or should i rename chassis to mustang and change it in the js file? not sure what i can and cant do with outerra yet? thanks
Title: Re: Ford Mustang Bullet
Post by: John514 on May 25, 2013, 08:10:30 am
Wow, thats a nice car! I cant believe how much difference can some crome do!
Title: Re: Ford Mustang Bullet
Post by: cameni on May 25, 2013, 12:33:53 pm
oh yh, i noticed the car is called chassis! can i use a helper and call that mustang_bullet? will outerra like/not like that? or should i rename chassis to mustang and change it in the js file? not sure what i can and cant do with outerra yet? thanks
The name is taken from the model node, but you can/should rename it in the importer.

Two-sided materials aren't supported for performance reasons.
Title: Re: Ford Mustang Bullet
Post by: bugsblake on May 25, 2013, 12:46:35 pm
ok thanks cameni!

right well i got the suspension sorted so the wheel dont drop 2 foot when it jumps! still done feel right though, will have to keep playing with damping a bit. the car sits on the ground nice now but i cant seem to stop it driving like its on ice? nothing i change makes a difference! gonna need a little help there!

anyway gonna keep going and see what happens! heres the js file as it is now but like i said, its like driving on ice!

Code: [Select]
function init_chassis()
{
    var wheelparam = {
    radius: 0.26,
    width: 0.2,
    suspension_max: 0.02,
    suspension_min: -0.16,
    suspension_stiffness: 4.0,
    damping_compression: 0.4,
    damping_relaxation: 0.14,
    slip: 0.8,
    roll_influence: 0.1
  };
   
    this.add_wheel('wheel_FR',wheelparam);
    this.add_wheel('wheel_FL',wheelparam);
    this.add_wheel('wheel_RR',wheelparam);
    this.add_wheel('wheel_RL',wheelparam);

    return {mass:1170, steering:1.0, steering_ecf:10000, centering: 0.6, centering_ecf: 10, com:{y:-0.9, x:-1.8, z:0.0}};
}
//invoked for each new instance of the vehicle
function init_vehicle(){
  this.set_fps_camera_pos({y:-1.4, x:-2, z:2.7});
}

//invoked when engine starts or stops
function engine(start){
}

const EF = 27000.0;
const BF = 28000.0;
const maxkmh = 243; 
const forceloss = EF / (0.2*maxkmh + 1);



//invoked each frame to handle the inputs and animate the model
function update_frame(dt, engine, brake, steering)
{
  var kmh = this.speed()*3.6;
  var redux = engine>=0 ? 0.2 : 0.6;
  var esign = engine<0 ? -1 : 1;
  engine = EF*Math.abs(engine);
  var force = (esign>0) == (kmh>=0)
        ? engine/(redux*Math.abs(kmh) + 1)
        : engine;
  force -= forceloss;
  force = Math.max(0.0, Math.min(force, engine));
  engine = esign*force;
  steering *=0.6;
  brake *= BF;
 
  this.steer(-2, steering);
  this.wheel_force(-1, engine);
  this.wheel_brake(-1, brake);
  this.animate_wheels();
}
Title: Re: Ford Mustang Bullet
Post by: ZeosPantera on May 25, 2013, 01:01:19 pm
Add this value under slip

    slip_lateral_coef: 1.0,

It changes the sideways grip. 1.0 means it is the same as the normal slip. I recommend higher than one so you don't understeer and slide forward. It is much better however to have the front and rear wheels separate so you can adjust the suspension and these tire values for better realism.

Title: Re: Ford Mustang Bullet
Post by: M7 on May 25, 2013, 01:04:08 pm
wow 100 models!!! of this quality? That's insane!!! Just took a closer look and the details are amazing. Do you how many polys this model have?

Quote
Two-sided materials aren't supported for performance reasons.

Not sure what this mean cause in sketchup, if i dont put a color/texture on the backside of a poly it will look transparent when looking from inside of an object. If i add color/texture to both sides, then it wont be transparent from any angle :-\ Think i will need to make a quick test to make sure.

Title: Re: Ford Mustang Bullet
Post by: M7 on May 25, 2013, 01:27:24 pm
Made a quick test. On the left i use color/texture on both side of mesh and they show on both sides. On the right i didn't color/texture the backside and it's transparent. So does the 2 side material mean something else?
Title: Re: Ford Mustang Bullet
Post by: cameni on May 25, 2013, 02:48:40 pm
I guess sketchup actually generates it as two separate sides in that case. Isn't there an option for it when exporting?
Title: Re: Ford Mustang Bullet
Post by: M7 on May 25, 2013, 03:03:24 pm
there is the option in sketchup to Export Two-Sided Faces but i normally export models with that option off. One thing i  just found though,  is that you might not be able to use normal map and maybe other mapping effect  on the backside (except diffuse) . Will have to make some more test.

edit: seems like both sides can have get all types of mapping. In the jpg i used diffuse+normal map texture. In the far box, frontside is outside the box and in the box near i flipped the sides and get exact same results
Title: Re: Ford Mustang Bullet
Post by: bugsblake on May 26, 2013, 07:56:10 am
hi guys. well as i couldnt get on outerra last night i didnt get any progress done on the mustang accept the dds textures!

the suspension still needs some work but im just stabbing at values here, dont really know what im doing! it just seems like the car takes every bump in the road as to the wheels/suspension! but at least it dont drive like its on ice now thanks to M7! :)

that 2 sided trick with sketchup is good but it dont work that way in 3ds max, but even if i have to copy part of the roof and flip it i should be able to get that done without too much trouble, just not used max much in the last year so may take me a while to get used to everything again.

also i noticed when parked next to the bmw that the mustang is about 20/30% too small so will have to scale it up a bit.

one last thing. i made the steering wheel a seprate mesh so it can turn. how is that set up? thanks

once some good progress is make i will repost it here! thanks guys ;)

oh yh. this mustang have over 300k polys! 337k i think, will check when im in max! the rest of the 100 odd cars i have are from 35k odd to 600k so not all of them be a nice as this one, did see that some will not be able to be used as missing the inside, but most are fully modeled! :)
Title: Re: Ford Mustang Bullet
Post by: bugsblake on May 26, 2013, 10:13:38 am
ok gonna crack on with fixing the roof and resizing the car in max next, but got to go watch a film with the kids right now so will do that in a few hours!

i been told that putting my car node/helper in max at 0,0,0 will save me having to mess with the COM in the js file! but im thinking should my 0,0,0 on the model it self be just behind the engine in line with the foot well in the middle of the car?

thats the best COM for a front engined car if im not mistaken right?

thanks
Title: Re: Ford Mustang Bullet
Post by: M7 on May 26, 2013, 12:07:19 pm
Sounds like you have things in control now  ;D
Title: Re: Ford Mustang Bullet
Post by: bugsblake on May 28, 2013, 09:36:14 am
ok guys the roof is fixed, size is fixed. it sticks to the road better now but still not happy with how it handles!

im gonna go back into max and add a few bits round the doors and other places you can see through the car.

when thats all done i'll have another go with handling but im not best at this. anyway will repost fixed car later and if anyone wants to make a better handling for it, be my guest!
Title: Re: Ford Mustang Bullet
Post by: bugsblake on May 29, 2013, 11:55:28 pm
ok update time!

fixed roof, fixed back, fixed size, fixed textures, added thumbnail, steering wheel works now!

as for handling, it sticks to the road now but im still not happy with it. gonna need some help there guys!

anyway here it is!

http://www.mediafire.com/?un10htuyd49im1d (http://www.mediafire.com/?un10htuyd49im1d)

will update again but now its almost 5am so im crashing out!
Title: Re: Ford Mustang Bullet
Post by: ZeosPantera on May 30, 2013, 01:28:17 am
Next time I wouldn't even bother zipping up the .otx.. just adds and extra step.
Title: Re: Ford Mustang Bullet
Post by: bugsblake on May 30, 2013, 02:09:55 am
yh its just when i was on mediafire it said limited access due to file problems or something? though it had still been downloaded many time! but next time i'll just upload the .otx file! i guess because mediafire dont know what an otx file type is, it thinks its a problem file!

anyway cant sleep and i already noticed a bug! i missed a couple of bits of the steering wheel when grouping so will fix that! also a couple of holes you can see out of from the inside!

with the headlight glass, right now its just a texture but it has chrome behind it so i need to change the headlight matt but setting it like the windows, you cant see the glass detail! anyway to do it so it looks good? im still getting used to this! anyways will keep at it and reupload when done!
Title: Re: Ford Mustang Bullet
Post by: bugsblake on May 30, 2013, 02:23:08 pm
can anyone here tell me how to set up the handbreak? i looked on outerra wiki but no luck! thanks

also i just cant work out the suspension? on a real car when the wheel hits a pot hole or bump, the car stays still and the wheel moves up and down! but i cant seem to get it to react like that? any pointers? thanks
Title: Re: Ford Mustang Bullet
Post by: bugsblake on June 07, 2013, 08:34:24 am
update.

added start up, idle and off sounds. revs sound funny but will be worked on!

http://www.mediafire.com/?h677h7yoty9mpf7 (http://www.mediafire.com/?h677h7yoty9mpf7)
Title: Re: Ford Mustang Bullet
Post by: Atrax on June 09, 2013, 03:51:54 am
can anyone here tell me how to set up the handbreak? i looked on outerra wiki but no luck! thanks

also i just cant work out the suspension? on a real car when the wheel hits a pot hole or bump, the car stays still and the wheel moves up and down! but i cant seem to get it to react like that? any pointers? thanks

Have you maybe tried checkin the Cherokees suspension setup, it behaves as you describe so you might find some pointers in there.
Love the new update! :D
Title: Re: Ford Mustang Bullet
Post by: bugsblake on June 09, 2013, 08:37:28 am
thanks mate! will check that out! :) was busy yesterday so didnt get to work on much. will have that evo done today and a aircraft released! :D
Title: Re: Ford Mustang Bullet
Post by: Atrax on June 09, 2013, 05:54:05 pm
thanks mate! will check that out! :) was busy yesterday so didnt get to work on much. will have that evo done today and a aircraft released! :D

Aircraft?  :o Nice! Wonder which one is it...  ::)
Title: Re: Ford Mustang Bullet
Post by: bugsblake on June 09, 2013, 08:50:38 pm
if you checked my post in the import section you would know! ;)

anyways while im wait for a hand to get that finished, im gonna rig this!

viper 2013!
Title: Re: Ford Mustang Bullet
Post by: ZeosPantera on June 10, 2013, 12:34:27 am
OK.. My game is working JUST ENOUGH to tweek physics on cars.

Here is what I got for the mustang after 20 minutes.

Code: [Select]
//vehicle script file
//see http://xtrac.outerra.com/index.fcgi/wiki/vehicle for example and documentation

//invoked only the first time the model is loaded, or upon reload
function init_chassis()
{
    var wheelparam = {
    radius: 0.35,
    width: 0.15,
    suspension_max: 0.10,
    suspension_min: -0.15,
    suspension_stiffness: 25.1,
    damping_compression: 0.15,
    damping_relaxation: 0.09,
    slip: 0.60,
    slip_lateral_coef: 1.5,
    roll_influence: 0.1
  };
     
    var wheelparam_Rear = {
    radius: 0.34,
    width: 0.2,
    suspension_max: 0.10,
    suspension_min: -0.12,
    suspension_stiffness: 18.4,
    damping_compression: 0.12,
    damping_relaxation: 0.08,
    slip: 0.65,
    slip_lateral_coef: 1.2,
    roll_influence: 0.1
  };
   
    this.add_wheel('wheel_FR',wheelparam);
    this.add_wheel('wheel_FL',wheelparam);
    this.add_wheel('wheel_RR',wheelparam_Rear);
    this.add_wheel('wheel_RL',wheelparam_Rear);
 
    this.load_sound("Mustang start.ogg"); //startup
    this.load_sound("Mustang idle.ogg"); //idle
    this.load_sound("Mustang shutdown.ogg");    //off
    this.add_sound_emitter("wheel_FL");
 
    return {mass:1109, steering:2.0, steering_ecf:10000, centering: 1.5, centering_ecf: 10, com:{y:-0.10, x:0.0, z:-0.1}};
}
//invoked for each new instance of the vehicle
function init_vehicle(){
  this.set_fps_camera_pos({y:-0.8, x:-0.32, z:0.8});
  this.geom = this.get_geomob(0)
  this.swheel = this.geom.get_joint("steering_wheel");

//invoked when engine starts or stops
  this.snd = this.sound();
  this.snd.set_ref_distance(0, 9.0);

  this.started = 0;
}

function engine(start)
{
  if(start) {
    this.started=1;
    this.snd.play(0, 0, false, false);
  }
  else {
    this.started=0;
    this.snd.play_sound(0, 2);
  }
}

const EF = 12000.0;
const BF = 5000.0;
const maxkmh = 343; 
const forceloss = EF / (0.2*maxkmh + 1);



//invoked each frame to handle the inputs and animate the model
function update_frame(dt, engine, brake, steering)
{
  var kmh = this.speed()*3.6;
  var redux = engine>=0 ? 0.2 : 0.6;
  var esign = engine<0 ? -1 : 1;
  engine = EF*Math.abs(engine);
  var force = (esign>0) == (kmh>=0)
        ? engine/(redux*Math.abs(kmh) + 1)
        : engine;
  force -= forceloss;
  force = Math.max(0.0, Math.min(force, engine));
  engine = esign*force;
  brake *= BF;
 
  steering *= 0.75;
    this.steer(-2, steering);

var steerAngle = steering *= 10.05;
this.geom.rotate_joint_orig(this.swheel, steerAngle, {x:0,y:-1,z:0});
 
 
  this.wheel_force(-1, engine);
  this.wheel_brake(-1, brake);
 
  if(this.started==1 && !this.snd.is_playing(0)) {
    this.started=2;
    this.snd.play(0, 1, true, false);
  }
  else if(this.started==2) {
    var pitch = Math.abs(kmh)/20.0;
    var g = kmh>0 ? Math.floor(pitch) : 0;
    var f = pitch - g;
    f += 0.5*g;
    this.snd.set_pitch(0, 0.75*f + 1.25);
  }
  this.animate_wheels();
}

Also forgot to mention. The wheels are animated backward.
Title: Re: Ford Mustang Bullet
Post by: Atrax on June 10, 2013, 04:05:48 am
OK.. My game is working JUST ENOUGH to tweek physics on cars.

Here is what I got for the mustang after 20 minutes.

Code: [Select]
//vehicle script file
//see http://xtrac.outerra.com/index.fcgi/wiki/vehicle for example and documentation

//invoked only the first time the model is loaded, or upon reload
function init_chassis()
{
    var wheelparam = {
    radius: 0.35,
    width: 0.15,
    suspension_max: 0.10,
    suspension_min: -0.15,
    suspension_stiffness: 25.1,
    damping_compression: 0.15,
    damping_relaxation: 0.09,
    slip: 0.60,
    slip_lateral_coef: 1.5,
    roll_influence: 0.1
  };
     
    var wheelparam_Rear = {
    radius: 0.34,
    width: 0.2,
    suspension_max: 0.10,
    suspension_min: -0.12,
    suspension_stiffness: 18.4,
    damping_compression: 0.12,
    damping_relaxation: 0.08,
    slip: 0.65,
    slip_lateral_coef: 1.2,
    roll_influence: 0.1
  };
   
    this.add_wheel('wheel_FR',wheelparam);
    this.add_wheel('wheel_FL',wheelparam);
    this.add_wheel('wheel_RR',wheelparam_Rear);
    this.add_wheel('wheel_RL',wheelparam_Rear);
 
    this.load_sound("Mustang start.ogg"); //startup
    this.load_sound("Mustang idle.ogg"); //idle
    this.load_sound("Mustang shutdown.ogg");    //off
    this.add_sound_emitter("wheel_FL");
 
    return {mass:1109, steering:2.0, steering_ecf:10000, centering: 1.5, centering_ecf: 10, com:{y:-0.10, x:0.0, z:-0.1}};
}
//invoked for each new instance of the vehicle
function init_vehicle(){
  this.set_fps_camera_pos({y:-0.8, x:-0.32, z:0.8});
  this.geom = this.get_geomob(0)
  this.swheel = this.geom.get_joint("steering_wheel");

//invoked when engine starts or stops
  this.snd = this.sound();
  this.snd.set_ref_distance(0, 9.0);

  this.started = 0;
}

function engine(start)
{
  if(start) {
    this.started=1;
    this.snd.play(0, 0, false, false);
  }
  else {
    this.started=0;
    this.snd.play_sound(0, 2);
  }
}

const EF = 12000.0;
const BF = 5000.0;
const maxkmh = 343; 
const forceloss = EF / (0.2*maxkmh + 1);



//invoked each frame to handle the inputs and animate the model
function update_frame(dt, engine, brake, steering)
{
  var kmh = this.speed()*3.6;
  var redux = engine>=0 ? 0.2 : 0.6;
  var esign = engine<0 ? -1 : 1;
  engine = EF*Math.abs(engine);
  var force = (esign>0) == (kmh>=0)
        ? engine/(redux*Math.abs(kmh) + 1)
        : engine;
  force -= forceloss;
  force = Math.max(0.0, Math.min(force, engine));
  engine = esign*force;
  brake *= BF;
 
  steering *= 0.75;
    this.steer(-2, steering);

var steerAngle = steering *= 10.05;
this.geom.rotate_joint_orig(this.swheel, steerAngle, {x:0,y:-1,z:0});
 
 
  this.wheel_force(-1, engine);
  this.wheel_brake(-1, brake);
 
  if(this.started==1 && !this.snd.is_playing(0)) {
    this.started=2;
    this.snd.play(0, 1, true, false);
  }
  else if(this.started==2) {
    var pitch = Math.abs(kmh)/20.0;
    var g = kmh>0 ? Math.floor(pitch) : 0;
    var f = pitch - g;
    f += 0.5*g;
    this.snd.set_pitch(0, 0.75*f + 1.25);
  }
  this.animate_wheels();
}

Also forgot to mention. The wheels are animated backward.


Zeos, could you do this for EvoIX too? I mean manual tranny. I've tried copy pasting it, but it makes my game crash for some reason. lol, yea I'm a noob with these kinda things.
Title: Re: Ford Mustang Bullet
Post by: bugsblake on June 10, 2013, 07:22:49 am
thanks zeos! handles much better! yh i did see the steering wheel was turning the wrong way! didnt notice the wheel them selfs! i still have to fix the steering wheel pivot anyway! and add the 2 bits that just float there! lol
Title: Re: Ford Mustang Bullet
Post by: ZeosPantera on June 10, 2013, 12:31:44 pm


Zeos, could you do this for EvoIX too? I mean manual tranny. I've tried copy pasting it, but it makes my game crash for some reason. lol, yea I'm a noob with these kinda things.

Tweaking I can do, adding a full manual transmission conversion would be quite a bit harder.