Composite images and animation

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
ShiraiJunichi
Miko-Class Veteran
Posts: 651
Joined: Sat May 21, 2005 12:28 pm
Location: University of Utah
Contact:

Composite images and animation

#1 Post by ShiraiJunichi » Sat Apr 08, 2006 3:11 pm

I'm using im.Composite for some of my images to save disk space. Basically, composing facial features for a character's image. I have an animation for eyes that I would like to compose with everything else, but trying to composite an animation gives me this error:

Exception: Expected an image, but got a general displayable.

Also, I was wondering... composite images have no processing expense at runtime, right (except maybe when it's first created)?

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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: Composite images and animation

#2 Post by PyTom » Sat Apr 08, 2006 3:45 pm

ShiraiJunichi wrote:I'm using im.Composite for some of my images to save disk space. Basically, composing facial features for a character's image. I have an animation for eyes that I would like to compose with everything else, but trying to composite an animation gives me this error:

Exception: Expected an image, but got a general displayable.
You want to use LiveComposite rather than im.Composite for these images, as it supports compositing displayables, rather than just images.

An alternative would be to make the animation out of im.Composites, which would work, but would probably waste memory.
Also, I was wondering... composite images have no processing expense at runtime, right (except maybe when it's first created)?
im.Composite has no expense, apart from the cost of loading images into memory. (And keeping them there, if you have multiple images used by an Animation.)

LiveComposite has expense proportional to the total size of all of the image parts. But it only needs to keep the image parts in memory, rather than the entire image.

When doing an animation, a LiveComposite can often be the most efficient, as only the small part that changes needs to be redrawn.

In conclusion, use LiveComposite.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
ShiraiJunichi
Miko-Class Veteran
Posts: 651
Joined: Sat May 21, 2005 12:28 pm
Location: University of Utah
Contact:

#3 Post by ShiraiJunichi » Sat Apr 08, 2006 4:38 pm

Works great, thanks!

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#4 Post by PyTom » Sat Apr 08, 2006 9:20 pm

Here at AB, we pride ourselves on creating solutions to problems before people have had them.

(So how 'bout a status update on Summer Snow?)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
ShiraiJunichi
Miko-Class Veteran
Posts: 651
Joined: Sat May 21, 2005 12:28 pm
Location: University of Utah
Contact:

#5 Post by ShiraiJunichi » Sun Apr 09, 2006 10:54 am

(So how 'bout a status update on Summer Snow?)
Actually, "Summer Snow" is going to be a really ambitious project. At least, for me anyways. It is going to have several thoughts and themes that I will try to express. I realized that such a project needs more time than I had for intRenAiMo. So I decided to work on a smaller project, currently named "Emiko"- but I don't know if that name will stick. Probably not, because it seems too cliche and un-imaginitive to name the game after the lead female character. Anyway, I'm still having a few problems with the script. I'm so "straight to the point" in my normal conversation, that it conflicts with taking time to slowly unfold the story. Maybe I'll re-play a few of Mikey's games to see how he did it so well ^_^.
In the beginning, I just wanted something about as long as Abigail. I think I'm about at that length, and I feel like the story isn't even a third done.
Only one path as of yet.
As you may have guessed by my question, quite a bit of art has been done. Art looks really good- Snow Shine is amazingly talented. In fact, she has even been asked if her Black Pencil manga could appear in a Vietnamese magazine. I think she will decline though... Anyway, I like her art so much, that I worry I'm letting it go to waste by using it in my game... It gives me a standard of quality to look up to though.
Music is pretty much chosen. I have a few piano tracks that were freely available on the web. I thought it was pretty good stuff, but after I played "Go Magical Boy!", I realized that it was far from being what it could be. But, you have to work with what you've got, I guess.
I'm not sure about including voice anymore... I normalized my wav files, and then converted them to speex, but then they sounded really horrible. It was weird because when I directly normalized the wav files while converting to mp3, they turned out fine... I don't think my hardware is good enough. I feel so ghetto, sitting at my PC recording something for a game with nothing but my humble microphone, and cheap integrated sound card. I'm tempted to ask Alessio if he knows where I could purchase some good equipment online or something- but then I might actually buy it! My spending tends to be a bit... impulsive. Not a good thing for a poor college student O_o;;;
And that pretty much sums it up. I'll be a bit busy, this being the final month of Spring semester. But after that- SUMMER BREAK! I'm hoping to finally have the time then to work on it non-stop and release some time in the Summer. Then I'll begin work on Summer Snow. With some work, that may see a release at next year's IntRenAiMo. Or... I may begin work on a new project...
The other day, I showed Ren'Py to a cousin of mine. And his response was, "You could make something like 'Marry Me Misato' with this!" ^_^;;; If he gets into it enough, we may begin work on a comedy of sorts.

User avatar
Alessio
Miko-Class Veteran
Posts: 573
Joined: Fri May 07, 2004 9:40 am
Projects: GO! Magical Boy (2006), Angelic Orbs (soundtrack), Cyberlin (in progress)
Location: Finland
Contact:

#6 Post by Alessio » Sun Apr 09, 2006 1:28 pm

I'm tempted to ask Alessio if he knows where I could purchase some good equipment online or something- but then I might actually buy it!
I'll be glad to give advice, but you won't necessarily need to buy anything; if the wav quality is good (and you said it is) then the problem is probably the conversion process or the speex format, not your recording.

Apart from that, you might want to add some compression to the wav before converting, that will minimize the impact of the conversion (what is compression? Look here: http://www.fasoft.com/wiki/index.php?ti ... ssorBasics). There's many simple free tools for that, ask if you need any advice. (I'll be on holiday for a week, will answer after that)

Watercolorheart
Eileen-Class Veteran
Posts: 1314
Joined: Mon Sep 19, 2005 2:15 am
Completed: Controlled Chaos / Sum of the Parts / "that" Midna game with ZONEsama
Projects: Sparse Series/Oddments Shop original cartoon in Pevrea; Cybernetic Duels (fighting game); Good Vibin'
Organization: Watercolorheart Studios
IRC Nick: BCS
Tumblr: adminwatercolor
Deviantart: itsmywatercolorheart
Github: Watercolordevdev
Skype: heartnotes
Soundcloud: Watercollider
itch: watercolorheart
Location: Florida
Contact:

#7 Post by Watercolorheart » Sun Apr 09, 2006 2:44 pm

Hey, excuse me, I've been trying to make an animation with LiveComposite and Im.Composite and I'm having some difficulty expressing to the engine that I'd like it to include the sm.Animation function that describes the actions of the blinking eyes on top of the seperate layers for the face, mouth, and eyebrows (I made them seperate so I could - in theory- have nearly 20 or 30 different expressions without wasting a great deal of space).

How do I phrase to Renpy, that - for example - I'd like the sm.Animation mae_eyes on top of brows, mouth, and face?

Can someone give me a code example, please, for LiveComposite?

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#8 Post by PyTom » Sun Apr 09, 2006 3:24 pm

You'd probably want something like:

Code: Select all

init:
    $ mae_eyes = anim.SMAnimation(...)

    image mae_happy = LiveComposite((400, 600), 
        (0, 0), Image("mae_base.png"), 
        (100, 100), Image("mae_happy_brows.png"))
        (100, 200), Image("mae_happy_mouth.png"))
        (100, 100), mae_eyes, 
something like that might work. I don't totally understand what you want. Basically, the first argument to LiveComposite is the size of the result, and then there's basically a list of position-displayable pairs.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Watercolorheart
Eileen-Class Veteran
Posts: 1314
Joined: Mon Sep 19, 2005 2:15 am
Completed: Controlled Chaos / Sum of the Parts / "that" Midna game with ZONEsama
Projects: Sparse Series/Oddments Shop original cartoon in Pevrea; Cybernetic Duels (fighting game); Good Vibin'
Organization: Watercolorheart Studios
IRC Nick: BCS
Tumblr: adminwatercolor
Deviantart: itsmywatercolorheart
Github: Watercolordevdev
Skype: heartnotes
Soundcloud: Watercollider
itch: watercolorheart
Location: Florida
Contact:

#9 Post by Watercolorheart » Mon Apr 10, 2006 2:52 pm

Yeah, I think that's it, thanks!

I couldn't figure out how to tell it what I wanted ... but since all the PNGs were made in Flash, and they're all the same size (600x600), I don't need to "position them" ... additionally, there's not really anything other than cel-shading so the file size is extremely small.

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot]