Movie Sprites

In this forum we discuss the future of Ren'Py, both bug fixes and longer-term development. Pre-releases are announced and discussed here.
Message
Author
User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Movie Sprites

#1 Post by PyTom »

Just a heads up on a new feature I'm in the process of adding to Ren'Py. It's now possible to use code like:

Code: Select all

image eileen movie = Movie(channel="eileen", play="eileen.webm", mask="eileen_mask.webm")
to define what I'm calling a movie sprite. When shown with code as simple as:

Code: Select all

show eileen movie
You'll get:


This starts both movies playing, and uses the red channel of the mask movie as the alpha channel of the other movie. The result is an animated sprite that can have far more frames than would be possible with ATL, Animation, or other methods that have to load all images into ram at once.

For now, this only works on desktop (Window, Mac, Linux) platforms. There isn't a fundamental limit to the number of movie sprites Ren'Py can display at once, but it is limited by how fast the player's computer is. Memory consumption should be about 24 bytes per pixel, so a 400x720 animated sprite will take about 7 megabytes, although garbage collection may make it be a little more.

This provides a far-superior alternative to animated gifs (it's pretty easy to use ffmpeg to convert an animate gif into two webms, and the example I used is 15% the size of the gif equivalent), and provides a uniquely flexible animation format.

Right now, the new audio/video code is living on a git branch. Once I fix a slow memory leak, I'll add it to the nightlies, and I play to get a release with this out soon.

Thanks to renoa-heartily for the animated gif I converted, which can be found in this thread: http://lemmasoft.renai.us/forums/viewto ... 79#p364740
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Geckos
Veteran
Posts: 471
Joined: Fri Aug 17, 2012 8:33 am
Completed: Brilliant Shadows, Perceptions of the Dead, The Phantom Icecream Truck
Projects: Embers of Magic, Pale Spectrum, Perceptions of the Dead
Organization: Ithaqua Labs
Tumblr: geckosart
Deviantart: sitaart
Contact:

Re: Movie Sprites

#2 Post by Geckos »

Awesome ^^
Image ImageImage

AXYPB
Regular
Posts: 95
Joined: Thu Sep 04, 2014 3:04 am
Github: AXYPB
Contact:

Re: Movie Sprites

#3 Post by AXYPB »

To what extent can movie sprites be manipulated as with static displayables, and can a loop point be defined so as to not replay the entire video as shown in the example?

User avatar
Vaendryl
Regular
Posts: 39
Joined: Thu Dec 26, 2013 10:10 pm
Projects: Sunrider
Organization: Love in Space
IRC Nick: vaendryl
Contact:

Re: Movie Sprites

#4 Post by Vaendryl »

AXYPB wrote:To what extent can movie sprites be manipulated as with static displayables, and can a loop point be defined so as to not replay the entire video as shown in the example?
asking the important questions!
If I can use this inside a dynamic displayable there are so many neat things possible :D
this is something for ren'py 7 I assume?

User avatar
Meg'
Regular
Posts: 185
Joined: Tue Sep 27, 2011 10:37 am
Projects: Anges Démoniaques, Gang (Alex & Hugo), Le passé dans les veines
Location: France
Contact:

Re: Movie Sprites

#5 Post by Meg' »

That seems like a pretty cool feature! :D Thank you PyTom!

User avatar
Harliqueen
Veteran
Posts: 427
Joined: Fri Feb 06, 2015 12:43 pm
Completed: Diving in Deep (NaNo15) The Lady's Choice(NaNo16) The Crossroads(NaNo17)
Projects: The Curse of Creek Edge
Organization: Seraphinite
Tumblr: seraphinitegames
Deviantart: SeraphiniteGames
itch: seraphinite
Contact:

Re: Movie Sprites

#6 Post by Harliqueen »

This looks like it's going to be an awesome feature! :D
Completed: Diving in Deep/The Lady's Choice/The Crossroads
Current WIP: The Curse of Creek Edge (NaNo2020)

Voight-Kampff
Veteran
Posts: 351
Joined: Sat Sep 05, 2009 8:47 am
Contact:

Re: Movie Sprites

#7 Post by Voight-Kampff »

Well that looks particularly awesome.

And yes, like AXYPB, I'm curious about the ability to loop.

Something I've always disliked whenever people have spites that are "animated" during a transition, or while "talking", is that the sprites typically stop moving during the interim. Nothing makes a character "die" faster than turning into a completely immobile, inanimate object (also makes it pretty jarring once they start moving again, as well).

So I'm wondering if we can generate sequences that can be looped in which the sprite constantly moves just a little bit—just a little bit of sway or shifting of their weight, etc.

User avatar
uyjulian
Regular
Posts: 128
Joined: Sun Mar 08, 2015 1:40 pm
Github: uyjulian
Contact:

Re: Movie Sprites

#8 Post by uyjulian »

Ooh, we get updated ffmpeg too?

Well, this will open up new possibilities.

SundownKid
Lemma-Class Veteran
Posts: 2299
Joined: Mon Feb 06, 2012 9:50 pm
Completed: Icebound, Selenon Rising Ep. 1-2
Projects: Selenon Rising Ep. 3-4
Organization: Fastermind Games
Deviantart: sundownkid
Location: NYC
Contact:

Re: Movie Sprites

#9 Post by SundownKid »

I am curious... would there be a way to do lip flap in combination with this?

Like maybe playing two versions of the movie at the same time, one where the character is talking, and then swapping between them while the text is going on?

User avatar
Alex
Lemma-Class Veteran
Posts: 3090
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Movie Sprites

#10 Post by Alex »

This sounds promising!

OldGoateye
Newbie
Posts: 24
Joined: Fri Oct 09, 2015 4:31 am
Contact:

Re: Movie Sprites

#11 Post by OldGoateye »

Wow, what a time to be checking in! This sounds like an incredibly cool and interesting feature; I can foresee many novels with mostly static/lip + blink animations, but suddenly one or two instances of full animation for key scenes... :D Fantastic!

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Movie Sprites

#12 Post by PyTom »

Answering in near-random order, since it's late and I got confused as to the order of posts.
AXYPB wrote:To what extent can movie sprites be manipulated as with static displayables, and can a loop point be defined so as to not replay the entire video as shown in the example?
The only major problem would be that you have to define different channels for each movie sprite shown. This makes transitions - dissolving between two moviesprites using the same channel - hard, although you could get around this by allocating a new channel for each pose.
SundownKid wrote:I am curious... would there be a way to do lip flap in combination with this?

Like maybe playing two versions of the movie at the same time, one where the character is talking, and then swapping between them while the text is going on?
The best way to do this would be to play a lipflap movie when the character starts, and then transition it into a normal movie when talking is done.

You could plausibly play two (really four) movies, but movie playback can be expensive. So it's best to avoid playing too many at once.
Voight-Kampff wrote:So I'm wondering if we can generate sequences that can be looped in which the sprite constantly moves just a little bit—just a little bit of sway or shifting of their weight, etc.
Yes, things will loop by default. Obviously, you'd have to loop the animation proper - Ren'Py should just seamlessly play frames.
Vaendryl wrote:If I can use this inside a dynamic displayable there are so many neat things possible :D
this is something for ren'py 7 I assume?
It should work in a DD. It'll be out as soon as I finish debugging things, in 6.99.9.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Kia
Eileen-Class Veteran
Posts: 1039
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Movie Sprites

#13 Post by Kia »

looks pretty good ^_^
would there be a way to use it in screens? I can think of few ways it would be useful, I've been waiting to see better masking options like this in the screen language.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Movie Sprites

#14 Post by PyTom »

it should just work in screens.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Kia
Eileen-Class Veteran
Posts: 1039
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Movie Sprites

#15 Post by Kia »

Well a character inside screens is not that useful. I meant something like this:

Code: Select all

Movie:
    channel "eileen"
    play "eileen.webm"
    mask "eileen_mask.webm"
    frame:
        something...
possibly with a way to control the animation of the movie and the mask. or better...

Code: Select all

frame:
    mask "eileen_mask.webm"
    text "something"
I asked for masks inside the screen language before but I think it gone unnoticed. ^_^

Post Reply

Who is online

Users browsing this forum: No registered users