Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Download Outerra Tech Demo. Unofficial Outerra Discord server, MicroProse Discord server for OWS.

Pages: 1 2 [3] 4

Author Topic: Character Animation  (Read 65662 times)

andfly

  • Sr. Member
  • ****
  • Posts: 347
Re: Character Animation
« Reply #30 on: October 10, 2018, 11:38:40 am »

Well...
I thank you for the compliments even if they are definitely exaggerated.
If you want to see true magic you can re-watch this movie:


I certainly did not mean to denigrate or downplay the system of animations built with graphics programs.
They remain a wonderful method and the only one that can be implemented if you want to animate a large number of characters at the same time.
The possibility, then, to record even small clips and connect them in a video editor, makes it an affordable and highly satisfying tool.
The final effects are very pleasant ... and your works prove it.

I was just trying to underline how the direct programming method of movements can open even wider and more exciting perspectives.
It requires a little more of initial effort and a little "struggle" with trigonometry and rotations, but allows the total control of the models under all circumstances.
You can program individual movements, or entire sequences, with maximum freedom of action ...

it's not a small thing.
If we add that the action takes place in a realistic and beautiful environment like the world of Outerra ...
Well ... really 15 dollars well spent !!!    :D :D :D
« Last Edit: October 10, 2018, 11:50:05 am by andfly »
Logged
I do not know the English language. I use Google Translate. I hope it's all understandable.

patmarrnc

  • Full Member
  • ***
  • Posts: 136
Re: Character Animation
« Reply #31 on: October 10, 2018, 12:54:19 pm »

Well...
I thank you for the compliments even if they are definitely exaggerated.
we might have to agree to disagree on whether or not my observations about you are exaggerations.  I stand by my statements


Quote
If you want to see true magic you can re-watch this movie:
indeed, this is awesome... and a bit troubling to me, because if it is ever implemented, I'm guessing the stuff I am currently using will go away.  ;-(


Quote
I certainly did not mean to denigrate or downplay the system of animations built with graphics programs.
I didn't take it that way. My intent was to point out that Outerra can be used in more than one way with animation.  I mentioned this distinction because I think there is a tendency for people to get locked into one paradigm,and maybe see Outerra as "only" a game engine, where models have to be totally controllable with a game controller.  I know people who use it in other ways, and I think the user base might grow if the world sees it as a product that might be useful in more than one way.



Quote
I was just trying to underline how the direct programming method of movements can open even wider and more exciting perspectives.
It requires a little more of initial effort and a little "struggle" with trigonometry and rotations, but allows the total control of the models under all circumstances.
You can program individual movements, or entire sequences, with maximum freedom of action ...

it's not a small thing.
If we add that the action takes place in a realistic and beautiful environment like the world of Outerra ...
Well ... really 15 dollars well spent !!!    :D :D :D

indeed! I agree completely!

Logged

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: Character Animation
« Reply #32 on: October 18, 2018, 06:10:28 pm »

I've got done my first character animation that  I made in blender of a guy waving his hand. I exported it as dae and then converted to fbx using autodesk fbx converter. Using the autodesk fbx viewer the animation seems fine, same as in blender. I can import it into outerra and run the anim file using the this.geom.animate() command as usual but the character gets totally distorted as soon as it starts to move, besides it being gigantic. (in blender he is just 2 blender units high). Bones in blender are all connected together. Any idea what could cause this problem ?  here is the blender file of the animated character  https://www.dropbox.com/s/638ctyij2k1t10u/PatrickBoned3-hi.blend?dl=0 and here the texture misisng in the  blend file.  https://www.dropbox.com/s/uezufvm9o2kmoh1/patrik_skin.jpg?dl=0
« Last Edit: October 18, 2018, 06:40:01 pm by fly77 »
Logged

patmarrnc

  • Full Member
  • ***
  • Posts: 136
Re: Character Animation
« Reply #33 on: October 18, 2018, 10:55:42 pm »

regarding the size: It's my understanding that there isn't a standard for size among modelling programs, so when moving models from one environment to another, you have to use trial and error to get the size right (resizing in Blender then reimporting into Outerra.)  Once you have it sized correctly, you can use the Blender file as a point of reference for sizing other models made in Blender. 

I've even noticed that when a program accepts more than one file format, the exact same model will be sized differently if imported as an OBJ or DAE or FBX. So I keep multiple reference files... one to size static models, and another one to size animated models

Also noticed that the same model will be a different size in Outerra if I use the Autodesk FBX converter to create my FBX, as opposed to exporting directly to FBX from Blender. 

regarding the distortion:
I've noticed similar distortion when exporting animations from DAZ, but I've never seen it in animations created by Poser.
Logged

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: Character Animation
« Reply #34 on: October 19, 2018, 08:53:25 am »

Ok for size I can adjust the scale in blender beforehand or during fbx import in outerra. regarding distortions by looking closer using open3mod free model viewer I was able to verify that the animation is still OK after exporting from blender as dae. The problem arises when using autodesk fbx converter. The resulting fbx file viewed in fbx converter seems OK but when viewed in open3mod the fbx animation displays the same distortion issue as in outerra. Seems that fbx converter viewer  is "more tollerant" (or more "intelligent"?) than outerra and open3mod viewer. I'll try to figure out what's the cause.
« Last Edit: October 19, 2018, 08:55:34 am by fly77 »
Logged

KW71

  • Outerra Developer
  • Hero Member
  • *****
  • Posts: 762
  • Love OT!
Re: Character Animation
« Reply #35 on: October 19, 2018, 09:44:14 am »

Try exporting from Blender directly to .fbx selecting in "Version:" FBX 7.4 Binary, and controling the scale in the proper tab (usually 1 would work for binary;   for ASCII is 100)
Logged
"A man who is contented with what he has done, will never become famous for what he will do".

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: Character Animation
« Reply #36 on: October 19, 2018, 10:51:03 am »

That's what i tried initially but did not work as outerra crashes during import. Above is the blender file. Are you able to import blender animations into outerra?
« Last Edit: October 19, 2018, 11:24:24 am by fly77 »
Logged

KW71

  • Outerra Developer
  • Hero Member
  • *****
  • Posts: 762
  • Love OT!
Re: Character Animation
« Reply #37 on: October 21, 2018, 02:44:32 pm »

I haven't tried to import animations yet.
Logged
"A man who is contented with what he has done, will never become famous for what he will do".

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: Character Animation
« Reply #38 on: October 21, 2018, 04:16:51 pm »

in the meantime I also tried to export directly fbx animation files from blender using the 6.1 ASCII export option. While with the 7.4 binary export option I could not get any animation file import in outerra (outerra allways crashes during import) (on the other hand fbx 7.4 binary export works to import fbx of static objects into outerra) with the 6.1 ASCII fbx export I can get the animation loaded into outerra. As with the collada-> fbx-converter path however I get models that are scaled wrongly (now they are really tiny lilliputs as opposed to the giants I still have with the collada) and again i could not solve the character movement distortion issue. It seems to have to do with the way axis orientation are set up and/or exported but while I tried hard a lot of the possible combinations of x,y,z,-x,-y,-z up/down front/back during the fbx eport stage I am not there yet to have a correct animation. Probably I made mistakes as the possible combination of axis orientations and/or model orientations are too many and the most obvious ones do not seem to give good results unfortunately. I'll continue insisting as the distortions seem to have to do with the coordinate frame orientation. On the other hand to fix the scale problem I tried increasing the size of mesh in blender and fit a new skeleton to the upscaled rig. Seems that I can increase somewhat the size of the lilliput but not enough yet. The scale factor setting in both 6.1 fbx ASCII blender export and outerra import do not seem to have any effect..apparently. Lot's of combinations of parameters to try...but I won't give up
« Last Edit: October 21, 2018, 04:44:52 pm by fly77 »
Logged

patmarrnc

  • Full Member
  • ***
  • Posts: 136
Re: Character Animation
« Reply #39 on: October 22, 2018, 11:29:34 am »

While trying to figure out what works, I tried a bunch of different procedures. It's been a while, so my memory is not clear about what worked and what didn't, but I do remember a couple of things.  Initially I used the Autodesk FBX exporter to create the final FBX. But in the end I was exporting from Blender.

However, I didn't create the animation in Blender (I created it in Poser, exported as DAE, then imported the DAE into Blender, then exported the final result to FBX)

Since you use Blender to create your animation, you might try adding an intermediate step of exporting your animation from Blender to Collada (DAE) to embed the animation into the file. Then import the DAE back into Blender in order to convert it to FBX

Also, take note of the export options. You might have to specify that you want to export animation (both times.. when exporting DAE and again when exporting FBX)

Also make sure to remove any cameras and lights from the model before exporting. I have had Outerra crash when trying to import models that still have lights or cameras embedded.

Logged

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: Character Animation
« Reply #40 on: October 22, 2018, 02:47:27 pm »

Wow ! it works now ! Thanks patmarrnc ! It just took me 10 minutes now thanks to your useful suggestions !!...I had lost 3 days in trials before using the DAE and ASCII fbx export changing lots of coordinate system export and model orientations/scaling. For the moment I just used your suggestion to make a blender animation without cameras and lights and tried a "minimalist" fbx 7.4 binary export with the settings  shown in the attached image.  And voilĂ  !  here from dropbox https://www.dropbox.com/s/1p3utoo23umf2ul/Patrick-hellow-world.mp4?dl=0
you have a video of patrick correctly sized by default saying "hello world" !  (the model is patrick downloaded from turbosquid https://www.turbosquid.com/3d-models/human-male-3d-model/504883; the blender simulation is just a rapidly drafted animation, no fancy model orientations..in blender the model stands upright along +z and front points towards the + y direction as this is needed for outerra vehicles.  )


« Last Edit: October 22, 2018, 08:53:21 pm by fly77 »
Logged

patmarrnc

  • Full Member
  • ***
  • Posts: 136
Re: Character Animation
« Reply #41 on: October 22, 2018, 03:56:35 pm »

so in the end it was just the lights and cameras? That's good to know. It's easy for me to become "supertitious", carefully following every step in a procedure that worked, even though all of the steps in that procedure may not have contributed to the success.
Logged

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: Character Animation
« Reply #42 on: October 22, 2018, 08:19:54 pm »

Finally I "cracked" the problem of activating different "pre-baked" animation files (.anim files) from within the javascript of outerra models, thanks to this outerra github webpage https://github.com/Outerra/anteworld/wiki/Animation-API


It was then only a matter of adapting this to launch multiple animated actions. Below are the essential statements to be included in the javascript file.

As an example I used several test animation files that I had made in blender and imported into outerra (see above discussion...many thanks again to patmarrnc!! for speeding up this achievement).

I was able to activate them from within the javascript of a character using as a control variable the speed of the character motion (he is configured as a vehicle,using transparent/invisible wheels as for my bicycle).

It turned out that the animations could fit more or less to a character that does ice-skating (without skates so far !) by using a bad "walk-cycle" - good however for ice-skating !

Since I discovered this solution just few days ago I have not had the time yet to set up a better animation for demonstration. I am just beginning to learn blender in general and animating characters in particular.

Here is the otx file of the animated character for download from dropbox https://www.dropbox.com/s/92rmeqpr3ozkzm8/Patrick1.otx?dl=0
The blender file of the model can be downloaded from here https://www.turbosquid.com/3d-models/human-male-3d-model/504883

He will appear as a vehicle "PatrickBoned3-hi" in the outerra menu. As usual for vehicles use "w" for moving forward, "s" for breaking, "a" and "d" for moving left and right. By using "v" you can switch between different camera views among which notably a "fly-by" mode that I developed (still to be optimized but promising). Also using the "+" and "-" on the numeric keyboard zoom in and out.

Enjoy ! and BUILD ON IT !

Here is a video of some action recorded on ice !

 

Below are the essential javascript statements to activate different animations (.anim files) depending on a control variable. I chose the "h" key (horn action of vehicles) to switch between two different animations. By the way, by changing the speed3 and the limits for kmh for switching between different actions you can also make him walk normally instead of skating.

So now with these simple commands it becomes possible for us to develop animated characters performing many different complex actions either through keyboard control or controlled by in-game algoritms implemented in the model javascript (maybe walking, climbing, swimming, etc... automatically depending on the terrain properties).

Together with andfly's great approach we have now two ways to make complex programmable animations inside outerra !

There is really no more excuse now not to develop lots of animated characters for outerra ! Or allmost. The only limitation that I still see is that in any case so far we are limited to modify characters treated as vehicles so they will not be able to move as freely as we wish. The "real animated character" (with total freedom in all regards) as the outerra mercenary is defined as object with physics="character" not physics="vehicle" but for me at least it is unclear how and where the physics of the mercenary is defined and how we could mod it.

Code: [Select]
var _animation1,_animation2;

var flag=0;
var sincro=0;
var speed1=1;  //any positive float value
var speed2=1;  //any positive float value

//invoked only the first time the model is loaded, or upon reload
function init_chassis(){
...

   _act_horn = this.register_event("car/controls/horn", horn_action);
   
  ....
   
}


//invoked for each new instance of the vehicle
function init_vehicle()
{
...
this.geom = this.get_geomob(0);

_animation1 = this.geom.load_animation("Scene1.anim", "", 0);
_animation2 = this.geom.load_animation("Scene2.anim", "", 0);
...   
}



function horn_action(){
  if (flag==0){
     flag=1;         
  }else{                   
    flag=0;
  }             
}

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

//invoked each frame to handle the inputs and animate the model
function update_frame(dt, engine, brake, steering)
{
...
   
  sincro=sincro+dt;
 

  if (flag==0){
      this.geom.get_animation_stack().blend_animation(_animation1, 1, true, (speed1*sincro)%1);
      } else {
         this.geom.get_animation_stack().blend_animation(_animation2, 1, true, (speed2*sincro)%1);
  }
     
  this.geom.animate(); 

...

}









« Last Edit: October 24, 2018, 12:57:02 am by fly77 »
Logged

andfly

  • Sr. Member
  • ****
  • Posts: 347
Re: Character Animation
« Reply #43 on: October 24, 2018, 11:15:32 am »

Congratulations !!!

It was a bit of time that I did not explore the forum and today I found this good news.
I fully agree with what you say ...
There are no more excuses for which you can not see, soon, a significant increase in animated characters, in the world of Outerra, created by users and not only reserved for developers.
And then ...
Bringing in the forum the discussion on methods, attempts, failures, successes, discoveries and inventions is the most beautiful form of collaboration and mutual help to share a common passion.
I am sorry to have, at this moment, little time availability and not being able to be very useful ...
This is another reason why I am even more admired for the work and the results you have achieved.

Congratulations again!   :) :)
Logged
I do not know the English language. I use Google Translate. I hope it's all understandable.

fly77

  • Outerra Master Modder
  • Hero Member
  • *****
  • Posts: 1761
Re: Character Animation
« Reply #44 on: October 24, 2018, 11:59:30 am »

Thank you andfly for your kind appreciaction. Coming from you its a special honor as you are probably the one who gave us the most beautiful addons from which we still can learn a lot..i just need to find the time..but indeed exchanging models experiences and failures on the forum step by step we can progress together helping each other. Now there are so many  possibilies opened already that for sure i will try also a more polished model..still keeping it relatively simple though.
Logged
Pages: 1 2 [3] 4