The Forest - orienteering simulation


The Forest is a simulation of the sport of orienteering, which has been likened to car rallying on foot. The aim is to visit a sequence of control points marked on a map. For some it is a great combination of navigation skills and fitness, competing against others to get round the course in the shortest time. But it need not be competitive. Large O-events have always had some courses catering for the less able, whether in terms of map-reading ability or mobility: it can still be very satisfying to complete the course. Such events may have hundreds or even thousands of entrants and so involve massive organisation. Originating in Scandinavia, O-events took place in forested terrain but nowadays events are also organised on street maps in towns. The maps are specially prepared to an international standard and that too takes a great deal of work by enthusiasts.

As the developer of The Forest I have always been fascinated by maps. The only sport I was any good at at school was cross-country running so when I discovered orienteering it was ideal for me.

When I got my first personal computer I had already been programming for 10 years (mainly in Fortran) and had made several O-maps, both surveying the ground on foot and doing the final cartography. At that time others were focussing on using computers to assist event organisation and results distribution. I wanted to do something different. I taught myself assembly programming from a book in order to program extensive terrain in the small amounts of memory that were available in PCs at that time.

My big breakthrough was to devise an algorithm for generating essentially limitless terrain from just a few hundred bytes of program. 

The first version of The Forest was published in 1982 for the TRS-80 which had only 16 kilobytes of programmable memory. A year later a better version was launched for the 48k Sinclair ZX Spectrum.

Those early versions were quite crude because display screens were very coarse and with limited colours (the TRS-80 version could only display 128 x 48 pixel blocks in green or black). I "surveyed" the terrain generated by my program so that a printed map drawn to proper O-standards could accompany the published game. That was good because it prevented people from usefully copying the software (there were no printer/scanners for consumers then).

After I retired I set about rewriting The Forest using recent technology, just as a hobby. Having worked on web sites (including large e-commerce ones) I decided that HTML5/Javascript was a likely platform to use. I was soon amazed by how well the 2D canvas performs in that environment. It was also great to be able to use real photos (my own) of trees and other things, rather than crude symbols.

The Forest is written in plain old-style Javascript to run in as many browsers as possible. It is object-oriented and I firmly believe that is the best way to manage the structure of large projects. But it uses the original prototype style of JS rather than giving the browser more work to do interpreting classes. I typically have a separate .js file for each type of object. That means the HTML page has more than 30 script elements but that does not cause any problems. As one who has worked in many different systems I do like the flexibility of Javascript but I don't think it is good for beginners because it quickly leads them into unstructured mess. I think the best language for beginners is Java because it is very strict, clear and consistent but of course the strictness frustrates some people. (I also think it is a tragedy that Java is no longer available in browsers: we used to be able to do things so much more neatly.)

For developing and testing I use Apache Netbeans. That is free and it has a good plug-in for HTML/Javascript. Importantly it also has a built-in localhost server for testing in a range of browsers. I use Affinity Photo for preparing my photos to use in the scenes.

Files

UserGuide.pdf 3.3 MB
Feb 28, 2024
TerrainGeneration.pdf - how the terrain is generated 4.3 MB
Jul 14, 2024
SceneDIsplay.pdf - how scenes are drawn 2.1 MB
Jul 01, 2022

Get The Forest

Leave a comment

Log in with itch.io to leave a comment.