The blog of an indie game dev !
Demos, paintings, tutorials and problems

Get all the news !

Never miss out any update.

Water interactions

Hi everybody!

Here is the usual sum-up of my recent activities, mainly water-character interactions here.

I – Swimming animation

OK! The first idea was to enhance the swimming of the character. So I first worked on the swimming animation in Blender in order to make it more believable (if you played the last demo or watched my last video, you may have noticed that there was no swimming animation).

And once the animation was done, I had to work on the transitions with the other possible states of the character. The more states already exist the more complex it is to insert and “connect” the new one. So I worked mainly on the following transitions:

  • swim / climb: the character  can now fall down into water while he is climbing, or jump out of water to a wall
  • swim / walk: the character can progressively come from a slight slope beach into water and once he is in a deep enough water zone, he transitions to the swimming state.
A very basic animation. But, we’re only going to see the head out of the water anyway.

The final tweaks needed were on the swimming speed and “inertia”. Of course, in water, a body is subject to the Archimedes principle as well as to some liquid friction. I started by coding the exact “realistic” forces, but those are not “reactive” enough to make the game nice to play. So I had to tweak the values and coefficients in the equations to give the game a good response time. But I’m not still quite satisfied with it. This may require more work.

II – Particles effects

Now the character swims! But visually, the moves in water seriously lack some water reaction.
I needed to add a few things:

  • a more or less huge splash when the character jumps into the water from a relatively high level
  • little splashes when the character walks in a bit of water
  • falling droplets from the character when he comes out of water
  • ripples and foam around the character while he’s swimming
  • ripples and foam around land and platforms immersed in water
  • little water splashes for small object falling into water (arrows and stones mainly at the moment).

And finally, I had to set up the exact same water particle systems for ennemies.

    Simple ripples and foam around the character
    Foam around a little island and water splashes while the character walks in the water. Well, OK, it lacks a beach…

    Little droplets falling from the character after a swimming session. Subtle… But more obvious with the animation.
    Ripples around ennemies in water. This required to correct all the sizes and parameters of the water effects.

    A few more updates are coming, hopefully with a new level in the next demo at the end of the week.


    Posted

    in

    by

    Tags: