Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Got any procedural content questions?

  1. #1

    Got any procedural content questions?

    Hi All,

    Since I've now managed to crawl out from under my procedurally generated rock to make a few blog posts, such as ( http://www.big-robot.com/2012/07/02/procedural-british-countryside-generation/) I thought it might be time to make an appearance here too!

    Feel free to ask me anything you like about the procedural tech behind what we are doing, I'll try to check in here and answer as much as I can.

    Oh and please point me in the direction of any other procedural related games/tech that you think we should know about.

  2. #2
    Junior Member
    Join Date
    Jul 2012
    Location
    Seattle, WA, USA
    Posts
    1
    I'm a huge procedural content nut, and I can tell from your past and current projects that you are too, so I figured I'll jump on the opportunity you've instigated to pick your brain a bit! I've been closely watching Sir ever since it has been announced, and with every blog post my eyebrow twitches erratically with interest.
    So here goes:
    - To what extent have you used Unitys custom editor functionality to support your procedural development? I've found in my own work that it is very difficult to convey the result of a procedural system. However, it seems possible to make an intuitive interface for procedural content generation that non-procedural-junkies could learn to use fluently. Have you taken any steps to do this, or are the content gateway for implementing new assets into the procedural system?
    - While the content you have posted so far is pretty nice looking and rather stylized, they all seem to have that same drab, overcast weather or deep night lighting. I'm sure that this is typical for the british countryside, but do you have plans to implement a day-night cycle? Since your content is all dynamic and probably doesn't have any baked lighting, it seems like a really cheap way to add more mood to the game.
    - When you're generating your countryside, to what level do you chunk your meshes? It seems that the player has almost constant, full visibility, and I'm curious what sort of steps you've had to take to tackle this problem. Also, are you separating content explicitly by the voronoi cells, or are you doing additional sub-grouping?
    - What sort of integration do you have with the AI in the game and the procedural content? Some of my favorite implementations of procedural content have involved the AI somehow with the generated content. Things seem to take on a much more tangible feel when the NPCs are using the content just as you are. It seems like the design for this game allows for a lot of that, and I'm curious to what extent you've managed it so far?
    - So far what you have made is really pretty, and I'm curious to which direction the development moves in: are you building the game around the effects of the procedural system, or are you building the procedural system to support the game play? I'm sure that, like all projects, this is probably somewhere inbetween, but I'm curious if there are any anecdotes here that are relevant.

    I could go on and on with questions, but I think that will do for now. I look forward to hearing more about this. Keep up the excellent work!!

  3. #3
    - To what extent have you used Unitys custom editor functionality to support your procedural development? I've found in my own work that it is very difficult to convey the result of a procedural system. However, it seems possible to make an intuitive interface for procedural content generation that non-procedural-junkies could learn to use fluently. Have you taken any steps to do this, or are the content gateway for implementing new assets into the procedural system?

    I havent written any editor scripts (for this project at least), all the parameters are made available via the IDE inspector, so the rest of the guys do have to understand some of how the system functions, but I try to group useful variables to gether and name them sensibly, so thtey know what they can and cant change. Occasionally I put in some gui sliders, but now there are too many parameters and too much customisation possible, so we do it via the project structure itself, using prefabs as holders for what you might call genetic information. (parameter sets for different regions etc)

    - While the content you have posted so far is pretty nice looking and rather stylized, they all seem to have that same drab, overcast weather or deep night lighting. I'm sure that this is typical for the british countryside, but do you have plans to implement a day-night cycle? Since your content is all dynamic and probably doesn't have any baked lighting, it seems like a really cheap way to add more mood to the game.

    We had a day/night cycle in teh lodestone engine, and it did look good, but at the moment we are trying to get a really specific mood into the game, and we dont have the time right now to balance all the models,textures etc to work well in a day night cycle. We have talked about it though, so it might still happen.

    - When you're generating your countryside, to what level do you chunk your meshes? It seems that the player has almost constant, full visibility, and I'm curious what sort of steps you've had to take to tackle this problem. Also, are you separating content explicitly by the voronoi cells, or are you doing additional sub-grouping?

    The terrain can be generated at any size (power of 2s) and the only real chunking is where the region cells handle their own visibility, so far we can push this range to quite a distance and it stil performs ok. I try and combine meshes (specifically generated walls,fences,etc) to reduce the drawcalls. We also try to keep model polycounts down so thta we can draw more of them and get a better viewrange. The main issue is generation time, with each inrease in terrain size exponentially increasing the generation time (a 2048 world can take several minutes)

    - What sort of integration do you have with the AI in the game and the procedural content? Some of my favorite implementations of procedural content have involved the AI somehow with the generated content. Things seem to take on a much more tangible feel when the NPCs are using the content just as you are. It seems like the design for this game allows for a lot of that, and I'm curious to what extent you've managed it so far?

    Yes, there are specifi AI features placed with the procedural code, these are things like key navigaiton nodes, guard points, rally points and so on, they are generally invisible to the player though.

    - So far what you have made is really pretty, and I'm curious to which direction the development moves in: are you building the game around the effects of the procedural system, or are you building the procedural system to support the game play? I'm sure that, like all projects, this is probably somewhere inbetween, but I'm curious if there are any anecdotes here that are relevant.

    It often comes down to just what is practical given the resources and time we have. Theres only so much you can do sometimes to get a procedural system to support gameplay, so very occasionally we have to shelve ideas in gameplay that the world cant support (but that happens with any system). Conversely we often get emergent scenarios that arise from the procedural stuff and get incorporated in the gameplay, because they are too fun not to. One example is when we had a system placing lootable objects in the world and occasionally some would get stuck in trees, it was actually quite fun as a player trying to get them down, so we might well leave that in!

  4. #4
    Junior Member
    Join Date
    Jul 2012
    Posts
    1
    Hello,

    This Procedural world generation stuff seems incredibly great for a lot of reasons, but I assume incredibly difficult to do? I have used Unity3d for a while but I am completely lost as to how to do procedural content in it. I have put off even trying to learn it, but am inspired by this project to give it a try. It all seems a bit scary, because I know generally nothing about it. My question is, what Unity classes (I assume Mesh for example) are most important when creating things procedurally? Also as a beginner to this stuff, should I focus on Heightmaps and terrain splatmaps as a starting point?

  5. #5
    Hi CGB,

    Well you can use procedural generation for loads of different things, dungeon crawlers (like diablo etc), simulations like Dwarf Fortress etc, RTS like spore etc.. Dependin gon what sort of game you ant to make you would probably use different methods.

    http://pcg.wikidot.com/

    is a good resource for a whole range of stuff. If you want to start with terrain stuff theres some exmples of how to make a heightmap in the unity site resources

    http://unity3d.com/support/resources...dural-examples

    But to begin with you could probably get some interesting results just instantiating prefabs from models you have already made, and using some random distribution, check my site for some more details such as http://www.nullpointer.co.uk/content/3d-roguelike-test/ (that example jsut instantiates cubes based on the 2d map thats been made).

    You could probably get some funky stuff just by spawning cubes in the sky, raycasting to see where they land and leaving them there, crazy sugar cube world! (Its often just about how you choose to distribute them that makes the difference etc)

  6. #6
    I'm no programmer, just a player who's really into the idea of procedural generation. My question is this: are we going to be able to save and share our islands? I recall playing Worms obsessively when I was young, and on the front of the copy protection code book (remember them? Low-tech solutions are still better...) I wrote the generation code for any particularly interesting levels that came up, and shared them with friends. Is there going to be anything comparable in SYABH?

  7. #7
    Junior Member
    Join Date
    Jul 2012
    Posts
    2
    This is a general question. I love random/procedural generation in games, but I'm a bit confused by it. For instance, in Sir, You Are Being Hunted, I'm guessing I could theoretically play through the game 100 times, and each time the world will be different, and I could keep all of those saved games on my hard drive without taking up too much space. In layman's terms, can you explain how that's possible? If that takes too much time, feel free to ignore me

    There were a couple of things you mentioned in the article that got me really excited, those being: the system is built to be extendable and we plan to include many more regions such as, marshlands, graveyards, bouldered areas, coves, ravines etc. Each region has a rarity value attached to it which dictates how likely that region is to appear in any generated world. Also, when you mention that the content generation can produces unexpected results. I'm quite excited to explore this game. I'm glad that some indie developers don't have the time/resources to create giant static worlds :P Procedural content is much more fun. I guess you miss out on hand-crafting a story that fits the static world, but to me replayability is more important.

    As far as other procedural related games, Malevolence: The Sword of Ahkranox looks pretty cool. Just about everything in that game appears to be procedurally generated, the game world, the quests, the look of the items, and it apparently is generated to infinity.

  8. #8
    Junior Member
    Join Date
    Jul 2012
    Posts
    1
    Howdy! Saw the article and I did have some questions about your methods.

    First, Voronoi is great for generating regions - I use it myself - but it seems a little unsuited to generating country fields, which have a stronger (though by no means absolute) bias towards right angles and being vaguely rectangular. Don't know if it's an issue, especially since it would be unnoticeable "on the ground" in-game, but wondering if you thought about it.

    Did you consider using a Poisson Disk Distribution rather than a disturbed grid? I notice from your screenshot that you have a few small needle-shaped regions, and it could help reduce that. It's more of a pain to implement than plain Voronoi, but not that bad.

    Anyway, the game is looking beautiful and I'm very much looking forward to it. Thanks for opening up this thread, too!

    Oasisbhrnw: Most random number generators on computers need to be given a "seed", or starting value, before you can use them. For games that are different on every playthrough, like most roguelikes, they usually just use the time you start playing the game as the seed. Given a particular seed, the computer can generate the same "random" numbers in the same order every time, so rather than save the whole world, it would just save the seed, use it to generate the same world, and besides that remember any changes you made to the world (like your character position or if you blew something up).

  9. #9
    Quote Originally Posted by polm23 View Post
    Howdy! Saw the article and I did have some questions about your methods.

    First, Voronoi is great for generating regions - I use it myself - but it seems a little unsuited to generating country fields, which have a stronger (though by no means absolute) bias towards right angles and being vaguely rectangular. Don't know if it's an issue, especially since it would be unnoticeable "on the ground" in-game, but wondering if you thought about it.

    Did you consider using a Poisson Disk Distribution rather than a disturbed grid? I notice from your screenshot that you have a few small needle-shaped regions, and it could help reduce that. It's more of a pain to implement than plain Voronoi, but not that bad.

    Anyway, the game is looking beautiful and I'm very much looking forward to it. Thanks for opening up this thread, too!

    Oasisbhrnw: Most random number generators on computers need to be given a "seed", or starting value, before you can use them. For games that are different on every playthrough, like most roguelikes, they usually just use the time you start playing the game as the seed. Given a particular seed, the computer can generate the same "random" numbers in the same order every time, so rather than save the whole world, it would just save the seed, use it to generate the same world, and besides that remember any changes you made to the world (like your character position or if you blew something up).
    Hi Guys,

    Yeah, I can make the cells in voronoi much squarer by making the point distribution more uniform to begin with, but to be honest the majority of the fields are square enough for us at the moment, the wonky ones seem to make it feel more British (ie more cookie than a intensive farming grid). The occasional squashed region is probably due to the fact that certain regions actually clear cells around them and move neighbouring points around. This does mean you can end up with some slivers, again I figure if there arent too many of them and they dont cause too many problems then im goign to leave them in as sometimes they end up making a really unique little find for the player, a really narrow forest or ridge etc, which all adds to the quirkyness.

    The poisson disk thing looks cool though, I'm definitely bookmarking that! I use other scattering/distribution funcitons for placing objects within the cells themselves, so that might be another interesting model to use.

    Oasisbhrnw As for the saving by seed question. As polm23 says you can theoretically save the initial 'seed' number and reuse that number to regenerate the whole world. This is what you get in Minecraft etc and Ive used it before for a number of other projects. However there are 2 main drawbacks to doing it, Firstly you have to 'regenerate' not just 'reload' the world, this means that if it takes say 2 mins to build a large world map by procedural functions, it would take 2 mins everytime you reloaded a map. Thats ok if you can stream the world in or if the world is essentially the whole of the games saved data (as it pretty much is in minecraft), but it also links to the second issue, which is any non static data, such as ai status, loot items, player data etc cant be rebuilt from seed since they are always changing. What we are going to do is likely to be a combination of the two approaches, with some faster stuff being regenerated procedurally and the rest being saved after the world is first built. At that point the save file for the world will act pretty much as any predefined world design would. Except of course we can have as many as we want!, theres no reason you couldnt share those files either (or even just the seeds if ytou were happy to wait the few minutes for them to be regenerated by the engine)

    Randomness in computers is actually never really very random, you can set up a system to give you a infinitely long series of different numbers, but you can get that same system to give you the same ones in the same order every time (by specifying a starting number). If you use the numbers to make your gameworld in the same order every time then the world will also be the same. Its a bit like playing snap with a deck of cards, but being able to remember how they were ordered (after the first shuffle), and then putting them in the same order if you want to play the same game again.

  10. #10
    Junior Member
    Join Date
    Jul 2012
    Posts
    1
    Hi,

    Good read, very interesting. Did you read this blog http://www-cs-students.stanford.edu/...ap-generation/ ?
    This guy was also playing with polygonal map generation and the content is quite interesting

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •