[video output=day274 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Dynamic Animation with Springs" vod_platform=youtube id=0MWGM4pte-I annotator=Miblo] [0:42][Recap and set the stage for the day] [1:52][handmade.cpp and handmade_config.h: Introduce and make Global_Timestep_Percentage editable with the debug system] [4:00][Run the game reduce that Global_Timestep_Percentage] [7:01][handmade_world_mode.cpp: Look at the current hopping code and consider doing physics simulation on the springiness] [10:05][Blackboard: Tracking the velocity and target position of the cape] [13:12][handmade_world_mode.cpp: Simulate tBob using the standard equations of motion[ref site="Handmade Hero Episode Guide" page="Day 043 - The Equations of Motion" url="https://hero.handmade.network/episode/game-architecture/day043"]] [16:12][handmade_world_mode.cpp: Set the acceleration to 0 and see that there's no movement on that joint] [16:36][handmade_world_mode.cpp: Set a loop and tweak the hopping variables] [22:00][handmade_world_mode.cpp: Restore the position to 0] [24:15][handmade_world_mode.cpp: Simulate the landing phase] [30:59][handmade_world_mode.cpp: Tune the hop] [32:41][Control the hero directly and see that the hop is oscillating] [33:04][Blackboard: Springs] [34:57][Blackboard: Undamped spring] [37:28][handmade_world_mode.cpp: Add that undamped spring equation] [38:31][Blackboard: How this spring equation works] [40:05][Blackboard: Under-, over- and critically-damped springs] [42:32][handmade_config.h and handmade_world_mode.cpp: Run at 100% global speed and slow down the head and jump] [44:01][handmade_world_mode.cpp: Tune the downward motion on the anticipation phase] [46:44][handmade_world_mode.cpp: Consider making the head snap back to the body when stationary] [49:15][Blackboard: Applying the spring technique in different directions] [57:33][handmade_world_mode.cpp: Implement this spring equation for the head] [1:04:41][Rerun the game and get that restorative force, but see that the facing direction is being affected by something] [1:07:12][Blackboard: Recentering the head along the body's axis of movement] [1:07:59][handmade_world_mode.cpp: Recenter the head] [1:16:13][handmade_world_mode.cpp: Introduce a non-normalised ddP2 in order to compute the spring] [1:17:21][Run the game and see that the problem is fixed] [1:17:56][Q&A][:speech] [1:18:30][@Miblo][The other day ingenero likened the new movement to Crypt of the Necrodancer. I like that game and see where they're coming from, but Handmade Hero already looks like it feels so much sweeter to play] [1:19:04][@ffsjs][I've probably missed it, but what exactly prompted switching the hero movement from analogue-rolling to digital-tile-based-wiggle-hopping?] [1:19:44][@cpots][Does math exist?] [1:19:47][@indie_d][Is the body always going to move on a fixed grid?] [1:20:38][@is_matt][Can we get a keyboard cam?] [1:20:52][@bluemelon555][Will the player be able to see the points in the design] [1:21:13][@macielda][Is the body going to lean towards the head or is it gonna stay detached?] [1:22:04][@indie_d][Shouldn't the head always draw on top of the cape?] [1:23:31][@trevnewt][Will other entities only travel on these points, too? Or can they move freely?] [1:24:08][@cvaucher][Is there a name for this technique of blending canned and simulated animations? Is it a common thing allowed in animation / 3D packages?] [1:26:16][@macielda][Why would I use an animation package instead of doing what you just did (and whatever you will do)?] [1:28:56][@trevnewt][Is there any plan for eventual addition of music?] [1:29:34][@garryjohanson][Ham-handed Q, could you use neural networks and make something like Boston Dynamics 'BigDog'?] [1:31:17][Close it up][:speech] [/video]