The Daily Click ::. Forums ::. Klik Coding Help ::. shadow map
 

Post Reply  Post Oekaki 
 

Posted By Message

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
21st January, 2007 at 20:05:02 -

Back when I was creating Splinter Source, I used a very primitive and stupid method for the shadows; they were all active objects. Originally, I actually had 32x32 tiles making up the shadows but I ran into an object limit problem. So what I did was took a screen shot of the map, cropped out the objects and only kept the shadows so I had one huge active object for all the shadows. Ya, like I said really stupid.

Anyways, it seems to me I should be able to acomplish a more efficient effect with the overlay redux object but I have no idea how. Any insight would the helpful.

Zi-Xiao

 
n/a

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
21st January, 2007 at 22:25:00 -

Well, if you'd like to try something strange, I'd recommend (as I always do) the Text Blitter.

Since the shadows are simply 32x32 pixel tiles (correct?) you can put the data of what tiles're where in an external file, and have a mere than 4 Text Blitters displaying them appropriately.

The strange part would come from making the way to create the shadowmap data, the way to display it properly, and a new way to detect if the character is actually IN shadow.

But it would totally work in the end.

 
Go Moon!

Deleted User
21st January, 2007 at 22:48:13 -

If you are using MMF 2, there is a much more simple solution. First, simply create a new layer and name it "shadows". On that layer, place all the shadows as obstacle backdrop objects, possibly with semitransparency. Next, create a new active object named "shadow detector" and put it on the same layer. Simply position the "shadow detector" to the X,Y position of the player, but it should stick on the "shadow" layer instead. If the "shadow detector" is overlapping a backdrop, then the player is in the shadows. Thats it, easy huh?

This is what im talking about: http://www.freewebs.com/klik-domain/shadow.mfa

If you are using MMF 1.5, then go with the method that Fifth came up with. Sounds clever to me- however you could also just use an array, fastloops and a small bunch of active objects... Well, if you want me to explain this further, just tell me.


Haha sorry if this is too noobish, im new to MMF 2.
Heh now this made me really motivated to make a stealth "sneak em' up" myself~ Hmm, i wonder...

Image Edited by the Author.

 

BeamSplashX

Eliminator

Registered
  17/06/2003
Points
  2330

VIP MemberHasslevania 2!The Outlaw
22nd January, 2007 at 17:44:48 -

As long as you get to wear sneakers, it's a good idea.

 
Oh! My god.

Deleted User
22nd January, 2007 at 20:23:47 -

No sneakers!

 

Deleted User
23rd January, 2007 at 18:27:17 -

Or maybe, just maybe, you can wear sneakers...
on ONE condition though; they are Adidas sneakers... whoa yeah!!1

 

Bibin

At least 9001

Registered
  01/07/2005
Points
  308

Silver Cup WinnerGOTW Winner!Has Donated, Thank You!VIP Member
23rd January, 2007 at 20:16:16 -

If Adidas, only one sneaker is permitted. Vans, however, can be permitted in amounts up to sixty-four.

 
n/a

Deleted User
23rd January, 2007 at 20:20:28 -

Bah, Vans sucks... Adidas however, its like... jesus on a sandwich <3

Oh and hows that game going? *points to yer spiffy avatar*

 

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
27th January, 2007 at 00:32:51 -

ok i just used the match rgb function and everything works well. HOWEVER. For some reason, although my overlay is visible in the frame editor, its not visible when the game is actually running. The reason seems to be the 'transparent mode' check box. Any idea why this is happening?

Zi-Xiao

 
n/a

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
27th January, 2007 at 06:10:21 -

Pure black is transparent in MMF.

 
n/a

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
27th January, 2007 at 11:51:43 -

i realize that. Even if I made the shadows orange and then ticked off 'transparent mode' the whole thing would still vanish when the game runs.

Zi-Xiao

 
n/a

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
27th January, 2007 at 11:51:58 -

i realize that. Even if I made the shadows orange and then ticked off 'transparent mode' the whole thing would still vanish when the game runs.

Zi-Xiao

 
n/a

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
27th January, 2007 at 12:03:26 -

You'll need the active overlay object if you use any scrolling, or it won't appear.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456
   

Post Reply



 



Advertisement

Worth A Click