.
PART 1
GETTING STARTED
Overview: Getting your pictures for your background.
The first step in creating a background is getting your image files. If you want to rip a background, you must use an 'emulator'. An emulator is basically a computer program that can play console or arcade games on your computer, there are also emulators for other computers. An emulator won't do anything on it's own, you need a ROM image of the software or game for it to work. The legality of emulators and roms are still being discussed today, but basically under copyright laws you are able to make 1 backup copy of your purchased game, book, tape, cd, movie, ect...
The emulators that I recommend are Project64 (n64), FinalBurn (CPS-2 arcade games), ZSNES (snes), GENESYST (genesis), NESTICLE (nes), and MAME (arcade). Each emulator has it's own way of deleting the layers and capturing a picture. For example, with ZSNES the 1 - 6 keys disable or enable a background or the sprites, from there you then hit the 'F1' key to bring up the pop up menu, where you can choose 'SAVE SNAPSHOT'. Depending on what color depth you have your settings on it will save as either a .pcx (8bit) or .bmp (16bit). With UltraHLE just hit the 'F10' key and it will save a snapshot in the targa format. With CALLUS, GENESYST, and NESTICLE, on the menu if you choose SETTINGS then LAYERS, you can disable whatever layer you want. Then hit 'F9' to save the .pcx. Also a good tip when you want to create multiple layers of backgrounds, try only activating one layer at a time, then take a snapshot. That way it is much easier later.
After capturing all of the needed background(s), the next step is to move them into a folder in you MUGEN directory. Elecbyte suggests a mugen\work\stages\backgroundname folder but you can use whatever your preference is. Now that you've collected all of your files that you are going to be working with, you are now ready to move on to the next step.
PART 2
GETTING YOUR IMAGES READY
Overview: Saving your images correctly.
Now that you have all of the files you need into one directory, now you must prep every single one of them!! Yes I know this may seem a little frightening at first, but this must be done. What I really recommend is a paint program, such as Paint Shop Pro or Correl Draw. If you do not have one, you can always check
www.download.com for a trial program. It will be an invaluable tool once you get started. Now for my examples I will be going by the Paint Shop Pro menu, but all of the paint programs are basically the same.
Now first OPEN your file, as you can see the picture will load and the background of the picture will most likely be black. Now for beginners sake, black (or color 0-0-0) will be the 'masking' color for all of your backgrounds, the 'masking' color will be the color that is not drawn in MUGEN.
Second you are going to DECREASE THE COLOR DEPTH to a 256 color (8bit) image. Now a problem may arise where if the black background that you want to be drawn may be misunderstood as the masking color. To check to see if this will be a problem, go to EDIT PALLETTE, then choose the upper-left color, which will be black 0-0-0. Change it to a bright color, preferably light red. If that light red shows up where you don't want it to (such as part of the background you want to keep) there is a quick way to fix it.
Here's how. First either hit undo or change the light red back to black 0-0-0. Now somewhere on the palette where a color is not defined (usually by white 256-256-256 or a gray) choose that light red again. Next INCREASE THE COLOR DEPTH to 16bit, then immediately DECREASE THE COLOR DEPTH to 256 color (8bit). Change the black 0-0-0, to something very very close to it... such as 0-0-4 or 0-0-8, then change the light red to 0-0-0. Again INCREASE THE COLOR DEPTH to 16bit, then immediately DECREASE THE COLOR DEPTH to 256 color (8bit), and the problem is solved!
Finally (this next one is easy) click FILE then SAVE AS. And make sure that you are saving the image in the right directory, and saving the image as a PCX - ZSOFT Paintbrush Image Version 5. And when you've completed this with ALL of your images... you're ready to move on to the next step!
PART 3
CREATING THE SPRITE FILE
Overview: Creating a .SFF file for the background.
Now the next step to creating a background is creating the image file for MUGEN to use. This is called an SFF file. This contains all of the sprites or images that you are going to be using to create this stage. What you'll need is SPRMAKER.EXE, from the ELECBYTE homepage in the developer section. Have SPRMAKER.EXE in the same directory as MUGEN.EXE.
Now open Microsoft Notepad from your Accessories folder. What we are going to do next is create a text file for SPRMAKER, just to make life a little easier.
The first thing to do is in the text file, on the first line, write:
stages\backgroundname.sff
Where 'backgroundname' is the name of your background, and it should be no more than 8 characters. This is going to tell SPRMAKER what the name of the file is going to be. Next you will be writing down the path of your PCX files and their image groups. It should look like this: work\stages\backgroundname\image.pcx
0
0
0
0
The first line:
work\stages\backgroundname\image.pcx
This is the path of your image.
0
This is the 'group number' of the image. Used to help sort each part of the background. For example this number would be different when you want to keep all of the background images in one 'group', and all of the foreground images in one 'group', and all of the images of a background animation in one 'group'.
0
This is the 'image number' of the group. You are to assign each image a different number. If two images are assigned the same 'group' and 'image' number, the first image will be overwritten.
0
0
These are the X and Y values of the image. For all intents and purposes these can remain at 0 and 0.
So when you're finished your text file should look something like this:
stages\backgroundname.sff work\stages\backgroundname\image1.pcx
0
0
0
0
work\stages\backgroundname\image2.pcx
0
1
0
0
work\stages\backgroundname\image3.pcx
0
2
0
0
; end of file
As you notice there are no spaces in this demonstration. This is very important because as soon as SPRMAKER sees a space, it will assume that this text file is over and will quit.
When you are finished and have all of the images included that you will need for the background... save it as backgroundname.txt. Then go into your MS-DOS prompt by either clicking the 'MS-DOS' icon on your start menu or click 'Run', from the start menu, then write 'command.com' and run it. Then navigate into your MUGEN directory ('cd..' to go up a directory, 'cd foldername' to go into that directory, 'dir' to see a list of the folders.), then choose this command line:
sprmaker.exe < backgroundname.txt.
After you close your MS-DOS prompt you are ready for the next step.
PART 4
CREATING THE DEFINITION FILE
Overview: Creating a .DEF file for the background.
OK now this may be (for some) the most difficult portion of creating a background, because it includes a lot of trail-and-error. But keep at it, you'll get it eventually. Also a good template is Kung Fu Man's background DEF file. But we will go through each part of the DEF file just for good measure. Also just a quick note, if you need a remark or a statement in the DEF file that isn't recognized by MUGEN, such as a reminder note, just use a ';' and anything after the comma on that line will be disregarded. OK, let's begin.
Start off the DEF file with:
[Info]
name = "backgroundname"
This will display the name of the stage in MUGEN. Make sure that the name is enclosed in double quotes.
[Camera]
startx = 0
starty = 0
These are the starting coordinates for the stage, normally you would keep it at 0 and 0.
boundleft = -150
boundright = 150
This is the length of the stage to the left and the right. For a longer stage, these values would be a lot larger, for a smaller stage, these values would be smaller. This is where trial-and-error come into play. But to get a general idea where these numbers will be, open your floor image and find the center of the image. There should be a number coordinate of the center displayed somewhere in your program. When get the X coordinate of the center, subtract that by 160, and that should be around the number that you are looking for.
boundhigh = -20
boundlow = 0
These are the height of the stage. With boundhigh, the bigger the number the farther the camera will follow the character. And this is ALWAYS at a negative number. boundhigh is also going to be the starting Y coordinate of your farthest background. And boundlow will always stay at 0.
verticalfollow = .2
This is how much the camera will move vertically towards the highest player. Valid values are from 0 to 1. A value of 0 will mean the camera does not move up at all. A value of 1 will makes the camera follow the highest player. Typically .2 for normal-sized backgrounds. You may need to enlarge this value up for taller backgrounds.
tension = 50
This is the distance player is from edge of the screen before camera starts to move. Typically this will stay at 50.
[PlayerInfo]
p1startx = -70
p1starty = 0
p1startz = 0
p1facing = 1
p2startx = 70
p2starty = 0
p2startz = 0
p2facing = -1
p1startx is typically -70 and p2startx is 70. These are the staring position of Player 1. p1startx is typically -70 and p2startx is 70, p1starty and p1startz should be 0. p1facing and p2facing is the direction the player faces, 1 is towards the right and -1 is towards the left.
leftbound = -1000
rightbound = 1000
topbound = 0
botbound = 0
[Scaling]
topz = 0
botz = 50
topscale = 1
botscale = 1.2
[Bound]
screenleft = 15
screenright = 15
You don't need to change these values.
[StageInfo]
zoffset = 200
The Zoffset is the line where the ground is. A larger number places the ground closer to the bottom of the screen, a higher number place the ground closer the top of the screen. This could be any number from 0 to 240, although from 200 - 240 is recommended.
autoturn = 1
A value of 1 makes the players automatically face each other. A value of 0 allows the player to face any direction. Normally you would want this at 1.
resetBG = 1
A value of 1 will have the background reset to it's starting animation between rounds. A value of 0 will have the animation continue between rounds.
[Shadow]
color = 32,32,32
This is the shadow color given in Red,Green,Blue. Valid values for each range from 0 (lightest) to 255 (darkest). The default color is 92,92,92 if omitted.
yscale = -.1
This is the scale factor of the shadow. Use a big scale factor to make the shadow longer. You can use a NEGATIVE scale factor to make the shadow fall INTO the screen. Defaults to 0.4 if omitted.
reflect = 0
A value of 0 will draw a shadow. A value of 1 will draw a reflection instead of a shadow.
[Music]
bgmusic =
You can play MP3, MOD, or MIDI here for the background, or just place a comma in front of it if you don't want music. If an invalid filename is given, then no music will play.
bgvolume = 0 This adjusts the volume for MP3s or MODs only. 0 is normal, use a negative number for a softer volume, and use a positive for louder volume.
[BGdef]
spr = stages\backgroundname.sff
This is the location of the SFF file of your background that you created before in step 3. This loads the images that you will be using in the main background definition.
debugbg = 0
Set this value to 1 if you want to clear the screen to magenta before drawing the default background. This is a great way for spotting "holes" or gaps in your background.
So far your DEF file should look something like this:
[Info]
name = backgroundname
[Camera]
startx = 0
starty = 0
boundleft = -150
boundright = 150
boundhigh = -20
boundlow = 0
verticalfollow = .2
tension = 50
[PlayerInfo]
p1startx = -70
p1starty = 0
p1startz = 0
p1facing = 1
p2startx = 70
p2starty = 0
p2startz = 0
p2facing = -1
leftbound = -1000
rightbound = 1000
topbound = 0
botbound = 0
[Scaling]
topz = 0
botz = 50
topscale = 1
botscale = 1.2
[Bound]
screenleft = 15
screenright = 15
[StageInfo]
zoffset = 200
autoturn = 1
resetBG = 1
[Shadow]
color = 92,92,92
yscale = 0.4
reflect = 0
[Music]
bgmusic = sound\backgroundmusic.mid (.mp3 or .mod)
bgvolume = 0
[BGdef]
spr = stages\backgroundname.sff
debugbg = 1
And after you're finished, you're ready to move on to the next step.
PART 5
MAIN BACKGROUND DEFINITION
Overview: A library of the sprite data and how to implement it.
This is the part of the DEF file where the each background element is defined. Each element has it's own image, velocity, starting positions, etc... etc... etc... Every element must start off with, [BG x] Where 'x' is a number or word or your choice, which is only for your records to keep track of, incase there is an error in that element, MUGEN would let you know. And element consists of parameters, which I will go over in detail.
type = parameter
This parameter defines what kind of image will this element be. There are 3 different types:
normal - This is just a flat normal image.
parallax - This gives the image a 3D look by scrolling the image. Sort of like the floors in Street Fighter 2.
anim - This declares the image to be an animation.
spriteno = group no, image no
This assigns the element an image. The syntax is, spriteno = group number, index number. Make sure you remember what group and index numbers you assigned each image in your SPRMAKER text file.
start = x, y
This is the starting position of the image based on the top right of the image. x is relative to the center of the stage, which would be directly in between the starting position of the characters. If you want the image to start at the leftmost portion of your stage, it must be a negative number. Or if you want the image to start to the right of the characters you must us a positive number. y is relative to the top of the screen when you start the stage. This number should be around (if not the same) number as 'boundhigh', to be sure that when a character jumps there will still be a background. So you may need to move around these numbers until you get it just right. Also this must be an integer, no decimal places.
delta x, y
The delta is how fast the background element moves, when the camera pans. This number could be a float, or can have a decimal. A value of 1, moves the background exactly 1 pixel for every 1 camera unit moved. (So if the camera moves over 1 unit the background moves over 1 pixel, get it!?) If the value is bigger than 1, the background will scroll faster, or if the value is smaller than one, the background will scroll slower. Again you must change these values until you get your desired feel for the scrolling.
trans = parameter
This is to change the transparency of the image if desired. There are 4 types of parameters, they are:
none - Does not make any kind of transparency, this is the default if 'trans' is omitted.
add - Makes the image brighter.
add1 - I suppose it makes the image brighter than 'add' but I cannot tell the difference.
sub - Makes the image darker.
mask = flag
This flag can hide the color '0' of your palette, so that you can see through the color '0'. This is why we prepped the images in step 2. For the flag, '0' turns masking off, meaning the background will look exactly like it is, this is the default if 'mask' is omitted. A '1' will turn masking on and will not draw the color '0'. This is good when you want to have multiple backgrounds.
layerno = parameter
This will determine whether the image is drawn in front of the character or in back of the character. If you the image drawn in back of the character, (which you normally do, this being a 'background' and all) use a '0', also this is the default if 'layerno' is omitted. If you want the image drawn in front of the character, you must use a '1'.
velocity = x, y
This is the speed the background moves at. The value you use is how many pixels the image moves at per game tick. This number can be a float, or can have a decimal. The default number is '0' if 'velocity' is omitted.
tile = x, y
This will continuously place the image right next to the image, therefore 'tile'ing the image. If you want to tile the image from left to right infinitely, at the x parameter use '1'. Or if you want to tile the image up and down infinitely, at the y parameter use '1'. Or if you only want to image to be tiled a certain number of times, instead of '1', just place that certain number in the parameter instead. The default is '0' if 'tile' or one of the parameters is omitted.
tilespacing = parameter
This parameter is an integer number, meaning no decimals, of how many pixels to draw between tiles. If omitted than the image tiles 'back to back'.
sin.x = length,time
This option makes the image circle back and forth on the x axis continuously, or left to right. length is the number of pixels of the radius, and time is the game ticks that it takes to complete one rotation.
sin.y = length,time
This option makes the image circle back and forth on the y axis continuously, or up and down. length is the number of pixels of the radius, and time is the game ticks that it takes to complete one rotation.
So an example of a background element would look like this:
[BG TheFloor]
type = normal
spriteno = 1,0
start = -150, 180
delta = .8, .75
mask = 1
As you see you only define what you have to. You only implement what you need to be changed from the default. Just keep in mind, for every image set that you have, you have to create a background element. And if there is an element above this one... that sprite will be drawn behind this image. And if there is an element below this one... that sprite will be drawn in front of this image. See how that works!?
After you have fiddled and toyed and have been the anal retentive perfectionist you know you are, to make sure these backgrounds look initially how you like it, you're ready to move on to more advanced background definitions.
-SamusAran748
Advanced Creation Below.