Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-20-2013, 06:44 PM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
Screen Fading

Hello all,

My goal is to fade the sides of the screen from black, coming in more and more transparent.

One way of doing it is I made fading images and they were set on a showImg and always staying on borders of screen, adjusting it's height and width according to screen size.

Unfortunately, I think it somewhat lags.

Any suggestions?

I attached a picture with the idea I had in mind.
The black starts from the borders, and fades in.
Attached Images
 
__________________
No matter how much I hate graal, I'm always coming back.

smh
Reply With Quote
  #2  
Old 04-20-2013, 07:21 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Images are the way to go~
__________________
Reply With Quote
  #3  
Old 04-20-2013, 07:32 PM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
Quote:
Originally Posted by Crow View Post
Images are the way to go~
Hmmm, I see. Well, I am also trying to get kind of a motion blur going on.

Any ideas for that?
__________________
No matter how much I hate graal, I'm always coming back.

smh
Reply With Quote
  #4  
Old 04-20-2013, 11:17 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by brokk View Post
Hmmm, I see. Well, I am also trying to get kind of a motion blur going on.

Any ideas for that?
Try:
PHP Code:
level.tilelayers[0].alpha 0.9
Less for a stronger effect. Should be the correct var, not 100% sure though.
__________________
Reply With Quote
  #5  
Old 04-21-2013, 03:48 AM
devilsknite1 devilsknite1 is offline
C:
devilsknite1's Avatar
Join Date: Jul 2006
Location: Florida, USA
Posts: 269
devilsknite1 has a spectacular aura about
Send a message via AIM to devilsknite1 Send a message via MSN to devilsknite1 Send a message via Yahoo to devilsknite1
Could always create a circular polygon around the player according to screenwidth/height
Actually, you may be interested in looking at this thread. It's not exactly what you're looking for, but can be done similarly.

And what kind of blur are you looking for? The level and the player?
Reply With Quote
  #6  
Old 04-21-2013, 02:15 PM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
Quote:
Originally Posted by devilsknite1 View Post
Could always create a circular polygon around the player according to screenwidth/height
Actually, you may be interested in looking at this thread. It's not exactly what you're looking for, but can be done similarly.

And what kind of blur are you looking for? The level and the player?
Looking for a a slight blur, but then a motion blur for when a player hits a certain speed.
__________________
No matter how much I hate graal, I'm always coming back.

smh
Reply With Quote
  #7  
Old 04-21-2013, 06:47 PM
Stephen Stephen is offline
Boom!
Stephen's Avatar
Join Date: May 2004
Location: San Francisco
Posts: 10,410
Stephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud ofStephen has much to be proud of
Quote:
Originally Posted by brokk View Post
Looking for a a slight blur, but then a motion blur for when a player hits a certain speed.
Yea, Tig and I did this on GK for our Easter monster attacks. We had to use images - the results were nice and I'd love to see this level of detail more common place.
__________________
Reply With Quote
  #8  
Old 04-21-2013, 07:44 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by Stephen View Post
Yea, Tig and I did this on GK for our Easter monster attacks. We had to use images - the results were nice and I'd love to see this level of detail more common place.
Would be nice if the code for it could be shared.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #9  
Old 04-21-2013, 11:06 PM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
Quote:
Originally Posted by Crow View Post
Try:
PHP Code:
level.tilelayers[0].alpha 0.9
Less for a stronger effect. Should be the correct var, not 100% sure though.
You'll want to reserve tile layer commands for tileset palette changes, not visual transitions. Seteffect would be more appropriate to use for this kind of thing because it darkens the screen, not the tiles.



I would recommend using a gradient image overlay on the screen layer, similar to what you've got pictured. By overlay, I mean that you need to stretch the image to the dimensions of the player's screen, and make it transparent. It shouldn't lag much at all as long as you aren't constantly re-drawing the image when you don't need to or anything like that.

Then for the actual transition itself, create a function using seteffect to fade the screen in and out as the player is warping from one level to another.

By combining a gradient image overlay with a fader, the darker shades of the gradient will fade out first, and the lighter shades will fade out last. However, you might also want to experiment by either inverting the image as well, or changing the image mode to negative as well to produce different results. If you wanted to get really fancy, you could try overlays in different shapes or forms.

Last edited by Draenin; 04-21-2013 at 11:21 PM..
Reply With Quote
  #10  
Old 04-21-2013, 11:18 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Draenin View Post
You'll want to reserve tile layer commands for tileset palette changes, not visual transitions. Seteffect would be more appropriate to use for this kind of thing because it darkens the screen, not the tiles.
He did say motion blur. Setting the bottom tile layer's alpha below 1 will create a motion blur-ish effect. You can't achieve that with anything else.
__________________
Reply With Quote
  #11  
Old 04-21-2013, 11:30 PM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
Quote:
Originally Posted by Crow View Post
He did say motion blur. Setting the bottom tile layer's alpha below 1 will create a motion blur-ish effect. You can't achieve that with anything else.
Great news. You can actually combine all three effects. (Overlay, Fade, Motion Blur)

However, I would not strongly recommend keeping motion blur on all the time. I've gotten a few complaints that way. You have to use it judiciously.
Reply With Quote
  #12  
Old 04-22-2013, 12:01 AM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
Quote:
Originally Posted by Draenin View Post
Great news. You can actually combine all three effects. (Overlay, Fade, Motion Blur)

However, I would not strongly recommend keeping motion blur on all the time. I've gotten a few complaints that way. You have to use it judiciously.
The plan was when the player "sprints", the motion blur is activated. So I'll just have the client check for speeds and movement and such.

Haven't tried the script that you guys offered me yet, but I will tonight and let you guys know how it goes. perhaps screenies if I'm having problems.
__________________
No matter how much I hate graal, I'm always coming back.

smh
Reply With Quote
  #13  
Old 04-22-2013, 12:49 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
You can just create a gani that creates a trail effect of the player and set it to an attr.

I think I actually have mine from Testbed. Basically you run a loop(however long you want the trail to be) and have an array that keeps track of the last 20 or so(again, the length of the trail) positions of the player. My version goes a bit further and also stores the animation frame to maintain accuracy and effect.
Attached Files
File Type: gani dusty_trail.gani (907 Bytes, 125 views)
Reply With Quote
  #14  
Old 04-22-2013, 12:59 AM
brokk brokk is offline
Registered User
Join Date: May 2012
Posts: 84
brokk is on a distinguished road
Quote:
Originally Posted by DustyPorViva View Post
You can just create a gani that creates a trail effect of the player and set it to an attr.

I think I actually have mine from Testbed. Basically you run a loop(however long you want the trail to be) and have an array that keeps track of the last 20 or so(again, the length of the trail) positions of the player. My version goes a bit further and also stores the animation frame to maintain accuracy and effect.
This is sweet, but I mean a full screen blur.
__________________
No matter how much I hate graal, I'm always coming back.

smh
Reply With Quote
  #15  
Old 04-22-2013, 01:05 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by brokk View Post
This is sweet, but I mean a full screen blur.
Then what Crow said is the only option. You just need to tweak the value to determine the strength of it.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.