The Mugen Fighters Guild

M.U.G.E.N Central => M.U.G.E.N Discussion => Development => Topic started by: ink on November 28, 2017, 04:30:58 pm

Title: Asymmetry, Transformations and costume changes are possible in MUGEN.
Post by: ink on November 28, 2017, 04:30:58 pm
I have been think about how to implement asymmetry and transformations in MUGEN. I believe this is very possible but with some limits, character sprites can't have more than 16 colors(including background transparent color). Also a 16 color character pretty much uses up the whole palette using this method so no effects can be in the palette unless they use the same colors as the character. I believe using this method should be fine for custom states too.


Ive made a quick example of how this should work below.

In Photoshop I've made the first sprite the background image at %100 opacity.
(https://i.imgur.com/q8DRxmY.png)
Above that I have a new layer of the color 00ff00 at %50 opacity.
(https://i.imgur.com/GeFk5Bg.png)
Above that I have the second sprite at %50 opacity.
(https://i.imgur.com/NAdb3Dg.png)
------------------------------------------------
Doing this creates an image that has 2 images in one sprite.
(https://i.imgur.com/NwqtNzw.gif)

------------------------------------------------
Below is the new sprite with a palette partially applied to reveal the second sprite.
(https://i.imgur.com/ytz6sTj.png)

and of course another palette would be applied to reveal the fist sprite.


----------------------------------------------------------------------------------------------------

Notes:

Other uses:

-Edit-
Graphicus pointed out that he brought up this idea almost a year go. It’s not a thread devoted to the topic so alot of us missed it. I definitely recommend checking out the thread, he shares a clear examples and the're some other cool ideas/details mentioned there too.
Spoiler, click to toggle visibilty
Title: Re: Asymmetry, Transformations are possible in MUGEN.
Post by: Trololo on November 28, 2017, 04:59:09 pm
Well, that definitely sounds crazy... I could even call it TOO crazy. And unbelievable.
Could you, please, make a video-demonstration of how it works? My brain just really can't handle even imagining such thing even working.
Title: Re: Asymmetry, Transformations are possible in MUGEN.
Post by: ink on November 28, 2017, 05:01:50 pm
Yeah, I was afraid of that. I will try an put together a simple character to show it in action.
Title: Re: Asymmetry, Transformations are possible in MUGEN.
Post by: XGargoyle on November 28, 2017, 06:07:50 pm
That is a clever solution, based on the principle of selective transparencies in sffv2.1: http://mugenguild.com/forum/topics/compare-mugen-ssf-and-palette-176465.msg2291761.html#msg2291761

The only drawbacks I see, are the 16 colors limitation (unless you do some crazy palette manipulation and optimization) and the insanely amount of work to do on the sprites just so they look right for a few required sprites
Title: Re: Asymmetry, Transformations are possible in MUGEN.
Post by: ink on November 28, 2017, 06:11:41 pm
The limitations are frustrating. I just realized this would be great for costume changes though, like M.Bison having a cape or not having a cape. The cape would have around 5colors so it would be more simple to pull off.

-edit-
^added to original post
Title: Re: Asymmetry, Transformations are possible in MUGEN.
Post by: Chronan on November 28, 2017, 06:17:34 pm
Well, that definitely sounds crazy... I could even call it TOO crazy. And unbelievable.
Could you, please, make a video-demonstration of how it works? My brain just really can't handle even imagining such thing even working.
It's possible and pretty cool. I'm planning on using it for Yamchav4 and Cell Saga Gohan to cover costume options and transform hair styles someday. But the downside is you're going to be working with potentially a lot of colors. So it's ideal if you have characters that aren't using a lot of colors or you know the specific colorsets that are going to overlay(such as hair+skin+shirt). Like ink said a 16 color character is pretty much the maximum limit unless you can guarantee that some colors don't overlay on any sprites in the sheet. In addition with Mugen1.1 SFFs(SFFv2??) you can specify colors on characters to use full alpha transparency(so the pixels are totally transparent).

So with the sprite below(SSj Trunks overlayed with Normal Trunks):
(https://i.imgur.com/98GwkFd.png)

If I want this sprite to be Normal Trunks, I just change the alpha for the Golden Hair Colors on the palette to 100% alpha. Then adjust the palette for the remain hair and possible skin colors to match the Normal Trunks sprite overlay.
I do essentially do the same thing to get an SSj sprite, adjust the palette so the sprite becomes SSj. Then alpha out any remaining normal hair colors.

At this point you have one set of sprites that you can change the appearance of by changing the palette, which can be done in Mugen using remappal, and it will save your character from reverting forms in custom states. It also saves you from needing to make double the AIR anims, doubling the sprites used in the SFF, etc. The cost being it may be much more time consuming to make all 6-12 pals for a character, but the color map ink used seems like a great way of handling that(wish I used it).

Below are those changes in action to get normal trunks (almost, I got lazy and didn't finish but this should give you an idea of where it's going):
(https://i.imgur.com/7FI1u9d.png)
(https://i.imgur.com/kNFKDlF.png)
(https://i.imgur.com/0AiSxoO.png)
Still need to correct some skin x jacket and a bit of colors on the hair. But you can see how from one sprite I've got normal Trunks, and if a adjusted the palette in the opposite direction I'd get SSj Trunks.
Title: Re: Asymmetry, Transformations are possible in MUGEN.
Post by: ink on November 28, 2017, 07:10:24 pm
That is the general idea.

But have you figured out how the back view of Trunks will look? I am surprised you are able to do it with that few of colors, because anytime his Super Saiyan hair overlaps another color it will need to be accounted for so it looks normal when he is not in Super Saiyan form.

For example his Super Saiyan hair overlapping his arms during moves or getting hit. Unless his hair is somehow always in the background and never the foreground.

Title: Re: Asymmetry, Transformations are possible in MUGEN.
Post by: Just No Point on November 28, 2017, 07:13:38 pm
I tried this with Gotenks for ssj3 but he had way too many colors. However that trunks wouldn't be too bad. The simplest solution would be to ONLY make these blended sprites on required sprites. And then you could make duplicates for all your other ones instead. This could limit the amount of colors you'd need as well.
Title: Re: Asymmetry, Transformations are possible in MUGEN.
Post by: ink on November 28, 2017, 07:16:07 pm
I thought that as well but then there is always the risk of some costume states not work. That would make things a lot easier though.

A small detail that I still think is cool is that the character's small portrait could transform also.
Title: Re: Asymmetry, Transformations are possible in MUGEN.
Post by: Just No Point on November 28, 2017, 08:47:18 pm
Custom states wouldn't be an issue if you only replace the required sprites. Using custom animations from P2 wouldn't screw anything up because you can still detect that you are in x animation and replace the anim with your transformed anim. The small port idea is pretty good and could help me with my current issue for full compatibility ^_^
Title: Re: Asymmetry and Transformations are possible in MUGEN.
Post by: ink on November 29, 2017, 12:39:30 am
The costume change.

(https://i.imgur.com/JnwIZ0s.gif)
Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: FeLo_Llop on November 29, 2017, 01:05:04 am
This is awesome. But you said a charcater can't have more of 16 colours(couting the transparency), so, what about the CSed characters? They have the same amount of colours of a stand, or even those which are shown in a palette template, so...why not possible?

Yes, I know I may sound pretty stupid at this point, but that cool Trunks disoriented me.
Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: ink on November 29, 2017, 01:16:08 am
16 is the max amount of colors in the example I had shown, which was the most extreme example I could come up with.

There are other cases that would work different. For example M.Bison with/without a cape. If there was a formula for how many color slots get wasted it would be  something like  (cape color amount)*(the amount of different colors it overlaps throughout the sprite set) = (Number of color slots you will need free for this method).

So most color separated characters especially the ones that already use up all 256 color slots would not work.
Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: Graphicus on November 29, 2017, 05:44:22 am
That's the same method I mentioned here:

Spoiler, click to toggle visibilty

Glad to see Chronan has been able to get it to work.
Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: ink on November 29, 2017, 06:23:16 am
Well damn... It looks like you guys already went over this idea for the most part nearly a year ago! Thanks for posting that Graphicus, your example looks like it would be easier to understand. I went ahead and added this to the original post.

Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: Chronan on November 29, 2017, 05:12:53 pm
That is the general idea.

But have you figured out how the back view of Trunks will look? I am surprised you are able to do it with that few of colors, because anytime his Super Saiyan hair overlaps another color it will need to be accounted for so it looks normal when he is not in Super Saiyan form.

For example his Super Saiyan hair overlapping his arms during moves or getting hit. Unless his hair is somehow always in the background and never the foreground.
If I applied it to the full sheet it'd definitely have some more colors added do to the normal and ssj hair overlaying jackets and skin colors on both face and arms. For general DBZ super saiyan changes or hair style change there shouldn't be too much worry about hair overlapping any mid section stuff. I think for most characters you might be safe to do 2 or maybe up to possibly 3 hair styles, but if clothes are changing as well (Bald Krillin to Buu Saga Krillin for example) the limit might be hit in a single merged sprite sheet. I want to test this more in future characters, since Nail is one of the next ones in line maybe I'll try drawing his jackets on and give him a jacket costume and a no-jacket costume. I'd fully test this out on Trunks but he's already fully coded with all the custom states, and I don't want to rip that apart. I have Teen Gohan and YamchaV4 planned though so I will definitely be using it on them.

I also had to test the alpha transparency stuff out in game just to be 100% sure it works. And it does work! I did two ghost trunks tests, one with alpha decreased from 255 to 128 similar to what ink's Rugal anim has but I did it to skin & hair only to save me some time, and I tested another with alpha set to 0 on skin (full transparency). So for DBZ sake a Ghost Nappa is as easy as a palette change now.
(https://i.imgur.com/9Hsuj62h.png)
(https://i.imgur.com/jUXgST9h.png)


Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: ink on November 29, 2017, 05:20:55 pm
Very awesome! That makes sense. Have you thought about adding the hair to the small portrait?

It could go outside of the normal box perimeter too because it would only be seen during a match, never messing up the select screen.
Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: Chronan on November 29, 2017, 09:13:29 pm
I didn't even think about that but in theory that would work and that would be pretty cool! Cool enough that I'd be willing to redo Trunks in this method, just for the ssj hair sticking out of the small portrait, BUT I'm not sure if the issue is a bug in Mugen 1.1 itself or me but I can't get small ports to react to remappal at all.

I can have it set to 1,1 (the default sprite pal in his SFF), switch to sprite pal checked, but it doesn't seem to ever update his small port. I might just be screwing something up, or it's a 1.1 bug, or my SFF/small port is broke.  can try fudging with the small ports and remappal some more, but I think 1.1 might just be bugged on that aspect.
Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: Bastard Mami on December 10, 2017, 07:10:13 pm
iirc, I remember the only problem we found with this method was then the transformation depends on the facing (because of you know who) and we can't detect facing in custom states which is why sofiyacat's mugen clone had a spriteno trigger; I think I already coded the tool to suprrimpose the two sprite folders though that might have been only on my head, I will check out later.
Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: Jesuszilla on December 10, 2017, 07:14:51 pm
Eh? I remember being able to detect facing in custom states.
Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: no1wammy on December 10, 2017, 07:26:11 pm
In order, rank the styles (CPS2, CPS3, SNK, DBZ, other sprite styles) that would 1) take advantage of this pretty well and 2) be the most involved and difficult.

Secondly, how would it look like in-game? I'd like to see an animation example (MUGEN or GIF) on how the screen would pick up on the transparent colors. I still feel that an additional exception script is necessary to "hide" the layer.
Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: Memo on December 10, 2017, 07:27:13 pm
In order, rank the styles (CPS2, CPS3, SNK, DBZ, other sprite styles) that would 1) take advantage of this pretty well and 2) be the most involved and difficult.

Secondly, how would it look like in-game? I'd like to see an animation example (MUGEN or GIF) on how the screen would pick up on the transparent colors. I still feel that an additional exception script is necessary to "hide" the layer.

Did you see the pics of trunks on the 1st page???
Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: no1wammy on December 10, 2017, 09:52:41 pm
Did you see the pics of trunks on the 1st page???

...must have missed that.

Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: Bastard Mami on December 10, 2017, 10:17:46 pm
jsut searched for the tool, did nto find it so I guess I only tought about doing so and probably solved the algo in a notebook
Title: Re: Asymmetry, Transformations and custome changes are possible in MUGEN.
Post by: Vans on May 30, 2018, 10:14:29 am
Eh? I remember being able to detect facing in custom states.

While facing can be detected, the problem is that you cannot detect if a sprite was "physically" flipped using .AIR code, I guess.