Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

878474 Posts in 32924 Topics- by 24336 Members - Latest Member: BeefJack

May 22, 2013, 12:54:26 AM
TIGSource ForumsDeveloperCreativeArtwater in 2D platformers
Pages: [1] 2
Print
Author Topic: water in 2D platformers  (Read 4585 times)
György Straub
Level 4
****


Friendly Giant Nano


View Profile WWW
« on: September 17, 2008, 01:31:01 AM »

how do you implement water in your platformers? on the first rung it's just about the changed movement of the characters, but then the water's behavior should be considered too (anything more sophisticated than a splash animation whenever a character enters / leaves water).

I've just been thinking about this (well not really, but I'm getting close to a point where I'm going to need it one way or another)... there are couple of approaches that come to mind before having googled for it:

* spatial approach: water is everything below a certain Y coordinate, so if the entities go beyond this coordinate, the physics that apply to them. yeah, but water can be beyond this "sea level". (wall) collisions are calculated afterwards.
* tile based approach: water is a tile type; collision detection has to be done before physics, and physics then can be applied to game entities based on what "substance" are they in. the tiles (can be an additional layer) can have, like a density (friction?) value. I kinda like it, it can even be brought in sync with walls (them being absolutely dense) - but it's tiles.
* cloud approach: it's really the extension of the tile based approach, but level data isn't stored in a grid (of uniform tiles) rather than a, I dunno, list or bsp-tree; everything can be a convex shape with an arbitrary number of edges, have unique unique orientation and scale - then the physical qualities.

anything more sophisticated?
Logged

deadeye
First Manbaby Home
Level 10
*



View Profile
« Reply #1 on: September 17, 2008, 02:35:13 AM »

You should definitely make your water a particle system with fluid dynamics.  And I want to see the Brownian motion on the character as the heat interchange from individual particles pushes him around.

But no, really I've only done water as tiles where overlap causes a change in the player's movement.  Well, that and instant death.
Logged

tweet tweet @j_younger
György Straub
Level 4
****


Friendly Giant Nano


View Profile WWW
« Reply #2 on: September 17, 2008, 02:47:38 AM »

You should definitely make your water a particle system with fluid dynamics.  And I want to see the Brownian motion on the character as the heat interchange from individual particles pushes him around.
:D

affirmative.


but that's nothing compared to how I like the idea of the player entity's instant death. optimization ftw!
Logged

jeb
Level 5
*****


Bling bling


View Profile WWW
« Reply #3 on: September 17, 2008, 03:09:37 AM »

You should definitely make your water a particle system with fluid dynamics.  And I want to see the Brownian motion on the character as the heat interchange from individual particles pushes him around.

Don't forget that, over time, the water should erode the platform walls.
Logged

Hayden Scott-Baron
Level 10
*****


also known as 'Dock'


View Profile WWW Email
« Reply #4 on: September 17, 2008, 04:01:20 AM »

I've been wondering about this myself recently. I don't know how fun real water displacement physics would be in actuality, as it would require quite a bit of fighting with the controls. I think a body of bouyancy is pretty fun to work with, and the idea of water pouring from one area to another can be simulated with some interesting methods. When a small amount of water falls on a wide flat surface though it's always a bit tricky to know how that should behave.
Logged

György Straub
Level 4
****


Friendly Giant Nano


View Profile WWW
« Reply #5 on: September 17, 2008, 04:15:38 AM »

You should definitely make your water a particle system with fluid dynamics.  And I want to see the Brownian motion on the character as the heat interchange from individual particles pushes him around.

Don't forget that, over time, the water should erode the platform walls.

haven't quite done with the wind engine yet.=)
Logged

deadeye
First Manbaby Home
Level 10
*



View Profile
« Reply #6 on: September 17, 2008, 04:40:56 AM »

I've been wondering about this myself recently. I don't know how fun real water displacement physics would be in actuality, as it would require quite a bit of fighting with the controls. I think a body of bouyancy is pretty fun to work with, and the idea of water pouring from one area to another can be simulated with some interesting methods. When a small amount of water falls on a wide flat surface though it's always a bit tricky to know how that should behave.

Yeah, in my experience physics and platformers don't mix too well.  It's nice in theory, but a bitch and a half to get looking and behaving properly.  That is, if you're using a pre-made physics engine.  If you're making your own physics engine then you're a hell of a lot smarter than me and probably have some idea what you're doing.

As for water displacement and stuff, the two games I can think of off the top of my head that do an okay job are Bloody Zombies and Phun.  Though in both the water (or blood as the case may be) effect is best when it's contained.  The illusion breaks down when individual particles escape the main body and go sliding around on their own.

Don't forget that, over time, the water should erode the platform walls.

Only if it's over the course of several thousand years.  And this would naturally have to take into account evaporation and precipitation.
Logged

tweet tweet @j_younger
ImaginaryThomas
Level 1
*


Reor, Creo, Incito


View Profile WWW
« Reply #7 on: September 17, 2008, 04:46:15 AM »

Will it be able to sustain a small eco system of simple invertebrates?
Logged

narasu
Level 10
*****


wehed milie hier, wehed milie daar


View Profile WWW Email
« Reply #8 on: September 17, 2008, 04:53:56 AM »

take this into account too:
Logged

Ronin Narasu - Musician, philosopher, petty thief

Website: http://www.ronin-narasu.co.nf
Soundcloud: http://soundcloud.com/ronin-narasu
Gnarf
Level 10
*****



View Profile WWW
« Reply #9 on: September 17, 2008, 04:55:23 AM »

That cave flyer thing game that was called Wings or something and was Finnish and I played rather a few years ago had water in it! And you could shoot water, and it sort of floated about, every little pixel of water. Float float float. Not very convincing floating, but cool.

I think the spatial approach could be just fine. Could to crazy hilarious awesome stuff that was wicked sick, like, eh, raising the water level during a level.
Logged

This is IT -- the missing link in the chain of my existence. Rondo's SPINNING BUDDHA is what I need to make me complete.
Hajo
Level 5
*****

Dream Mechanic


View Profile
« Reply #10 on: September 17, 2008, 05:00:09 AM »

Don't forget that, over time, the water should erode the platform walls.

While not realistic (as deadeye already told), this could be a neat idea to impose a time limit on levels, when the platforms actually grow too short to carry the player.
Logged

Per aspera ad astra
Danrul
Level 4
****


View Profile Email
« Reply #11 on: September 17, 2008, 05:03:06 AM »

I reckon that a game where erosion of wind and water is exaggurated could be interesting.  Like, where water is acid to platforms and stuff but not you, so jumping out you drip it on the platforms and if you try to climb ledges it fails.

on second though, that idea fails.
Logged
György Straub
Level 4
****


Friendly Giant Nano


View Profile WWW
« Reply #12 on: September 17, 2008, 05:05:21 AM »

I've been wondering about this myself recently. I don't know how fun real water displacement physics would be in actuality, as it would require quite a bit of fighting with the controls. I think a body of bouyancy is pretty fun to work with, and the idea of water pouring from one area to another can be simulated with some interesting methods. When a small amount of water falls on a wide flat surface though it's always a bit tricky to know how that should behave.

Yeah, in my experience physics and platformers don't mix too well.  It's nice in theory, but a bitch and a half to get looking and behaving properly.  That is, if you're using a pre-made physics engine.  If you're making your own physics engine then you're a hell of a lot smarter than me and probably have some idea what you're doing.

As for water displacement and stuff, the two games I can think of off the top of my head that do an okay job are Bloody Zombies and Phun.  Though in both the water (or blood as the case may be) effect is best when it's contained.  The illusion breaks down when individual particles escape the main body and go sliding around on their own.
That cave flyer thing game that was called Wings or something and was Finnish and I played rather a few years ago had water in it! And you could shoot water, and it sort of floated about, every little pixel of water. Float float float. Not very convincing floating, but cool.

I think the spatial approach could be just fine. Could to crazy hilarious awesome stuff that was wicked sick, like, eh, raising the water level during a level.

'zactly, Bloody Zombies is a good example. Sadly I haven't seen Wings, nor have I found anything closely resembling to it. I'm just banging my head against my platformer's physics - but very basic things: collision detection, jumping... I can really feel that the generosity that had to characterize framework development is coming to the end with actual game development.

It's hacktime.

Logged

Alex May
...is probably drunk right now.
Level 10
*


hen hao wan


View Profile WWW Email
« Reply #13 on: September 17, 2008, 05:06:01 AM »

how do you implement water in your platformers? on the first rung it's just about the changed movement of the characters, but then the water's behavior should be considered too (anything more sophisticated than a splash animation whenever a character enters / leaves water).

I've just been thinking about this (well not really, but I'm getting close to a point where I'm going to need it one way or another)... there are couple of approaches that come to mind before having googled for it:

* spatial approach: water is everything below a certain Y coordinate, so if the entities go beyond this coordinate, the physics that apply to them. yeah, but water can be beyond this "sea level". (wall) collisions are calculated afterwards.
* tile based approach: water is a tile type; collision detection has to be done before physics, and physics then can be applied to game entities based on what "substance" are they in. the tiles (can be an additional layer) can have, like a density (friction?) value. I kinda like it, it can even be brought in sync with walls (them being absolutely dense) - but it's tiles.
* cloud approach: it's really the extension of the tile based approach, but level data isn't stored in a grid (of uniform tiles) rather than a, I dunno, list or bsp-tree; everything can be a convex shape with an arbitrary number of edges, have unique unique orientation and scale - then the physical qualities.

anything more sophisticated?

It's not really clear what your aim is. If your bodies of water are static areas, then you want a static solution like box areas or tiles as you suggest, or something in the attribute layer of your map data. Anything further can be done with smoke and mirrors e.g. physics particles on the surface or created by objects at the surface, other cosmetic particles, rendering tricks, etc.

If your water is fluid, you want to make sure it either isn't gameplay critical (could the player move all the water somewhere with persistence for example) or it can somehow be restored to its level-designed state. For fluid water you probably want a particle-based solution using some kind of SPH interaction (look up lennard-jones) for the water physics.

An intermediate solution could be to have static bodies of water but to define the surface with a line of connected springs or some other simulation of water surfaces. Add particles for splash effects and you'll have a pretty effective water body with a stable yet fluid-like surface.
Logged

Danrul
Level 4
****


View Profile Email
« Reply #14 on: September 17, 2008, 05:09:19 AM »

I reckon water is an under-utilised possibility in games.  Its an oppurtunity to add another level of depth (oh a pun) to the gameplay. 

I think we need to think about displacement.  Imagine having a cave underwater that will fill if you knock the enemies into the water, so you have to take them out carefully.
Logged
Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic