Thursday, July 7, 2011

Sensibeat's .emg File Structure Tutorial

From RYU_03.cos.emz I dump the face emg file that I rename as RYU_03.face.emg (included in swap obj.rar):
Notice that the emg is composed of 4 objects sharing 1 name.

.emg file references

Let's take a look at RYU_03.face.emg in HxD:

offset 04 to 07:

Code:
00 01 01 43

number of this emg, former is 00 01 01 42, next is 00 01 01 44

offset 10 to 13:


Code:
00 00 02 C7

appears on every emg, may be the marker to the starting point of every later offset references

offset 14 to 15:

Code:
00 01

number of object's name(s)

offset 1C:

Code:
00 50

no idea what those datas are

offset 20 to 21:

Code:
06 66

number of vertex (666 in hex = 1638 in dec)

offset 2E:

Code:
00 40

appears on every emg, no idea what those data are

offset 24 to 25:

Code:
00 00 39 64 (+ 10 = 39 74)

relative offset (couting from offset 10) of another part of the emg

offset 2A to 2B:

Code:
00 04

number of objects

offset 2C to 2D:

Code:
00 70 (+ 10 = 80)

relative offset (counting from offset 10) of the list of relative offsets of the objects

offset 30 to 5F:

no idea what those datas are

offset 60 to 63:

Code:
00 00 00 54 + 10 = 64

relative offset (counting from offset 10) of the 1st object's name dds references (only one here, more references here in case of more objects)

offset 64 to 7B:

Code:
02 00 00 00 00 02 80 3F 22 00 80 3F 00 00 00 00 00 07 80 3F 22 00 80 3F

dds reference
the 1st number in red points to the texture dds
the 2nd number in red points to the normal map dds

dds are ordered from 0 (first texture dds) and the normal map dds numbers follow the texture ones
Ryu has 5 texture dds numbered from #0 to #4 and 5 normal map dds numbered from #5 to #9
#2 is the 3rd texture dds
#7 is the 3rd normal map dds

offset 80 to 8F:

list of relative offsets (counting from 10) of the objects
00 00 00 80 + 10 = 90     1st object
00 00 20 50 + 10 = 20 60 2nd object
00 00 29 D0 + 10 = 29 E0 3rd object
00 00 38 80 + 10 = 38 90 4th object

offset 3974: (given at offset 24)

offset of the beginning of the second part of the emg, that I have yet to understand...

Sensibeat's cmn.emz File Structure Tutorial

cmn.emz file structure

I extracted ZGF.cmn.emz in piecemontee's SF4 AE and opened it in my hexadecimal editor:
[IMG]
I highlighted the references for each data, in bright colors the Relative Location and in faded color, the Length.
So the 16 characters in red are references for #EMO, the 16 in orange are references for #EMM ... etc

You have to know that those values are read backwards (2 characters at a time)

In the case of #EMO, let's look at it's Relative Location (in bright red), we read: 60 00 00 00
It means the Relative Location is 00 00 00 60 (60)

The Rule is: Relative Location (RL) = offset of True Beginning (TB) - offset of Current Reference Location (CL)

We have RL: 60 and CL: 20
TB = RL+CL = 60+20 = 80 (easy one but for later calculations remember we're in hexadecimal)

The True Beginning of #EMO is at offset: 80
[IMG]

Let's try with #EMM:
We read: E8 8D 02 00
Meaning our RL is: 00 02 8D E8 (28DE8)
We have CL: 28
TB = 28DE8+28 = 28E10

The True Beginning of #EMM is at offset: 28E10
[IMG]



Now let's take a look at our #EMO's Length (in faded red, 1st screen), we read: 88 8D 02 00
It means the length of the file is 00 02 8D 88 (28D88)

The Rule is: Length (L) = offset of True Ending (TE) - offset of True Beginning (TB)

We have L: 28D88 and TB: 80
TE = L+TB = 28D88+80 = 28E08

The True Ending of #EMO is at offest: 28E08
[IMG]

The last references are the True Beginnings of the files names at the end of the cmn.emz file:
[IMG]

For ZGF.skl.emo we can read: 90 D0 A8 00
Meaning its True Beginning is at offset A8D090

Sensibeat's Col-based Transparency Tutorial

So, as many people are asking, and because it may be difficult to find every informations in the SF4 modding thread (31 pages already), I translated a tutorial I made some time ago on a french forum.

I used Sakura as an example.

To make transparency only using col.emz file, 2 steps are required:
- editing the col.emz file with a hexadecimal editor
- editing the Alpha layer of the dds where the texture is

1) edit the col.emz file

First I use piecemontee's SF4Explorer to identify the objects names and find them easier in the hex-editor

link: Free File Hosting Made Simple - MediaFire (you can get a newer version but this one is enough for names)

Reminder: to see objects names in SF4Explorer we are going to look at the cos.emz file, but it's the col.emz file we are going to edit (both are linked).
This step isn't required, but it's such easier when you know the true names of things, instead of having to look for them one by one, doing blind tests...

Ok... there the skirt was obviously "Skirt", but "Hatimaki" for her hairband was quite harder to figure...

Now you know the name of the thing you want to edit, open the col.emz of your mod (not the original col.emz, the unarchived one -dat, emb, name it... I rename mine .emz just after I unarchive them to .emb with quickbms-) under a hex-editor and do a search on that name:
Now scroll down a bit to the line "BrushA":
See those 40 characters outligned? You'll have to edit them:

For full transparency (removing objects, holes, ripped clothes) change them by those 40:
(I'll test on Sakura's skirt)

For semi transparency (Rose's pants) change them by those 40:
(I'll test on Sakura's hairband)
Ok, now that first step is done, save your col.emz and let's edit that texture.

2) edit the .dds file

Firstly what is an Alpha layer?

It's a layer in addition to basic color layers (RGB) that will create transparency (a white layer without colors, only black & white -and shades of grey-).

You find it here in Photoshop:

If it's here, no problem, your .dds file is in DXT5 format.
If it isn't there, the .dds file should be in DXT1, you'll have to add one yourself.

To know the DXT format of your .dds files I recommend downloading Windows Texture Viewer from the NVIDIA site: it shows the DXT.
link: Windows Texture Viewer
To show you the effect of semi transparency, I put a big rectangle with a gradient from white (visible) to black (invisible) on Sakura's hairband:
(on screen: Alpha layer alone)

To show you full transparency, I draw some simple shapes on her skirt:
(on screen: RGB layers and Alpha layer displayed together: the black of the Alpha layer is shown in transparent red under this display mode in Photoshop)

Then I inject the .dds back in the col.emz file...

And here is the result:
Have fun!

Credits goes to sn00pee for all his finds on the subject.

edit:

*forgot to mention an important thing:
Full transparency works if you save in both formats, DXT1 1bit alpha or DXT5.
Semi transparency only works if you save in DXT5.

sn00pee (again) found a way to inject bigger files in .emz without crashing the game here.
(I think the guy that created Rose Ninja used that method on the *cough*second color*cough*)

Wednesday, July 6, 2011

SSF4AE PC Moveset Swap Tutorial

Thanks to Capcom's decision to forego emz containers and their associated headaches, moveset swaps are extremely easy to do now and they're not plagued by the "monkeyface" problem we all know so well.

Here's how you do it:
Step 1: Make a backup of your AE installation. If you mess something up, this will save you a lot of time, I promise.

Step 2: Pick 2 characters: 1 whose moveset we'll be taking (the donor) and 1 who will be receiving those moves (the recipient). For this example, I will use Hakan as the donor and Ryu as the recipient (i.e., Ryu with Hakan's moveset).

Step 3: Go to the resource/battle/chara directory and find your donor's folder, in this case HKN. In this folder, copy all of the files from HKN.cam.ema down to HKN.vfx.ttex.emz EXCEPT for HKN.fce.ema and copy them somewhere (a working folder where we have write permissions is appropriate).

Step 4: Rename all of those files we just copied to match our recipient's character prefix, in this case RYU. Now, go back to resource/battle/chara and copy them into our recipient's folder, overwriting the ones that are already there (it's cool, you backed everything up anyway, right? Right??).

Step 5: Now, this is the key step: navigate to your donor's "latest" moveset files, which are located in dlc/03_character_free/battle/regulation/latest/ for normal characters (I'll update this post with the AE character's locations when I get home). Take the donor's bac and bcm files, in this case HKN.bac and HKN.bcm, copy them to our working directory and rename them to our recipient's character prefix.

Step 6: Finally, we take our renamed bac and bcm files and drop them into our recipient's folder in dlc/03_character_free/battle/regulation/latest/ (assuming they're a normal character and not AE-specific), overwriting what's there.

That's it. All done!

I'm going to explain a little bit about what we've just done, so read over it if you're interested:

The actual moves and animations are stored in the .bac and .bcm files, which were previously components of the *.cmn.emz bundles in vanilla SF4. When they were bundled, we had to open the entire bundle in a hex editor and find the desired files and names to edit manually. However, since Capcom stopped using the bundles, we can just rename the files and be done with it.

Now, you'll notice in step 3 we omitted the *.fce.ema file, which contains the character's face animation data. By doing so, we've let Ryu--our recipient--keep his original face animation data, thus avoiding the monkeyface for the most part.

Last, I wanted to mention the various revisions of moveset files included in the AE installation. The ones included in the resource/battle/chara directory are the regular, non-AE movesets, which are superseded by the ones located in dlc/03_character_free/battle/regulation/latest/. However, during the challenges/trials, the game reverts to using the SSF4 movesets, which access the resource/battle/chara ones.

Sunday, July 3, 2011

Heart-Shaped Mini Cheese Pizza ميني بيتزا القلوب بالجبن

Heart-Shaped Mini Cheese Pizza ميني بيتزا القلوب بالجبن

Scroll down for English post
عند عمل البيتزا من الممتع وجود أطفال في المطبخ للتسلية، ولكنه أكثر تسلية بالنسبة لهم إذا كانت هذه البيتزا على أشكال القلوب أو أشكال مختلفة، اليوم سأقوم بعمل وصفة سهلة وسريعة لبيتزات صغيرة على شكل القلوب ويمكنكم عمل أي شكل تفضلونه أنتم أو أبنائكم، أتمنى أن تعجبكم.
نصائح للحصول على أفضل عجين بيتزا هنا

الوصفة تكفي: 10 بيتزا صغيرة
وقت التحضير: 30 - 60 دقيقة
وقت الطهي: 10 دقائق
When making pizza it's great to have your children in the kitchen, but when it's in shapes it's more fun, here I'm making some heart shaped mini pizzas and you can make any shape you or your children would like, also it's great for anniversaries or Valentine's Day, hope you like it.
For recipe tips and how to make a perfect dough follow the steps in here >> My Stuffed Crust Pizza & tips 4 great dough.

Serves: 10 mini pizzas
Prep. Time: 30 - 60 minutes
Cooking Time: 10 minutes
Click here for the recipe اضغط هنا للوصفة »

Tuesday, June 28, 2011

Quick No-yeast No-knead Flatbread خبز سريع بدون خميرة


Scroll down for English post
وصفة اليوم عبارة عن خبز سريع وسهل. في بعض الأحيان يكون عمل الخبز في المنزل شيء صعب ومرهق للبعض، لكن هذا الخبز السوري في منتهى السهولة كأنك تقوم بعمل البانكيك، هو عبارة عن خبز بدون خميرة يتم تجهيزه في دقائق دون الحاجة إلى استخدام الفرن، وصدقوني إنه لذيذ للغاية حقاً، يمكنكم عمله للإفطار أو لحفلات الكوكتيل أو كمقبلات. اعتدت أن أقوم بعمله للإفطار عندما أكتشف أن الخبز عندي قد نفذ دون أن أنتبه، وصدقوني هذا الخبز رائع مع الجبن الكريمي كما أنه لذيذ جداً مع وصفتي لغموس التونة الموجودة هنا، هيا لنرى الوصفة.

نصيحة الوصفة:
1- إذا لم تقوموا باستخدام الخبز فور عمله يمكنه حفظه في كيس بلاستيك حتى يظل طري ولا يصبح صعب الأكل.
2- يمكنكم مضاعفة المقادير كما تحبون.

الكمية تكفــــي: رغيفين
وقت التحضير: دقيقتين
وقت الطهــــي: 6 دقائق
Today's Recipe is for a quick bread. For some people making bread at home is so hard sometimes,  but this no-yeast no-knead flat bread is just as easy as making pancakes, you can make in minutes without even using the oven, only on stove top and believe me it's very delicious! You can make it for breakfast, cocktail parties or use it in appetizers. I used to make that bread for breakfast when I realize that I'm out of bread, and believe on that >> It's really yummy with cream cheese, it's also super delicious with my tuna dip recipe in here. Let's see the recipe.

Recipe tip:
1- If you are not going to use the bread right away, place it in a plastic bag so it doesn't get tough to eat.
2- You can double the ingredients if you wish to make more.

Serves: 2 loaves
Prep. Time: 2 minutes
Cooking Time: 6 minutes

Click here for the recipe اضغط هنا للوصفة »

Wednesday, June 22, 2011

Solder-less Happ Button Mod for Mad Catz SE Fight Stick

I actually performed this mod about a year ago on my own stick, but never published the pictures or process until now because I didn't think anyone would be interested. However, I've noticed a few threads on the Shoryuken forums with individuals asking for "clickier" alternatives to the sensitive-yet-mushy Sanwa and Seimitsu buttons that are currently preferred by most players, and Happ's products fill that niche quite nicely.

Before I dive in with the mod itself, I'm going to take a few moments to talk about differences between Japanese- and American-style arcade buttons and why someone might prefer one over the other. I'll try to be as objective as possible. If you already know or don't care, feel free to skip straight to the tutorial and pics.

Background

American-style buttons--specifically those from arcade part manufacturers Happ and IL--use a plunger positioned atop a Cherry microswitch, which produces a tangible and audible click when depressed. Japanese-style buttons, on the other hand, use a silent, low-resistance switch that provides little-to-no feedback as to when a button press is registered to the system. This is not to say that Japanese-style buttons are not sensitive, as they are actually significantly more sensitive than the Happ designs, there is simply no indication from the button itself as to when it will register.

Overall, Happ buttons seem to be popular with individuals who also like clicky, mechanical keyboards (like the venerable IBM Model M keyboard, which I use at home), as well as folks who grew up with the American arcade scene (i.e., "old farts," as the kids like to call us).

With that out of the way, lets get started. Some people have laughed at this mod for being "ghetto," but I'll take that over those tacky, overwrought custom sticks so many people seem to favor.

Anyway, as it says in the title, this is a solder-less mod, but you'll still need some additional items (Note: this is a button-only mod; putting a Happ stick into an SE is a much bigger undertaking and I don't recommend attempting it unless you are an experienced modder)

What You'll Need

1. Phillips-head screwdriver. To remove the screws from the bottom of the case.

2. Buttons. I recommend the Happ Competition pushbuttons, which have a low travel distance and convex shape, similar to Japanese-style buttons, but with that same satisfying click as the Happ Classics.

3. .187 quick-disconnects. These connect the stick's board to your buttons. The Japanese-style buttons use .110 quick-disconnects, which are too small for your mighty Happ buttons.

4. Wire. Somewhere around 14 to 16 gauge is good, even a little thicker or thinner should be fine, though you'll want to make sure your quick-releases can grab them properly.

5. Cardboard box. This will be used to make a spacer to provide room for your long-ass American buttons, which run deeper than their Japanese counterparts (/innuendo).

6. Glue. For the aforementioned spacer, which needs to be 2 layers deep. Pretty much any glue should be fine, but you want it to be pretty strong and thick. I used wood glue.

7. Optional. You can use special solderless connectors--like these--to join your wires to the stock wires, but I'll show you a little trick later on that works just fine without any connectors.

Step 1: Remove the bottom plate from the stick

Pretty self-explanatory. Just unscrew the 6 screws (2 in the middle and 1 under each of the 4 rubber feet).

Step 2: Trace the outline of the bottom plate onto your cardboard, twice
Depending on the size of your cardboard, you may have to break down your box. While you're at it, go ahead and draw a second square inside of each, about 1" smaller in each direction.

Step 3: Cut your cardboard

Cut along the lines you just drew such that you have 2x 1" frames of cardboard.

Step 4: Glue the frames together to make your spacer
Put your 2 frames together and glue them. This is your spacer, which provides the necessary clearance for your buttons.

For the next couple of steps, which cover removing the old buttons and putting the new ones in, I recommend replacing 1 button at a time so you don't get the wires mixed up. They're color-coded, but if you lose track of which wires go with which button, you'll have to do a bunch of trial-and-error testing at the end to get everything sorted out. Anyway...

Step 5: Pop out your stock buttons

They have a little clippy thing that holds them in:
If you press it in with a screwdriver or whatever, you should be able to pop them out without much trouble. Make sure you disconnect the wires from the bottoms first.

Step 6: Connect your new wires to the old button connectors

You can use the aforementioned optional solderless splicers or you can do what I did: strip the end of your new wire, pull back the rubber sleeve thing from the old .110 quick-disconnects, wrap your bare wire around the old quick-disconnects
and then slide the rubber sleeve over the whole thing. The connection will be fine and the sleeve will hold everything in place nice and tight. :D
Step 7: Add your new buttons

Not much to this step. Just stick 'em in there, screw on the included nut until it's tight and then clip in the included Cherry microswitch. It's a tight squeeze in the tiny SE case, so you'll want to take that into consideration. Take a look at my finished layout:
Step 8: Connect your buttons and test it out

Crimp your .187 quick-disconnects to stripped ends of your new wires and then connect them to your new Happ buttons. One wire connects to the bent post on the side of the microswitch and one connects to the nearest post on the bottom, as shown in the previous pic. Important: if the quick-disconnect on the side touches the bottom plate of your stick, it will ground itself and cause a button press to register (this is bad). To prevent it, you can tape/glue a piece of paper or plastic (I used one of those anti-static bags that an old computer motherboard was shipped in) to the inside of the plate, just to be extra-cautious.
At this point, you should be ready to test your buttons out. Make sure the wires are all connected to the correct button (i.e., the buttons execute the correct actions in-game). If any of them act like they're always pressed until you actually press the button (i.e., its response is backwards), then you've attached the wire to the wrong post.

Step 9: Replace the bottom plate

Once you're sure everything works properly, just cram your wires into place and screw the bottom back on. With the spacer, the screws should be just long enough to catch if you press firmly on the bottom plate. However, they probably won't be able to hold the rubber feet in place securely and you'll probably lose them (though I imagine most of you are like me and have long since lost those rubber feet anyway).

Here's what it looks like from the side. Yes, the cardboard is visible (though not particularly noticeable), and yes, people will probably make fun of you for it.
If you have any questions about the process, hit me up in the comments.

UPDATE: Reader sfkingalpha had the clever idea of covering the cardboard edge with duct tape, which greatly improves the appearance compared with nekkid cardboard:
"Aside from aesthetics, I think this also helps with air tightness and cardboard deterioration!"
Looks great, sfkingalpha!

He was also able to keep his rubber feet by getting longer screws, specifically 3/4 SS panheads.

Here's his finished product:

Cari Farmasi

Farmasi Di Kuala Lumpur dan Selangor Selangor / KL Area NO SHOPS NAMES ...