Annoying editor transparency display bug

  • 9 Replies
  • 4457 Views
*

Offline Exp HP

  • 259
  • 2
  • 1 in 166 children
    • View Profile
Annoying editor transparency display bug
« on: November 26, 2009, 04:44:16 »
This really bugs me.  It's a difference between how the game and the editor display graphics.

In the game, whenever you have two transparent tiles or objects on top of eachother, they add in effect (meaning if you have two shadows on top of eachother, they turn darker, and if you have two glowing things on top of eachother, they get brighter).

In the Editor, two transparent tiles add in effect only if they are different.  This means that if you place the same transparent tile on the same square in two different layers, it will look like there's only one tile there.

Not only is the editor's display behavior unintuitive, but it also means that a level might look different in the game than it does in the editor.  This is demonstrated in the attached image.


Is this intentional?  Seems odd to me...

This puzzled me a lot a while ago when I was using the Lasers tileset in my level.  The lasers aren't particularly bright (not against a green background, at least), so I always had to double them up, and it bugged me that I always had to pick different lasers in order for them to look brighter.  Just today I tried putting orange on orange and realized it was still bright in the game even though it wasn't in the editor. X-P
« Last Edit: November 26, 2009, 05:06:41 by Exp HP »
(secretly hoping nobody will mention the object compendium)
My stars:   :hiddenstar:(Object Compendium):hiddenstar:(By PM)
Check out my Youtube channel for some terrible Let's Plays by a socially inept nerd!

Re: Annoying editor transparency display bug
« Reply #1 on: November 26, 2009, 05:11:36 »
You can notice this bug aswell with transparent ground tiles:
&=transparent
*=2 times transparent

   &&&&&&&&&
    &&&&&&&&&
    &&&&&&&&&
&&&&****&&&&&
&&&&*&&*&&&&&
&&&&****&&&&&
&&&&&&&&
&&&&&&&&


The && in the middle must be doubled up on two layers, but you can't tell in the editor. I had this problem with Bass's ice castle tileset.
Lurk more.

*

Offline LPChip

  • You can only truly help other people by allowing them to fail.
  • 3510
  • 138
  • Excel at the thing you're the best at!
    • View Profile
    • LPChip Interactive
Re: Annoying editor transparency display bug
« Reply #2 on: November 26, 2009, 11:45:37 »
I'd say, learn how this bug works, and turn it into a feature.

With that I mean: You can work around it, so its not a bug that has to be fixed. But when you know how it works, you can use it as a design features to make neater transparent paths.
on the left, above my avatar.

MODPlug Central Forum
"If I tried to kill you, I'd end up with a big fat hole through my laptop." - Chironex

*

Offline LimeLemon

  • 414
  • 0
  • ¯\(°_o)/¯ i dunno lol
    • View Profile
    • Fur Affinity
Re: Annoying editor transparency display bug
« Reply #3 on: November 26, 2009, 12:13:43 »
No feature here.
In the game [...] they add in effect

In the Editor, two transparent tiles add in effect only if they are different.

[...] a level might look different in the game than it does in the editor.
Spoiler: Achievements (click to show/hide)

Spoiler: Backloggery (click to show/hide)

*

Offline Nifflas

  • 1532
  • 61
    • View Profile
Re: Annoying editor transparency display bug
« Reply #4 on: November 26, 2009, 12:20:35 »
In either case, it's a Multimedia Fusion 2 artifact. I can not fix it.

*

Offline Pick Yer Poison

  • 782
  • 3
  • One cool cat.
    • View Profile
Re: Annoying editor transparency display bug
« Reply #5 on: November 26, 2009, 18:38:22 »
I think pseudo-alpha may be the culprit here. That is, when you create a tileset with actual transparency, KS loads it as pseudo-transparency.
Code: [Select]
Where the actual block is
#####
#####
#####
#####
#####

KS loads it as

# # #
 # #
# # #
 # #
# # #
Thus, two of the same tile would have exactly the same transparent areas. That's like looking through two holes on different walls at the same time; you can see the end just as easily as you could if the second wall wasn't there at all.

I don't know if MMF 2 does this, though, so please tell me if that's not it.
I imagine this problem is a result of Game Maker's capabilities.
Fail. X-P

*

Offline Nifflas

  • 1532
  • 61
    • View Profile
Re: Annoying editor transparency display bug
« Reply #6 on: November 29, 2009, 13:25:42 »
I don't think so, MMF2 handles actual transparency and it does it nicely. I mean, if you put a tile over another identical one but just change one pixel to be different, it should work. My wild speculation is that MMF1 before it supported the alpha channel was optimized to disregard all but one of multiple identical tiles stacked on top of each other since only one would actually need to be rendered. Then they must have forgot to change this behaviour when MMF2 got the alpha channel.

*

Offline Comhon

  • 327
  • 22
    • View Profile
    • comhon.cz
Re: Annoying editor transparency display bug
« Reply #7 on: November 29, 2009, 14:46:23 »
I know this bug. I am using the effect in my level.

*

Offline Exp HP

  • 259
  • 2
  • 1 in 166 children
    • View Profile
Re: Annoying editor transparency display bug
« Reply #8 on: November 29, 2009, 21:17:30 »
I don't think so, MMF2 handles actual transparency and it does it nicely. I mean, if you put a tile over another identical one but just change one pixel to be different, it should work. My wild speculation is that MMF1 before it supported the alpha channel was optimized to disregard all but one of multiple identical tiles stacked on top of each other since only one would actually need to be rendered. Then they must have forgot to change this behaviour when MMF2 got the alpha channel.
Then I must ask...
If this behavior is inherent to MMF2, why does the actual Knytt Stories game not exhibit this behavior?  And is there any reason you didn't implement the game's rendering behavior in the editor?

(actually, since I enjoy guessing how stuff works, I'll take a stab at answering my own questions:
In the game, you probably pre-render a composite image of the BG + all 4 tile layers when a screen is loaded to optimize game speed (which explains why you don't have any foreground tile layers), whereas you just have a bunch of sprites (or MMF2 equivalent objects) in the Editor.  Thus the game displays tile transparency correctly because your code explicitly draws them one-by-one onto an image (as opposed to sprites, which MMF2 manages for you).
And you didn't implement the game's behavior in the editor because tiles can change in the editor.)
« Last Edit: November 29, 2009, 21:31:13 by Exp HP »
(secretly hoping nobody will mention the object compendium)
My stars:   :hiddenstar:(Object Compendium):hiddenstar:(By PM)
Check out my Youtube channel for some terrible Let's Plays by a socially inept nerd!

*

Offline Nifflas

  • 1532
  • 61
    • View Profile
Re: Annoying editor transparency display bug
« Reply #9 on: November 30, 2009, 10:04:14 »
There's a technical difference in the editor and game. The editor separates the layers into actual Multimedia Fusion 2 layers to be able to show or hide certain layers. The game itself renders everything into the same on top of each other. There must be some internal difference to how objects are handles in those situations.