A very basic attenuation cone is calculated by using the dot product of the light position and each vertex in a vertex shader. Then, just blend two textures based off that mask!
La Grue Cendrée (source on github) is a pixel art map generator and a work in progress.
Help!
I am not a designer or graphical artist of any kind, so if any one has any idea as to how to draw cities, villages or castles or other landmarks, I’m open to suggestions. Also it would be nice if these could be generated as well instead as just drawn and pasted on the map.
How it works
The terrain (shapes of islands and ocean) is generated first. Each cell (above image is 400×200) has an integer value, positive meaning island and negative meaning ocean. Then comes in the MAGIC
variable, equal to 2*sqrt(HEIGHT+WIDTH)
(because it seems to work this way). In the beginning there are MAGIC
cells set at a value of MAGIC
, the rest at 0, and the picture evolves over MAGIC
frames. Basically, at each frame each cell can do one of three things:
(Edit: exchanging also changes the values of the current and exchanged cells, and terrain evolves this way.)
Then features are added:
Future changes
Programming
Its written in Go without any external libraries.
Conclusion
Thank you very much for viewing, upvoting, reading, etc. If you have any question, suggestion of feature or colors or anything, please do leave a comment!
Edit2: typo
I recommend the works of G.A. Henty as a corpus for this sort of thing, he was a prolific 19th century author who wrote the same sort of story over and over and over again (he wrote something like a hundred books). I think each of the works is something like 50,000 words. Unfortunately I don't think many of his works are online anywhere yet, Project Gutenberg has a few of them though.
I tried my hand at this once awhile back. I didn't know about Markov Chains, I just tried grabbing words and then creating a list of words that could possibly come after those words, then generating a random string. I got pretty poor results:
> From some general strength, thick assault notification their serfs flames impatience sent leaders, artillery, rise founder.
-
>quality; nets, "Organized laugh attitude, sub-officers effects exceptional edge tale turn," stones these rapacity, abated.
-
>"Mercia, Faster amusement marks javelins, as expectations coracles forest fingers" Sir Mounting, monks; Joshua, limbs, roams.
-
>CHAPTER extended ups interior gentler mistress, preparations, tales hills exceptions articles, goodwill income possible; "Ay," encampment.
-
>It Hannibal, distance; "I'm "Never music--flute, "my Next "Tell proud intentions, ours daylight revealed "Give kinsfolk.
The program had no awareness of whether a word was a noun, verb, adjective, etc, so, my thinking was that I should make it aware of that, then have it analyze the sentence structures that Henty used, then have it grab a random structure and fill it in with valid words. Unfortunately my understanding of English grammar wasn't up to the task.
https://s3.amazonaws.com/darren/Cavern.java
I think that should be visible. It's just java source, so open it with notepad or vi or whatever if the content type is screwed.
Reviewing the code, apparently I figured out which room covered each point, then picked a random point in each of two random rooms (with the option of always hooking the smallest together first?) then just ran along the X and along the Y in straight lines until I ran into the two rooms.
You can also see that was a 3x3 block of caverns, if you notice there's blanks running vertically and horizontally. It keeps the caves from sprawling over the entire map.
I thought this lecture from Unity3D's conference was a lot of fun: http://unity3d.com/unite/archive/2014
It wasn't a very clever solution. I've seen much better. You can also work it by recursively subdividing the space until each block is small enough to make one cavern, then connecting the caves along the subdivisions, if you follow.
All much more sophisticated than I came up with myself way back then.
Filter Forge is one of my favorite programs ever, super-good for procedural textures or just dicking around in a node-based interface. Shameless advertising of my own filters
For my gymnasium exam project I decided to make a simple(ish) world generator. I wanted it to be sphere-like but because of time pressure it only makes a part of the area of the world now (the hexagonal area showed in the screenshots).
The algorithm isn't much more than a simple diamond-square algorithm, but it splits the hexagon in triangles of the length ~~n^2+1~~ n^2 +1 instead of squares.
It's pretty easy to "prepare" the world by presetting some of the initial triangle corners, in order to make it look like a canyon, islands or just pure randomness.
It's not as fancy as much of the stuff I see around here, but it was fun to build and I wanted to share :D
(never got to finish the game, had too many ideas and not enough knowledge with c++)
Edit: graphics
For 3D and javascript you cannot beat threejs, but for more 2d and data visualization processing is likely the best, it natively uses java, but has bindings for javascript and python. Also processing has a 3D renderer but I highly recommend threejs if that's the route you wanna take.
Pick up processing at https://processing.org/ its a super easy to use interface for creative coding then look at http://natureofcode.com/ Its a textbook that teaches you the basics of procgen type stuff. Its super intuitive and easy to follow.
Thanks! It's a mess at the moment, since I've been tweaking everything while trying different methods, but yeah you can find it here. Be warned, its not pretty nor efficient.
Its a LUA scripting language that I used in the CraftStudio engine. The map object is basically a 3d grid of blocks, but I use it for 2d in this case with an ortho cam.
I had fun playing around in this looking at the generated islands. Here are some neat islands that I captured in an album. https://imgur.com/a/qUCSh
This was neat for a two week project, however you may capture more attention calling this a procedural island demo with a flight avatar for viewing. By calling it a Flight Sim first people might be judging it on the flight controls rather than show casing your island generation.
I liked that you not only did islands but a shallow depth of the ocean around the islands and that it wasn't uniform. Also there didn't seem to be any repeating patterns over and over, I went through a fair amount of iterations.
Since I'm not aware of your skill level or goal I figured I would offer some encouraging next steps. Next try doing a lot more than four islands, perhaps generate a new island after so much distance. Add a different color for mountains over a varying range for ice and sand color for low areas reaching water for beaches. Each week try to think of something neat to add to your generation and remember to keep your code nice and packed for reuse in a later game.
Good job, keep having fun with it and sharing.
Everything you need is there. It took at most 10 minutes to adapt his snippets and spit this out.
Code for "simple" version (all derivs from same noise instead of inputs), https://hastebin.com/hemofozaxu.go
Awesome! I tried to mix a few of the images with images of medieval maps using the deep learning dreamscope app https://dreamscopeapp.com They look quite nice, here are the results: http://imgur.com/a/ZeDFY
In order to read values out from a fragment you can just output the texture to an array of pixels, I'm not sure if Three supports that or not, you may have to do a little bit of webgl voodoo to make it work. check out these examples for some inspiration http://threejs.org/examples/?q=gpgpu
You don't need to use a compute shader. What you wanna do is create an array then call gl.readPixels() and it'll fill your array with the values from your bound texture containing the output of the fragment shader. it is described here https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/readPixels
But this is fairly advanced and might involve a little hackery. You would definitely have to stray from Three.js to generate your heightmap. So this may not be an option for you.
As far as the look of your output. In that post they return 1-distance like in my code above, that will give you sharp mountain shapes rather than blobs. They also layer the noise with increasing frequencies and lowered amplitudes. which makes it seem highly detailed and breaks up the smooth faces. I think that is what you are looking for.
If you choose not to use the gpu to generate your values you still have another decent optimization. The slowest part of the algorithm is the fact that you have to compute a hash value nine times per pixel, one way to speed that up is to use an array of random values then write a much simpler hashing function which simply picks a value from that array. it could be as simple as array[(x+y)%array.size].
Nice post, but it's sorely missing examples! How does it turn out?
For generating rhyming words, I stole an idea from @cmyr, who runs a few amusing Twitter accounts (one finds tweets that are anagrams, another composes haikus, etc.): He used the espeak voice synthesizer to generate a list of phonemes from a word.
Here's my code, which is not a complete example for finding rhyming words, but invokes espeak to convert Greek words to phonemes and caches them for speed.
I don't think starting with terrain is necessary.
There are two parts to the problem of procedural generation of pretty much anything: some kind of conceptual model of the type of thing you want to generate (terrain, characters, civilisations), and showing the generated results in a player-visible way (in your case, producing readable text).
You might learn some general lessons by looking at level generation, but neither the conceptual models nor the presentation are directly applicable to what you want.
Concept models are so specific to what you're doing that it's hard to point you towards resources, but for ideas on text generation, you could look at text generation tools like http://tracery.io/ or play with text-adventure systems like http://inform7.com
Thanks! We used G3D (http://g3d.sourceforge.net) to render and build the scene. Everything was based on a stack based grammar which involved pushing primitives we built in Blender out from cube faces. The city was laid out using Voroni Diagrams.
It's done with the Processing framework so you can either use the Java or the Javascript implementation. They have their own Processing IDE for the Java version, I think you can use it for writing Javascript code as well.
Alternatively, you can use the p5js implementation in your IDE of choice.
One of the big problems that Martin O'Leary talked about in his map generation posting was the difficulty of placing labels. One solution to that problem is called "force layout". The basic idea is that you treat the labels and other map elements as objects with forces acting on them, and let them move around until they find a "comfortable" spot. For example, you might make labels move away from rivers (so they don't cover them up). It turns out that D3js (which Martin's map generator uses) has a force layout engine built-in. Unfortunately, in the latest version it doesn't have the kind of collision force most useful for laying out labels. So I had to write that new force, but the result works pretty well. The attached album shows the layout process in more detail. (I think I made the images a bit too large, so you might have to shrink the size in your browser for best viewing.)
Added customisable Guns to my Procedural Tower Defense game, parts that you can collect throughout the runs and assemble!
If anyone wants to check it out, it's on Play Store: https://play.google.com/store/apps/details?id=com.Blingames.ProceduralTD
P.S. It's my Cake Day! Also feedback appreciated :D
I do know of this book.
https://www.amazon.com/Procedural-Generation-Design-Tanya-Short/dp/1498799191
But I don't know how it is. I've actually been meaning to ask about it here one of these days. It has the great Tarn Adams of Dwarf Fortress name on it but I don't know how much of him is actually in it. And I honestly don't put much trust in amazon reviews anymore.
I made a game like this for android many years ago. It's called Source
My game doesn't have an end tile but the idea will be the same. You have to work backwards so you generate a completed state and then randomly turn all the tiles to create the starting state.
The algorithms you want to lookup are maze generation. There are many different types depending on whether you want deadends, loops, end tiles, bridges, as well as particular layouts.
Also a good tip is to forget about the notion of tiles until you finish generating the maze. I store nodes with edges connecting to neighbours which will be modified throughout the generation phase, because this phase doesn't need to care about rotation but it does need to keep the connections consistent between two neighbours. Then afterwards I convert the nodes into tile objects which have their own neighbour state and rotation which is used for the game playing phase
Yes, but that gets complicated if the landscape is chunked, as you always need to access surrounding chunks, which might or might not exist right now. If the landscape is fully available, absolutely!
See for example the Dwarf Fortress world generation for what one can do with such stuff. I do believe that there was an in depth article about the world generation of Dwarf Fortress, but I can't find it, so I could be imagining that one.
Wow, thanks for all the help on this request! :-)
Here is a link to the file I am working with:
http://www.filedropper.com/namefile
Let me know if the link doesn't work properly. I plan on adding more names to the list in the future. I actually compiled this out of three separate files I found online that were originally separated by male, female, and last names.
Could you use simplex, sharpen it and then use a threshold function to "cut off" the parts between that you don't care about? (like this https://codepen.io/vantreeseba/pen/RyrEXG)
The other thing you could do is use something like poisson disc sampling, but I think that would be too well distributed for what you are wanting to do, but like this https://codepen.io/vantreeseba/pen/XqmPmP
That's such an awesome tool! Thanks for sharing.
I used WolframAlpha to test my equations but it doesn't seem to be nowhere as good as Desmos.
One thing to remember is that most complex shapes can be seen as combination of other basic shapes, and it helps to know some functions by name, like guassians, sigmoids, etc. And use some basic rules of thumb:
multiply the input by a constant to "thin" the shape: n1 = x*w (edit: use negative constant to mirror shape)
add a constant to the result to offset the shape in the x axis: n2 = n1 + l
apply your shape function (sigmoid, gauss, etc): n3 = sig(n2)
multiply the output by a constant to control height: n4 = n3*h (edit: make the constant negative to invert shape)
add a constant to offset in the y axis: n5 = n4 + k
repeat and add together
Just as a quick example, you could describe the shape of the White Cliffs of Dover as a combination of two sigmoids, both offset to the right s1 = sig(x - offset) but the second one reversed s2 = sig(-x - offset). Then add the two like this (s2 - s1). if you want to reduce the wideness of the cliff, just multiply x by a constant w. https://www.desmos.com/calculator/mbseosg2ei
I made something that reduces a corpus to English-ish, then samples randomly from those words. Here's the rough procedure by which it generates words:
The python code is temporarily hosted here: http://codepad.org/bjPhYk5q
Here's examples of words that it generates from the text of the US Constitution:
Here's examples of words that it generates from the signature names of the US Constitution:
If I were using this for something other than a hobby I'd tack on some postprocessing to ensure it doesn't generate streams of consonants of length > 3, like 'ttngbl' and 'bbss.'
Edit:
It's probably easier if you share your names with me through Pastebin and then I'll produce derivative names and send those names back to you through another Pastebin. Of course something like 50% of the names will be gibberish, but you can sieve through them. No special characters, please!
Edit 2: Here's a list of 1000 names generated from the Lord of the Rings corpus
I made this in processing. It is very good to do this visual kind of stuff. About the squares what i did was see what was the latitude and longitude of the pixel and see if it was in a range of the latitude and longitude values that i wanted to make lines. I dont't actually know how to make a 1 pixel thick line of only the exact pixel where the imaginary line for the 30° latitude line would be for example. If someone has any idea of an algorithm for that i would appreciate it.
Got some pretty interesting results here: https://codepen.io/anon/pen/dzRBpV?editors=0010
There's probably a couple of bugs (I don't think I'm doing the whole turning probability thing right), and I couldn't make it look like it run very fast on anything more than 100*100, but it looks all right I guess.
You could put a link in the project description (where now it says "3D Procedural Game Engine Using OpenGL") and there's github pages although if there's already a blog, maybe that's sufficient.
Space Colonization is a really cool algorithm, but has its limitations.
My guess is that Treemagik and Forester use a specialized L-System. Definitely a ton of work to create convincing procedural generations of various trees.
You should also check out SpeedTree.
Outsourcing PCG directly would be even riskier, however someone like a PCG consultant/contracter would be seen as less risky but still a bit dangerous. There's quite inconsistent use of outsourcing in the games industry at the AAA end QA might be partially outsourced by the publisher but art is sparingly outsourced. At the indie end it's a lot more flexible and open to the idea of outsourcing but there's less money to pay for it.
I think middleware would be an excellent way to get more PCG into games. Speedtree is really quite commonly used for example. Inverse Procedural Generation (which still uses PCG techniques really) might also be a lot easier to sell to risk averse devs and artists or designers with high standards.
Generalised PCG might be tough to pull off though. I could imagine a library with lots of different facilities you could plug together but it would be orders of magnitude harder to actually develop than a specialised PCG tool like Speedtree.
Neat! Looking at the photo there, perhaps metaballs might be worth a look into, along with Material Maker maybe?
Do keep us updated!
The maths people at wolfram have something called wolfram tones:
Quite a few controls; but I think it's quite repetitive.
http://tones.wolfram.com/generate/GtAHW1tWAVbu9XpM1jdOvzoXqaKu8jXS0Jjj6IkE6jsXsi
You could check out Gaussian Mixture Models they sound similar to your "adding together a bunch of gaussian distributions". But I'm not sure what exactly you are looking for. If you are looking for smooth Gaussian distributions you can always use the general form of its probability density function to generate points as you desire.
Good procedurally generated music is good. All else is awful.
I think we're at a point where PG can make for great riffing within a framework that is more explicitly designed by a person. Frankly, the vast majority of what passes for pop music is mostly procedurally generated, there's just a producer guiding the process and applying effects and transitions to give it some flavor.
Brian Eno developed a concept of Generative Music (http://en.wikipedia.org/wiki/Generative_music) and had worked with some developers to create software around it. It's interesting work, but it hasn't had quite the impact I think people expected.
I've done some limited work with using computer systems to perform live music, stuff like ChucK (http://chuck.cs.princeton.edu/) or digital drum machine programs of my own design. There's a lot to be said for the concept that it's just another instrument.
So what's the reason for the research? Why not? It's fun. It helps us understand the world around us. If you can write an algorithm that replicates a certain component of music, then you're probably very close to understanding why the music works. That doesn't mean you're trying to kill music or musicians, just peal back the covers and see how it all ticks.
Agree about writing most of it on your own.
If you're looking for a Perlin noise implementation you can use, I recommend grabbing code from Cinder ( http://libcinder.org/docs/v0.8.5/classcinder_1_1_perlin.html ). For my project I initially looked at using libnoise, but that one is LGPL which didn't work for me.
I too like using javascript (or even better typescript).
The best thing about this, is that you can just throw it onto a webpage and show everybody and let them experiment with it.
No downloads. Instead direct results.
And if you want to make it interactive some game library like http://phaser.io and you can have tilemaps and stuff like that running pretty quickly.
I'm using Love2d, which is based on Lua, AKA the programming language so ridiculously easy a 5-year-old could learn in a month.
Every platform uses a separate texture (and every tree uses a separate texture right now, but they could be bound to platforms as well in theory). The textures are only drawn when the platform is visible (i.e. not off-screen). Using a single giant texture would be too slow.
Each texture is a canvas - when the level starts, the tree objects are generated, but instead of being drawn in real-time every frame, they get drawn once on a canvas and then the canvas is drawn every frame (if the tree is visible, i.e. the x/y coordinates are within the screen boundaries). Drawing the canvas isn't any different from drawing a sprite, the only difference is that the canvas pattern is "drawn" by code before the level starts rather than loaded as an asset.
You can also make up words using a Markov chain.
Ex: https://golang.org/doc/codewalk/markov/
Except you'd do it for characters (or syllables) instead of whole words.
Edit: There's also a recent post on this from our sub. http://www.reddit.com/r/proceduralgeneration/comments/2q6las/procedurally_generated_englishlike_words/
Hiya all, I posted this just to get some feedback on a small Tower Defense game I made and put on Playstore for testing it out. Like I said it's just a small project to learn something new, still it would be something to get any kind of feedback along the way so if anyone wants to try it, the link is https://play.google.com/store/apps/details?id=com.Blingames.ProceduralTD
If anyone has any questions I am happy to answer :D
Have you used “Islamic Geometric Patterns” by Jay Bonner? (https://www.amazon.com/dp/1441902163) I’ve found it excellent reference for these sorts of designs, and wonder how it compares to the one you mention.
Hey all,
I had some spare time recently and so decided to make a mobile game using procedural generation. So I started hacking away at game ideas in Unity and ended up zoning in on using flat-shaded polygons as an art style and gameplay mechanic, since that was really quick to implement and gave a lot of interesting possibilities.
The end result is a game where you have to match incoming shapes to survive, and collect colour schemes as you progress. I hope you find it fun:
As usual I'm more than happy to discuss the approaches used to generate the levels and geometry so they're always playable (and learnable by players - an important element of the design).
Cheers, Michael (Starfleet Commander)
Procedural Bus seat upholstery/bowling alley carpet
THANK YOU! <3
This is perfect. If you can, please post this on itch.io with the 'procedural generation' tag, so other creators could also benefit from this tool and have an opportunity to donate to you for it.
Thank you.
Wilderless is available on google play here https://play.google.com/store/apps/details?id=com.Protopop.Wilderless&hl=en_CA&gl=US Its version 1.6 but I am submitting 1.7 with the road option this weekend.
I am also submitting Wilderless Classic to the google play store. Wilderless Classic is a free version based on the original earlier version of Wilderless. Hopefully it will be accepted soon.
Also, there's a book about the subject:
https://www.amazon.com/Procedural-Storytelling-Design-Tanya-Short/dp/1138595314
The drunk wander technique is lead by the player, instead of having the blocks already carved out.
The game is called Evergreen Isle for Android
https://play.google.com/store/apps/details?id=com.GoldenTurnipGamesLTD.EvergreenIsle
Entirely made by me to allow anyone to generate a good looking world. I work on this from time to time to add more features and further optimization (It is heavily optimized already)
You can obtain the shader for free at: https://gumroad.com/l/terramux
I originally made this to help friends who make Warhammer 40k fan-lore to easily create artworks of their custom planets.
Look up Facade from 2003 (Michael Mateas and Andrew Stern). They went on to found playabl.ai
Some time ago, I made a Procedural Asset Creator, a tool that allows to create procedural asset generators inside the Unreal Engine 4.
The "Simple" version is similar, but designed for simple assets (e.g. low poly style), relying on easy vertex coloring instead of textures.
Generated assets can be exported as regular .fbx meshes to any other app.
The core system uses the UE Procedural Mesh component. More info:
I learned about different mesh creation techniques & triangulation algorithms (at first Delaunay, then switched to EarClip with holes), then implemented my own shape-based solution for along-spline mesh generation.
I've used UE 'Plane' structures and Line-Plane intersections with spline-oriented lines to avoid the gimbal lock problem with UE Rotators. This fixed the infamous mesh twisting problem along various spline shapes.
At some point I wanted to create a sword generator for my hobby project... Then I started creating it, but soon realized that maybe it's worth to create a universal asset creator, so I can extend it and create not only swords, but other assets as well.
That's when I started shaping it as the in-editor asset creator tool.
Feel free to ask if you have any questions.
This was done entirely in Houdini using height fields. Basically applying some noise, masking areas and adding different noise, heightfield erode sim to erode the heightfield and provides masks. You then use those masks in a compositing network to create the texture. This tutorial will tell you everything you need tk knowa-z terrain handbook.
God is a Cube is my actual personal project, which I worked on for several years (more than 1 year fulltime).
I worked 3 years on the figurines project (Prodigy), mostly on the communication part, with a big business part (what to sell and at which price). I researched hundreds of Kickstarters, write the original page structure and entirely designed the whole rewards system. We ended up with 12% of backers giving at least $500.
>If I do release it, after the initial kickstarter, as with my other projects, it will be free.
1- Which means you will need a fulltime job to pay the bills, so you will never spend as many time on the project than if it was your main source of income. From a consumer point of view, that's bad.
2- Also, nobody pays for a game which will be available later for free.
It's kind of strange, but considering those 2 points, projects get more crowdfunding support by being sold than by being free.
Alternatively, you have the option to make the game for free and set up a donation system ($ per month) on Patreon, like Dwarf Fortress author did.
This sample is using poisson disc sampling per chunk now
https://codepen.io/vantreeseba/pen/XqmPmP?editors=0010
As long as you feed it the same seed, you can resample and it gives the same output because the seed is modified by the xy position as a hash. (You can also just directly use the xy position as the hash, but this allows you to modify the sampling per "world gen seed" as well).
So I'll assume you have Blender (because why not, it's free and it's amazing software :D) delete everything, add circle, go to edit mode, extruded the circle vertices and merge them to the center of the object, you have a disk now. Go to the modifiers tab & add displacement then link the displacement to texturing of your choice to add these bumps. In my case I let Blender's procedural generation do its work, I added a bunch of perlin noise and multifractal noise to get the details. And to top it off, one important step is to add a wireframe modifier in the chain to get that effect. For lighting I used a Sun lamp. (rendered in Cycles)
Awesome, thank you!
I always find it helpful to throw these kinds of things into a graphing calculator to see what's going on.
I was wondering how someone goes about discovering these equations for certain shapes? I tend to poke my noise generator with random equations, just to see what happens, but that seems like a haphazard, hit-or-miss way to go about things.
Another way of quickly seeing results is to make a .net app in visual studio. Here's a short program that draws dragon fractals (you have to manually make Form1 1280x720 in the properties or change that in the code).
Thanks. Here's something else I did a few years back (that I was more pleased with how it sounded) inspired by the works of Casey Reas (one of the guys behind processing (https://processing.org/)) - https://youtu.be/kmo-KxM-wSw
Im using processing with java ( https://processing.org/ ). I created the enviroment that is needed to run the elementery cellular automata rule 30 made by stephan wolfram. But i created a random ruleset everytime i ran the code, suddenly i stumbled upon this ruleset.
The get() method returns the color of a pixel at the given x, y location. I once did something very similar to this project, except I added bristles to the paint brush to make it look textured.
A decently easy programming language for graphics is Processing, which is widely used for procedural art. The language is based on Java which is similar to C. You'll find lots of examples of using Perlin noise.
Here's a video tutorial: https://www.youtube.com/watch?v=Qf4dIN99e2w
In my experience a gaming engine or trying to do it in C++ is way overkill. Prototype it in Processing first and then if you really want it in a game or something you can port it pretty easily. If you just want to print out your designs or save them as screenshots or whatever, you don't need to learn all that extra stuff.
As u/thomar points out, Red Blob Games writing on hexagonal grids is the best resource. There's a link to the guide at the top of the link below.
When the sampler is initiated I give it size, which is the size of the chunk.
When I ask it to generate, I pass in the X,Y position of the chunk to generate the samples for, and internally it creates a hash from the X,Y position.
It uses that hash to seed the RNG for the sampler run for the cell. This allows you to have reproduceable samples for the cell, because the seed is based on the cells X,Y position.
This can create overlaps at the edges of the cells, which is why I only allow points that are "radius" away from the edge of the sampler as well as each other.
Each of the points are generated around (0,0) and then I just add the offset of the cells X,Y to them to get the final world position.
If you look at the code in my codepen https://codepen.io/vantreeseba/pen/EvYyNO?editors=0010
you should be able to see where I seed the RNG with a hash on line 32.
outside of that, it's just the random placement/rejection from poisson disc sampling + rejection if they are too near (radius) the edge of the cell.
The subversion city generator you linked to is pretty much the gold standard - unfortunately it was abandoned and no one knows HOW they pulled that off.
Most city generators out there either use a straight grid (think Manhattan) or some sort of an L-systems derivative (google "Parish and Muller").
The only generator out there that has curved roads is Citybound (click on github logo at the top to see the repo).
I have my own Godot implementation that has curved roads, but is definitely less flexible than Citybound's (no hand-editing) and it has other limitations (only one lane wide in each direction, only 3 and 4 way intersections so far).
IMHO the main thing you need to ask yourself is "what do I need the city for"? If you want it for a FPS/TPP/RPG game, you'll need interiors, but you don't really need curved roads as the player will most likely spend majority of time indoors. If you want just some scenery, you will probably be fine with a grid AND buildings that are just premade models, no extruding shapes. If you want a racing game, premade models probably will be fine, too, but you really want curved roads at the minimum, and most likely other things too (banked roads, elevation differences).
Yeah the system they made is really impressive. What they made for procedural animations is really great.
Basically they abstracted the animations so that you could program in "wave your top most limb towards your friend" and then this would be translated to how the arm should move on different creatures. Larger creatures would have the limb move further, the correct one would be selected etc.
In a recent article I read it said they did have to throw the challenge out of the stage to keep it maximally creative. You can make any shape in the editor and they are all equally viable but that means the shape making process ultimately means nothing gameplay wise. This has made the game very popular with creative modellers but the gameplay is very poor.
We're doing something a bit similar and we've got a microbe editor. We're going for a more realistic approach where you need to think in the editor to make a good microbe otherwise it will die a lot.
There is a tutorial floating around for procedural generating a city in Houdini, starting with a voronoi pattern to build the base pattern from, subdiving a grid onto each cell and building the city from that. It was from cmivfx but it looks like the website is no longer. I found the intro to it, it might be worth looking for the rest of the series for some inspiration. https://www.sidefx.com/gallery/houdini-procedural-city-asset/
Your street layout with something to build a larger plan like that would look awesome.
I'm not sure if this would be allowed for your uses, but Houdini is an awesome tool for 3d procedural generation and they have a free apprentice version. There are plenty of tutorials online for terrain generation and the like.
Runtime content generation is very cool, I didn't know it could do that.
My primary concern from watching the video and it's sort of backed up in Sceelix's documentation is that it's node workflow seems to be missing a lot of information. It's to be expected for an early access product. In Houdini I get moderately clear instructions on how each node works, and if I get stuck I can fall back to their excellent documentation.
A lot of this is subjective (except the price, you cannot beat Sceelix's price for sure) and depending on your resources and expectations Sceelix could very well be the one.
I've wanted to create more realistic mountain ranges and river structures without needing to use simulated erosion techniques for a while now. These heightmaps are generated by using Perlin Noise to create paths that converge in interesting ways.
Aerialod by ephtracy: https://ephtracy.github.io/index.html?page=aerialod
Thank you so much for your help! It looks like the library that threejs used in their examples makes the gpgpu stuff a bit easier. I will try messing with that tomorrow.
Anyway I'm getting a little bit off topic, but just for anyone reading, I had an idea to create two heightfield meshes per chunk: One that would be passed to PhysiJS, and the other for actually rendering. The one being passed to PhysiJS has less vertices. The other is a THREE.PlaneBufferGeometry, with lots of vertices for detail. The CPU generates the noise that creates the general, broad shape of the terrain and sets the vertices of the meshes accordingly (or maybe even use the gpgpu stuff for this noise).
This seems to be the best approach, as then I can create a vertex shader that adds high frequency noise for the mesh that needs to be rendered (to create a rough look). Additionally, the physics engine doesn't have to calculate for all those tiny vertices and waste a lot of computational time.
It is flat. https://monosnap.com/file/0KHuut5l8kioWBE8Gn6ciQyzpV9Xj4
To add height, I tried to set mesh vertices heights according to the type of surface (ocean, shore, plane, etc), but noisy transition zones exhist "between" vertices and stay flat. Maybe, shader tesselation + displacement can give proper heights to these zones. Will try when Unity shader graph will support it.
I made over 100 Portraits in the same art style for an tabletop RPG with
https://artbreeder.com/ and all i asked for is an algorithm that can make art assets in black and white in an specific style without neural net training.
and the assets are mountains, cliffs , craters , trees , dunes ,hills and ravines
KumoWorks is a software for cloud scenery creation in a completely innovative way. Through raytracing and artificial intelligence, it can discern the silhouette of the clouds and give them volume and lighting fully automatically. All the user has to do is draw the outline of the clouds, and the program will take care of the coloring and painting.
i see red stuff.
anyway, in OBS go to Settings -> Video and you can change the frame rate.
I've found better success with VSDC video editor's screen capture. http://www.videosoftdev.com/free-video-editor/download
Super easy, just click screen capture and you can drag the borders to the section of the screen you want to capture, and hit record.
BTW I've got a project called Space Wizards which uses noise functions to generate a whole galaxy of planets to explore too. http://steamcommunity.com/sharedfiles/filedetails/?id=833225514
I did not compress this one. But just because it has no semicolons, doesn't mean you can't compress it. I've used the Google Closure Compiler to compress javascript with no semicolons before, and it has worked perfectly.
I have no semicolons, because I am using the standard style of Javascript. The standard style prevents you from littering your code with unnecessary whitespace and newlines, so it makes the code much cleaner and terser.
Regarding libraries, Boost has a really nice polygon library with decent Voronoi functionality: http://www.boost.org/doc/libs/1_55_0b1/libs/polygon/doc/voronoi_main.htm
I haven't used it myself (yet) but for an infinite plane, if you know the point density in advance, it's easy enough to simply use a bounding box with a certain amount of "bleed" padding. Generate the diagram for points you care about, then simply move the bounding box as needed. Disregard anything generated in the bleed area and cache stuff generated in the main area. In this way you can build up an ever-expanding diagram in every direction.
Are you proposing an conjoined effort to write a terrain generation software or library ? Just quick remarks:
Generating infinite terrain is not much harder than generating a rectangular chunk, what you need is a pseudo random function that is capable of generating a value for any point in your grid. There are several, a simple way is to pass the coordinate values through a hashing algorithm. That way you can generate terrain at arbitrary space coordinates. I made this for a small game I'm working on.
Regarding noise generation, someone wrote a very interesting article which generalizes lattice noise beyond Perlin noise, take a look : http://www.codeproject.com/Articles/785084/A-generic-lattice-noise-algorithm-an-evolution-of
It would also be interesting to look into harmonic noise at other ratios, not only powers of two. Maybe try the ratios found in musical chords :-)
You could try making a simple AI for some games. I found this one very interesting: http://theaigames.com/competitions/ai-block-battle
You can download the starterbot and go from there, testing it out online and competing with others. It is fun to watch your bot climb the leaderboards. I'm "Dookiebot" on there, currently #36 but I was #18.
I don't know why, but when you paste the .pde code from his GitHub repository link on this website and you press 'run', I'm getting the error "Error! Error was: SyntaxError: Unexpected token 'in'". I get the same error when I convert it to JS and run it locally. Can anybody help me here?
http://processingjs.org/tools/processing-helper.html
I'm thinking of porting Simplectic Noise to C++. Do you have a specific place where you would want various ports to be stored?
It would be great if there was a complete list somewhere of all the ports, like json.org has at the bottom of their page!
Yep, I already downloaded http://opengameart.org/content/hexagon-tiles-93x - they're very neat. I just wish they were "horizontal" ...
For the ocean, I had experimented around a bit and felt that it looked nicer with a mostly homogenous blue (the land sticks out more), but I'll probably change that when I get to revamping the display (probably with tiles, or fancier CSS). For now I'm bogged down in optimization...
Hello all!
This is what I was eventually able to make after a month of struggling to find time to work on it.
From the beginning I wanted to work on making a garden more than making a plant (I've done some work on that already).
Since I didn't have much time (I'm posting this right before the deadline, and I've been working on it all of tonight :P), I've made a simple walled garden with a number of small, randomly colored flowers. It's not amazing, but considering I had to build the entire movement/terrain system myself I'm pretty happy with it.
It's coded in processing, which is not really meant for games, so movement is WASD and arrow keys to look around. Crouch and Shift are the standard, and click generates new plants.
I've put it up on openprocessing here, but I have doubts that that will run online, you may need to download and run it yourself.
Features:
-Procedurally generated simple flowers -Day/night cycle -Lovely looking walls -Ability to move around -Doesn't crash? (I'm just reaching for things now...)
I'll try to get some images uploaded.
Lovely write-up, very detailed and easy to follow. This is the kinda stuff we need more of, if you ask me.
Side note: If you don't know about it already and you work with Löve, then check out Cupid. It's a small extension that adds a developer console and better crash handling. Makes debugging much less painful.
Currently no longer supported, but it's still fully functional (it uses a few deprecated functions that can easily be changed in the source code, so it gives warnings, but it works fine).
I never leave home without it.
I really like the aesthetic of this, well done!
If I'm reading this correctly, it sorts the pixels vertically, but preserves their horizontal coordinate, right? So the pixels are sorted "inside their own columns".
> (messy) code
Here're a couple recomendations to make it a bit less messy:
index
and x
) to represent the same quantity. Remove index
and leave only x
.while x < w
by a for loop.table.sort
call. It would end up looking something like this:local function sort_by_luma(a, b)
local a_luma = 0.2126 * a.r + 0.7152 * a.g + 0.0722 * a.b
local b_luma = 0.2126 * a.r + 0.7152 * b.g + 0.0722 * b.b
return a_luma < b_luma
end
...
for x = 0, w - 1 do
table.sort(map[x], sort_by_luma)
end
​
Works great as a wallpaper!
​
I generated this in Godot. I think it looks pretty cool!
​
I'm hoping to create an animated version which shows the iterative creation of the stars
I wrote something on my blog because it was getting too big here.
I can't explain it all but it goes into some detail about how I structure the data used in the simulation and then some techniques I use.
https://medium.com/p/a9471cee7061
The TL;DR
The zone generation process is a series of steps that each do something particular. I didn't do it all at once. I started with just making hills over flat terrain. Then, I would want to add something else and start thinking about how to do that.
Use different random number generators seeded from the same initial values so you can work on different parts without affecting others. All random number generators must be seeded deterministically so you can get the same results each time with the same starting data.
Use lots of functions (I use a ton of Perlin noise).
Spend a lot of time looking at things until you get something that looks good.
When something looks good with hardcoded values, add parameters into your data so you can tweak things for different zones and zone types.
You can download the game for Android: https://play.google.com/store/apps/details?id=com.rtr.rtr
Comet movement controls the fine pitch, frequency cutoff and volume. Switching to another orbit changes the chord.
Which version of this book do you recommend?
Amazon has this page.
The ebook is roughly twice the price, but has a more recent published date of 2014. The cheaper hardcover has double the pages, but a published date of 2002.
Thanks for the suggestion, and assistance.
Thanks! It is called Starfleet Pilot and you can try it from Google Play. I recently uploaded a playable demo.
It is (supposed to be) a scifi arcade-esque shooter, with some slight rougelite-inspired elements.
At its current stage is is quite rough around the edges, but I am slowly trying to sand them (slowly as it is a hobby project and I do not have that much free time).
Let me know what do you think!
Don’t be, it’s not your fault and I’m not talking about you, I’m talking about those who create libraries and using misleading/incorrect names/terms.
There’s s really good book I used when I was developing procedural textures for mentalRay (long time ago): Texturing and Modeling: A Procedural Approach
You can find a lot of information about perlin noise and symplex noise (also created by Perlin) on the net.
I found something interesting. Android Processing IDE (APDE). Here's the link: https://play.google.com/store/apps/details?id=com.calsignlabs.apde So, I ran it in that, but no image output. I've got permissions for read and write external storage. Any ideas as to how to adapt void keyPressed(){ if(key==' '){ img.save("fancy_circles.png"); println("exported image"); To export to a selectable directory, or even a hardcoded output? Like Downloads folder for example.
https://play.google.com/store/apps/details?id=com.CoastOfKobe.CoastOfKobeSmall&hl=en
(Free download, BUT: small buttons demand a very large screen or pen input AND ... no swipe input)
The map in this game is generated by random walks, with multiple seed locations for each terrain type, thus "highly randomized, but preserving many characteristic features of Japanese geography".
When cities on the map reach a sufficient population density, urban mitosis occurs, and 7 new hex tiles are generated procedurally (dynamic/on-the-fly map generation).
Semantically you are right, its not a true "Tilemap". This is one of the reasons why I separate the two words. Even though there are no graphical tiles being used to render the map, I feel like I'm using a similar enough level generation method to warrant the use of the name. My usage of the word "Tile" to convey the idea that levels are built out of square pieces of a constant size is pretty spot on as well. I also feel like the name "Tile Map" is more familiar with people that are into game development than anything I could come up with.
Also, this "Tile Map" is functionally the same as an actual "Tilemap", the only difference being in rendering. Each "Tile" used by the algorithm is merely an arbitrary value that the generator builds levels out of. Some of those "Tile Types" include "Empty", "Corridor", "Room" , "Entrance", "Spawn", "BossRoom", etc. The one and only difference is that the rendering is done using solid colors instead of a tileset because this animation is just a way to preview the data so that I can quickly tweak and improve upon the generation algorithm. Much like I currently do in Unity using prefabs to build 3D levels out of this data, all you would need to do to render a true tilemap using a tileset is to check the Type of each tile to know which base sprite needs to be used for the "Flooring" while the neighbors of each tile in the map to select the right orientation / variation of the "Wall" tile you would want to apply.
Basically, while you may be right that this is not a true "tilemap", I think my usage of the name is warranted considering that the only true difference is the rendering method.
I know your joking but... Speaking of generated books...
thats a good tutorial, I used it to make: https://play.google.com/store/apps/details?id=com.formisk.aliquidcloud.free
also, I liked your results, hope to do something terrainy with it as well in the future