rainbowasfen.blogg.se

Townscaper ideas
Townscaper ideas




townscaper ideas

Println("Y Range: " + minY + " - " + maxY) Println("X Range: " + minX + " - " + maxX) Traverse the corner array to find the range for X and Y coordinates.įloat x = corners.getChild("x").getFloatContent() įloat y = corners.getChild("y").getFloatContent() XML cornerHolder = xml.getChild("corners")

#Townscaper ideas code

The code expects a file called "Town0.scape" to be located in the project's "data" folder. Noise distribution (larger values -> more variation).įinal static float BUILDING_HEIGHT_NOISE_RANGE = 20.0 įinal static float BUILDING_COLOR_NOISE_RANGE = 1.0 įinal static float STRUT_HEIGHT_NOISE_RANGE = 20.0 įinal static float MAX_BUILDING_HEIGHT = 4.0 įinal static float MAX_BUILDING_COLOR = 15 įinal static float MAX_STRUT_HEIGHT = 10.0 Offsets in noise space for attributes.įinal static float BUILDING_HEIGHT_NOISE_OFFSET = 0.0 įinal static float BUILDING_COLOR_NOISE_OFFSET = 25.0 įinal static float STRUT_HEIGHT_NOISE_OFFSET = 50.0 data, then save the file out with a timestamp.

townscaper ideas

Load a save file from Townscaper as a template, replace the voxel If you do, I’m curious to see where you go! Even if you don’t, I strongly recommend checking out Townscaper – what Oskar Stålberg has created is absolutely wonderful. I’m sharing the code I used – hopefully continuing in the footsteps of Chris and Patrick (whose shoulders I stand on for map generation) with the idea that someone may take this and run somewhere new with it. I think my favorite towns involve a middle of the road approach which yields town maps that have some variation in height but, not too much. Increasing the variation in building height and distance between the base of each building node and the waterline yielded a fairly nice result. The next attempt involved mapping the coordinates of the map to a 2D point in Perlin noise space but, I didn’t scale things, so there’s a fairly low level of variation. This gave a nice wavy pattern but, wasn’t quite what I was trying for. My first attempt iterated the map while incrementing a 1D vector in Perlin noise space to determine these attributes. Using that as a starting point, I decided to try building up town maps in processing using Perlin noise to determine height, color, and distance above waterline. While looking for information on how garden paths are calculated, I stumbled across Chris Love’s article on the Townscaper file format. I’ve been playing Oskar Stålberg’s Townscaper recently and enjoying seeing how the algorithms react to changes.






Townscaper ideas