47 lines
22 KiB
HTML
47 lines
22 KiB
HTML
<!DOCTYPE html PUBLIC ""
|
||
"">
|
||
<html><head><meta charset="UTF-8" /><title>Towards a procedural animation API</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">The-great-game</span> <span class="project-version">0.1.3</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1"><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1"><a href="3D-formats.html"><div class="inner"><span>3D file formats</span></div></a></li><li class="depth-1"><a href="A-generic-planning-algorithm-for-craftworker-npcs.html"><div class="inner"><span>A Generic Planning Algorithm for craftworker NPCs</span></div></a></li><li class="depth-1"><a href="API_Spec.html"><div class="inner"><span>API Spec (unfinished)</span></div></a></li><li class="depth-1"><a href="Appraisal.html"><div class="inner"><span>Appraisal (unfinished)</span></div></a></li><li class="depth-1"><a href="Architecture.html"><div class="inner"><span>Architecture</span></div></a></li><li class="depth-1"><a href="Baking-the-world.html"><div class="inner"><span>Baking the world</span></div></a></li><li class="depth-1"><a href="Biomes_and_ecology.html"><div class="inner"><span>Biomes and ecology (unfinished)</span></div></a></li><li class="depth-1"><a href="Building_on_microworld.html"><div class="inner"><span>Building on Microworld</span></div></a></li><li class="depth-1"><a href="Canonical-dictionary.html"><div class="inner"><span>Canonical dictionary for this documentation</span></div></a></li><li class="depth-1"><a href="Division_of_tasks_between_server_and_client.html"><div class="inner"><span>Division of tasks between server and client</span></div></a></li><li class="depth-1"><a href="Dynamic-consequences.html"><div class="inner"><span>On the consequences of a dynamic game environment for storytelling</span></div></a></li><li class="depth-1"><a href="Economy.html"><div class="inner"><span>Game world economy</span></div></a></li><li class="depth-1"><a href="Further-reading.html"><div class="inner"><span>Further Reading (and watching)</span></div></a></li><li class="depth-1"><a href="Game_Play.html"><div class="inner"><span>Game Play</span></div></a></li><li class="depth-1"><a href="Genetic-buildings.html"><div class="inner"><span>Genetic Buildings</span></div></a></li><li class="depth-1"><a href="Gossip_scripted_plot_and_Johnny_Silverhand.html"><div class="inner"><span>Gossip, scripted plot, and Johnny Silverhand</span></div></a></li><li class="depth-1"><a href="MVP-Roadmap.html"><div class="inner"><span>Minimum Viable Product, and a road map</span></div></a></li><li class="depth-1"><a href="Modelling_democracy_and_morale.html"><div class="inner"><span>The Red Company: modelling democracy and morale (unfinished)</span></div></a></li><li class="depth-1"><a href="Modelling_trading_cost_and_risk.html"><div class="inner"><span>Modelling trading cost and risk (unfinished)</span></div></a></li><li class="depth-1"><a href="Naming-of-characters.html"><div class="inner"><span>Naming of Characters</span></div></a></li><li class="depth-1"><a href="Not_my_problem.html"><div class="inner"><span> Not my problem</span></div></a></li><li class="depth-1"><a href="On-dying.html"><div class="inner"><span>On Dying, and Injury</span></div></a></li><li class="depth-1"><a href="On-sex-and-sexual-violence.html"><div class="inner"><span>On Sex, and Sexual Violence, in Games</span></div></a></li><li class="depth-1"><a href="Organic_Quests.html"><div class="inner"><span>Organic Quests</span></div></a></li><li class="depth-1"><a href="Pathmaking.html"><div class="inner"><span>Pathmaking</span></div></a></li><li class="depth-1"><a href="Populating-a-game-world.html"><div class="inner"><span>Populating a game world</span></div></a></li><li class="depth-1"><a href="Pseudo-object-inheritance.html"><div class="inner"><span>Pseudo object inheritance</span></div></a></li><li class="depth-1"><a href="Roadmap.html"><div class="inner"><span>Roadmap (obsolete)</span></div></a></li><li class="depth-1"><a href="Sandbox.html"><div class="inner"><span>Sandbox</span></div></a></li><li class="depth-1"><a href="Selecting_Character.html"><div class="inner"><span>Selecting the Player Character</span></div></a></li><li class="depth-1"><a href="Settling-a-game-world.html"><div class="inner"><span>Settling a game world</span></div></a></li><li class="depth-1"><a href="Sexual-dimorphism.html"><div class="inner"><span>Sexual dimorphism</span></div></a></li><li class="depth-1"><a href="Simulated-genetics.html"><div class="inner"><span>Simulated Genetics</span></div></a></li><li class="depth-1"><a href="Simulation-layers.html"><div class="inner"><span>Simulation layers</span></div></a></li><li class="depth-1"><a href="The-spread-of-knowledge-in-a-large-game-world.html"><div class="inner"><span>The spread of knowledge in a large game world</span></div></a></li><li class="depth-1"><a href="Things_Voice_Interaction_Enables.html"><div class="inner"><span>Things Voice Interaction Enables</span></div></a></li><li class="depth-1 current"><a href="Towards-a-procedural-animation-api.html"><div class="inner"><span>Towards a procedural animation API</span></div></a></li><li class="depth-1"><a href="Tree-library-evaluation.html"><div class="inner"><span>Tree library evaluation</span></div></a></li><li class="depth-1"><a href="Uncanny_dialogue.html"><div class="inner"><span>The Uncanny Valley, and dynamically generated dialogue</span></div></a></li><li class="depth-1"><a href="Voice-acting-considered-harmful.html"><div class="inner"><span>Voice acting considered harmful</span></div></a></li><li class="depth-1"><a href="Worlds-and-flats.html"><div class="inner"><span>Worlds and flats [obsolete]</span></div></a></li><li class="depth-1"><a href="intro.html"><div class="inner"><span>Introduction to the-great-game</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>cc</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>journeyman</span></div></div></li><li class="depth-3"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>the-great-game</span></div></div></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>agent</span></div></div></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.agent.agent.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>agent</span></div></a></li><li class="depth-5"><a href="cc.journeyman.the-great-game.agent.schedule.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>schedule</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>buildings</span></div></div></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.buildings.module.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>module</span></div></a></li><li class="depth-5"><a href="cc.journeyman.the-great-game.buildings.rectangular.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>rectangular</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>character</span></div></div></li><li class="depth-5"><a href="cc.journeyman.the-great-game.character.sex.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>sex</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>gossip</span></div></div></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.gossip.gossip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>gossip</span></div></a></li><li class="depth-5"><a href="cc.journeyman.the-great-game.gossip.news-items.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>news-items</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>holdings</span></div></div></li><li class="depth-5"><a href="cc.journeyman.the-great-game.holdings.holding.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>holding</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.the-great-game.launcher.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>launcher</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>location</span></div></div></li><li class="depth-5"><a href="cc.journeyman.the-great-game.location.location.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>location</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>lore</span></div></div></li><li class="depth-5"><a href="cc.journeyman.the-great-game.lore.digester.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>digester</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>merchants</span></div></div></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.merchants.markets.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>markets</span></div></a></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.merchants.merchant-utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>merchant-utils</span></div></a></li><li class="depth-5"><a href="cc.journeyman.the-great-game.merchants.planning.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>planning</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree" style="top: -114px;"><span class="top" style="height: 123px;"></span><span class="bottom"></span></span><span>objects</span></div></div></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.objects.character.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>character</span></div></a></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.objects.container.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>container</span></div></a></li><li class="depth-5"><a href="cc.journeyman.the-great-game.objects.game-object.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>game-object</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.the-great-game.playroom.html"><div class="inner"><span class="tree" style="top: -114px;"><span class="top" style="height: 123px;"></span><span class="bottom"></span></span><span>playroom</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>proving</span></div></div></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.proving.core.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>core</span></div></a></li><li class="depth-5"><a href="cc.journeyman.the-great-game.proving.sketches.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>sketches</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.the-great-game.time.html"><div class="inner"><span class="tree" style="top: -83px;"><span class="top" style="height: 92px;"></span><span class="bottom"></span></span><span>time</span></div></a></li><li class="depth-4 branch"><a href="cc.journeyman.the-great-game.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>world</span></div></div></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.world.heightmap.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>heightmap</span></div></a></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.world.location.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>location</span></div></a></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.world.mw.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>mw</span></div></a></li><li class="depth-5 branch"><a href="cc.journeyman.the-great-game.world.routes.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>routes</span></div></a></li><li class="depth-5"><a href="cc.journeyman.the-great-game.world.world.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>world</span></div></a></li></ul></div><div class="document" id="content"><div class="doc"><div class="markdown"><h1><a href="#towards-a-procedural-animation-api" id="towards-a-procedural-animation-api"></a>Towards a procedural animation API</h1>
|
||
<p>I’ve been watching this animation tutorial, and I’m impressed with its simplicity. This seems to be to be something it would be possible to do, and it started me thinking about what I wanted from a procedural animation API.</p>
|
||
<iframe width="800" height="504" src="https://www.youtube.com/embed/LNidsMesxSE?si=QgaN2aHG0g71aWkX" title="An Indie Approach to Procedural Animation" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen=""></iframe>
|
||
<p>The game is now open source, with the source available <a href="https://github.com/WolfireGames/overgrowth/">here</a>. It’s available on <a href="https://store.steampowered.com/app/25000/Overgrowth/">Steam, here</a>.</p>
|
||
<p>So: what have we here?</p>
|
||
<p>A simple character rig with a small number of key frames which can adaptively negotiate a moderately complex terrain. Inverse kinematics is used, but the core of the animation is key-frame animation with well thought out interpolation, and it all looks remarkably persuasive. This looks buildable.</p>
|
||
<p>So: what do I actually need?</p>
|
||
<h2><a href="#smooth-continuous-movement-on-complex-terrain" id="smooth-continuous-movement-on-complex-terrain"></a>Smooth continuous movement on complex terrain</h2>
|
||
<p>Characters need to transition from one movement to another movement smoothly, without sudden jums or jerks. Turning needs to look physically plausible.</p>
|
||
<h2><a href="#animation-for-several-skeleton-types" id="animation-for-several-skeleton-types"></a>Animation for several skeleton types</h2>
|
||
<p>Creatures I need to animate include</p>
|
||
<ol>
|
||
<li>People: upright bipedal motion;</li>
|
||
<li>Horses: even-length-legged quadripedal motion;</li>
|
||
<li>Camels: also even length legged quadripeds, but their gait is different from horses, although the skeleton might be similar. So: different key frames? Or something more elaborate than that?</li>
|
||
<li>Seals: primarily aquatic quadrupeds, with forelimbs considerably longer than back limbs, and all limbs much shorter than the other quadripeds under consideration. But I’m not sure how much I need to actually animate them.</li>
|
||
<li>Dragons: exist in the world, but aren’t necessarily going to appear in version one of the game. A much more complicated problem.</li>
|
||
<li>Birds: but don’t need to animate them close up or landed. However, not all birds fly using the same ‘gait’, so, again this may be complex.</li>
|
||
<li>Other quadrupeds, such as dogs and cats; but these are a long way down the priority scale.</li>
|
||
</ol>
|
||
<p>At the proof of concept stage, I only need animated people; and the only reason for cataloguing the other things I need to animate is that the animation framework needs to be able to handle multiple skeleton types.</p>
|
||
<p>It’s also worth pointing out that in Cyberpunk 2077, it’s very noticable that several different gaits are implemented for people: there is a noticably distinct ‘fat person’ gait, and several different gaits that are used, for example one extremely sexualised female gait, used mainly for characters who are sex workers, but for a small number of other female characters. The point here is that not all characters walk the same, and having distinctive gaits for some characters or classes of characters decidedly adds to a game’s persuasiveness.</p>
|
||
<h2><a href="#the-api" id="the-api"></a>The API</h2>
|
||
<h3><a href="#move-to-model-terrain-target" id="move-to-model-terrain-target"></a>(move-to model terrain target)</h3>
|
||
<p>Plans a route across the terrain from where the model is to the target (which can be either a location or an object, including another potentially moving character), avoiding obstacles and choosing the easiest path across slopes, and produces a route; animates the model along that route, using the keyframe-based system described in the video, with inverse kinematics to ensure feet touch the ground.</p>
|
||
<h3><a href="#look-at-model-terrain-target" id="look-at-model-terrain-target"></a>(look-at model terrain target)</h3>
|
||
<p>Turns the model’s gaze, and, if necessary, head and body, to face towards the target.</p>
|
||
<h3><a href="#sit-on-model-terrain-target" id="sit-on-model-terrain-target"></a>(sit-on model terrain target)</h3>
|
||
<p>Causes the model to sit on the target, moving to it first if necessary. If the target is approximately chair-height, sit on it as if on a chair; if it’s a horse or camel, sit on it as though to ride; otherwise, sit cross legged. If the target is just a location, sit cross legged on the terrain surface at that location.</p>
|
||
<p>Obviously, what I’ve described there is partially specific to upright bipedal models; horses and camels don’t sit on chairs!</p>
|
||
<h3><a href="#lie-on-model-terrain-target" id="lie-on-model-terrain-target"></a>(lie-on model terrain target)</h3>
|
||
<p>As above, but lie down.</p>
|
||
<h3><a href="#drink-from-model-terrain-target" id="drink-from-model-terrain-target"></a>(drink-from model terrain target)</h3>
|
||
<p>As above, but drink. Target is expected to be a drinkable container, such as a mug, flask or bottle, or else a point in the terrain which is flooded.</p>
|
||
<h3><a href="#eat-from-model-terrain-target" id="eat-from-model-terrain-target"></a>(eat-from model terrain target)</h3>
|
||
<h3><a href="#strike-model-terrain-target-implement-vector" id="strike-model-terrain-target-implement-vector"></a>(strike model terrain target implement vector)</h3>
|
||
<h3><a href="#thrust-model-terrain-target-implement-vector" id="thrust-model-terrain-target-implement-vector"></a>(thrust model terrain target implement vector)</h3>
|
||
<p>Two closely related animation calls, both of which might be used both in combat animation and in craft activity animation. <strong>BUT</strong> both combat animation and craft activity animation are much more complex problems which this not does not address.</p>
|
||
<h2><a href="#other-things-which-need-to-be-animated" id="other-things-which-need-to-be-animated"></a>Other things which need to be animated</h2>
|
||
<h3><a href="#conversation" id="conversation"></a>Conversation</h3>
|
||
<p>In conversation, people move to a convenient distance from one another, typically face one another, typically take turns to say things, frequently use hand gestures when speaking. The intensity of gestures will vary with the emotion being expressed. The animation of NPC-to-NPC conversation is if possible more complex to get right than of player character to NPC.</p>
|
||
<h3><a href="#combat-animation" id="combat-animation"></a>Combat animation</h3>
|
||
<h3><a href="#craft-activity-animation" id="craft-activity-animation"></a>Craft activity animation</h3>
|
||
<p>Both of these will be very complicated to get right.</p>
|
||
</div></div></div></body></html> |