Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-04-2008, 09:59 PM
Rufus Rufus is offline
Registered User
Join Date: Jun 2004
Location: United Kingdom
Posts: 4,698
Rufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud of
Applying filters on tiles.

Is there any way to apply filters to tiles? Similar to backpals, but in a way that doesn't lag like hell. If you're not sure what I mean by filter, here's a level from Graal Classic and a "filter" from Zelda: Four Swords Adventures:





__________________
Quote:
Originally Posted by Loriel View Post
Seriously, you have ****-all for content and you're not exactly pulling in new developer talent, angling for prestigious titles should be your last concern.
Reply With Quote
  #2  
Old 11-04-2008, 10:03 PM
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
A layer with its transparency set would be able to replicate this. You know the deal with that, though.
Reply With Quote
  #3  
Old 11-04-2008, 11:15 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by DustyPorViva View Post
A layer with its transparency set would be able to replicate this. You know the deal with that, though.
It might be possible to have a weapon script that edits the tilelayers on clientside, and sets the transparency. I might try that later.
__________________
Reply With Quote
  #4  
Old 11-04-2008, 11:41 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by cbk1994 View Post
It might be possible to have a weapon script that edits the tilelayers on clientside, and sets the transparency. I might try that later.
Of course it is, but Rufus said in a way that doesn't lag like hell, meaning a hard-coded method would be preferred over anything scripted. A filter is easily done by script.

Ideally you would specify a layer as a filter layer and provide an image to do it, then you would specify which tiles the filter would be drawn over, like grass tiles and such. Then Graal would apply the filter only over tiles that are in the allowed list, that way doesn't cover things like houses and paths and you wouldn't have to treat the filter as if it was another tile layer by manually placing them over the grass and such.

Better layering support could really allow for some awesome effects.
__________________
Reply With Quote
  #5  
Old 11-05-2008, 05:53 PM
Rufus Rufus is offline
Registered User
Join Date: Jun 2004
Location: United Kingdom
Posts: 4,698
Rufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud ofRufus has much to be proud of
Quote:
Originally Posted by Inverness View Post
Ideally you would specify a layer as a filter layer and provide an image to do it, then you would specify which tiles the filter would be drawn over, like grass tiles and such. Then Graal would apply the filter only over tiles that are in the allowed list, that way doesn't cover things like houses and paths and you wouldn't have to treat the filter as if it was another tile layer by manually placing them over the grass and such.

Better layering support could really allow for some awesome effects.
You're correct and I must admit I didn't really think about it before I asked. There are tiles that are semi-grass semi-cliff, etc so applying a filter to tiles is not exactly suitable.
__________________
Quote:
Originally Posted by Loriel View Post
Seriously, you have ****-all for content and you're not exactly pulling in new developer talent, angling for prestigious titles should be your last concern.
Reply With Quote
  #6  
Old 11-05-2008, 07:14 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Rufus View Post
You're correct and I must admit I didn't really think about it before I asked. There are tiles that are semi-grass semi-cliff, etc so applying a filter to tiles is not exactly suitable.
Well in that case there would need to be a filter mask the same size as the tileset.
__________________
Reply With Quote
  #7  
Old 08-25-2010, 04:28 AM
LordOfPi13 LordOfPi13 is offline
Classic iPhone LAT
LordOfPi13's Avatar
Join Date: Jul 2010
Location: California
Posts: 45
LordOfPi13 is an unknown quantity at this point
Send a message via AIM to LordOfPi13
Amazing! For the record, are you publicly sharing this for use on servers? Or just for us to play around with =P
Reply With Quote
  #8  
Old 08-25-2010, 04:41 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Quote:
Originally Posted by LordOfPi13 View Post
Amazing! For the record, are you publicly sharing this for use on servers? Or just for us to play around with =P
I'm not sure what you're asking since there isn't anything shared at all except a Photoshop'd image.
Reply With Quote
  #9  
Old 08-25-2010, 06:04 AM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
I'm so confused.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #10  
Old 08-25-2010, 06:19 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Wondering now though, if grass were laid on a separate layer from all your other tiles, and you used the transparent-edge cliff tiles and such on the higher levels, I don't think it would be too difficult to pull off an effect like this with something like a simple image overlay.
Reply With Quote
  #11  
Old 08-25-2010, 06:24 AM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
Sounds like a job for the stencil buffer!

..oh.. wait..

(Be forewarned that I typed this on my phone whilst very sleepy, I won't be home for a while, so if I'm rambling, please, ignore it.)

Yeah, with a stencil buffer you could take pics1 and make an overlay of sorts where black pixels are non-filtered and white pixels are filtered, then for the problem tiles that are half grass half non-grass, draw over them with the stencil buffer to crop out that specific area.

In current, non-stencil buffer Graal, you could draw it as a big overlay, then draw non-grass tiles from a separate pics1 with teansparency where the grass should show up on tip of that image. This would probably lag on older machines, though. Perhaps the best solution is to do the previously mentioned for only "problem tiles" that are half grass half non grass and separate the rest into tile layers, although I'm unsure how tile layers work exactly and if you can draw under them while still maintaining that the player be drawn above them.

Furthermore, I'm sure you can come up with something remotely satisfactory if you were to "bake" it into the level by automating the entire process via a third party scrypt you can write in Python or whatnot to redraw the level based on tile indexes that you send over, use a special pics1 with white being grass and black being non grass, parse out the grass parts via the black or white pixel color, I guess, make a 1024x1024 overlay for the entire level that is only on the grass portions, and send it back to the server to be downloaded and drawn by the client via a system NPC, all of which is perfectly doable in PHP with the GD library, or Python, or whatever you so choose to interface with on the server. And it would only have to be calculated once per level, forever and ever. That's what I did for my lightmapping system and it worked fabulously, with extremely zero lag since it's simply a 1024x1024 graphic being drawn over the screen at the level's top left corner.

Orrrrrr you can try and tinker with TDrawingPanels, but I wish you luck in getting those to work without freezing the client for a good two or three minutes while you redraw the level to a GUIControl, parse out the grass sections, and draw your detail texture to the grass areas to overlay.

Your best bet? The second to last method I described. Hooray for anything that looks good in Graal being a huge ****in' hack.
Reply With Quote
  #12  
Old 08-25-2010, 04:48 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Downsider... Too much text
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #13  
Old 08-25-2010, 07:17 PM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
It's very difficult to track how much you're writing when you're on an iPhone and your fingers are just flowing over the touchscreen. The only truely helpful things said were in the third to last paragraph. The rest are methods that will be unbearaly slow.
Reply With Quote
  #14  
Old 08-25-2010, 07:55 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by 12171217 View Post
It's very difficult to track how much you're writing when you're on an iPhone and your fingers are just flowing over the touchscreen.
I bet. My dad has one.
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
Reply


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 09:16 PM.


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