A Math Based Personality For Games

We make no apologies for being hardware focused here at Hackaday, but that doesn’t mean we aren’t occasionally impressed by a particularly inspired feat of bit wrangling. For example, [t3ssel8r] has taken a break from his game to discuss his procedural animation system and the beautiful math behind it.

Sometimes, rather than having specific keyframes, games will instead use procedural animation. This means that the position is determined on the fly rather than a predetermined set of positions. Developers can use the combination of IK or FK (inverse or forward kinematics) to solve for rotation and positions of the joints that will place the end at a specific position. Particularly with crawling multi-limb things, it’s pretty easy to put a limb on the ground and keep it there until it’s too far away, pick a new spot, and move it there. It’s simple code to write and looks convincing. It can handle complex terrain and situations with different limb positions.

However, it doesn’t offer the chance to inject some life or personality into the movement as keyframes do. [t3ssel8r] goes through the equations and reasoning behind his semi-implicit Euler solver-based system. There are some fantastic explanations in the video, but the short version is that he has three parameters to control the system’s frequency, dampening, and initial response. This allows him to tweak the behavior in a somewhat intuitive manner. One problem is stability; if the timesteps get too large, the position quickly explodes outwards. Using eigenvalues (who ever thought you’d use those) to determine the minimum timestep allows the system to remain stable and take multiple smaller steps when needed or just bound the change temporarily.

If you’re looking for more animation, this blender plugin renders your PCB traces in a new light.

Continue reading “A Math Based Personality For Games”

Toilet Paper Chase And Indoor Cycling Race With Unity And Arduino

While we’re still far away from returning to a pre-Corona everyday life, people seem to have accepted that toilet paper will neither magically cease to exist, nor become our new global currency. But back at the height of its madness, like most of us, [Jelle Vermandere] found himself in front of empty shelves, and the solution seemed obvious to him: creating a lifelike toilet paper chasing game in hopes to distract the competition.

Using Unity, [Jelle] created a game world of an empty supermarket, with the goal to chase after distribution tubes and collect toilet paper packs into a virtual cart. Inspired by the Wii Wheel, he imitated a shopping cart handle built from — as it appears — a sunshade pole that holds an Arduino and accelerometer in a 3D-printed case as game controller. For an even more realistic feel, he added a sound sensor to the controller, and competing carts to the game, which can be pushed out of the way by simply yelling loud enough. You can witness all of this delightful absurdity in his build video after the break.

From racing shopping carts to racing bicycles

But that’s not all. With the toilet paper situation sorted out, [Jelle] found himself in a different dilemma: a cloud foiled his plans of going for a bicycle ride. In the same manner, he ended up building a cycling racing game, once again with Unity and Arduino. From a 3D-scanned model of himself and his bicycle, to automatically generating tracks on the fly and teaching an AI to ride a bike, [Jelle] clearly doesn’t joke around while he’s joking around.

However, the best part about the game has to be the controller, which is his actual bicycle. Using a magnetic door sensor to detect the speed, and a potentiometer mounted with an obscure Lego construction to the handlebar, it’s at least on par with the shopping cart handle — but judge for yourself in another build video, also attached after the break. The only thing missing now is to level up the difficulty by powering the Arduino with the bicycle itself.

Continue reading “Toilet Paper Chase And Indoor Cycling Race With Unity And Arduino”

3DBuzz Closes With A Final Gift

If you wanted to learn about creating modern computer games, 3DBuzz had some of the best tutorials around. In fact, some of the tutorials about C#, C++, Android, and math would be useful for anyone, while the ones about game art and modeling in Maya are probably mostly for game developers. While these were once available only by subscription, the company — now defunct — has left them available for download via this BitTorrent file.

We don’t know enough about things like Blender and Maya to evaluate the material, but it is well regarded and the ones we do know something about seem very high quality. There are, for example, many videos about C++ and C# that are very professional and cover quite a few topics.

Continue reading “3DBuzz Closes With A Final Gift”