Category Archives: procedural

Another long time…

Well this time it’s been more than a year since the last time I updated this site. I never did post the creative writing project I was working on, although I did get it working nicely, I just hit a bit of writers block. I tested the features of it that I wanted with random phrases and words, but wasn’t able to write enough content to justify posting anything.

Meanwhile, my ray tracer project has all features I initially planned. That is, it has all the code that the books website had plus anything that that code excluded as an exercise. The current master branch on github has all the features that the book discusses. The project’s Wiki has a page of thumbnail images it has rendered of all the build functions from the books website.

Giant version of Figure 24.6 from the book

Figure 24.6 from the book, rendered large, the phong highlights were the reason I decided to see what an area light version would look like

Raytraced Image with reflective materials and area lights

Area Light Version of the large 24.6 image

Note: This image should be linked directly to the github version of it, so it should be updated as I change things, Unfortunately the 6000×4000 size does not work well with wordpress, or most people’s screen size. To view the full images, because of the way github handles binary files, your browser will probably ask you to open or save the file, instead of simply displaying it. This is due to the way github handles the files, and I apologize for the inconvenience.  I will be updating these images soon, as they need to be rendered with more samples.  Also I hope to render a globally shaded version as well, but that may not happen soon.

I plan on adding several of the features the book describes in its exercises, as well as several features of my own.

I’m thinking I may post some of what I learned in doing this project here. To facilitate this I am planning to add some other features. I plan on using the project itself to render any figures that I need to help me describe what is happening.

To make that easier, I need a primitive for visualizing a vector, and some way to render text. The vector visualization should be easy, but the text is a different matter entirely, I see a few ways of doing it, but I don’t know which way I should do.

My two options are rendering the text on a texture and drawing a quad with that texture, or actually rendering text as 3D characters in 3D space, the first option is the easiest, the second is probably better in the long run, and I may do both. For now, I need to implement something to get working for my next post here.

Tiled map generation now working

Working on my RTS game, and I now have a working tile based map.  It has working random generation, and a working A* pathfinder. Also has a working minimap.

The previous images show the minimap and map view zoomed at two different sizes.

The following image shows the visualization of the A* algorithm in action. for debug purposes each iteration of the algorithm is slowed down and the open set and closed set visualized as red and cyan tiles. The current node is depicted as the white tile.  The red tile not attached to the blob is the goal node. The start node was the highest point inside the gray rock formation.

 The following is the final path from the above visualized run.
 

 The following is several paths generated on the same map.  The two in the middle around the center rock position are so different because the path-finder was set to require 3 tile clearance for the top path, and therefore could not go through the gap the other path did. 

Map Generation

Working on a RTS-like/City Sim-like game and working on getting a large map for it. My plan is that the game be tile based and completely procedurally generated. Working with some Simplex Noise, I’ve generated what I hope will be a the starting point of my levels, but I need to work on the scale. The generated images here have no scale, but they appear as though they would be in the scale of several (possibly hundred) square miles or km, which is impractical.  The goal is to have a tile equal about half a meter or 1.6 feet, about the width of a person.  That makes path finding and collision avoidance/detection easier.  My plan is also to make one pixel in the map correspond to one tile, this poses the problem that the below images would be 200 meters for most, the tiled ones were generated as 400×400 px, and the largest image would still only be half a km, at 1000×1000 px.  At the moment my noise is normalized to always contain [0,1] so it always looks similar, scale changes do make it look better, but even I try to get it to generated square at a much more detailed scale it still has large patches of ‘desert’ near water because of the way the noise is mapped to land, still thinking of a way to deal with this. I am thinking generating the noise for a larger area and using that to normalize a smaller actually used area.

This one is to show the way the tiles will hopefully look.

UPDATE: I’ve been tinkering and I got the following image for different levels of zoom, the left-most image is the landscape I’m thinking will be a mile or km width/height.  each set of images is scaled by two.

Some noise tests

Not quite halfway done with that paper I mentioned earlier but decided a distraction was in order.

This is a project I’ve been toying with on and of for a long time.  I started toying with Perlin Noise because I hope to create a fully procedural game.  The noise would be useful for textures mainly but also landscapes and other various things.  So I made this program to play with how the noise behaves with different inputs. While doing so I found out  Simplex Noise is less expensive to compute so that is what this currently uses.

Feel free to play around with it, ask questions, I don’t care if you use it to make textures for yourself but I’d like recognition if you do. I’m going to open this to public comments so questions and comments can be asked and posted.

The in program help should be useful, but it doesn’t cover the gradient editor (far right in first screenshot). This is mainly because I got tired of writing help. If I get enough requests I’ll fix it.

My planned next evolution is to figure out how to make it generate tile-able noise as well as continuous noise.

This is a screenshot of all the pieces
This is a screenshot that has a more useful image, picture it as a height map of an environment where the blue would be water and white is top of mountains

These are other images produced by the program

This could be a heat map of some kind, or a region map possibly red being desert green could be forest, blue water, and yellow deserted islands
This is another like the above, but shows a more complicated landscape

You can download the stand alone .jar file here: NoiseTest.jar

Perhaps in a few days I’ll post some details on how this works, but it’s likely to take a while.