Home Samus MUGEN Fushigi Yuugi Help Links Games
Samus Aran

SAMUS'S TUTORIAL PAGE

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.



Move on to the next step.




Hosted by www.Geocities.ws

1