Inquiries on the workings of the Kingdom Hearts games.

Discussion in 'Code Vault' started by HyperThermal, Feb 2, 2015.

  1. HyperThermal Moogle Assistant

    Joined:
    Feb 2, 2015
    Gender:
    Male
    0
    1
    Hello, and thank you for taking the time to read through this post. I am currently working on a game of my own, and for education purposes, I would like to get some information about how certain processes work. At the moment, I am trying to wrap my head around character movement, namely how the player controller switches states (from standing still, to walking, to jumping, etc.) and how the game knows when each state switch works (namely, how the game figures out if the character is on the ground or not).

    Thank you again for reading this post.
     
  2. Explode Who?!

    Joined:
    May 20, 2007
    Gender:
    Male
    Location:
    New York
    656
    I can not speak specifically for the Kingdom Hearts series, as I'm sure of the details of their engine. However, I am a 3D animator who recently took an interest in game development. I'm very inexperienced, but I might be able to shed a little light.

    The only game dev program I have any knowledge of is Unity, which is fairly popular. You probably know that under the hood, games are driven by coding. This is the basis for determining what a character can do. In Unity, there are usually 2 different steps to making your character move correctly. One of them is using the game physics to code the basic movements, which is driven by the buttons that the player inputs. So it's written (in a scripting language, of course) that when the player presses the spacebar (or say, the O button) to add an upward speed of 300 (or whatever) meters meters per second. The game's internal gravity will cause the character to fall back down. Without any restrictions though, the player can just hold the button and jump infinitely. So you have to set up a conditional statement that checks where the ground plane is. So if the character is in contact with collision plane for the ground, then they can jump. Otherwise, they can't. I believe you typically label the ground collisions as such, to distinguish them from the wall collisions. Otherwise players could just rub up against the side of the level and jump forever.

    I took a couple screenshots from a tutorial that went over how to program character movement from scratch. It's a 2D side-scroller with a 3D character, so most of it will apply to a full 3D game, but not everything.

    The other step after getting the movement and physics down is getting the animations to work alongside its corresponding movement, and getting them to blend into each other. In other words, you don't won't the idle animation to play when you are running forward, so you set up conditions for when to trigger the running animation, when to go back to idle, etc. I think if you animated your character in Unity, you would also do this entirely in the character movement script, calling on the names of different animation clips. However, a lot of the time people animate in a different program, like Maya, and then import it into Unity as an .fbx file. Unity handles these imported animations with its Animator window, where you set up what is essentially a flow chart. The different animations appear as a rectangle, and you draw arrows between them to tell one to transition into the other. You then give it parameters which tell it when to change between them. Like I said, I'm also very new to this, so the details could be wrong.

    Here's the link to that tutorial I posted screenshots from. It goes over other things like attacking, and setting up a health system. It's on Digital Tutors, which is not a free site.
    http://www.digitaltutors.com/tutori...pment-Pipeline-Volume-2-Character-Prototyping

    They recently had a promotion where you could have a free trial period, but I think it might be over. You could look anyway though, I could be wrong. It's about $30 for a month. Pretty steep, but it might be worth it for you if it's what you want to do. Especially if you can marathon-watch the videos you want (and take tons of notes), and then be done with it in a month or two. They have dozens of hours on Unity alone, plus Unreal Engine and other stuff. Not trying to sell you on it (I don't have a paid account) as there are plenty of free tutorials out there as well. You just have to be more careful when learning stuff from people on Youtube, because they may not know what they're talking about, or could be doing something in a really roundabout way.
     

    Attached Files: