some sort of fluid simulation

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
erisdar
Posts: 4
Joined: November 15th, 2013, 3:48 pm

some sort of fluid simulation

Post by erisdar » July 30th, 2014, 11:27 am

Hi everyone,

after countless hours of learning from Chili, I decided, it is time to made my first project. It is simple top-down fluid simulator. It isn't perfect, but I hope you'll like it ;) You can add fluid by clicking in window.

I hope the code is readable but if you don't understand something, I will explain it to you.

I was inspired by Creeper World, which is game where you basically fight against fluid.

Any suggestions are welcomed. Also there is a bug which causes some pixels to freeze and i don't have faintest idea how to find this bug, so if you're bored then you can try to find it :)

Thank you Chili for tutorials, jokes, advices etc. Btw. never stop being Chili: D

P.S. I recommend to run the simulator in release mode!!!

Update: So here is new version of my simulator. I found my bug so there shouldn't be any more inactive pixels. There is little change, you can add fluid by right click. Btw. I don't like the way how I made option, main menu and slider classes, but I'm too lazy to make it batter :)
Attachments
Fluid physics 1.1.zip
You can change a lot of things :)
(1.22 MiB) Downloaded 174 times
Fluid physics.zip
(1.11 MiB) Downloaded 199 times
Last edited by erisdar on August 6th, 2014, 9:53 am, edited 1 time in total.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: some sort of fluid simulation

Post by chili » July 30th, 2014, 3:29 pm

Neat simulation bro! I like your class design. This is the kind of code I hope that my viewers will learn to produce from watching my stuff.

P.S., did you check out my mass/spring network simulation?
Chili

Craigspaz
Posts: 33
Joined: June 9th, 2012, 12:23 am

Re: some sort of fluid simulation

Post by Craigspaz » July 31st, 2014, 1:08 am

This is a pretty cool simulation! Your code is easy to understand. You should add features like changing colors. Changing fluid spread speeds based on the type of fluid. Add Gravity so then the liquids move towards the bottom.
CraigSpaz

erisdar
Posts: 4
Joined: November 15th, 2013, 3:48 pm

Re: some sort of fluid simulation

Post by erisdar » July 31st, 2014, 8:11 am

Chili: I saw your simulator, but I'm still getting used to programing with vectors, so it was pretty hard to understand. I found interesting document about fluid dynamics for games, so I'm trying to understand it and I will use it to make my simulator better.

Craigspaz: First of all, I want to create the most efficient and bug free fluid mechanics and then I will add terrain, gravity etc.

Post Reply