HOME | DD

AceDecade — Shadow Engine v.0.8

Published: 2009-08-15 02:26:18 +0000 UTC; Views: 1369; Favourites: 10; Downloads: 37
Redirect to original
Description Updates: Background art done by Michelle Nguyen, gradient light added. I think it looks pretty

To do:
-Physics engine sucks. Slope support needed, as well as one-directional floors, like stairs that you can jump up through but not fall down
-Action engine(light switches, elevators, etc)
-Text and cutscene engine
-Enemy engine
-Weapon engine

Controls:
WASD - Move/Jump
Q - Flashlight On/Off
1-2 - Streetlights On/Off

Shadow Engine v.8 -
You are Dino Bob. Your location is unknown. Odd, antipolitical graffiti is scribbled on the walls, and what appears to be a mailbox is sitting right outside. Your goal: nothing. Really, there's not much to do yet, but enjoy the advanced light and shadow effects of this engine. The dino is temporary, and the level is definitely going to be revamped later. More to come!

Thanks to for the tips about raycasting, bitmapping, and timestep fixation!

Thanks also to for the blendmode help.
Related content
Comments: 69

JOeYLOL [2009-09-08 01:18:36 +0000 UTC]

Im interested in how you drew the light cause its so bloody clean

👍: 0 ⏩: 1

AceDecade In reply to JOeYLOL [2009-09-08 02:09:39 +0000 UTC]

Actually, I used fairly accurate ray-casting, and let the point go into the wall. Then I erased the light using part of the level. That way it has a nice smooth texture.

👍: 0 ⏩: 2

JOeYLOL In reply to AceDecade [2009-09-08 08:26:09 +0000 UTC]

so did you just loop through the distance of the light at each degree of the light and check for collisions?

👍: 0 ⏩: 1

AceDecade In reply to JOeYLOL [2009-09-08 13:13:00 +0000 UTC]

Every degree would be pretty laggy, as well as every point on that degree.I used variables in my light class like rstep and pstep, so instead of every degree, I check every x degrees. And every x steps on the degree. Oh, and I dont use hitTestPoint, I use getPixel32 and a color-coded lightmap.

Other than that, that's pretty much the basis of ray-casting. Great effect if you ask me.

👍: 0 ⏩: 1

JOeYLOL In reply to AceDecade [2009-09-08 13:36:34 +0000 UTC]

yeah i didnt think it was every point

👍: 0 ⏩: 1

AceDecade In reply to JOeYLOL [2009-09-09 00:54:58 +0000 UTC]

Actually, I looked back at the code, it's every point. Maybe I should include an option to make it every x points.

👍: 0 ⏩: 1

JOeYLOL In reply to AceDecade [2009-09-09 04:47:32 +0000 UTC]

wow how is it so fast?

👍: 0 ⏩: 1

AceDecade In reply to JOeYLOL [2009-09-09 05:10:18 +0000 UTC]

I haven't the slightest, but I managed a max fps of 58 with three lights on at perfect detection.

👍: 0 ⏩: 1

JOeYLOL In reply to AceDecade [2009-09-09 05:16:08 +0000 UTC]

wtf

👍: 0 ⏩: 0

JOeYLOL In reply to AceDecade [2009-09-08 02:18:30 +0000 UTC]

aaah very nice

👍: 0 ⏩: 0

JOeYLOL [2009-09-07 23:43:00 +0000 UTC]

looks fucking awesome dude

👍: 0 ⏩: 1

AceDecade In reply to JOeYLOL [2009-09-07 23:47:33 +0000 UTC]

Thanks, man! I really couldn't have done it without seeing yours though.

Oh, are you any good at level design? :3

👍: 0 ⏩: 1

JOeYLOL In reply to AceDecade [2009-09-08 00:56:19 +0000 UTC]

i dunno lol

👍: 0 ⏩: 1

AceDecade In reply to JOeYLOL [2009-09-08 02:12:43 +0000 UTC]

Damn. How bout storylines?

👍: 0 ⏩: 1

JOeYLOL In reply to AceDecade [2009-09-08 02:21:33 +0000 UTC]

i havent done much before :S

👍: 0 ⏩: 1

AceDecade In reply to JOeYLOL [2009-09-08 04:07:23 +0000 UTC]

Aww, well if you have any ideas or anything that a dinosaur with a flashlight might fill, let me know. ;D

👍: 0 ⏩: 1

JOeYLOL In reply to AceDecade [2009-09-08 04:10:16 +0000 UTC]

detective...with explosions...eating ppl....

👍: 0 ⏩: 1

AceDecade In reply to JOeYLOL [2009-09-08 04:55:47 +0000 UTC]

Well, it's got the three key elements in a good story: detectives, explosions, and eating people. It just might work!

👍: 0 ⏩: 1

JOeYLOL In reply to AceDecade [2009-09-08 06:12:36 +0000 UTC]

haha

👍: 0 ⏩: 0

JOeYLOL [2009-09-06 23:44:08 +0000 UTC]

nice :3

👍: 0 ⏩: 1

AceDecade In reply to JOeYLOL [2009-09-07 04:47:59 +0000 UTC]

Thanks! Needs a ton of work though.

👍: 0 ⏩: 1

JOeYLOL In reply to AceDecade [2009-09-07 05:32:10 +0000 UTC]

i kinda like yours better than mine

👍: 0 ⏩: 2

AceDecade In reply to JOeYLOL [2009-09-07 06:33:38 +0000 UTC]

For the record, I think wonderwhy's is better than both of ours =\

👍: 0 ⏩: 1

JOeYLOL In reply to AceDecade [2009-09-07 08:22:00 +0000 UTC]

yes his would be, but atm its to slow and acts more like water

👍: 0 ⏩: 1

AceDecade In reply to JOeYLOL [2009-09-07 19:28:21 +0000 UTC]

Hm, works fine for me =\

👍: 0 ⏩: 0

AceDecade In reply to JOeYLOL [2009-09-07 06:25:12 +0000 UTC]

Thanks, though you have the right idea. Mine was yours at one point, but then I sat down and and screamed my eyes out and eventually stumbled upon many of the features I've implemented since. I actually first started working on this years ago, gave up, and started again a few weeks ago.

👍: 0 ⏩: 0

Moozipan-Cheese [2009-08-27 22:17:26 +0000 UTC]

Ooh, nice. I fell off the edge. :3

👍: 0 ⏩: 1

AceDecade In reply to Moozipan-Cheese [2009-08-27 23:35:41 +0000 UTC]

I forgot to add a wall =\

👍: 0 ⏩: 0

Pakaku [2009-08-15 21:44:59 +0000 UTC]

Why not make the end of the flashlight beam fade out, instead of that hard edge?

👍: 0 ⏩: 2

AceDecade In reply to Pakaku [2009-08-16 01:34:19 +0000 UTC]

It's the nature of the engine, though I suppose I could experiment with gradient masks. I'll look into it

👍: 0 ⏩: 1

Pakaku In reply to AceDecade [2009-08-16 04:15:54 +0000 UTC]

I was going to say, if you could use a white-to-black gradient at the tip of the beam, it would look much better than just an edge.

👍: 0 ⏩: 1

AceDecade In reply to Pakaku [2009-08-16 04:21:04 +0000 UTC]

One problem is that there isn't always a "tip of the beam"
I re-draw the beam, and sometimes it gets stopped by a wall.

👍: 0 ⏩: 1

Pakaku In reply to AceDecade [2009-08-16 05:55:26 +0000 UTC]

So then what would happen if you did fade it out? From what I understand you just punched a shape through a square to give that "beam" shape. If you faded the end out, and it hit a wall, what would happen?

👍: 0 ⏩: 1

AceDecade In reply to Pakaku [2009-08-16 06:35:02 +0000 UTC]

Well first of all, there's no way to "fade" a cutout. I can't simply write "light.fadeNearEdges();" as convenient as that would be. Furthermore, if I did apply a fade at the edge, it wouldn't show if the edge never got made. If the wall is 3 inches from the flashlight, you'd never see the edge because it would get cut short. Or did you mean the edge of whatever the shape happens to be?

👍: 0 ⏩: 1

Pakaku In reply to AceDecade [2009-08-16 06:42:03 +0000 UTC]

Well it should be a good thing if the face out gets cut off at a wall, wouldn't that make it more realistic in some sense? When you shine a flashlight at a wall, it doesn't start fading as it gets closer to the wall. It hits the wall without fading. But if you shine it into the darkness, it could fade away.

Are you using some sort of bitmap to make the shape of the beam, or is it completely code?

I've never tried coding in Flash before, so I don't know anything about raytracing. I do have it, though, and if I decide one day to try it, I might see if I can find an exploit.

👍: 0 ⏩: 1

AceDecade In reply to Pakaku [2009-08-16 08:28:42 +0000 UTC]

Ray-casting basically means, you give a certain angle, and you project points out from the center for a certain distance. if the point hits something, you stop it. Then you draw a line between each point and fill in the middle.
Think of it like shooting a net out, each point flies out as far as it can go, then you connect the dots to make the light shape.

👍: 0 ⏩: 1

Pakaku In reply to AceDecade [2009-08-16 09:07:06 +0000 UTC]

Ah, so it's not a bitmap shape, it's like a vector.

Would you be able to fill in the shape with a colour? If you're using the points to cut through a black square, couldn't you calculate them again and then fill that shape in with something? Maybe a gradient?

👍: 0 ⏩: 1

AceDecade In reply to Pakaku [2009-08-16 10:57:51 +0000 UTC]

First, there's the issue of alpha. If i were to do that, I would have to cut a shape out of the shadow that is 100% opaque on one end and 100% transparent on the other, and I don't think inverse masking supports alpha. If it does, however, and I was theoretically able to... wait, I suppose I could fill the shadow in with new info, where... it's very complicated, and more issues arise, but it just MIGHT be possible.

👍: 0 ⏩: 1

Pakaku In reply to AceDecade [2009-08-16 21:16:34 +0000 UTC]

What sorts of issues?

👍: 0 ⏩: 2

AceDecade In reply to Pakaku [2009-09-07 23:20:26 +0000 UTC]

Edit: You were right. I did it. It looks awesome. THANKS!

👍: 0 ⏩: 1

Pakaku In reply to AceDecade [2009-09-08 02:14:46 +0000 UTC]

Oooh, that's just how i imagined it should look.

👍: 0 ⏩: 1

AceDecade In reply to Pakaku [2009-09-08 04:05:05 +0000 UTC]

You're a visionary, it's true...

👍: 0 ⏩: 1

Pakaku In reply to AceDecade [2009-09-08 04:15:55 +0000 UTC]

I just wish I could make the visions come true.

👍: 0 ⏩: 1

AceDecade In reply to Pakaku [2009-09-08 04:55:17 +0000 UTC]

Well I made one of them happen. Maybe two? I can't remember.

👍: 0 ⏩: 1

Pakaku In reply to AceDecade [2009-09-08 05:21:51 +0000 UTC]

I can't remember a second, either

👍: 0 ⏩: 1

AceDecade In reply to Pakaku [2009-09-08 13:14:26 +0000 UTC]

Oh, it wasn't you, it was flux. He wanted light to go through an object, and stop when it hit the other side. That way, my light-obstructing objects would have light on them, but light couldn't go through them. I should really see about doing that for more of my walls.

👍: 0 ⏩: 1

Pakaku In reply to AceDecade [2009-09-09 02:28:12 +0000 UTC]

I wouldn't have a clue how to make that work.

👍: 0 ⏩: 1

AceDecade In reply to Pakaku [2009-09-09 03:08:55 +0000 UTC]

It works, but I didn't implement it for my walls yet.

👍: 0 ⏩: 1

Pakaku In reply to AceDecade [2009-09-09 03:11:35 +0000 UTC]

Can you use parents?

👍: 0 ⏩: 1

AceDecade In reply to Pakaku [2009-09-09 04:32:14 +0000 UTC]

Pardon?

👍: 0 ⏩: 1


| Next =>