News:

The forum has been updated to SMF (2.1.3)!
Please be patient as we work to polish up the place and update features as we can.

Main Menu

Is there a way to export the images from the maps with transparency?

Started by Triyence, 19, January, 2014, 03:34:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Triyence

If you look at the image below:
http://imgur.com/f3g5pRV

I just want to get the "3rd layer" of information which is this type of smoke layer. The problem is that it has all this pink in it when it must have some type of transparency associated with it. I want to be able to get that image with the transparency.

http://imgur.com/c2FqG9O

This is what the layer looks like when added to the 1st layer. How do I basically get the "smoke" from this image?

Also, is there anyway to get the entire source code for the editor?

Atrius (He/Him)

The editor source code is available here.

The image data has no transparency information associated with it.  The game's engine applies a special blending mode while drawing that layer, it gives a different effect than just using plain transparency would.
If you click on the button that says "Map" and select "Tilesets" you should be able to find the image used on that layer, I believe it uses palette 13.  When you draw it use an additive blending mode for the same effect.
[sprite=220,4,0]I'm shaking my head in general disapproval of everything[/sprite]

Triyence

Thanks for the reply!

Unfortunately I wasn't able to duplicate the result and I was wondering if you'd have any more suggestions. I'm assuming that I'm missing something simple. I didn't know it used that style of layout so that is good to know. I've attached a picture showing all the palettes from that map using addition as the layer mode and I can't seem to get it. Is the engine doing something else I'm not aware of?

Daddy Poi's Oily Gorillas

Perhaps I can help? It's only half of the answer, though. A method that should not require using Atrius's Editor.

In VBA, go to the room you want to look at.

(Golden Sun has a debug mode if you need help getting to the room, 03001238:01 for GS2 should enable it, and you Press B+Start to open the warp menu.)

When you are at the room. (In this example, 57), go to Tools=>Map View, look for the layer you are interested in. (The blended layer is at BG1.) You can copy this image to clipboard via (prt sc, for the entire screen) or (alt+prt sc, for just the current window), put in a paint document, and crop the unnecessary parts out.

Atrius said the palette would be 13, right? Well, I click a tile here in VBA's Map view, and Palette says 1.

Go to Tools=>I/O Viewer, see 4000050 for FX Type, which in this case is 1 for Alpha Blending, which means you now look at the next addresses (4000052+) for EVA (1st Target Coefficient/Intensity) and EVB (2nd Target Coefficient/Intensity). If FX Type was 2 or 3, you'd likely look at EVY (Brightness). See the documentation at http://nocash.emubase.de/gbatek.htm#lcdiocolorspecialeffects if you are interested in how I learned about this.


Unfortunately, I have not learned/tried the actual blending in paint programs, but I believe I have learned how via my own programming before. (In VB.NET, since GBATEK gives you the equations you need.)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Atrius (He/Him)

Quote from: Teawater on 20, January, 2014, 03:59:08 PMAtrius said the palette would be 13, right? Well, I click a tile here in VBA's Map view, and Palette says 1.

My mistake if that's the case...   I forgot about the Alpha/Brightness coefficients too, you may have to decrease the alpha when you're drawing it to get it right too.  The GBA only has 16 levels of alpha to work with for drawing layers, so it jumps by 6.25% at a time.
[sprite=220,4,0]I'm shaking my head in general disapproval of everything[/sprite]

Triyence

Thanks guys this is helping a lot. I'm brand new to this stuff so please bear with me. I've never done this before, but the attached image is where I'm at.

I'm now stuck trying to interpret this, specifically the bolded parts.

Quote4000052h - BLDALPHA - Alpha Blending Coefficients (W)
Used for Color Special Effects Mode 1, and for Semi-Transparent OBJs.

 Bit   Expl.
 0-4   EVA Coefficient (1st Target) (0..16 = 0/16..16/16, 17..31=16/16)
 5-7   Not used
 8-12  EVB Coefficient (2nd Target) (0..16 = 0/16..16/16, 17..31=16/16)
 13-15 Not used

For this effect, the top-most non-transparent pixel must be selected as 1st Target, and the next-lower non-transparent pixel must be
selected as 2nd Target, if so - and only if so, then color intensities of 1st and 2nd Target are mixed together by using the parameters
in BLDALPHA register, for each pixel each R, G, B intensities are calculated separately:


 I = MIN ( 31, I1st*EVA + I2nd*EVB ) //with values plugged in: I = MIN ( 31, (I1st * 0x4) + (I2nd * 0x10) )

Otherwise - for example, if only one target exists, or if a non-transparent non-2nd-target pixel is moved between the two targets, or
if 2nd target has higher display priority than 1st target - then only the top-most pixel is displayed (at normal intensity, regardless of BLDALPHA).

If you can break this down a bit more I'd really appreciate it. I'm getting tripped up on it's use of the words 'transparency' & 'target', since I'm not actually seeing any transparency, I'm not sure what it's referring to. And I'm guessing a target is a pixel?

Also seems like a discrepancy between the palette numbers, since #13 in the editor is definitely the right one.

Daddy Poi's Oily Gorillas

@Atrius: Decrease the alpha? ... What if one uses a 16-bit Pixel Format? And I usually do bit shifts when I can. So 16 levels is just ((a * b) >> 4)  Example: ((redValue * evaNumerator) >> 4)


@Transparent pixels: They aren't on the smoke layer in the given example, nor on the floor layer, but a good example is the black solid background on BG2 to describe what is meant. When rendered in game, the black background is not shown, thus, transparent. On that BG2 layer, purple is also a transparent color. The transparent color is always the first color in the palette. And each tile likely selects one of the available 16-color palettes as seen in Palette Viewer. (@Palette Viewer: Background is for backgrounds/layers, Sprite is for Sprites.)

QuoteI = MIN ( 31, I1st*EVA + I2nd*EVB ) //with values plugged in: I = MIN ( 31, (I1st * 0x4) + (I2nd * 0x10) )

You are suppose to put the color values there, at I1st and I2nd. 1st being from one layer, and 2nd being from the other layer in the same position. (Copy the same function three times for each color part) Each pixel gets a color (from the palette) that is 16 bits, ... 5 for red, 5 for green, and 5 for blue, and 1 unused. Although, if you are new, I should probably warn you that you may have to understand data formats and stuff. (Think hex editors.)  It would be very tedious to do this manually, so knowing a programming language would be the practical way of handling it. (Unless you find a program/method capable of doing the same thing.)

Huh, palettes showing up in different places is strange...
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)