Advertisement

Basic wind simulation in a large building

Started by June 04, 2015 07:47 PM
4 comments, last by Osidlus 9 years, 7 months ago

Hi all,

I'm looking at putting simple wind physics into our game, e.g. making particles and lights hanging from the ceiling blow around. It's set inside a large building, e.g. 10-30 rooms to a floor. I'm looking for a way to simulate wind without too much performance cost.

What I'm looking for is a combination of randomness and pattern. I don't want all lights swinging together, but in a long hallway it would look silly if each moved independently of the others.

A few thoughts:

  • Fluid simulation: difficult and costly.
  • Perlin noise: only has a magnitude, no vector. Ignores the building structure.
  • Perlin noise times prevailing direction of each hallway. Fine for hallways, not great for rooms or junctions.

Any suggestions?

Thanks,

JT

i asked a similar question recently:

http://www.gamedev.net/topic/667285-for-amber-waves-of-grain/

Norm Barrows

Rockland Software Productions

"Building PC games since 1989"

rocklandsoftware.net

PLAY CAVEMAN NOW!

http://rocklandsoftware.net/beta.php

Advertisement

Well, how about a simple graph system ? Place some waypoints in doorways, windows. The ways between the doorways represent the flow direction. Then use A* to calculate the wind direction from windows where the wind enters the building and exit windows. Maybe you need to calculate the wind pathes for several windows and overlay them.

No realistic simulation, but at least a simple fake.

Calculate it off-line. This is what I did for snow fall in a previous project. When you're done with your entire map, go the fluid simulation route, and use that to generate cyclic "wind swing" loops, like a couple seconds long. Bake them into your map, and you get the results of a highly detailed simulation with 0 CPU cost. The other nice thing is that this can also give you a lot of options on how to tweak things to actually get the look you want, without having to have your artists go in and fix stuff. Store the forces instead of positions, so you can sum forces that may not be considered offline.

Thanks for the options. Norman's style of approach might be a good first order approximation - pleasant results but wouldn't take the building into account (if I understand it correctly). The approaches suggested by Ashaman and Oolala are similar for me. I can't do a full offline calculation because we're using procedural level generation (sorry I didn't mention!). But we can construct a graph in terms of rooms and corridors, so a certain level of precalculation on a graph level may be possible.

Any other options would also be welcome!

I think this is a cook booky article that may give you the answer:

http://www.electronics-cooling.com/1999/01/improving-productivity-in-electronic-packaging-with-flow-network-modeling-fnm/

This topic is closed to new replies.

Advertisement