tutorial mugen

Embed Size (px)

DESCRIPTION

tutorial mod.

Citation preview

A Brief Introduction To BackgroundsThis document assumes that you are already familiar with how to create SFF files.A background in MUGEN consists of the following elements:*) One or more background sprites, drawn from back to front, with or without masking, and with or without parallax effects*) Specifications of how those sprites should move in relation to the camera*) Animation data for background animations*) Specifications of the width and height of the playing field*) Specification of the "ground level" for the stage*) More miscellaneous settings*) Background controller definitions for more advanced effects.The simplest kind of stage will simply have a single layer in the background.Suppose you have a single PCX file which you want to use as a background picture. Create a file stage1.sff with this PCX as sprite 0,0. Place the axison the center of the bottom edge of the PCX. Now copy stage0.def to stage1.def and open stage1.def up in a text editor.In the [Info] group, you can customize the name of the stage. Stage namesshould be enclosed in double quotes.To get the stage up and running as quickly as possible, simply go to the [BGDef] group. Change the spr parameter to point to stage1.sff, and setdebugbg to 1. Now go to the [BG 0] group. Make sure the type parameter isset to normal (since this is not a parallaxing background element). Makesure the spriteno parameter is set to 0,0. Set the layerno to 0 to preventthe background from being drawn in front of the characters. Finally, set the start parameter to the desired starting location of the background. The coordinates are measured from the center of the bottom edge of thescreen. If you placed the axis for sprite 0,0 in the bottom center as suggested, then you can just set start = 0, 0.Other parameters that can be set for this BG element:delta = xdelta, ydeltaxdelta and ydelta are scaling factors: for each pixel the camera moveshorizontally, the background element will move xdelta pixels, etc. If youonly have a single background image, you will generally want to set delta to1, 1. Using smaller deltas for the rear background layers can create the illusion of depth when you have multiple layers.trans = none, add, or subControls the transparency of the background element.mask = 0 or 1If you have multiple layers, set mask = 1 on the foreground layers to preventdrawing color 0 for them. If masking is not necessary, then make sure to setmask = 0.tile = x, ytilespacing = x, ywindow = x1, y1, x2, y2Unless you are using a small image which you want to tile to fill up the wholebackground, you should set tile to 0,0. window should be left at 0,0,639,479for now.Finally, delete or comment out the [BG 1] block, since we don't have any other background elements.Now test your stage:mugen kfm kfm -s stage1Try walking and jumping around. Depending on the dimensions of sprite 0,0, youmay not be able to see all of the background, or you may end up scrolling pastthe edge of the background and seeing a solid magenta color (the result of setting debugbg = 1). To fix this problem, and to further customize the stage,you can adjust the parameters listed below.In the [Camera] group, the boundleft and boundright parameters control howfar the camera can scroll left and right from its initial starting position.You should adjust these so that the camera cannot scroll past the edge of thebackground. For instance, if your background image is 1000 pixels wide and the camera view is 640 pixels wide, then you should set boundleft to -180and boundright to 180.Similarly, the boundhigh and boundlow parameters control how far the cameracan scroll vertically. boundlow should be kept at 0 in most circumstances.If your background image is 750 pixels high and the screen is 480 pixels tall, then boundhigh should be set to -290.You can leave the verticalfollow, floortension, and tension parameters alonefor now. These are used to tweak camera behavior according to the commentsin stage0.def.The [PlayerInfo] and [Scaling] groups can also be left alone for now.The [Bound] group contains the parameters screenleft and screenright, which control how much a character can protrude off the edge of the screen. Theseparameters are typically set to about 15.The [StageInfo] group contains the zoffset, autoturn, and resetBG parameters.zoffset determines the ground level of the stage. It is measured in pixelsfrom the top of the screen when the camera is in its starting position. Youshould adjust this value to make sure the players actually stand on the ground level of your image. The autoturn parameter makes players turn aroundto face each other if necessary, and should be left at 1. The resetBG parameter, if set to 1, resets stage animations and background controllers to their initial states. Since we won't be using animations or backgroundcontrollers in this example, you can leave resetBG alone.The [Shadow] group determines how player shadows are displayed on the stage.Player shadows are just vertically scaled copies of the player sprites. Theyscale parameter controls the scaling factor (where 1 means no scaling).The color parameter can be set like this:color = R,G,Bwhere R,G,B are the corresponding color components (ranging between 0 and 255). The higher the number, the less of the corresponding color there is inthe shadow.Finally, the reflect parameter enables reflection shadows if set to 1. Thisis useful for "shiny-floor" effects.Once your BG is working, be sure to turn debugbg back off.