The Daily Click ::. Forums ::. Klik Coding Help ::. Alpha Channel Graphical Glitches
 

Post Reply  Post Oekaki 
 

Posted By Message

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
23rd June, 2005 at 20:14:54 -

After not doing any real kliking for months, I finally got back into working on Rocket Skater's engine. I fixed some movement and camera bugs, and replaced the pixelly 32 directions active object when rotating around poles with the silky-smooth Alpha Channel object. However, I see some graphical glitches when trying this approach.

Sometimes, when the character is pointing up or down, the Alpha Channel's character object's borders (as in what I declared as transparent, but still in the rectangular borders in the object) will flash white, causing the pole to flicker.

The pole-swinging is initiated in the following (slightly shortened) event:
Pole detector overlaps group 2 (pole) & group 2's alterable value A is 0 & character is either walking, jumping, or falling -> set group 2's alterable value A to 1 & do stuff to make character invisible and know that it's pole-swinging & rotate alpha channel to angle based on direction between group 2 and character & reposition alpha channel & make alpha channel reappear.

Even though I tell the alpha channel object to reappear after rotating and repositioning it, it still flickers briefly its last angle. What could be causing these graphical bugs?

MMF non-open source engine: http://bellsouthpwp.net/r/e/realnoyb/RSAlpha.zip

Engine Notes: Press space to jump, walljump, and let go of poles. Press "s" on the ground to go to beginning of demo (I started it in an area with three rotation poles for ease of bugchecking these problems). You fly off poles in the angle your body makes with the pole, not off in a perpendicular tangent as you would in real life. I might change that later.

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
25th June, 2005 at 22:41:55 -

Okay, I reread the help file of the Alpha Channel Object and found that the flickering borders is due to having rotations and/or animations while overlapping other objects, and can be easily fixed by unchecking the "Display as Background" box in the Alpha Channel Object's properties. However, I still cannot figure out why the object still momentarily flashes its previous rotated direction when I tell it to reappear in the code in the above post. Can anyone else?

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
29th June, 2005 at 16:08:01 -

Okay, I made an unprotected .cca file to demostrate my problem. Press up and down to rotate the arrow (an Alpha Channel Object), and space to toggle visibility. The problem I'm having is that when you give the alpha channel object a new angle, then make it reappear, it briefly flashes its previous angle. What is causing this and how can I fix it?
Example: http://bellsouthpwp.net/r/e/realnoyb/AlphaRotation.cca (24 kb MMF source. Requires Alpha Channel Object from Bonus Pack 2.)


 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames

Nuutti



Registered
  26/10/2003
Points
  1364
30th June, 2005 at 05:24:38 -

http://nuutti.afraid.org/jotainmuuta/AlphaRotationFixed.cca
why did you make it to get the angle only when it's visible? I fixed it by using "always".
~np.

 
P.S. sorry for my mangled english.

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
30th June, 2005 at 16:40:36 -

No! That was just an illustration of the problem in my game engine (link posted above if you need further explanation). When the platform character is close to a pole, then the character would start swinging around the pole. The character's active object (well, actually a set of linked actives) is made invisible, to be replaced with the alpha channel object. The initial angle of the alpha channel is set based on the direction between the pole and the character, then the alpha channel object is made visible again. The angle is calculated in the event where the alpha channel object is made visible again, thus my reasoning behind changing the angle only when it reappears in the example file. Thanks for providing the only helpful post, Nuutti, but it still doesn't fix my problem.

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames

Fifth

Quadruped

Registered
  07/05/2003
Points
  5818

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
30th June, 2005 at 17:29:53 -

So... now the only problem is that, when you change its direction and make it visible in the same action, it doesn't change its visible angle until after it reappears?

That's simple enough to fix. Just don't make it all happen in the same loop. Change the order of things!

Instead of:
1-action occurs, so
-change direction and make visible

have something like
1-if flag is on,
-make visible
2-action occurs, so
-set flag on
3-if flag is on,
-change angle

Therefore the direction will change one full loop before it becomes visible, and should give it time to get ready.

 
Go Moon!

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
30th June, 2005 at 18:28:40 -

It works! Thanks.

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames
   

Post Reply



 



Advertisement

Worth A Click