water physics

Started by
5 comments, last by scruthut 7 months, 4 weeks ago

I am working on a game engine, and looking into making a mmorpg; this makes me especially interested in distributed parallel computing. I would be starting a platform for playing all my games called Scrut Network, and need help designing my servers. I want iphone / android and PC games to all run seamlessly on the same network and multiplayer platform so one system hardware can play any other. My main project Land of Scrut would be a massive world with weather, gods, entities (as there are inhabitants of the world that are not controlled by the player) that have jobs and go home. and genetic algorithms for the animals to share traits and have a breeding system in the game along with a production system, so you can raise fast horses for example. the setting would be diverse of course, yet i want water to be in the entire world (or map you may say). does this sound like I would want to off load more onto the gpu or will it be more cpu load based computed. Please help me out as I have not done the profiling yet. But i want water and that seems to be the greatest difficulty other than AI.

Advertisement

The usual recommend is to have a lead system. Don't worry about all the systems until you can do it for the first.

I suspect that will be enough of a challenge for you.

Thank you but what do you mean by a lead system?

The first, or the primary. The one you prove you can build something.

You don't start with all systems, you start with a single system and then expand. Even when using cross platform tools and experienced developers, all features still get a lead system.

scruthut said:
But i want water and that seems to be the greatest difficulty other than AI.

Usually water is handled with procedural animation for a purely visual effect, and i guess to should be the easiest task from your list, not the hardest.
Saw a video recently from somebody trying to recreate the water of Sea Of Thieves:

Some people tend to call this ‘water simulation’, but it's not. It uses FFT to model the appearance of a water surface, but such water does not react to anything else than it's parameters.

The simulation part usually happens elsewhere, like in the physics engine. If you have a boat, you can simulate it as a rigid body. The water is then often assumed to be just a plane (ignoring displacement as shown above), and the plane is used to simulate buoyancy forces causing it to wobble the boat respecting shape and mass properties. That's also pretty simple and usually done on CPU. Often good enough without a need to model any true interaction between boat and water which goes both ways. Teh boet wobbles realistically, but the water remains a static plane and is not affected by the boat. If you want to include water displacement, i would sample the water height around the boat and calculate an averaged water plane from that. Should be good enough.

It's also possible to do real fluid simulations. The most common is a ‘shallow water simulation’ on a 2D heightmap. This is often used to simulate ripples in puddles if players walk through them. Such approach can be mixed with procedural oceans as above, usually done locally, e.g. using a patch of simulation surrounding current player position. With this we can simulate a trail of waves behind a boat for example. Such simulation is usually done on GPU, but still pretty cheap.

Full 3D simulations to model water are usually done using particles in a grid, e.g. using SPH, APIC or MPM methods, which are much more difficult than any of the above.
This is also very expensive. It's doable these days for realtime games, but only for a small volume. That's why 3D fluid simulation effects in games are usually restricted to a bounding box. Achieving full scene simulations for large games might be possible with a lot of work, trickery, and high requirements on HW, but so far nobody has done it afaict.

Currently, the way to go seems to find the proper mix of hacks to fake what you need.
Considering your mmorpg vision means enough work for a decade of work for a single guy, i would not worry at this point about water details.
I would rather worry about the vision itself. It seems way to ambitious - a classical beginner mistake. Consider to lower expectations and starting small if you want results. Much, much smaller! Or hire a lot of people. ; )

scruthut said:
does this sound like I would want to off load more onto the gpu or will it be more cpu load based computed

NPCs and gameplay logic are usually done on CPU. GPU can be used for simulations pretty well, but beside fluid that's still a rare exception for good reasons.

scruthut said:
My main project Land of Scrut would be a massive world with weather, gods, entities (as there are inhabitants of the world that are not controlled by the player) that have jobs and go home. and genetic algorithms for the animals to share traits and have a breeding system in the game along with a production system, so you can raise fast horses for example.

Well, that's the dream of simulating an entire universe we all have.
There is just one problem with this mindset: It's a lot of work, enough for a lifetime, and after that - even if it would work, it's still no fun and no game at all.
When i was young and still excited about games, i assumed creating a big populated world is enough. Once we have that, interacting with it should be already fun, interesting and motivating.
But i was very wrong about that. Quantity does not give us anything beyond the claims about our rich simulations.
That's another big reason to start small, ideally with a distinct idea in mind, willing to reduce the project to the minimum needed just to make this core idea work.

Mine craft is more or less what I was looking for except more detail and they need to do something about those huge blocks, makes the game so boring after a while; I just want to dig a cannal in the dirt and make a farm, maybe breed prize live stock with good genetics… and for your information I do realize you can already do that, just want it done nicer with better simulations with godly influences. Plus one draw back is I do not know how to make a chat bot, so that form of interaction with entities and gods can not happen until I get my degree and graduate from me university. At least I have an entire game engine linker/loader designed and the libraries too. all I need is a game editor / tools and some assets to license this. I also need a compiler / linker / debugger / profiler / source editor / pretty much an entire IDE for my programming language in the game and I have made a language before with the compiler and virtual machine but this time I plan to translate into machine code (x64 that is) The kernel is designed, shell i forgot damn I still have some designs left to do, but its a nice layered architecture that makes a good system for making games at least. In fact, ill post my next new design patter other than my distributor that is, i have implementations for a system with that post if you read it, but the distributor can be taken back and viewed as a pattern… My new pattern is a feature, which is dynamic behavior applied to an object at run time and can change. so I shoot your head, but does it explode / make a hold / or a dot on your head; destructable walls too can be made with features; one can change settings in game in real time and change exposer settings like graphic killing or like a head exploding instead of a dot on the head… I have alot of free time as I am just a full time student atm, so i have alot of time to design.

This topic is closed to new replies.

Advertisement