Results 1 to 10 of 27

Thread: ideas for TAtmosphere

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    btw is your thermodynamic simulation based on 'cellular automata'? just read that both minecraft and dwarf fortress use them to simulate fluids
    The field of cellular automata was almost certainly inspired by the very concept of a thermodynamic simulation being as the latter preceded the former by a century or two. They're thinking 'game of life' (probably the first and best known example of 'cellular automata' but the man who wrote game of life was thinking 'thermodynamics with more complex rules'.

    But it's how to optimize that simulation, restrain it to work with only the world.

    It's easy, start with a blank world, all blocks are of the type 'outer-space'. when you generate the landscape, that will leave you with outer-space blocks and filled blocks.

    The real question is about how you generate caves, how that interacts with terrain generation, really you want it as a seperate step so you can control this oxygen problem.

    you want both dynamic and fixed oxygen block types.

    what about caves that meet outer space?

    For every time a 'cave growing' algorithm turns a rock into empty-space, and finds it meets outer-space, you then 'grow' out from all of these blocks (with some more A* walking) for a set radius (say 30 blocks) that provides a smooth transition from no oxygen to 100% oxygen as you walk into the cave. The oxygen simulation *would not run* for these blocks, they would have a special property of 'fixed' oxygen level, so are not governed by the oxygen sim but can still be 'felt' by the player.

    Why not empty the whole cave, cave system of oxygen? That would be far too much simulation, A* could walk down miles of caves etc the game would crawl to a stop.

    --

    Now for dynamic oxygen.

    If a block being processed with oxygen comes across an outer-space block, the simulation doesn't move past it (like a filled rock block). the oxygen is 'lost to outer space'.

    If the oxygen simulation meets a 100% oxygen block, again, the simulation stops. this prevents the simulation calculating anything for situation where you dig from one cave to another that are both pressurised.

    The simulation must run but it will stop at 'outer-space' blocks and leak oxygen, it will stop at 100% oxygen blocks (either simulated or 'fixed') because there's no change and it'll stop at any 100% oxygen blocks (fixed or dynamic)

    If you do all of this it leaves you with one last problem.

    For dynamic rooms that the player has dug, how do you override the 'fixed' oxygen levels at things like cave/outside transitions, WITHOUT then causing the problem of A* walking thru the cave system and breaking the simulation. you'd want a more realistic oxygen sim rather than the fixed, smooth transition put in place by the generator.

    Well it's already partly solved, as you dug into the exposed cave section with your dynamic oxygen supply at your back, the A* will flood out into the cave. it'll flood into outer space and decrease the levels, it'll turn all of the 'fixed' <0 oxygen, smooth transition blocks it meets into dynamic blocks, and as soon as it meets the 100% oxygen, *fixed* blocks layed down during generation, it stops.

    This means that outerspace will still suck from your Oxygen supply in the room you came from (via the dynamic thermodynamic simulation) and that the old fixed blocks will be made dynamic in the process, but won't walk all the way into the cave system, due to the fixed, 100% oxygen blocks.

    Sorry about being confusing, hope you understand what I mean.
    Last edited by phibermon; 04-07-2013 at 04:14 PM.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

Bookmarks

Posting Permissions

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