lighting>

MyChairHasALooIn

  • Posts: 310
knocked up a test of a new idea :>

up/down/left to move dude, enter toggles lights on/off (bugged), z and x control light intensity.

http://www.stencyl.com/game/play/14278

Strasteo

  • Posts: 322
I can barely experience the effect, sadly. It's very lag-intensive. :c

MyChairHasALooIn

  • Posts: 310
I'm sad to hear that dude, I went through quite a few iterations improving performance, and can probably use one more to bring all the other improvements together better.

On my terrible computer it works although not at a great framerate.

I think it looks pretty good even with no scene art to illuminate.

coleislazy

  • *
  • Posts: 2607
Its pretty cool, but performance is poor. I get 20-30 FPS on a fairly decent computer. Also, the speed at which the light shifts seems a bit fast; it makes my eyes hurt.

MyChairHasALooIn

  • Posts: 310
Fair point, although that gives me an idea, might split the management so 1 in 4 tiles is dealt with per frame with the rest staying as they were. The flicker is because there aren't enough different shaded frames to blend well combined with their large size being randomly shuffled a little towards light/dark every frame.
 more clearly, each tile of darkness get's shuffled to the next grade of light/dark at random, and the variations aren't fine enough, so the flicker is very obtrusive. combined with all of them doing it every frame at 20-30 fps (which is where my pc is sitting too)

Even more awesome idea, if which of each group of 4 tiles gets updated is random and the other random effect is removed, it may look just as cool, but be less eye melting and a lot less cpu intense.

Sadly the data isn't tracked atm so each tile has to be told how bright to be for every frame in this version. So it will take me a while to get an array shoehorned in and tidied up to store information for all the (resting) tiles.


MyChairHasALooIn

  • Posts: 310
http://www.stencyl.com/game/play/14406

rebuilt the guts of the thing to reduce processing, all static lights are now saved to a lightmap for the level, the mobile lightsource is added to this to produce end results.

light is slaved to the mouse no other control at the moment.

ipe 369

  • Posts: 1001
Beat me to it, you did it with transparent tiles i presume? It gives a great effect.

MyChairHasALooIn

  • Posts: 310
in the when created part of the behaviour the behaviour creates and hides 20 copies of an actor which is a tile sized black square. it fades them by num*5%, hides them, and records them in a list.

in the always part, it runs through the array where the default lighting info is stored (in juicy integers from 0 to 19) and draws the  image of the relevant actor at that spot.

I could explain this much better by posting design mode screenies and not trying to explain it all.

ipe 369

  • Posts: 1001
Jesus christ actors?
Doesn't that lag like fuck? I had like 1200 tile sized actors, everything off (no collision, no animation etc) And i still got like 5 fps. You should consider using the tile api

Innes

  • *
  • Posts: 1963
Is there any chance that you could remove the expletives please? Many of the users of this forum are young people including my own children.

Thanks.
Visit www.TheStencylBook.com - the only published book for learning Stencyl.

rob1221

  • *
  • Posts: 9424
ipe it's only 20 lightweight actors; he uses drawing to create what you see.

ipe 369

  • Posts: 1001
I'll use the word 'chuffbunny' instead

MyChairHasALooIn

  • Posts: 310
Correct rob, the 20 actors don't do anything at all once generated except hold the images I use to create the effect.

It's the draw image of self block found under drawing, it just calls whichever shade of shadow (i.e. which actor) needed.

You can get a similiar result with one actor, with all the various shades needed as frames for an animation, telling it to switch to frame whatever then draw self. Or you could store all the info as animations and switch between them, tho that does cause slow down. The way I've done it means I didn't have to try and neatly graduate the opacity by hand for each frame, with stencyl's pencyl being the most advanced art program I own and having just a vague slider for that function.

Also the expletives thing, because the interweb's bad enough without us lot piling in ;) Chuffbunny is awesome. Friend of mine swears by fartfish.

ipe 369

  • Posts: 1001
OH I GET IT NOW
That's genius! no movement or anything, really clever! Would it work with a large scene?

MyChairHasALooIn

  • Posts: 310
Well in a future proofing kind of a way, the size of the array that stores the static lights is determined by the size of the scene, some editing to make the drawing part only read from the array based on the part of the scene currently being looked at should work, and some minor jiggling to ensure they still line up correctly, and taking into account that could mean displaying an extra line of shadow to cover when you have half tiles either side (or top/bottom) of the screen.

Yes it can be done, I'll get on it when I've returned from the hallowed halls of Blockbuster and bought some eggs. Good times.