Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17063

A simple way to generate limitless terrain in real time, in plain HTML5/JavaScript!

$
0
0

This article explains in some detail how I generate terrain in The Forest (www.myforest.uk) as the player moves around. I discovered the techniques around 1980 when making games for a TRS-80 with only 16 kilobytes of memory available. In 2014 I began converting my old Z80 assembler to HTML5/JavaScript.

The starting point is a 1-dimensional profile of length 256 for which the data are stored as a literal array of integer values. Charted in a spreadsheet it looks like this:

Figure 1

The profile is a periodic structure (its last value and slope are very similar to …


Viewing all articles
Browse latest Browse all 17063

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>