How do you make them blink?

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
n9261andvari
Regular
Posts: 58
Joined: Sat Apr 29, 2006 1:25 am
Location: Otherside of the world, when you sleep I'm awake...
Contact:

How do you make them blink?

#1 Post by n9261andvari »

Ok...I've already started digitalizing the concept art and I've finished working on the female. Then I realized, I wanted the characters to blink but I doubt I'll be able to make the female blink so I'm just gonna make the guys blink. Lol, anyways...how do you make the characters blink? Do you need 2 separate images like one with the eyes open and other with the eyes closed? Or do you guys use a gif?

Also another question about images...for backgrounds is it better to save it into a jpg format or png format? Can someone tell me the pros and cons about it cos I don't really notice anything different apart from the size of the file and the fact that png format can have transparency.

Thanks for reading and any answers will be greatly appreciated. (^_^)v

Enerccio
Miko-Class Veteran
Posts: 616
Joined: Thu Oct 26, 2006 4:23 pm
Projects: My Teacher; Songs of Araiah; Something new; Possible Cross Bomber?
Location: Slovakia, Kosice
Contact:

Re: How do you make them blink?

#2 Post by Enerccio »

for blinking you have two options:
Either have all frames for blinking animation (ie full pictures with eye changes)
then you use this code:

Code: Select all

image ayaki present normal static = Animation("images/ayaki_present/ayaki_normal/Ayaki_NormalA.png", 4.0, "images/ayaki_present/ayaki_normal/Ayaki_NormalA1.png", .10,  "images/ayaki_present/ayaki_normal/Ayaki_NormalA2.png", .15,  "images/ayaki_present/ayaki_normal/Ayaki_NormalA1.png", .10)
or you can use other code, in which you only change eyes and use one sprite for rest of body, which I don't use, so I can't help ya.

As for backgrounds, I like png. Maybe bigger file, but better quality.
Image
http://www.bishojo.tk is technically ONLINE!
Songs of Araiah promo: http://www.youtube.com/watch?v=CalchucuoDU

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

Re: How do you make them blink?

#3 Post by monele »

As for backgrounds, I like png. Maybe bigger file, but better quality.
I might be wrong but a JPG at maximum quality (well, just *slightly* below max quality) should be just as good and still smaller in filesize :)

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: How do you make them blink?

#4 Post by Jake »

monele wrote:I might be wrong but a JPG at maximum quality (well, just *slightly* below max quality) should be just as good and still smaller in filesize :)
Depends what the image is, basically. For photos, people will struggle to tell the difference between a highest-quality JPEG and a PNG. However, JPEG messes up most-obviously around high-contrast areas, so the nearer your image is to black-and-white lineart the more likely it is that the JPEG will look worse. Realistically, on highest-quality you really do have to step down to bold monochrome lineart / text on single-colour BG for normal people to notice the artifacts without looking for them, though.

Having said that, bold monochrome lineart is also the kind of image that PNG compresses the best, so you may even find that the file's smaller with PNG when you're using that kind of image. ;-)
Server error: user 'Jake' not found

Wintermoon
Miko-Class Veteran
Posts: 701
Joined: Sat May 26, 2007 3:41 pm
Contact:

Re: How do you make them blink?

#5 Post by Wintermoon »

Actually there are a number of art styles that look bad in jpeg. Monochrome line art is one of them. Pixel art is even less tolerant of jpeg compression than monochrome line art. Photographs, paintings, and 3D renderings tend to do well with jpeg compression.

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: How do you make them blink?

#6 Post by Jake »

Wintermoon wrote:Pixel art is even less tolerant of jpeg compression than monochrome line art.
Leaving aside the semantic argument that all 2D computer images are 'pixel art', it depends largely on the pixel art in question - those huge "look what you can do a pixel at a time with MS Paint" waterfront scenes and so on actually tend to look fine in JPEG, because they're well-blended, dithered or otherwise not so significantly contrasty.

It's quite particularly high-contrast from one pixel to the next - 'sharp' graphics - that makes it easy to spot the artifacts - they're obvious in anything which butts significantly-different colours right up against each other, be it undithered low-colour art like the smilies the forum uses, oekaki drawings, mono line art, black text on a white background or whatever.

(JPEG artifacts are also more obvious on LCD monitors, since the pixels are crisper and there's no phosphor bleed like you get on CRTs, so minor discrepancies are easier to spot.)
Server error: user 'Jake' not found

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

Re: How do you make them blink?

#7 Post by DaFool »

Since I like to reduce filesize, I use jpeg for backgrounds and pngs for sprites. I use lineless backgrounds so they work well with jpeg.

For blinking, I usually have a faceless base and two or more states for the face (such as blinking with eyes closed state). I have to composite them together, otherwise they will need 2 show statement declarations all the time.

You can blink regularly using a timed Animation, or do a random status like what I did on NT. (See its code for how to use im.Composite and for the blinking effect there).

n9261andvari
Regular
Posts: 58
Joined: Sat Apr 29, 2006 1:25 am
Location: Otherside of the world, when you sleep I'm awake...
Contact:

Re: How do you make them blink?

#8 Post by n9261andvari »

DaFool wrote: For blinking, I usually have a faceless base and two or more states for the face (such as blinking with eyes closed state). I have to composite them together, otherwise they will need 2 show statement declarations all the time.

You can blink regularly using a timed Animation, or do a random status like what I did on NT. (See its code for how to use im.Composite and for the blinking effect there).
Composite? Hmm...I'm kinda confused now. How can I view the code? I don't think it's viewable...is it?

Wintermoon
Miko-Class Veteran
Posts: 701
Joined: Sat May 26, 2007 3:41 pm
Contact:

Re: How do you make them blink?

#9 Post by Wintermoon »

Jake wrote:Leaving aside the semantic argument that all 2D computer images are 'pixel art', it depends largely on the pixel art in question - those huge "look what you can do a pixel at a time with MS Paint" waterfront scenes and so on actually tend to look fine in JPEG, because they're well-blended, dithered or otherwise not so significantly contrasty.
By "pixel art" I mean a rather specific art style that produces a very sharp and clean image by deliberately avoiding blending between adjacent contrasting colors. It is possible to hand-pixel an image in a different style, but why bother when you can get the same result through easier techniques?

Dithering is actually very vulnerable to jpeg artifacts, unless you don't care that your careful dithering is turned into a smooth gradient.

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: How do you make them blink?

#10 Post by Jake »

Getting further off-topic:
Wintermoon wrote:By "pixel art" I mean a rather specific art style that produces a very sharp and clean image by deliberately avoiding blending between adjacent contrasting colors.
Yeah, I guessed what you mean - I just don't like the term, because nothing about it means something specific to that particular style, and people used the term to mean something else before it got hijacked by the current lot.
Wintermoon wrote:Dithering is actually very vulnerable to jpeg artifacts, unless you don't care that your careful dithering is turned into a smooth gradient.
That's... typically exactly why most people use dithering, so I imagine most people with dithered images wouldn't care in the least. :P
All the same, at highest quality, regular dithering isn't going to be blended out that badly - that's only going to happen if you drop the quality quite low in the first place.

But that's beside the point, you're likely to get a better compression with an 8bpp (or lower) file format if you're really only using such a limited palette in the first place, and none of those that I know of use lossy compression methods in the first place.
Server error: user 'Jake' not found

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

Re: How do you make them blink?

#11 Post by DaFool »

n9261andvari wrote: Composite? Hmm...I'm kinda confused now. How can I view the code? I don't think it's viewable...is it?
All .rpy files within a /game directory are viewable. To check, just create a new Ren'Py project, call it something like 'Iwanttoseehowthisworks', then instead of launching it, delete its particular game directory and replace it with the game directory of the piece in question. Then when you 'Edit Script', all the rpy files will become viewable.

chronoluminaire
Eileen-Class Veteran
Posts: 1153
Joined: Mon Jul 07, 2003 4:57 pm
Completed: Elven Relations, Cloud Fairy, When I Rule The World
Tumblr: alextfish
Skype: alextfish
Location: Cambridge, UK
Contact:

Re: How do you make them blink?

#12 Post by chronoluminaire »

Or just open up Notepad/SciTE/your favourite text editor, and go "File -> Open" and find the .rpy file in question... ^^;;
I released 3 VNs, many moons ago: Elven Relations (IntRenAiMo 2007), When I Rule The World (NaNoRenO 2005), and Cloud Fairy (the Cute Light & Fluffy Project, 2009).
More recently I designed the board game Steam Works (published in 2015), available from a local gaming store near you!

n9261andvari
Regular
Posts: 58
Joined: Sat Apr 29, 2006 1:25 am
Location: Otherside of the world, when you sleep I'm awake...
Contact:

Re: How do you make them blink?

#13 Post by n9261andvari »

OH! Naruhodo...*whacks self on head* Why am I such an idiot.
Sorry it's just that I thought, well...there's that option that makes players unable to view the script to avoid cheating yes? So I thought all complete works would have that set to "true" or "false" whichever one that disables the option...lol...cool now I can learn a lot of stuff through trial and error. Thanks guys! *bows*

n9261andvari
Regular
Posts: 58
Joined: Sat Apr 29, 2006 1:25 am
Location: Otherside of the world, when you sleep I'm awake...
Contact:

Re: How do you make them blink?

#14 Post by n9261andvari »

I just looked at the script for NT and BOY! Was I confused. Lol...nevermind. I will ask further questions after I experiment with it. If I still don't understand then you'll be hearing me again, lol.

Enerccio
Miko-Class Veteran
Posts: 616
Joined: Thu Oct 26, 2006 4:23 pm
Projects: My Teacher; Songs of Araiah; Something new; Possible Cross Bomber?
Location: Slovakia, Kosice
Contact:

Re: How do you make them blink?

#15 Post by Enerccio »

There is only option to avoid cheating (developer mode)
but script can be viewed anytime unless you exclude it from making distributions (cause compiled script, which is necessary to run game cannot be viewed that easily).
Image
http://www.bishojo.tk is technically ONLINE!
Songs of Araiah promo: http://www.youtube.com/watch?v=CalchucuoDU

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]