Orienteering, JavaScript and Video games

 

This section is about an odd combination of topics which requires some explanation.

* Other languages, such as Python, are freely available for writing programs but the beauty of JavaScript is that everyone with an internet browser already has the environment for running the programs without having to download and install something else first.

 Orienteering

I have always been fascinated by maps. I was never much interested in sport but at school I was good at cross-country running. I got involved in the sport of orienteering around 1970 and quickly found that it is a fascinating combination of running and maps.

As a student I also discovered I had an aptitude for programming. When personal computers became available at the end of the 1970s I wanted to see how programming could be applied to orienteering. Apart from race timing and results production which other people were covering, I thought about maps on computers and how they might help people to learn navigation skills, particularly with regard to understanding contours on maps.

I developed a program to simulate orienteering, called The Forest. It was written first for the Tandy TRS-80 and then in 1984 for the Sinclair Spectrum. The latter had more success in the open market. A friend then converted it to work on the BBC Microcomputer too. It was written mainly in assembly language (low level, rather cryptic), with a little BASIC as a container. The maps that could be displayed by such early computers were extremely crude, so a printed map had to be supplied along with the cassette tape containing the program when purchased. The printed map was seen as an advantage because it made copying the package difficult.

 JavaScript

Fast forward to 2014 and the formerly ubiquitous BASIC programming language is all but forgotten. Everything is now web-based and version 5 of HTML is almost established as the standard. Arguably the most important new feature in HTML5 is its <canvas> element and the JavaScript API (Application Programming Interface) that enables quite sophisticated graphics to be drawn within <canvas> elements. Browsers have quickly adopted the new standards and JavaScript has replaced BASIC as the programming language that is freely available to everyone.*

So I began rewriting The Forest for this new platform: HTML5 & JavaScript. I quickly became amazed by how much is possible in this environment. The new version is now (mid-2018) available both as a navigational training aid for orienteers and with a treasure hunt and other diversions for non-orienteers. It has more than 1,000 sq km of forest to explore and yet it downloads and runs in seconds.

 Video games

The new version of The Forest demonstrates that JavaScript interpreters in browsers are now very fast, so that the HTML5 / JavaScript platform is quite practical for writing video games. It has the advantage that such programs will download and run on a very wide range of devices without any modification: desktop or laptop PCs, tablets, smartphones, any device that can browse the internet. There is no need to convert the program for each type of machine, as we used to have to do. Furthermore there is no need to publish through any kind of application program ("app") store; simply upload the HTML and script files to a web host.

 Links

Try The Forest: myforest.uk

User Guide for The Forest [PDF] with useful hints and tips.

Contours - another of my programs which may help understanding contour maps.

Detailed history of The Forest.

A 1984 review of the original version, in Crash magazine.

A programmer's guide to The Forest is also being written.

If you wish to learn to program you could do worse than follow my JavaScript course, based on training I used to give professionally.

British Orienteering Newcomer's Guide

Better Orienteering - a site containing a huge number of references and links to useful orienteering resources.

My own orienteering maps

Food for thought: Philosophy of The Forest

Next page