[SOLVED?] Character ''flickering''

Started by Miglioshin, Wed 01/02/2012 14:58:44

Previous topic - Next topic

Miglioshin

Hi everyone,

I was improving the walk cycle of my character, in particular I was centering the position of all frames (in the transparent rectangle) because I noticed that, when walking, my char seem to flicker.

After the centering procedure, well, it's still flickering, but only when the room is NOT scrolling.

Better said:
when the char walks across a static room (i.e left -> right) it flickers but when the room is scrolling while the char is walking it doesn't flicker.

It's clear that I do not have 'empty' frames in the walk cycle and, when checking the preview animation inside the editor the char doesn't flicker.

What can be the cause?

Any ideas?

Thanks in advance.

Darius Poyer

I haven't had this issue myself, but I would go over the general settings, look under the "character Movement" section see if messing with some of that improves it.

Could be that you have some empty frames at the beginning? or empty directions, or too many directions, like 8 while only 4 are set.

seems like a basic Occam's razor kind of deal though.

Miglioshin

No, I don't have any empty frames

No, I have only 4 direction set and only 4 loops (0, 1, 2, 3).

I played around with the char settings pane, and set/unset option like movement linked to animation and that sort of stuff.

I played also around char movement speed and animation delay, and after a while I noticed that setting MovementLinkedToAnimation to false (tweaking again speed and delay, because the same values have 'changed' their result into 'faster than the previous setting') have 'quite' solved my issue.

It seemed to me that, with MLTA==true, my char 'jumped' some pixels while walking (w.speed 6 - a.delay 4 - loop frames 0 to 10) giving the impression to flicker, actually being 'stuck' at a certain x during the walking frame and reappearing like 4 - 6 pixels further with the next walking frame...

Now the char don't flicker while walking, it's only a little blurred and a tiny bit transparent... ???

Could it be due to my computer (Intel Celeron 2.80 Ghz - 512 MB RAM - Radeon 9800 pro)?


Khris

Blurred, transparent, jumping...?
Could you export this character and upload it for us to look at?

Also, I'm not quite sure what you mean by "flickering" but it doesn't sound like actual flickering, more like gliding / moon-walking, which is a lot more noticeable if the room isn't scrolling.

If MLTA is true, a walking speed of 6 and an animation delay of 4 means that every 4 frames, AGS moves the character 6 pixels while switching to the next animation frame.
If MLTA is turned off, the character moves 6 pixels every frame while the used sprite changes every 4 frames.

For characters with feet, MLTA should be true and the sprites of the walk-cycle should be drawn in a way that a foot touching the ground moves back a constant amount of pixels in between frames. This amount is then entered as the walking speed, and not touched any further. Any speed adjustment is only done by changing the animation speed. (For perfect examples of this, see Ben304's games.)

Miglioshin

#4
Quote from: Khris on Thu 02/02/2012 16:59:30
... the walk-cycle should be drawn in a way that a foot touching the ground moves back a constant amount of pixels in between frames. This amount is then entered as the walking speed...

Oh, this is something I really didn't know (I'm no animator at all and poor coder as well, but I'm a decent musician... ^_^), I will take this in consideration for my future walk cycles.

I'm uploading 2 short videos of what I'm talking about (on youtube), as soon as they're up I will edit with the links.

With 'flickering' I mean... err... flickering like a malfunctioning neon tube.

EDIT:

This video shows the character flickering while walking in a static room

http://www.youtube.com/watch?v=4aZ4TYgmDBA

And this shows how the charcter stop flickering in a scrolling room when it's scrolling (but is the background that actually flicker -- look at the door when bg is scrolling)

http://www.youtube.com/watch?v=GlA5qMawb8Q&context=C3d739dcADOEgsToPDskLrPRONWC0dHfmpqEJOMm2I

As I said before the view sprites are already centered, so no left-right shifting while the animation is playing, and I have no 'empty' sprites in the loop.
This happens with all my character views (also with the dog that moves around on a skateboard, but as said before, no legs no MLTA).
When I 'preview' the animation inside the editor it looks 'crystal clear and perfect' (in its hideousness --- also w/o the 'center pivot' flag).


Snarky

This looks more like a screen refresh issue than a problem with the walkcycle itself. Somewhere there's a v-sync setting you could try.

Miglioshin

#6
Hmmm, I'll try to look at it...

EDIT:

I tried to set system.Vsync to true ( in game_start() ) but I noticed no changes at all.
I checked the general settings, the preferences and winsetup, but I found nothing related to video sync.
I also checked all my monitor osd options but I found nothing.

Atm I'm clueless...

Snarky

OK, so system.vsync only works in DirectDraw in full-screen. If you're running in any other setting, it won't work.

Check out Calin's plugin to see if it helps you work around the problem: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=41669.0

Miglioshin

Quote from: Snarky on Mon 06/02/2012 21:40:04
OK, so system.vsync only works in DirectDraw in full-screen. If you're running in any other setting, it won't work.

Check out Calin's plugin to see if it helps you work around the problem: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=41669.0

Bad news here, I'm actually using Direct Draw 5 and I usually test the game by launching it via the compiled .exe (in fullscreen), and I really noticed nothing different with System.Vsync true or false, I also verified if it was true with the line:

if(System.Vsync==true){gMYGUI.visible=true;}

The gui was visible (a small rectangle in the top left corner of the screen) but there were no significant changes in the game behaviour, no less tearing, no fps drop...
I'm wondering if setting S.Vsync to true really does something 'inside the engine'...
Maybe something gone wrong with the latest update (I'm using AGS 3.2.1)?
I've seen Calin's thread last night or so, and it seems his plugin is dedicated 'only' to Direct3D 9 because S.Vsync doesn't work with that setting, but as far as I can see it doesn't work the same with Direct Draw 5.

I found a couple threads with a similar issue, but both of them haven't been solved yet.

Regardless, thanks for the link Snarky ^_^

Since my game (like all my games) will be a non-commercial game, I might consider the option to leave things as they are and move on, or I'll never release it!! lol
I belived that this was an easy fix overlooked by my inexperience with AGS engine but it seems I was wrong...

Khris

Could you release a stripped version with just the room and character for us to test? Maybe this doesn't occur on every system.
Another thing to try would be Ali's smooth scrolling module. Basically, if your character moves 5 pixels every few frames in a scrolling room, so does the viewport. The module changes that by scrolling manually.

Miglioshin

Quote from: Khris on Tue 07/02/2012 14:55:35
Could you release a stripped version with just the room and character for us to test? Maybe this doesn't occur on every system.

I guess this can be true, my system isn't the latest for sure, but I can't try out the game on a powerful system...

No, I won't spend time to export - repacking - adjusting - re-coding a single room version (I'm lazy enough with this project) BUT if you are kindly willing to go deep into this issue I will be glad to .rar and mail you the entire game folder.

The major issues you'll face will be:
- most of the code (obj names, functions etc...), comments in the code and the game itself are in Italian...
- my personal indentation method that you already faced (learned somewhere in the italian Inform beginner's guide... lol) which will surely make you dizzy... (and angry...)
- beginner's scripting and (probably) messy and redundant code all around!

Meanwhile I wil try different settings for my cha (atm speed 10, delay 4).

I didn't realize all the implications around movement speed and animation delay, in particular the ones you mentioned in your previous post.
Probably a movement speed of 10 is too high compared with the sprite size, and maybe this is the main cause of the 'shifting effect' of the walk/scrolling, 10 pixels are simply too much (didn't tested yet but I guess I'm not too far from the truth).

Why I (arbitrarily) set it to 10?
In my ignorance I wanted my char to walk at a good peace without rushing around and I adjusted the animation delay accordingly 'at sight'...  :-[

And then you rightly made me notice that behind a decent walk cycle there are much more rules than one would expect (and that one is me! lol).
And that made me think that the major cause of this strange beahviour is my hideous view and its settings...

The truth is that I drawn the sprite in the old fashioned style (with tracing paper) and then scanned them; slightly corrected them (removed anti-aliasing with photoshop and windows paint), imported them in the editor, and left them at their fate... (not the best work eh?)...

Khris

It's not that much work; make a copy, change the starting room and delete all other room files.

Whatever you'll upload, I'll take a look at it focusing on the current issue, not your coding.

Miglioshin

Ok.

I followed your suggestion and got rid of unnecessary things, then I quick-searched for a free file hosting site and uploaded the remains at:

http://www.filefactory.com/file/c27f556/n/Gli_alieni_mi_han_fottuto_la_birra!.rar

According to the terms of use this link will be valid within 90 days from the latest download of the file itself


Khris

#13
I tried downloading it yesterday and again today, the download always gets interrupted in the middle.

Could you upload it here? http://netload.in/

Miglioshin

#14
I'm trying to upload the file there, but it seem I have problems because it doesn't move on...

Meanwhile I sent you an e-mail to the address I found in your profile informations with the archive attached (2,45 MB).

If netload moves on with my upload I'll edit with the link.

EDIT:

After several trials I uploaded to Mediafire

http://www.mediafire.com/?k43dq9x1l2c0857

Khris

I took a look at it and I'm afraid there isn't much you can do.
What I tried was setting the game's speed to 80 and it might have gotten slightly better but I could've imagined it.
What I'm saying is you didn't do anything wrong, it's just that the engine doesn't buffer the output and thus one can almost watch the sprite getting drawn.

Miglioshin

Oh... oooh... oooohhhh... !

*sigh*  :'(

It's a pity and a relief at the same time.

A pity because I can do nothing about it (except lowering the cha.movspd around 6 maybe).

It's a relief when I hear you say I didn't mess up things, really.

Thank you khris for the amount of your (spare) time you spent around this issue.


SMF spam blocked by CleanTalk