Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Author Topic: Jeep Grand Cherokee going around  (Read 3872 times)

Nadeox1

  • Jr. Member
  • *
  • Posts: 23
  • The guy at BeamNG
Jeep Grand Cherokee going around
« on: March 10, 2013, 01:12:58 pm »



After understanding how the video thing works, and obtaining the right codes I put this together. Had some fun.  In the last part, which i cut, the car flipped and bounced kilometers away :p
Also a way to present my Channel. Hoping my partnership could bring more people into outerra :)
Logged

Jagerbomber

  • Hero Member
  • *****
  • Posts: 1486
Re: Jeep Grand Cherokee going around
« Reply #1 on: March 10, 2013, 01:14:26 pm »

Are you allowed to use the BF intro?  ;)
Logged
"Perhaps this speaks to some larger trend within society today...  A prevailing desire on the part of indie developers to recreate the entire world into one where you can charge more than $15 for your game design degree coursework." - Yahtzee ;) :P

Nadeox1

  • Jr. Member
  • *
  • Posts: 23
  • The guy at BeamNG
Re: Jeep Grand Cherokee going around
« Reply #2 on: March 10, 2013, 01:31:33 pm »

It's a custom one made from an editor in After Effect and free to use. I guess yes :)
Logged

ZeosPantera

  • ||>>-Z-<<||
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2518
  • #1 Outerra Fan Boy
    • My Youtube
Re: Jeep Grand Cherokee going around
« Reply #3 on: March 10, 2013, 02:42:50 pm »

I'd recommend a mod for the vehicle physics. The CG and default grip level is too arcade.

Code: [Select]
//invoked only the first time the model is loaded, or upon reload
function init_chassis()
{
  var wheelparam = {
    radius: 0.34,
    width: 0.245,
    suspension_max: 0.20,
    suspension_min: -0.04,
    suspension_stiffness: 32.0,
    damping_compression: 0.48,
    damping_relaxation: 0.1,
    slip: 0.52,
    roll_influnce: 0.1,
}
 
  this.add_wheel('wheel_forward_left', wheelparam);
  this.add_wheel('wheel_forward_right', wheelparam);
  this.add_wheel('wheel_back_left', wheelparam);
  this.add_wheel('wheel_back_right', wheelparam); 
 
  //sounds
  this.load_sound("jeep_start.ogg");
  this.load_sound("jeep_idle.ogg");
  this.add_sound_emitter("steering_wheel");
 
  return {mass:2500, steering:2.5, steering_ecf:60, centering: 2.0,
      centering_ecf: 40, com:{z:-0.2, y:0.1}};
}

//invoked for each new instance of the vehicle
function init_vehicle()
{
  this.set_fps_camera_pos({x:-0.48,y:-0.08,z:0.4});
  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);
  }
}


const EF = 12000.0;
const BF = 2500.0;
const maxkmh = 140;
const forceloss = EF / (0.6*maxkmh + 2);


//invoked each frame to handle inputs and animate the model
function update_frame(dt, engine, brake, steering)
{
  var kmh = this.speed()*3.6;
 
  //reduce engine force with speed (hack)
  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;
  this.steer(0, steering);
  this.steer(1, steering);
 
 
  if(this.started>1)
    this.wheel_force(0, engine);
    this.wheel_force(1, engine);
    this.wheel_force(2, engine);
    this.wheel_force(3, engine);
 
  brake *= BF;
  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.5*f + 1.0);
  }
  this.animate_wheels(); 
}
Logged
"Fear accompanies the possibility of death, Calm shepherds its certainty" - General Ka Dargo

sniperwolfpk5

  • Full Member
  • ***
  • Posts: 117
Re: Jeep Grand Cherokee going around
« Reply #4 on: March 11, 2013, 05:45:51 am »

Nadeox1 gr8 work. Beautiful done every thing. Only one issue. What is that zig zac road intersection? I thing you have max out every thing
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6638
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: Jeep Grand Cherokee going around
« Reply #5 on: March 11, 2013, 07:35:45 am »

That happens when the roads don't connect at the same level, there's a sharp transition that gets meshed in that zig-zag way. Automatic level matching will take care of most of these artifacts.
Logged

Thunderstorm99

  • Newbie
  • Posts: 3
  • newbie
Re: Jeep Grand Cherokee going around
« Reply #6 on: April 01, 2013, 01:23:25 pm »

dumb question but is there any way to download your model somewhere?
Logged