Advanced Shadows V2

What do you mean by this?

1 Like

Thanks, this helped a ton. So it seems to be working much better now. Will it effect physical hitboxes? so the player will treat it like a full block?

1 Like

Nvm, I figured it out. I wanted the light to remove the darkness so you can see in areas, but hidden areas would be blacked out until within view. But I think I got it working.

2 Likes

Well, everythings kinda bugged at the moment. The player has a circle around him and hardly any rays stop at the walls. Iā€™m still trying to fix this, not sure whatā€™s going on. I can send a link if you want to take a look at it.

1 Like

A link would be helpful. Having a small circle around the player means itā€™s hitting something because I added in a NOR gate so that when the rays hit nothing they expand a lot.

1 Like

Parent objects donā€™t effect hitboxes. Make sure the parent object you are using doesnā€™t have any code, because the child will gain the code that is in the parent.

1 Like

I made sure I made a new wall object so they all share it.

Itā€™s on the fifth level, Shadow Testing.

1 Like

Not sure if you want to edit your post now so other people canā€™t see the link to the game

1 Like

So I finally have it working. But I want it to look more cleaner since itā€™s really choppy. Not sure how I could fix that, but the general idea works now.

1 Like

You need to move the Line sprite 1 pixel to the Left, this is very important, and then the Animation needs to be exactly where it is. Also to prevent the light from sometimes going through the wall you can add a Position behavior in the wall and that will prevent the Walls from combining collisions

1 Like

You also canā€™t see the Line with Blend set to 1 because it is black, if you had the line as a different color it would work

1 Like

Alright. Iā€™m currently in school so I havenā€™t had time to reply sooner. Iā€™ll work on it some more when I get home.

1 Like

kk, if you need help with anything else feel free to ask.

Btw, it seems like youā€™re running a lot of expressions. It seems like they are only needed at the start of the game to set things up, so after everything is done those objects should be destroyed so they no longer run those expressions. (expressions take up ~10ms)

1 Like

A ton of the code is used for the actual game. I took the character from the game on a new level so a lot of the expressions donā€™t apply on that testing level, but work on the game.

And yes, thereā€™s a ton of code that needs to turn off after a certain period for performance, but Iā€™ll get to that later on.

1 Like

The horizontal wall tops are pretty thin and the end of each raycast stops a little short on it, causing jagged gaps around the edge of the walls.
Screen Shot 2022-09-22 at 3.51.49 PM
Is there any solution to removing those? Or is it not possible for the thin walls.

2 Likes

Nothing can really be done about it unless ray casts outputted the correct distance. Technically you could change the expression in the line to be ā€œA*52ā€ and it fixes it, but I donā€™t know if that could cause other problems.

If this idea doesnā€™t work you could still use it for something like a flashlight

1 Like

image
Is the light supposed to be there?

1 Like

No, but it canā€™t be stopped because rays output distance to the center

1 Like

Sadly i donā€™t think I would be able to use this feature, mostly because it slows down performance really bad and with a lot of objects to deal with, the rays sometimes go through and I tried fixing everything to make sure it looked clean, but thereā€™s still a lot of bugs to deal with.

Iā€™m gonna keep the testing level up, but I donā€™t think Iā€™ll be able to add it to the final game.

1 Like

Understandable, good luck with the rest of your game

1 Like