Outerra forum

Anteworld - Outerra Game => Tech demo, support, updates => Topic started by: Bob425 on August 31, 2018, 02:22:47 pm

Title: Boats
Post by: Bob425 on August 31, 2018, 02:22:47 pm
Under the new version, the US Coastguard boat sits very stern down, even when static, I have tried to correct this without any success.

(https://drive.google.com/uc?export=download&id=1_fSOiFEbl-rUCTc98dmJ4DyMPs4Gj_I5)
Title: Re: Boats
Post by: patmarrnc on August 31, 2018, 05:22:48 pm
yes, all the boats I've created have the same problem.  (I haven't tried changing the center of gravity in the script yet)  I didn't really want to start changing the scripts (not my forte) until hearing if there is some other solution
Title: Re: Boats
Post by: Bob425 on August 31, 2018, 06:06:38 pm
yes, all the boats I've created have the same problem.  (I haven't tried changing the center of gravity in the script yet)  I didn't really want to start changing the scripts (not my forte) until hearing if there is some other solution

The strange thing is that two of my boats sit on an even keel, while others misbehave like the US Coastguard.
Title: Re: Boats
Post by: patmarrnc on August 31, 2018, 07:43:24 pm
All of mine are very small (row boat, motor boat, kayak etc) and they worked "reasonably" OK in the previous version. I'm no javascript whiz, that's for sure. I usually take other peoples' scripts and mutilate them until the damage is acceptable to me.  In the new version the small crafts not only sit unevenly in the water, they also perform erratically.

1) I can't seem to find a setting at which the crafts don't bob excessively in the water (going completely underwater then rising completely out of the water)

2) In the process of bobbing, the interior of the crafts appear to fill with water (would collision fix that?)
Title: Re: Boats
Post by: KW71 on August 31, 2018, 07:51:37 pm
Hi, patmarrnc and Bob425!
I really don't have idea, but could the boats issue be related to the thread about vehicles bouncing?
https://forum.outerra.com/index.php?topic=3845.0
Title: Re: Boats
Post by: Bob425 on August 31, 2018, 09:59:27 pm
Cracked it!! The boat's center of gravity must be central, not one third back as normal, as shown below:-

(https://drive.google.com/uc?export=download&id=1YbvxLGzn4d9gKj4mByTFKKiIOAcLf9-h)

(https://drive.google.com/uc?export=download&id=1uQLrscPPCTr-xbY2EUgCV82q1nNW1FMW)
Title: Re: Boats
Post by: fly77 on September 01, 2018, 02:57:23 am
how to set the center of gravity of the boat ? I do not understand which of the parameters in the javascript file I need to change and which value to set.
Title: Re: Boats
Post by: Bob425 on September 01, 2018, 05:06:56 am
how to set the center of gravity of the boat ? I do not understand which of the parameters in the javascript file I need to change and which value to set.

No, you do not understand, you have to make the changes to the model itself, using a 3D modelling program like MAX or Blender.
Title: Re: Boats
Post by: cameni on September 01, 2018, 09:18:49 am
By default the center of mass is taken from model's pivot, but you can also modify it in the script by adding com property in parameters returned from init_chassis. That tells the distance to shift the COM from the pivot:

Code: [Select]
function init_chassis(){
  return {
    mass:18000,
    hydro_h1:3,
    hydro_h2:5,
    hydro_uplift:6000,
    Cx:{x:1.2, y:0.1, z:1.2, w:0.8},
    com:{y:2}
  };
}
Title: Re: Boats
Post by: Bob425 on September 01, 2018, 09:52:49 am
By default the center of mass is taken from model's pivot, but you can also modify it in the script by adding com property in parameters returned from init_chassis. That tells the distance to shift the COM from the pivot:

Code: [Select]
function init_chassis(){
  return {
    mass:18000,
    hydro_h1:3,
    hydro_h2:5,
    hydro_uplift:6000,
    Cx:{x:1.2, y:0.1, z:1.2, w:0.8},
    com:{y:2}
  };
}

Thats very intersting, cameni.
If I had known this it would have saved me a lot of time.
Thank You.
Title: Re: Boats
Post by: patmarrnc on September 02, 2018, 01:46:20 pm
thank you very much, Cameni!

You had already told me about how to change the center of gravity in the script (when my cars wer leaning sideways and tipping over), but I hadn't gotten around to trying it yet on my boats. 

But I also appreciate your inclusion of some other variables that will probably work better than what I've got in my script.
Title: Re: Boats
Post by: Bob425 on September 05, 2018, 02:02:13 pm
Are there any variables in the boat's .js file to raise the bow when up to speed, a semi-planning attitude?
Title: Re: Boats
Post by: cameni on September 05, 2018, 04:12:05 pm
hydro_uplift

https://github.com/Outerra/anteworld/wiki/Vehicle%20Parameters
Title: Re: Boats
Post by: Bob425 on September 05, 2018, 06:56:57 pm
Many thanks, Cameni.
Title: Re: Boats
Post by: Bob425 on September 07, 2018, 09:22:31 am
Are there any plans to add a bow wave to watercraft?
Title: Re: Boats
Post by: cameni on September 10, 2018, 05:21:55 am
There are plans for everything :)
Title: Re: Boats
Post by: 2eyed on September 10, 2018, 09:38:06 am
There are plans for everything :)
Cameni is GOD! :)) (of OT).
Title: Re: Boats
Post by: Jagerbomber on September 10, 2018, 02:19:03 pm
The plans have been set in motion.