Demo: Green Dragon

Articles with the tag: Game Engine

Framework: checking memory leaks with Valgrind

Profiling with Valgrind memcheck and gprof to check for memory leaks and performance problems. Could things be sped up by not using so much C++ standard library things (which I used copiously for educational purposes, instead of clobbering everything together in C)? One mustn't assume so, sez Stroustrup - testing is needed.

Loading could be drastically improved by saving JSON and COLLADA model formats in a form suitable for my game environment. The vertex indexer currently involves a triple-nested for-loop!

[29/06/14 23:13]

All the valgrind warnings are gone apart from one about the OpenGL library. That can't be my fault, right?

Read More »

Framework: animation clip subsystem test

Animation base complete: IK is blended with animation clips and morph targets.

Making a couple of looping "idle" animations in Blender dragon rig to make the simulated character more realistic and life-like.

A pre-rendered animation I made in Blender to show off my dragon model:

The skeletal animation works in my animation subsystem for CharSim:

Testing a crude looping "idle" animation - it works with mouse-following IK and facial morphing.:

Read More »

Framework: animation clip attributes

Time structures:

Real time:

double timer; // Time since GLFW initialisation.
float tDelta; // Time per frame (could also be considered Game Time)

Game time:

float tGame; // Time since first frame (i.e. first update-draw cycle)
float tDuration; // Game-time duration for clip, whose clipDuration will be warped to match it.
// Placeholders for time-based events. Likely entered as literals in the animation update logic.
float tStart;
float tStop;

Animation time:

float tAnim // Time taken since animation starts (Animation Time) (could include repeated clips)

Clip time (supports warping):

float tClip // Time taken since clip starts (Clip Time). Calculated by modding tAnim with tClipDuration).
float tWarp; // Ratio by which tClipDuration is warped by to match the given game-time tDuration.
float tClipDuration;

Clips are loaded onto a an array ClipArray. A call to play a clip sets its isPlaying value to 'true' and each clip is iterated through each update cycle.

struct Clip
    String clipId;       // Name ...

Read More »

Framework: animation clip sequences

So far I've been implementing the dragon in SkeletonNode for testing purposes. This needs to be abstracted into a separate DragonNode (for the dragon demonstration character) and then the SceneGraph should be implemented with ControllerNode SceneGraphs which handle broad movement. They can also receive user input and control AgencyNodes and InteractiveNodes by calling their animation sequences.

Speaking of animation sequences, they need to be turned into callable functions and be blendable together.

Animation system: how to make a trigger call an animation clip on time.

It can't be based purely on comparison with an elapsed time. For instance, if a trigger is set to play a clip after 10 s (seconds), the elapsed time is likely to be fractional in any specific frame: 9.999... 10.002..., so the trigger will be missed.

A margin of error could be used, but this creates an inaccuracy and the game ...

Read More »

Lighting and shading the character model

Cool, but not what I want (using the geometry shader)

Aaand success: the shader-based skinning is complete: vertices and normals are transformed.

[09/06/14 12:25]

Let's try a simple (e.g. Lambert + Phong) shader.

Fantastic. Now let's add UV texturing, then the CameraNode can be set up.

[09/06/14 15:59]

Seeing if armature animation code still works with dragon mesh - it may need updating.

Creating a small looping idle animation for the dragon character rig in Blender:

Playing the test animation in game engine:

It works!

Now it just needs to be made blendable with simulated motion for more realistic idle dragon motion (such as swaying) while the player interacts with the character.

Some interpolation (such as smoothstep) should be used to make the looping animation smooth as it bounces between keyframes.

Read More »

Input: mouse pointer control

Alright, let's get XY coordinates via the mouse to control the end of the curve using GLFW.

A possible angle for the final animated/simulated dragon head and neck:

The end bone and therefore the face is aligned with the rest of the neck, however. The head should be made to point more directly at the cursor, as well as the eyes.

[13/05/14 15:40]

Putting mouse coords in Input handler class, but these should be normalised for the IK solver animation so they can be converted easily into world coordinates. How will the IK node be aware of screen coordinates? Such coordinates will be useful for picking (the process of allowing the mouse access to objects in a scene by casting a "ray" from its screen position), so a general access point should be sought.

Collision detection nodes

Add BoundingNode which (model) nodes can inherit from ...

Read More »

Page 1 / 4 Older »