• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
riuthamus

Voxel Based Water

6 posts in this topic

I am coming to this forum now since I have already posted my idea in the design concept and have a general idea of how I want the system to work. Thanks to a few posts there I have come up with an idea for how we can make voxel based water that does not suck like minecraft! I want to troubleshoot these concepts and see if they are even possible before I waste 40+ hours of my coders time doing something that would ultimately be horrible for our game.

[b]Reference post for background information:[/b]
[url="http://www.gamedev.net/topic/628527-voxel-worlds-and-water-what-is-the-best-method/"]http://www.gamedev.net/topic/628527-voxel-worlds-and-water-what-is-the-best-method/[/url]

[b]Goal of this project:[/b]
To create a voxel based water system that will give a decent feel of water simulation while not hogging resources. ( isnt that goal of everything? :( )

So the first thing to understand is what the current mindset is. I think the best option would be to create some way of defining ocean/source blocks from voxel shore water.

[img]http://www.bhslaughter.com/forum/uploads/gallery/album_371/gallery_1_371_22765.jpg[/img]

The dark blue would be your source blocks, and your light blue would be the voxel water filling in until it reaches full. Once the voxel shore water fills up it would become a source block. To save on resources we can limit how much one source block can spawn outward from an open face. This means you would need several source blocks to be able to get a wide area to fill up all the way and make more source blocks.

You might be asking, how do you plan on making this voxel based? The video from the previous topic in the design section showed an example of a cell based water system. If you understand the basics of art you can realize that everything we see is more or less a pixel and a pixel is simply a small block of color. You could use this understand to apply this to real world objects. Legos can look some serious shit if you build it big enough and you spend enough time with it. Why? because they are no different than the big portraits that we make they are pixel based ( assuming you understand the previously describe logic ). Using this knowledge we could apply the theory to our voxel system. If we were to break down each block into 8 sub parts we now have 8 pixels to display 3d water information with.

[img]http://www.bhslaughter.com/forum/uploads/gallery/album_371/gallery_1_371_13884.jpg[/img]

The dark blue would be your source block, and the light blue would be the voxel information of the water flowing out. As the water flows out the sub blocks would pop in and out as the water moved through that space. I can see several issues coming from this:[list]
[*]Water travel would have to be processed by the CPU or GPU, this could cause a serious strain on the system if several source blocks were to be in play. How much? not sure at this point as this is very theory based at this point in time.
[*]We have an entire world to manage of upwards to 10milllion blocks. If we want to keep the premise of the game ( players can make what they wish ) while still providing a solid feeling ( high fps and responsiveness ) we are going to have to figure out a middle ground. This is not a water simulation game so we can not devote 100% CPU to rendering of it.
[/list]
I am coming to this area of the forum to discuss what possible solutions we could use, if any. I hope I made this clear enough, if not let me know and we can go from there.
1

Share this post


Link to post
Share on other sites
Here i go again...

I've seen the link on your sign. the screenshot of you water gave me the following idea (when I say adjacent, keep in mind that I mean Adjacent AND in the same layer, i'm considering the 2d space of a layer):

all your water blocks start as source blocks.
whenever a block that is not a source block and is next to a source block gets updated, all the source blocks next to it are updated as well.

when a source block is updated, if there's a gap adjacent to it (i.e.: a block next to it was removed.), spawn a shore block on that gap. if there's less than 3 source blocks attached to the updated source block, the source block becomes a shore block. if a shore block has at least 3 source blocks adjacent to it, then it becomes a source block.

whenever a shore block has a source block directly above it, the shore block becomes a source block.

whenever a shore block has a gap next to it, spawn another shore block on that gap.

a shore block can regulate the water level on itself based on how many sources and shore blocks are next to it, as an example, you said you have 8 pixels, a shore block can only have 4 blocks next to it on the same layer, so let's say that for each source block next to the shore block, you paint 2 pixels and for each shore block you paint 1 pixel. whenever a shore block spawn another shore block, the original block loses 1 pixel, that is transferred to the new block.

if a shore block has no pixels drawn, it cease to exist.

you can do this in a way that you form a homogeneous line with your shore blocks, creating the curve effect that you want. updating the blocks only when another block get's updated can be tricky, but can save some CPU time. the trick here is to maintain the amount of data per block at a minimum.

i don't know if this helps, but is what I've in mind to solve your problem, hope this gives ideas to other people that can then help you better.
2

Share this post


Link to post
Share on other sites
Don't know if it's on the same path as you're going or if it's been mentioned before (I took a quick look and didn't see any mention) but I remember in an interview ([url="http://www.gamasutra.com/view/feature/131954/interview_the_making_of_dwarf_.php?page=9"]here[/url]) Tarn Adams briefly discussed his flow model for Dwarf Fortress. Maybe there's some inspiration in there.
2

Share this post


Link to post
Share on other sites
Just spitballing a few things here:

A quick glance over the OP it looks like you are basically using a type of cellular automata, if that is the case then you could read this for some ideas: [url="http://www.gamasutra.com/view/feature/134736/an_intro_to_cellular_automation.php"]http://www.gamasutra..._automation.php[/url]

For optimizing, you will need to restrict the number of calculations that need to be made, there is really no other choice. This can be done by constraining the simulation to only those areas that need it and/or precalculating as much as possible.

I'm reaching on this one, but it also may be possible to memoize fluid calculations somehow (see here for example: [url="http://en.wikipedia.org/wiki/Hashlife"]http://en.wikipedia.org/wiki/Hashlife[/url]). If even applicable, this could greatly increase simulation speed (at the cost of memory obviously).

For determining feasability, the only way is probably to just bite the bullet and prototype the simulation.
2

Share this post


Link to post
Share on other sites
It may be that you are out on deep water here. If it is a voxel based game, with a very large world, it usually means the game engine has to be able to load or create only needed parts of the world (sometimes called chunks).

In such a world, it is difficult to use any algorithms that depend on adjacent blocks. Suppose you have a chunk 'A' adjacent to 'B'. But to be able to find out how water behaves in A near B, you also need to load B. But that may require loading of all adjacent chunks to 'B', or you can't compute how B looks.

It is possible to handle, but no easy thing.

Just for fun, my voxel based world. Everything including the water, is blocks, but drawn smooth:
[attachment=10278:DynamicShadows_2012-07-27.jpeg]
2

Share this post


Link to post
Share on other sites
While true, the only thing that matters is what the client sees. The server is a total different thing. Not with netcode yet so not sure exactly how that will play itself out. You can reduce some load by the way you draw objects and faces. This is why we have a view limitation. Good points though and I will make sure that Michael keeps that in mind when making the system. Thank you all for the feedback. Once we try some of these or we fail I will let you know! Really, thanks!
0

Share this post


Link to post
Share on other sites
A search for "tall cell grid" might turn up helpful results (there are a few papers about it)
You could even do real water simulations with it, e.g. this http://www.youtube.com/watch?v=Jl54WZtm0QE
2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0