# Procedural Terrain Platformer

Graphite Game is a game that, like Crazy Pong and Octalping, started as a PC prototype growing into an Android app in development. This was in 2012 and sadly the development has now ceased, however the project was a great learning curve project.

Fundamentally, It is basically a 2D scroller, which is a role playing game that is a sandbox.

The main feature I was enjoying to explore was procedural map generation that use random seeds. I approached the problem a little like Minecraft, using a random string generated at the start of the map to solely dictate the game world. As the game was only 2D, I only had to create a single height function $f( x )$ that calculates the y, given an x say. I approached this by superimposing sinusoidal waves together using different amplitudes and phases where each wave is of the form $w( x ) = a*t(s)*sin(b*u(s)*x + c*v(s))$ where a, b and c are constants for each function and t,u,v are functions of the seed that return a float between 0 and 1. a dictating the amplitude, b dictates the phase and c is not particularly necessary but dictates the horizontal shift. Using $f(x) = \sum^n_{i=1} w_i(x)$ generates a good random map given a spread of constants. For example you want to have some constants with very small phase to give a rocky feel and some much more relaxed larger waves to emulate hills. It is was also possible to experiment with sin waves within sin waves, but I won’t get too much into that now.

Another part of the project that I was keen to experiment with was the ballistic mechanics, making it possible to fire bows and arrows. Nothing too complex, but something very fun to implement.

For now I don’t wish to disclose too many details, but hopefully once some more work has been done on the project I will be able to upload some screenshots.

This work went on to inspire some of the more complex 3D experiments.