 |
Castle Paradox
|
| View previous topic :: View next topic |
| Author |
Message |
Joe Man

Joined: 21 Jan 2004 Posts: 742 Location: S. Latitude 47°9', W. Longitude 123°43'
|
Posted: Sat Apr 08, 2006 1:03 pm Post subject: |
|
|
| Yeah, I'm familiar with bitmap transparency. Just throwing something out there to possibly be added one day. |
|
| Back to top |
|
 |
Kizul Emeraldfire Type: Cyber Dragoon

Joined: 26 Mar 2004 Posts: 229
|
Posted: Sun Apr 09, 2006 8:41 am Post subject: |
|
|
Hmm, I was sorta thinking of the layers a whole different way. I was sorta thinking that each layer could be a different tileset. You'd be able to add/remove layers in Edit Maps -> <map> -> Add/Remove Tile Layers (or just Add/Remove Layers). By default, each map would have one tile layer (the base layer), and you could add layers above and below it. By default, all tiles on one tileset are opaque.
However, if you wanted to get jiggy with some layers in your game, here's how I was thinking that would work (we'll use the standard 'Tree-over-an-NPC' example). Here is the tree tile:
We want it to be drawn mostly over the NPC:
However, as is shown here — that's quite impossible the way the tile is right now. :)
So, we go back the the main menu and go to Edit Graphics > Edit Maptiles > Tile Set x > Draw Alpha Map (or something. Maybe Draw Transparency. I dunno what to call it exactly! :D)
By default, all tiles are opaque, so we black out the stuff we don't want to see over the NPC sprite by using the black-to-white bar at the bottom of the palette thing (but don't worry, you won't see the black you just scribbled onto the tile when you go to the Draw Maptiles menu and edit it! :D). Black makes it invisible, white makes it completely visible. This would also allow us 14 shades of opacity (the superdark gray to the superlight gray), but let's not use those right now)!
Go out of the editor, save the changes and kick up the game.
Et voilá! The tile is only drawn over MOST of the NPC! :)
Edit: Was just thinking — since people like to use custom palettes, maybe the OHR could have a built-in 256-color black-to-white palette that's only used when you went to draw the Transparency stuff, and for calculating it as well. Just a 100% grayscale palette of 256 colors or something, that way you'd be able to have larger control over the transparency/opacity of the tile/sprite you're working on. :/ Just a thought! :D |
|
| Back to top |
|
 |
Joe Man

Joined: 21 Jan 2004 Posts: 742 Location: S. Latitude 47°9', W. Longitude 123°43'
|
Posted: Sun Apr 09, 2006 1:39 pm Post subject: |
|
|
| If you were paying attention, which you clearly weren't, adjusting opacity will definately not be an option (though you may have been thrown off by alternate terms) in the near future. Sorry, but you'll have to wait for Jormungand, if it ever is implemented. |
|
| Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Mon Apr 10, 2006 6:08 am Post subject: |
|
|
Jormungand will have the same restrictions. It's not that we're lazy, or the language is incapable of it, it's that we're stuck in 256-color mode for the time being.
Anyway, Ked, would it be acceptable if instead of using colour #0 for transparency, we instead allow you to choose which colour your use? I.e. you could pick any colour in the palette to be transparent. _________________ I stand corrected. No rivers ran blood today. At least, none that were caused by us.
Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ |
|
| Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Mon Apr 10, 2006 7:12 am Post subject: |
|
|
| Mike Caron wrote: | Jormungand will have the same restrictions. It's not that we're lazy, or the language is incapable of it, it's that we're stuck in 256-color mode for the time being.
Anyway, Ked, would it be acceptable if instead of using colour #0 for transparency, we instead allow you to choose which colour your use? I.e. you could pick any colour in the palette to be transparent. |
I still like a 1-bit transparency bitmap that is unrelated to the pixels in the image. |
|
| Back to top |
|
 |
Kizul Emeraldfire Type: Cyber Dragoon

Joined: 26 Mar 2004 Posts: 229
|
Posted: Mon Apr 10, 2006 9:50 am Post subject: |
|
|
| Joe Man wrote: | | If you were paying attention, which you clearly weren't, adjusting opacity will definately not be an option (though you may have been thrown off by alternate terms) in the near future. Sorry, but you'll have to wait for Jormungand, if it ever is implemented. |
Well, for right now, we could just use colors 0 and 16, I was just giving my 2 cents-worth. :) |
|
| Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Mon Apr 10, 2006 12:52 pm Post subject: |
|
|
| James Paige wrote: | | Mike Caron wrote: | Jormungand will have the same restrictions. It's not that we're lazy, or the language is incapable of it, it's that we're stuck in 256-color mode for the time being.
Anyway, Ked, would it be acceptable if instead of using colour #0 for transparency, we instead allow you to choose which colour your use? I.e. you could pick any colour in the palette to be transparent. |
I still like a 1-bit transparency bitmap that is unrelated to the pixels in the image. |
But, why? We use the colour-based system in sprites, and it seems to work ok. This is the same thing, except that there's more colours overall, and you don't have to worry about being able to make tiles with only 255 colours.
I cannot think of any other program that uses a mask for doing transparency. Either way, the algorythms would be the same:
Mask Based:
| Code: |
For x = 0 to sprite.width - 1
for y = 0 to sprite.height - 1
if sprite.mask[y * sprite.width + x] then buffer[(dy + y) * buffer_width + (dx + x)] = sprite.data[y * sprite.width + x]
next
next
|
Colour based:
| Code: |
For x = 0 to sprite.width - 1
for y = 0 to sprite.height - 1
if sprite.data[y * sprite.width + x] = trans_colour then buffer[(dy + y) * buffer_width + (dx + x)] = sprite.data[y * sprite.width + x]
next
next
|
In fact, if we use colour 0, then we can optimize it by using Allegro's blitting routines, which are optimized for colour based transparency. _________________ I stand corrected. No rivers ran blood today. At least, none that were caused by us.
Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ |
|
| Back to top |
|
 |
Gizmog1 Don't Lurk In The Bushes!

Joined: 05 Mar 2003 Posts: 2257 Location: Lurking In The Bushes!
|
Posted: Mon Apr 10, 2006 4:14 pm Post subject: |
|
|
| What about old games where people used color 0? Would we have a bitset or something in the game, "ENABLE TRANSPARENCY ON MAP?" or "ENABLE TRANSPARENT TILES?" |
|
| Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Mon Apr 10, 2006 5:22 pm Post subject: |
|
|
Well, we (or, I) was thinking a bitset to solve the first problem I mentioned, of the overhead tiles.
Otherwise, drawing the tiles solid, or drawing them transparent with a solid black background is the same. _________________ I stand corrected. No rivers ran blood today. At least, none that were caused by us.
Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|