Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2013-05-08 21:47:38

MatheusRRR
Member
From: Rio de Janeiro, Brazil
Registered: 2012-10-05
Posts: 335
Website

[suggestion] alpha

i am suggesting alpha, in backgrounds "themes". smile
will be useful for creating weather with transparency (ex. Rain).

example

// rain
background
{
   initial_position    0 0
   scroll_speed        0 0
   behavior       linear 0 500
   repeat_y            true
   zindex              0
   Alpha           0.5  <--------

   sprite
   {
       source_file     "images/rain.png"
       source_rect     0 0 320 240
       frame_size      320 240

       animation
       {
           repeat      TRUE
           fps         1
           data        0
       }
   }
}

Last edited by MatheusRRR (2013-05-08 22:02:50)

Offline

#2 2013-05-09 03:25:29

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: [suggestion] alpha

MatheusRRR wrote:

i am suggesting alpha, in backgrounds "themes".
will be useful for creating weather with transparency (ex. Rain).

we can certainly add that if necessary smile, but isn't it better to just create an object to simulate the weather effect? That way, you can not only control the alpha in run-time, but also add some smart behavior to the weather (say, make it stop/start at some places you specify)

Remember that you have commands:

detach_from_camera: http://opensnc.sourceforge.net/wiki/ind … rom_camera
set_zindex: http://opensnc.sourceforge.net/wiki/ind … set_zindex

Offline

#3 2013-05-09 06:48:15

jobromedia
Member
From: Stockholm, Sweden
Registered: 2009-11-01
Posts: 1,072
Website

Re: [suggestion] alpha

Wasn't it problematic adding alpha through Allegro due to acceleration problems? We're still using 255,255,255 as our transparent mask.

Offline

#4 2013-05-09 21:18:42

MatheusRRR
Member
From: Rio de Janeiro, Brazil
Registered: 2012-10-05
Posts: 335
Website

Re: [suggestion] alpha

Alexandre wrote:
MatheusRRR wrote:

i am suggesting alpha, in backgrounds "themes".
will be useful for creating weather with transparency (ex. Rain).

we can certainly add that if necessary smile, but isn't it better to just create an object to simulate the weather effect? That way, you can not only control the alpha in run-time, but also add some smart behavior to the weather (say, make it stop/start at some places you specify)

Remember that you have commands:

detach_from_camera: http://opensnc.sourceforge.net/wiki/ind … rom_camera
set_zindex: http://opensnc.sourceforge.net/wiki/ind … set_zindex

I did it and worked very well. wink
I suggested this command, because making scripts object is too heavy. (lags)
So I did a test by creating a rain without transparency and the effect was much better (no lags).
I suggested this command, not specifically to weather, but to create effects such as clarity, dust, fog, and even more, with the effect of "scroll_speed". tongue

Offline

#5 2013-05-09 22:16:53

jobromedia
Member
From: Stockholm, Sweden
Registered: 2009-11-01
Posts: 1,072
Website

Re: [suggestion] alpha

You can't possibly sell this idea with at least providing a gorgeous picture. smile If it looks nice, Boom! I'm all in for alpha.

Offline

#6 2013-05-09 23:27:35

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: [suggestion] alpha

MatheusRRR wrote:

I did it and worked very well. wink
I suggested this command, because making scripts object is too heavy. (lags)
So I did a test by creating a rain without transparency and the effect was much better (no lags).

unfortunately, that wouldn't solve your problem. It's not the scripted object that is heavy. As jobro has already pointed out,

jobro wrote:

Wasn't it problematic adding alpha through Allegro due to acceleration problems?

yes, it is "problematic". This feature you have asked will be just as slow, anyway, because alpha is always slow in Allegro 4. So, it doesn't solve anything.

Matheus wrote:

I suggested this command, not specifically to weather, but to create effects such as clarity, dust, fog, and even more, with the effect of "scroll_speed". tongue

so, I have another suggestion: simulate the alpha effect by creating a certain texture pattern. Magenta is transparent, right? So, imagine you have a 3x3 grid. You can simulate a 50% alpha value, without using any alpha (and therefore it will be fast), by drawing (and repeating) this pattern:

X o X
o X o
X o X

where X = some color you'd like and o = Magenta (transparent) smile

does it help? smile

Offline

#7 2013-05-10 05:09:11

jobromedia
Member
From: Stockholm, Sweden
Registered: 2009-11-01
Posts: 1,072
Website

Re: [suggestion] alpha

We would have to come up with some tool to generate these textures, it will take a sh*tload of time if this ain't solved. Pixelating these texture else risks to become one of the major headaches in this game.

Offline

#8 2013-05-12 01:58:00

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: [suggestion] alpha

jobromedia wrote:

We would have to come up with some tool to generate these textures, it will take a sh*tload of time if this ain't solved. Pixelating these texture else risks to become one of the major headaches in this game.

you can simply copy and paste a transparent grid pattern on top of a regular texture

Offline

#9 2013-06-14 22:38:44

svgmovement
Member
Registered: 2011-11-24
Posts: 209

Re: [suggestion] alpha

A transparent grid pattern:
alphamasks.png
Hope this is useful.


-- svgmovement

Offline

#10 2013-06-17 19:05:15

aronthehedgehog
Member
From: Lincoln, NE
Registered: 2013-04-05
Posts: 390

Re: [suggestion] alpha

cool i like that


Not active much anymore.
The only things I do now is just let inspiration come to me when it's needed.
Also bad profile pic because I don't have anything else in mind.

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org