summaryrefslogtreecommitdiff
path: root/notes.md
blob: 5284adb98160652065f7a54f19e846a7f57dcded (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
> I have a programmer's superstitions about always using powers of 2, which are more 
> pleasing to the spirit of the machine.
-mewo2, whose sentiment I share


grid generation
---------------

The basic sequence is:

	- pick N random points
	- relax them a lil
	- generate their voronoi diagram

Picking N random points it quite straightforward. For relaxation, I indent to just step 
over MxM points, get the closest of the set of N, and compute the averages to get the 
centroids. This, again, should be quite simple. Voronoi generation is then just a 
matter of using rhill's library.


terrain generation
------------------

mewo2 does this automatically; I'd like to do it interactively. Their primitives list 
is helpful to me though! I'd like to have "brushes" for these things, so that you can 
pick a radius and strength and then just go to town adding features.

	- constant slope: not entirely sure how this would work (pick a point and make things 
	  slope from there to the center?)
	- cones: pretty solid imo
	- round blobs: also pretty solid
	- relax: lerp with the average of neighboring points, with the lerp strength relative 
	  to brush strength and radius.
	- round: same as relax, but lerp with a point's own square root.

Normalization seems probably superfluous -- we'd like to be able to have really tall 
mountains and stuff, and it could also make some of the other operations a bit weird 
(like having stuff that was previously land disappear under water while building a 
mountain).

One thing to keep in mind is the effect of map scaling on brush radius size. I think I'd 
like to have the visual radius stay the same size, and shrink the internal radius to 
match it.

Rivers and erosion are interesting -- I may want to have an "erosion" and "rain" brush 
to generate these features.


rendering
---------

tba, not sure what I want to do here


additional features
-------------------

I want to take the same approach as OpenStreetMap and have all other features (and 
possibly even some, like rivers) be *nodes*, that exist independently of the terrain 
grid. These can be zero-, one-, or two-dimensional. Each node should exist on a *layer*,
so that different layers can be viewed at any given time. Additionaly, nodes may be 
assigned a relevance level, which corresponds to the scale required to view them. The 
highest-level nodes are only visible when broadly zoomed out, and reflect things like 
major cities, nations, and large-scale geographic features. The lowest-level nodes 
would represent things like individual buildings and only be visible when highly zoomed in.

Node should be able to indicate things like climate regions or land use patterns as well,
and those kinds of nodes should be on their own layers, so that the user can view or 
ignore relevant data at any time.