Jump to content
  • Advertisement
lawnjelly

Animating characters on sloping ground

Recommended Posts

Anyone have any suggestions for ways of animating characters on varying slopes on landscapes? I've no idea what are standard ways of dealing with this, and have been putting this off to some extent. The issues are mainly with larger animals cutting through the terrain on slopes.

elephants2.jpg.bde85e4247bea9227a7540faf5bda775.jpg

I've tried raising animals up higher above the land, but they look obviously 'in the air' in certain positions. I've also tried putting 2 land height probes at the front and rear, so that they change height according to their orientation, but that looks silly with strange changes in elevation as they move. I've also tried changing the pitch angle when rendered, this looks a bit silly (but not out of question lol).

Another possibility is to turn off depth testing against the landscape, but I would have to figure a way of still having it working when they are behind mountains. Perhaps if I push back the depth value of the land this will work.

I have read this article on mechwarrior 4:
https://www.gamasutra.com/view/feature/131863/animation_blending_achieving_.php

and I see they deal with it by having a flat animation, left and right and up and down slope animations, and blending between them. I can do this, but it sounds like a lot of extra animations for a one man team, and it also means I'd probably have to use a lower / upper body split for all animations, rather than be able to use full body. Plus use some performance for the blending (this is on mobiles).

I've not really used IK before in game, is this a realistic / practical solution? Or can I use a simpler system, make some standard poses on flat, and slopes, then measure knee etc angle offset, then blend in these offsets with some scaling at runtime to make the legs more bent or extended?

croc.jpg.f1afe806dc88ab22ec152e3b806d9603.jpg

Another solution is to just design around the problem and make the large animals only able to move over flat ground. I guess this is more what happens in real life, I haven't seen many crocodiles climbing up slopes on nature progs lol.

Any thoughts, experiences on this would be welcome. :)

 

Edited by lawnjelly

Share this post


Link to post
Share on other sites
Advertisement

Maybe having an up-vector for the models that points in the same direction of the face normal of the underlying polygon? And Orientate your model to coincide with that?

Share this post


Link to post
Share on other sites
10 hours ago, markypooch said:

Maybe having an up-vector for the models that points in the same direction of the face normal of the underlying polygon? And Orientate your model to coincide with that?

I did try this (just with pitch rather than taking into account roll, but the effect was similar). It 'kinda' works but it looks a bit wierd (as gravity no longer seems to be pointing downward). I guess I may end up partly using a milder version of this as part of a solution.

Share this post


Link to post
Share on other sites

I don't think there is any "standard" way and as far as I know stuff can get very fancy there. Take for example HumanIK which dynamically adjust the model and has been used in many AAA games : 

 

Edited by ChuckNovice

Share this post


Link to post
Share on other sites
On 1/28/2018 at 2:05 PM, lawnjelly said:

Any thoughts, experiences on this would be welcome.

There is a old trick for this.

You attach a sphere collider at the bottom of the rig. The sphere tilts the model and the back legs blocks the fall.

You can then use ray cast to move the legs to the surface and all kinds of fancy tricks. Here is a ugly example I made in Blender just to show the concept:

Sphere.thumb.jpg.6acc99f26deb7aec1589559fb4b61a66.jpg

Search for : Sphere collider align to terrain

Or something like that, this is a very old and well used trick.

 

Share this post


Link to post
Share on other sites

Thanks guys! I've found some IK example source code and it doesn't look as frightening as I feared. So I'll try and have a go when I get some spare time! :)

Share this post


Link to post
Share on other sites
5 hours ago, lawnjelly said:

Thanks guys! I've found some IK example source code and it doesn't look as frightening as I feared. So I'll try and have a go when I get some spare time! :)

Post the link(s) if they're available for others in the future that use this thread :)

Share this post


Link to post
Share on other sites

https://www.youtube.com/watch?v=2772HKIsf1M

http://www.darwin3d.com/gdm1998.htm

It turns out I'd actually done stuff similar to the CCD algorithm in the past.. although the constraints will be fun, one suggestion was to convert to euler angles, do the constraints, than back to quaternions. First I'll try the 2 bone analytical solution though, as it might work for leg heights and I would guess is the most efficient.

It has inspired me I might use a similar technique to animate the snake in game! :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
  • Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Aggrojag
      Hello!
      I'm working on a game that is a narrative driven dark comedy with some small aspects of platforming and puzzle solving. The project is rather small as well. It touches on topics such as suicide, mental illness, family, corruption, free-will, and redemption.
      This project is exercise in polish, this means some experimentation will be needed along with some reworking of assets as they're provided.
      This will be a revshare model.
      First, I'm looking for a 2D sprite artist, not pixelated, that can compliment the style of the attached images, and be similar to the temporary character.
      We are looking to bring on a SFX designer at this time. Full list of required SFX will be available upon request, as well as a build with all elements related to sound implemented in some form (many SFXs pulled from the web for now). Will likely require some field recording, and some pretty strange SFX for when things get weird. I imagine a good portion of these will be quite fun to create.
      Lastly, I'm looking for a male voice actor, English should be your primary language. There will be at minimum two characters that will need to be brought to life through vocals. The first voice is similar to Marvin from Hitchhiker's Guide to the Galaxy. A reference for the second voice would be a mix of Ren (Ren & Stimpy), and Android 21 (DragonBallFighterZ). Due to formatting, I'm not including YouTube links in the post, sorry.
       
      WIP Scene with our custom shaders attached (platforms are lazily placed, as this was an asset test):

      A scene with dynamic lighting and temp character:

       
      Unshaded asset:

      If you made it to the bottom, thank you, and I look forward to hearing from you.
    • By Paszq
      Group photo of some of the characters and creatures currently living in Arpago
    • By Hanna Habela
      Hi,
      Check it out: habela.github.io
      ok, don't know if it is that "cool" or that "unique"... but supposedly being self-confident and brag yourself is a way to go hmm...don't know
      Anyway, tell me guys what do you think about my site and art in it as well.
      Btw: Say nicely "hi" or "hello" to me coz I'm new here (not so new to game art, as I'm doing it for some time now and more than 2 years as freelancer)

    • By Uzma Inaya
      I am trying to oscillate a 2D object about a point, while the object has already been drawn then later I want to oscillate it by specifying the pivot point, how to proceed, please help me.It is for a mini project.I am using codeblocks and using c programing language along with OpenGL to do this, I have attached main .c file and .cpb file below (For reference I have attached the code for that object also below .) I have attached a .png file as what is my 2D image looks like.I want to oscillate that image about its top point(i.e cap tip).
      #include <GL/glut.h> #include <math.h> #define PI 3.14159265358979324 void myinit() { glClearColor(1.0,1.0,1.0,0.0); glMatrixMode (GL_PROJECTION); gluOrtho2D(0.0, 200.0, 0.0, 150.0); //glutPostRedisplay(); } void display(void) { float r3 = 4.0; // Radius of circle. float x3 = 80.0; // X-coordinate of center of circle. float y3 = 67.0; float r1 = 1.0; // Radius of circle. float x1 = 77.0; // X-coordinate of center of circle. float y1 = 73.0; float r2 = 1.0; // Radius of circle. float x2 = 83.0; // X-coordinate of center of circle. float y2 = 73.0; float R = 3.0; // Radius of circle. float X = 80.0; // X-coordinate of center of circle. float Y = 103.0; // Y-coordinate of center of circle. int numVertices = 25; // Number of vertices on circle. float t = 0; // Angle parameter. int i; glClear(GL_COLOR_BUFFER_BIT); //glColor3f(0.5, 0.5, 0.5); glLineWidth(2.0); glEnable(GL_LINE_STIPPLE); //glLineStipple(1,0x00ff); //draw a line glBegin(GL_LINES); glColor3f(0.92, 0.78, 0.62); glVertex2f(80.0,60.0); glVertex2f(90.0,65.0); glVertex2f(90.0,65.0); glVertex2f(90.0,75.0); glColor3f(0.137255, 0.556863, 0.137255);//0.0, 0.5, 0.0); glVertex2f(90.0,75.0); glVertex2f(80.0,80.0); glVertex2f(80.0,80.0); glVertex2f(70.0,75.0); glColor3f(0.92, 0.78, 0.62); glVertex2f(70.0,75.0); glVertex2f(70.0,65.0); glVertex2f(70.0,65.0); glVertex2f(80.0,60.0); glColor3f( 0.137255, 0.556863, 0.137255); glVertex2f(90.0,75.0); glVertex2f(80.0,100.0); glVertex2f(80.0,100.0); glVertex2f(70.0,75.0); glEnd(); glFlush(); glBegin(GL_POLYGON); glColor3f(0.1, 0.9, 0.0); for(int i = 0; i < numVertices; ++i) { //glColor3ub(rand()%256, rand()%256, rand()%256); glVertex3f(X + R * cos(t), Y + R * sin(t), 0.0); t += 2 * PI / numVertices; } glEnd(); glFlush(); glBegin(GL_POLYGON); glColor3f(0.647059, 0.164706, 0.164706); for(int i = 0; i < numVertices; ++i) { glVertex3f(x1 + r1 * cos(t), y1 + r1 * sin(t), 0.0); t += 2 * PI / numVertices; } glEnd(); glFlush(); glBegin(GL_POLYGON); glColor3f(0.647059, 0.164706, 0.164706); for(int i = 0; i < numVertices; ++i) { glVertex3f(x2 + r2 * cos(t), y2 + r2 * sin(t), 0.0); t += 2 * PI / numVertices; } glEnd(); glFlush(); glBegin(GL_POLYGON); glColor3f(1.0, 0.7, 0.0); for(int i = 0; i < numVertices; ++i) { glVertex3f(x3 + r3 * cos(t), y3 + r3 * sin(t), 0.0); t += - PI / numVertices; } glEnd(); glFlush(); } void main(int argc,char *argv[]) { glutInit(&argc,argv); glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); glutInitWindowSize (1000, 1000); glutInitWindowPosition (0, 0); glutCreateWindow ("joker"); myinit(); glutDisplayFunc(display); glutMainLoop(); }  
       
      thanks in advance, please help me
      joker.cbp
      main.c

    • By INTwindwolf
      COMPANY AND THE PROJECT
      We are an indie game studio consisted of professional and skilled artists who are dedicated indie enthusiasts. Our current project is INT, developed on Unity Engine 5 for platforms Windows, Linux, and Mac. We are recruiting a few more members on the team to finalize our playable demo.

      INT is a 3D Sci-fi RPG with a strong emphasis on story, role playing, and innovative RPG features such as randomized companions. The focus is on the journey through a war-torn world with fast-paced combat against hordes of enemies. The player must accomplish quests like a traditional RPG, complete objectives, and meet lively crew members who will aid in the player's survival. Throughout the game you can side and complete missions through criminal cartels, and the two major combatants, the UCE and ACP, of the Interstellar Civil War.
      Please note that all of our current positions are remote work. You will not be required to travel.
      For more information about us, follow the links listed below.
      INT Official website
      Steam Greenlight
      IndieDB page
      Also follow social media platforms for the latest news regarding our projects.
      Facebook
      Twitter
       
      3D ANIMATOR
      We are looking for an Animator to join the Art team to rig characters and create animations for the game. You will be collaborating with fellow members of the team in the creation and polishing of 3D animations.
      Your tasks will include:
      Create rigs to be used for animations. Skin 3D models to rigs. Refine existing 3D animations. Contribute to constructive team discussions. Attend regular team meetings.  
       
      REQUIREMENTS
      To be successful in this position, following requirements apply:
      Have working knowledge of 3D animation suites. Understand import/export requirements for Unity Engine integration. Excellent self-management skills. Excellent attention to detail. Excellent communication skills. Satisfaction of the follow requirements are preferred, but not essential:
      Knowledge of the Unity Engine UMA character creation system would be an advantage.  
      REVENUE - SHARE
      This is the perfect opportunity to get into the game development industry. We have the majority of our art assets completed and are marching towards our crowd-funding campaign, currently planned for mid 2018.
      We are unable to offer wages or per-item payments at this time. However revenue-sharing from crowd-funding is offered to team members who contribute 15-20 hours per week to company projects, as well as maintain constant communication and adhere to deadlines. Your understanding is dearly appreciated.
       
      TO APPLY
      Please send your Cover Letter, CV, Portfolio (if applicable), and other relevant documents/information to this email: JohnHR@int-game.net
      Thank you for your time! Please feel free to contact me via the email provided should you have any questions. We look forward to hearing from you!
      John Shen
      HR Lead
      Starboard Games LLC
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!