Fireflies - Objects And Best Way to Turn Them Off or On

Started by Ghostlady, Fri 20/12/2024 05:33:59

Previous topic - Next topic

Khris

Older versions of AGS didn't have alpha channel support yet. The pink thing only applies if you do not use alpha channels.

You can tell your artist that AGS supports alpha channels and she can just draw assets on a transparent background using partially transparent pixels and store it as PNG and it will appear in the game just fine.

Crimson Wizard

#21
I was probably confused about the situation. Somehow I assumed that these fireflies are a part of the older assets, created years ago, and that you have to cut them out from those old assets. Are these on contrary new assets created right now by an artist?

As for whether to have these animations on a transparent surface, or having them with parts of background, I suppose that depends also on artistic features. For example, if the fireflies cast light on some object in background (such as trees), then the animation frames should also include trees (or parts of trees).

If that's not a issue, then of course it may be better for an artist to create fireflies on a transparent surface, separate from room background, and save them as 32-bit ARGB images to let keep half-transparent pixels.

But then, before that, we'd also have to clarify this: what is your game's color depth? is your game actually 32-bit, or lower (16-bit, 8-bit)?

Ghostlady

The fireflies are new assets being created.  The background is from the original game.
The fireflies are shedding light on pieces of the background.  See screenshot above.
The color depth is 16 bit. 
I'm going to go with the fireflies on the background.  Seeing how they look on the background with the light shedding outwards, has a nice look to me.
I just need to figure out how to cut them correctly.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Crimson Wizard

Alright, the situation is clear now. Since your game is 16-bit, then you won't be able to have translucent effects (at least not easily).

Speaking of cutting out firefly frames, perhaps your artist can make these cuts for you? :).

Ghostlady

Quote from: Crimson Wizard on Thu 23/01/2025 22:16:04Alright, the situation is clear now. Since your game is 16-bit, then you won't be able to have translucent effects (at least not easily).

Speaking of cutting out firefly frames, perhaps your artist can make these cuts for you? :).
I wanted to try it myself first.  I have a 2023 version of Paint Shop Pro. I need to google a little to figure out how to get the coordinates.  If I can't figure it out I'll definitely ask the artist.  She will do it for me for sure. :)
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Ghostlady

The fireflies are now working, very cool.  I slowed the speed down a little.  Tell me what you all think, if I should change anything.

https://www.youtube.com/watch?v=CaYjGR-JUOU
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Snarky

If it were me, I would really try to have one sprite for each light, so that they would fade in and out individually and not in a cluster. Aside from that, you can probably play around with different parameter values to make it behave the way you want.

Ghostlady

My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Ghostlady

#28
I am posting the final version in case someone else has an interest in Fireflies.  Thanks everyone for the help.  I love it.

https://youtu.be/TxVn0UbQFfg
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Khris


Snarky

@Khris, the game is 16-bit, so it can't use alpha-transparent sprites.

Khris

Right; one could draw each fly in multiple steps though to achieve more or less the same effect.

Crimson Wizard

#32
You could use objects or room overlays for each firefly, instead of raw drawing.
That would have significantly better runtime performance, and then these may use their Scaling and Transparency properties.

Ghostlady

Kris...this is really awesome! I could use this on a separate scene in the swamp.  Its more "magical" with a red fox.  Can I actually do this with this older game?
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Khris

It should work with overlays, like this: https://pastebin.com/1YDztxrj



The sprites I used are a ~20 pixel circle and a 6 pixel circle; just put the sprite numbers into the #define lines at the top.

The script should work as-is with the exception of the Game.Camera parts; you might have to replace those with GetViewportX/Y(). Or just remove the offset altogether if the room isn't scrolling anyway.

Ghostlady

Can you send me one of your sprites so that I can have my graphic artist take a look at it?
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Khris

Sure, it's literally just two filled circles: https://imgur.com/a/tMe63VR

In-game, the glow circle is displayed at about 20% opacity.

Ghostlady

I created a new room, added the background, copied in your script.  I grabbed your two sprites, added them to the sprites in the game and put their number in the define area.  When I run the game there are no fireflies.  What am I doing wrong?  I tried commenting out the lines with Game.Camera, still no fireflies.
My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

Khris

Hmm, did you link to room_Load and room_RepExec in the room's events table?

Ghostlady

My Games:

Hauntings Of Mystery Manor
Intrigue At Oakhaven Plantation
Haunting at Cliffhouse

SMF spam blocked by CleanTalk