Fancy Fade Outs!

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
kylekrack
Liquid Metal Slime
Posts: 1242
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Fancy Fade Outs!

Post by kylekrack »

Playing around with pixel-based movement, the 'use door()' command is proving to cause a bit of complication, likely due to its automatic wait tick. For this and other reasons, I'm using 'teleport to map()' instead. Obviously, this command typically doesn't look as nice because of how instant it is, right? Well I've got the solution to that.

The ability to dissolve sprites in the new release has a plethora of aesthetic uses, as I'm discovering. This is the one I'm working with now.

Code: Select all

#Make a slice collection with a backdrop sprite
#of a solid color (the default should be white)
#and give it the lookup code "fade"

plotscript, fancy fade out, begin
    suspend player

    variable(col, fade)
    
    col := load slice collection(#)
    fade := lookup slice(sli:fade,col)
    
    dissolve sprite(fade,dissolve:random scatter,10,0,true) ###5th argument sets dissolve backwards
    wait(10)
    
    teleport to map(get door destination(#),get door x(#),get door y(#))
    
    dissolve sprite(fade,dissolve:random scatter,10,0,false) ###
    wait(10)
    
    free slice(col)
    resume player
end
All you have to do is make the proper slice collection and set the data for the doors however you like. This script will make a 10 tick fade from transparent to white, teleport the player, then fade the white away over 10 ticks. I know this may seem like a fairly obvious script to make, but like I said, there are a lot of uses for dissolves.

The different dissolve types all make for really spiffy transitions, and would probably be useful for cutscenes or entering battles as well. I think this would be a great, simple way to customize the look of your game without much struggle.

I hope someone else finds this useful or interesting.

Image
Last edited by kylekrack on Thu Apr 14, 2016 5:56 pm, edited 1 time in total.
My pronouns are they/them
Ps. I love my wife
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Interesting idea; I hadn't thought of that. Crossfade and diagonal swipe are two other dissolve animations that would be good.

A very similar effect is to us a fuzzy rect and the "set rect fuzziness" command.

Actually, both "teleport to map" and "use door" cause a one tick wait, but you definitely wouldn't want to use "use door" because of the screen fade it causes.
User avatar
kylekrack
Liquid Metal Slime
Posts: 1242
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

Yes, those two animations look great. Another interesting one is the shrink dissolve, surprisingly. After playing with all of them, I think each one has potential for giving a different feel to transitions.

I will keep in mind that teleport to map() still waits a tick.
My pronouns are they/them
Ps. I love my wife
User avatar
Gizmog
Metal King Slime
Posts: 2622
Joined: Tue Feb 19, 2008 5:41 am

Post by Gizmog »

Great thread and great thinking! If I ever make an RPG I'm going to be sure to keep this kinda stuff in mind.
User avatar
FyreWulff
Slime Knight
Posts: 107
Joined: Wed Mar 13, 2013 9:16 pm
Location: The Internet
Contact:

Post by FyreWulff »

I've never worked with slices, so is there a way to capture the current screen as a sprite, put that into a slice?

That way you could capture the screen at the exit map right before the door triggers, put that on screen, then crossfade to the new map, or have map transitions where the entire map cross dissolves or some other neat effect under the player character.
User avatar
Gizmog
Metal King Slime
Posts: 2622
Joined: Tue Feb 19, 2008 5:41 am

Post by Gizmog »

Regrettably there's not, but Macabre worked around that by taking a screenshot pre-boss fight and then re-importing said screenshot with a photoshop swirl effect to give the battle some prerendered pep.
User avatar
Mogri
Super Slime
Posts: 4669
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post by Mogri »

I think the first game I saw that in was Mattgamerr's Lolsidothaldremobine. It does look really cool, but it depends on everything being in the right spot on the screen.

Being able to grab portions of the screen as a slice would be awesome, and it would make this really easy.
User avatar
Gizmog
Metal King Slime
Posts: 2622
Joined: Tue Feb 19, 2008 5:41 am

Post by Gizmog »

It's also pretty cool to do it to your tilesets, makes for some easy poison style effects. It would be *AMAZING* to do the screengrabs though. The only feature I think I would want more is the ability to enter like.. Pixel X-Y coordinates of a sprite and return the 0-15 color value from the palette, or the 0-255 color from the master palette. That would open the door for some serious shenanigans.
User avatar
kylekrack
Liquid Metal Slime
Posts: 1242
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

Gizmog wrote:I can't stop looking at it.
It's pretty darn mesmerizing. I am fully blown away by this demo.
My pronouns are they/them
Ps. I love my wife
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Nobody linked to Yi, which is what I assume Kylekrack was referring to.
Which is pretty awesome, and all the animations could be sped up (not necessarily easily) to make them practical.

I would add a command to grab a screenshot of the screen, but I don't know whether it could be reasonably continue to be supported in future if we add transparency and hardware accelerated graphics backends, because then the screen would be 24 bit, not paletted. We would have to add a backcompat bit to enable 24 bit graphics for transparency etc and break old scripts using the screenshot command. Or maybe a more limited command to render just a single map layer (without any transparency etc effects that might be added to map layers in future). Alternatively I suppose we could add a command to take a screenshot, but disallow reading or writing any pixels in it. (This makes a lot of sense actually, since it would be a hardware surface which isn't directly accessible to the CPU without a transfer)

As for being able to read and write pixels from sprites (rather than the screen), I will add that at some point probably soon after the new script interpreter (arrays).
Last edited by TMC on Sat Apr 23, 2016 1:37 am, edited 3 times in total.
User avatar
kylekrack
Liquid Metal Slime
Posts: 1242
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

TMC wrote:the new script interpreter (arrays).
Image
My pronouns are they/them
Ps. I love my wife
Post Reply