Home

Week 3

First look at locomotion! It still needs lots of work.

For making this works I have two foot nodes, which I move based on the control bar movement. On the control bar I have two symmetrically positioned control points. I move one of the feet by the scaled relative control point movement based on which control point is higher.

Relative here means relative to the center of the control bar. This forces the player to do the walking motion and allows them to position the control bar where they want.

The scale factor is currently chosen such that the puppet walks like their feet were connected by an invisible bar. With the current setup, it seems more fun to choose a higher scaling factor, because one can take larger step. But, I will have to experiment with the scaling factor when there are more other things to balance it against - think terrain, buildings, other puppets, gravity, etc.

A helpful visualization tool for me is a pen. I imagine the control points to be at the ends of the pen. While I bought a cheap marionette, to see what movement on a real marionette is like, walking a pen on a table feels closer to what I want for my idea. A pen comes with the physical limitations I want to imitate.

This is where the idea for my control code comes from. When you walk a pen across a table, one end of the pen is on the table and does not move. The other end is the one, which does move. It is always higher making for an easy condition in code.

I am unsure whether I am happy with the movement code separation between control_bar.gd and puppet.gd. The idea is to allow for controlling other types of entities with the control bar, e.g. vehicles or non-humanoid puppets. The interface consisting of setActiveFoot and moveActiveFoot intuitively does not map well to that semantically, but the necessary information is transmitted and the somewhat weird semantics might be a benefit. I presume that the player will intuitively build an understanding of locomotion, which has a resemblance to the interface. When I introduce novel controllable entities at a later point in the game, their control scheme should build upon that understanding, if applicable.

On a different note, in the video you see tee collision pills and the puppet's feet move in an unrealistic fashion. I am happy that it moves at all, because it uses inverse kinematics (IK), but I will have to take another look at IK in the future. Currently there are three IK targets - the body and the feet. The feet collision pills I intend to use for walking with gravity, walls and other obstacles. The body collision pill is intended for detecting whether the puppet needs to crouch and whether it is hit by enemies.