I developed the idea of creating an underwater dungeon for my game.
So i wondered if it would be possible to create an underwater distortion effect, like for example Jabu Jabu's Belly in Oracle of Ages (https://www.youtube.com/watch?v=az2I343A5N4).
Would be very cool if it can. :)
Should be easy enough to do as an overlay - basically using an animated sprite. I haven't tried an animated overlay before though.
Unfortunately, I think this is not possible yet, but maybe possible in next releases. In that effect, some pixels are shifted before drawn (not only for the ground, but also for entities on the map). We would need to be able to modify the pixels of the map and entities with some getters and setters functions on their sprites/tiles/surfaces, or something like that.
Solarus developers are still working on this, see:
https://github.com/christopho/solarus/issues/452
Yes, for that particular effect I guess you're right. I need the get/set_pixel functions as well (hopefully) for some lighting effects, so let's home this is implemented soon!
Just for reference purpose, here's a really old doc that explain how to implement a lot of special effects in a 2D RPG game.
The code relies on DirectDraw so it's not really usefull as is but it may give a good starting point for the math calculation involved.
The text is in french.
http://www.google.fr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=8&cad=rja&ved=0CG0QFjAH&url=http%3A%2F%2Fwww.alrj.org%2Fdocs%2F2D%2FEffetsSpeciaux2D.doc&ei=qzXeUoT0IovY7AapxYGQDA&usg=AFQjCNFrxpfYrmlDwTp5i5y2M2mSXBh8yw
Quote from: fosamax on August 28, 2015, 11:54:40 AM
Just for reference purpose, here's a really old doc that explain how to implement a lot of special effects in a 2D RPG game.
The code relies on DirectDraw so it's not really usefull as is but it may give a good starting point for the math calculation involved.
The text is in french.
http://www.google.fr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=8&cad=rja&ved=0CG0QFjAH&url=http%3A%2F%2Fwww.alrj.org%2Fdocs%2F2D%2FEffetsSpeciaux2D.doc&ei=qzXeUoT0IovY7AapxYGQDA&usg=AFQjCNFrxpfYrmlDwTp5i5y2M2mSXBh8yw
Looks like an interesting doc. Unfortunately I can not read it, because i don't know french.
I was able to track down the related game on archive.org
https://web.archive.org/web/20050208070757/http://jpeglauden.free.fr/html/projets/magicia.htm
You can download and test the game. It's still working on Windows 7. Didn't play enough to see the underwater effect in use anyway.
It's very possible to do.
Use the transparent water tile over the entire area on the highest layer. That way it will appear that you're underwater.
Quote from: DementedKirby on August 30, 2015, 07:27:46 PM
It's very possible to do.
Use the transparent water tile over the entire area on the highest layer. That way it will appear that you're underwater.
Then you have just a water overlay without a distortion. ;)
True, but at least you get an underwater effect in the mean time ;)
That's right. It is my back-up solution if the distortion is not possible.
I still think it will look pretty decent. Now, correct me if I'm wrong, but didn't most SNES games simply simulate the "underwater effect" with sprites? Super Mario World, Donkey Kong Country, Mega Man X, etc. just had the hero enter the water but it didn't distort any of the images yet you could still tell they were underwater. At least, with having the transparent water tiles as a high layer over the entire map you want submerged, you get a better illusion of being underwater than those previously mentioned games because 1) Zelda is viewed from a bird's eye view camera angle and 2) you actually see the water moving over the level. So I think it's a good thing for the moment and just as aesthetically pleasing.
Quote from: DementedKirby on September 04, 2015, 01:45:23 PM
I still think it will look pretty decent. Now, correct me if I'm wrong, but didn't most SNES games simply simulate the "underwater effect" with sprites? Super Mario World, Donkey Kong Country, Mega Man X, etc. just had the hero enter the water but it didn't distort any of the images yet you could still tell they were underwater. At least, with having the transparent water tiles as a high layer over the entire map you want submerged, you get a better illusion of being underwater than those previously mentioned games because 1) Zelda is viewed from a bird's eye view camera angle and 2) you actually see the water moving over the level. So I think it's a good thing for the moment and just as aesthetically pleasing.
Sometimes they used an overlay, and sometimes they used distortion.
For example Donkey Kong Country
https://www.youtube.com/watch?v=GH-UGtfGH8I
I see what you mean. But if you look closely, only the map tiles are distorted. Maybe you could do the same with animated tiles?
Quote from: DementedKirby on September 06, 2015, 07:50:09 PM
I see what you mean. But if you look closely, only the map tiles are distorted. Maybe you could do the same with animated tiles?
Could be an idea to try. That together with an animated overlay to would be a nice thing i guess.
I think that would be your best bet. Honestly, it should be pretty easy with animated tiles and the high layer transparent water overlay. Have you tried it out yet?
I'm experimenting.
(http://i57.tinypic.com/2lnefjs.jpg)
Lots needs to be done.
- Water overlay is not animating yet, but it does moves like the forest overlay.
- Tiles needs animation.
- Link is swimming, but can't interact with objects yet.
- And ofcourse Link's sprite needs to be changed to a custom made diving state.
Hmmmm... unless I actually see that in animation, I'd stick with having a high layer with transparent water tiles. So far, I feel that it looks better than that. Maybe when animated that would look better, but I've been experimenting with making Iron Boots and that's what been working for me.
I want to stick to the overlay, because i want to have the high layer for other stuff, like a school of fishes swimming around or airbubbles.
Well, I'm very interested in seeing the final product! Do let us know when you got it animated and how it looks!
I apologize for replying in a 2-years-no-post topic (even though I've been searching for the forum rules but couldn't find anything), but if anyone's still interested by the French document about special effects, then I'd gladly translate it to English.