Monday, October 22, 2007

MMOG Development

Not long after getting the Internet in 2001, I found an online MMOG based originally on ALttP ( ). Not long after, a built in editor was discovered so I started playing with the proprietary scripting engine. Some of my more notable accomplishments are described below.

A* Pathfinding

One of the things that brought myself fame in the game's community is this A* implementation. While not optimised for large areas, it was well suited for single level traversal. It used the tiles in the game as nodes and several arrays for the F and G costs, aswell as for the Parent relationships. It was built to add cost for water, swamp, and other rough terrrain. In the pictures, the blue Xs are visited nodes and the green Xs are open nodes.

As I grew more knowledgable of abstract data types (binary heaps etc) and dynamic memory management, implementations of A* grew more powerful and useable in more demanding settings.

Mini Games

I built several mini games, some of which allowed you to play other people. As you can see above, I recreated the popular DS game Polarium (although never got around to adding versus play). Also, I scripted a Dots game (drawing squares on paper versus others), Connect Four, and a single player Tic-Tac-Toe (using a Minimax implementation limited by the game engine's script restraints). Since pixel graphics are not my specialty (or most graphics), all of these make heavy use of the polygon drawing functions within the scripting language. This caused me to find many ways to optimise drawing using vectors and arrays.

3D rendering

The second picture here is an early attempt at a simple 3d engine. It uses some complex trigonometric equations to solve for rotating the points (very slow). The first and third are both from the same script (different from first picture) that uses 3d transformation matricies to rotate the points with some very basic culling and lighting (just the cosine between the veiwing angle and face normal).

This is a simulation of rope using relatively simple vector normalisation and inertia calculations. The 3D effect is created by doubling the draw of each segment to perpendicular rectangles (knowledge of 3D rotations was not a part of my toolkit at this point).


The first picture is of a vector drawing script that allows the player to draw lines and shapes with the selected color. This was all done using the aforementioned polygon drawing functions. The second is just an experiment with the built in particle system (adopted from the Torque engine, which the MMOG began to use) as well as a custom built shadow script that would rotate based on time of day. The third is a custom built particle effect that would simulate an exploding spray of sparks. The flag image is actually a procedural animation that would chop up an image and disply vertical portions of it in a way to simulate a wave effect. The version shown is actually using an array of color values instead of an image.

The above is one of a few string/rope simulations made using simple vector calculations based on Euclidian distance. One of the more advanced versions of this calculated the string for 3 dimensions and used screen aligned quads to keep the rope at a consistant width. In this version, the line used simple physics relations for projectile motion to cast and land in the water.

This is a simple fractal algorithm that would take an array of vectors, then extrude the edges of a square using the vectors.

No comments: