In my last post i have talked about using unreal engine 4 and such. Now after i have played a lot with it, i know for sure - this game can not be made with UE4 based on the gameplay mechanics i have mind and it will take at least a few years before UE4 will support what i need: Realtime fluid simulation based on particles. So i decided to drop that idea about using UE4 and try to make it myself, because there is no physics engine out there which do support a particle-based fluid simulation with mixing liquids including two-way interaction with rigid-bodies.
Of course i tried out "Liquidfun 1.1" and at the first glance it looked amazing, but after i used it seriously i was very dissapointed because it never got usable in any way. Particles just bounces off on every wall, like it was some kind of superball, the fluid was not fluid like at all and creating single particles just wont work - only group of particles which are part of some shapes can be created. I dont know why this had not worked for me, but after i have analyzed it a bit, it looked like liquidfun hates chain-shapes for some unknown reasons and my entire level are based on this chain-shapes, so this may be the reason why it was always unstable. I even tried it with cpp implementation, but this had exactly the same problem.
At that point i really was very depressed for a few weeks and have not worked on the game at all, but then i had a good talk with a very good friend of mine about that game idea. He had a lot of good ideas and so becomed that we decided to make it together. Unfortunatly he does only know programming in theory, but had never do any real programming at all, except for some assembler assessments in his school, but more importantly he had absolutly no clue how games are built - what a programmer must do to create a game, what a game loop is, how input is determined and how graphics are displayed on the screen.
Well that was the point where i decided to start completely from scratch and let him see every aspect of it - with a livestream like-way. Another reason to start it over again was the old engine i created - this was fully based on immediate and old rendering techniques. It worked just fine and after a few session we got the same result like before - a jumping character, a level and some camera which follows along based on OpenGL 3.3. After that we added jumppads, tuned the player movement a bit and we started to see some pictures coming together.
You can see the results here:
But as ussual like i had expected this, i got demotivated and stopped working on that project - which was great for my family because i was not sitting in my pc-corner anymore and had more time for them and my friend was learning for his studies and had no time at all too. So the project was freezed for the time being.
Until the start of january where i got boored and started to read tons of papers about particle systems, fluid simulations, physics simulations and many other advanced topics. Also my friend got back from his studies and we made more coding-sessions together with pretty good results. So i have implemented a fully working position-based-fluid simulation including one-way collisions!
You can see an early result here:
The best part is, that simulation is already integrated into our game framework and work right a way. Unfortunatly the performance for collision tests are extremly poor right now, because i have not optimized it yet. 2 * 2000 * 400 linesegment tests per frame are just too much. But i have good plans for that, i will sort this line segments into my existing uniform grid which i already use for particle-neighbor determination and use this to test only the line segments which are close to a particle - so i assume this will increase the performance drastically.... i hope.
Stay tuned for future updates.