Post new topic    
Liquid Metal Slime
Send private message
A Workaround for Transparency??? 
 PostSun Jun 08, 2014 4:02 pm
Send private message Reply with quote
***I copied and pasted this from another post of mine since I think it will be more useful for people to find here as it's own topic.

A Workaround for Transparency???
I just had this idea which may or may not work to create a "pseudo-transparency effect." I did not test this out, but may test it in the future. Feel free to try it out.

The idea is to create a transparency by rapidly flickering a certain coloured sprite, animated tile, or slice over top of the area you want transparent.

For example:
-I think the easiest way to accomplish this would be by using "Tile Animation."
-Lets say you want to make a square piece of glass which your hero can walk behind.
-Simply draw one tile which is a white square, and another tile which is blank.
-Set the animation up so that it displays one tile, waits 1 tick, displays the other tile, waits 1 tick.
-Now we have our glass!
-Place this glass animation in your map in a higher layer than your heroes and NPCs.
-Now it should hypothetically look like your character is semi-visible when passing under this animated tile.

Limitation:
-This transparency will be limited to 50%. In other words it will likely make the characters pixels become lightened by 50%.

Potential Workaround for this Limitation:
-This 50% transparency can be increased or decreased by either altering the timing of the animation, or by altering the indexing of the animation tiles.
-I would suggest not changing the timing as it would cause the effect to look choppy and less window-like.
-Instead I suggest changing the index. If you don't know what indexing is, here's a pretty self-explanatory example I found online:
http://www.glprogramming.com/red/images/Image89.gif
(Or just see my profile picture. It's a good example of many indexing styles combined together.)

So basically you would just have to have more animation tiles of which would have different indexed tiles. This is a bit complex to explain and even I would have to do it by trial and error to get it running right myself.

Additional Cool Stuff
-This same effect could be done with a colour to add "tint."
-It could be done with alternating colors and indexing to add "shimmer."
-You could of course shape your windows, or areas of transparency in a variety of shapes so that it looks a lot nicer.
-Use a dark colour in order to create a shading effect rather than a light effect.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Liquid Metal King Slime
Send private message
 
 PostSun Jun 08, 2014 5:28 pm
Send private message Reply with quote
Not a bad idea, but I think the OHRRPGCE's frame rate is too slow for this to really work.

Stuff that flickers every 1 tick still looks like flashing colors, not like transparency
Metal King Slime
Send private message
 
 PostMon Jun 09, 2014 3:23 am
Send private message Reply with quote
https://twitter.com/ID_AA_Carmack/status/449711244254015488

At 18fps you'll end up with annoying flashing, but if you use indexing plus flickering (as you said) it could be a useful effect. By which I mean display half of the pixels each frame. You might even try making it flicker at less than 18fps to see if that gives a less annoying effect.

Changing palettes (possibly combined with clipping slice tricks at the transitions) would be a better way to fake transparency.
Liquid Metal Slime
Send private message
 
 PostMon Jun 09, 2014 3:24 am
Send private message Reply with quote
Bob the Hamster wrote:
Not a bad idea, but I think the OHRRPGCE's frame rate is too slow for this to really work.

Stuff that flickers every 1 tick still looks like flashing colors, not like transparency


Hmm. Is there no way of making the rate of flicker faster using coding. I recall there was some millisecond and microsecond functions in the plotscripting dictionary but perhaps those are only useable for testing purposes.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Metal King Slime
Send private message
 
 PostMon Jun 09, 2014 3:38 am
Send private message Reply with quote
Those commands are for measuring time intervals. There are no commands for changing the frame rate. We want to make the frame rate customisable soon however. May or may not happen for the next release. In the meantime you can change the frame in-game using the Ctrl + and Ctrl - debug keys.
Liquid Metal Slime
Send private message
 
 PostMon Jun 09, 2014 3:40 am
Send private message Reply with quote
TMC wrote:
https://twitter.com/ID_AA_Carmack/status/449711244254015488

At 18fps you'll end up with annoying flashing, but if you use indexing plus flickering (as you said) it could be a useful effect. By which I mean display half of the pixels each frame. You might even try making it flicker at less than 18fps to see if that gives a less annoying effect.

Changing palettes (possibly combined with clipping slice tricks at the transitions) would be a better way to fake transparency.


So I could go less than 1 tick between flickers? Is this possible with coding?
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Liquid Metal Slime
Send private message
 
 PostMon Jun 09, 2014 3:41 am
Send private message Reply with quote
TMC wrote:
Those commands are for measuring time intervals. There are no commands for changing the frame rate. We want to make the frame rate customisable soon however. May or may not happen for the next release. In the meantime you can change the frame in-game using the Ctrl + and Ctrl - debug keys.


Oh, I see. Well I'll wait a few releases. Then my workaround will be more feasible.

Thanks.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Metal King Slime
Send private message
 
 PostMon Jun 09, 2014 3:49 am
Send private message Reply with quote
You can test it now using the debug keys.

Looking at the replies to John Carmack's tweet I see someone mentioned that jittering is actually used in Unreal Engine 4. AFAIK what they are talking about is to vary the positions of objects from frame to frame by a sub-pixel amount so that you get anti-aliasing of edges for free because they get temporally blurred.
Liquid Metal Slime
Send private message
 
 PostMon Jun 09, 2014 1:49 pm
Send private message Reply with quote
TMC wrote:
You can test it now using the debug keys.

Looking at the replies to John Carmack's tweet I see someone mentioned that jittering is actually used in Unreal Engine 4. AFAIK what they are talking about is to vary the positions of objects from frame to frame by a sub-pixel amount so that you get anti-aliasing of edges for free because they get temporally blurred.


Ahh. That's very interesting. Gotta' hate coming up with an idea that's already been around for awhile. Though it really goes to show how CUSTOMS limitations breed good ideas from users trying to make work arounds. I think that's the one thing I've always loved about this engine, is the amount of work arounds being developed. For as long as I can remember, someone has been making a work around for something.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Metal King Slime
Send private message
 
 PostTue Jun 10, 2014 3:47 am
Send private message Reply with quote
I've always found figuring out workarounds to limitations to be a lot of fun; a problem solving exercise. Using those workarounds is often not fun (e.g. creating dozens of near-duplicate attacks). But now that I'm working on the engine I cringe whenever someone suggests a workaround that's actually more work than just implementing the dang feature. Happens very often.
Liquid Metal Slime
Send private message
 
 PostTue Jun 10, 2014 4:49 am
Send private message Reply with quote
TMC wrote:
I've always found figuring out workarounds to limitations to be a lot of fun; a problem solving exercise. Using those workarounds is often not fun (e.g. creating dozens of near-duplicate attacks). But now that I'm working on the engine I cringe whenever someone suggests a workaround that's actually more work than just implementing the dang feature. Happens very often.


Yeah I can see what you mean. I do enjoy the satisfaction of creating a good work around. It's also good to see what workarounds others are coming up with despite their tediousness, because it just goes to show how determined people are to make a not-yet-developed-feature work for their game.
⊕ P E R S O N A L M U S I C: https://open.spotify.com/album/6fEo3fCm5C3XhtFRflfANr
⍠ C O L L A B M U S I C: https://dustpuppets.bandcamp.com/releases
Display posts from previous: