Modding French Bread Games: Characters

From Mizuumi Wiki
Jump to navigation Jump to search


If pixloen feels like it, documentation on backgrounds, music, grpdat and stages may or may not be written on separate pages. hey maybe there'll actually be a full documentation on French bread modding

Credits

feel free to write your own name/notes/whatever


contributions
pixloen Color wrote base page with some odd workarounds currently downloading every raito instrument as you read this

Introduction

This guide is a general how-to and reference page for modding UNICLR & MBTL characters. WIP and based on experience / trial & error, but also just a page so I can get used to mediawiki and such. MBAACC uses different versions of software and a different format and won't be covered here.

When finished this will contain enough information so that you don't struggle and die when you enter maincord's #modding-tl channel.

Assumed Knowledge

  • Basic understanding of file structures
  • Basic understanding of batch files
  • Basic understanding of programming

Note that French Bread uses Squirrel for most functions, but such code can be easily understood if you have JS, LUA, C and etc. experience

Tools & Other Guides

Basic Tools

  • Hantei-chan, a HA6 editor
  • CGlib, .cg extractor
  • CGTool, .cg compiler
  • A basic text editor such as Notepad++. Regular Notepad is fine but may be harder to use.
  • A hex editor. HxD is used commonly.
  • .pat editor / visualizer. None are public, but you can use HA6 + hex editor as a close enough replacement.
  • DDS decomp/compression tool. Found in the .pat cut-ins guide.

Game Specific Injectors / Extractors

MBTL

UNICLR

Written Guides & Documentation


Setting Up The Modding Environment

Game files are located in a place like ...SteamLibrary/steamapps/common/UNDER NIGHT In-Birth Exe Late[st], or ...SteamLibrary/steamapps/common/MELTY BLOOD TYPE LUMINA This is commonly referred to as the game's directory or root folder. (REMEMBER THIS!)

Follow this guide for extracting MBTL files. For UNICLR, simply download UNIST Unpacker, head to the /d folder in the game's directory, place UNIST unpacker there, and drag every file onto the unpacker.exe.Once you're done extracting, the unpacked / out folder's contents can be dragged to the root folder.

Install the injector / _English patch file and now the game's code will read files from the unpacked folders instead of the archives. Editing the new folders will create changes in the game respectively.

Basic Character File Structure

Head to /data and you'll see a folder for every character. You can either edit these or make new characters (more info down below). Every character folder in modern French Bread games have some variation of these files:

Name File Comment
Project / System character_0.txt Contains a list of files to load. Usually references the .ha6, the .cg and the .pat.
CommandTable character_cmd_0.txt Contains the move list.
MoveTable character_mv_0.txt Contains the move logic and specific code for unique moves or projectiles.
Sound Effect List character_se_0.txt Contains the location of sound effects found in ROOTFOLDER/se
Hantei-kun Project File character.ha6 Stores move animations, hitboxes and hit data.
CG character.cg Stores character sprites.
Pattern character.pat Stores images that aren't sprites. Incl. effects such as sword swipes or wings, or MBTL cut-ins.
Base files BaseData.LST / _temp.ha6 / _temp.LST Usually files that don't mention character name / number. Haven't tested what they do but I presume it's a necessity for the character to function.

In short, the CommandTable gives a character inputs which are assigned to patterns in the Hantei-kun Project File, which can feed information to the MoveTable. The MoveTable can then create new functions.

Character_0.txt

This text file contains a list of files to load for the character, as well as character project name. Self-explanatory.

An example .txt from Akatsuki's folder.

 
[System]
ProjectName=Aka
[DataFile]
FileNum= 3
File00=_temp.HA6
File01=Aka.HA6
File02=../BaseData.HA6
[BmpcutFile]
FileNum= 
File00=Aka.cg
[PAniFile]
FileNum= 1
File00=Aka_ef00.pat

Character_cmd_0.txt

This text file contains all unique moves that this character can do. Note that it only has the move commands in the list and does not contain any actual framedata or graphics. However, conditions such as timing, move followups and inputs can be applied here. Moves 5A, 5B, 5C, 2A, 2B, 2C, j.A, j.B and j.C are universal across all characters.

Special moves are listed as Skills, and normals are listed as Atk_Std, Atk_Cro, and Atk_Air for Standing, Crouching and Air normals respectively. EX moves that take meter such as 236C are listed as 236EX, and Super attacks such as Infinite Worth and Arc Drive are listed with SP.

In MBTL, character move commands must start with cmd.. Examples include


Skill_0202EX = {},	
Skill_0202BorC = {},
Skill_0202A = {},	

Atk_Std6B = {},
Atk_Std6C = {},	
Atk_Air2C = {},
Atk_Air6C = {},

Skill_J0202A = 
	{
		command = ["0202","2+A+B"],
		flags = [ "lastdelay" ],
		
		CmdCheck = {
			HeightLimit = def_POS_AirDashLimitHeight,
			SkillType="SpecialDouji",
		}
	},

Skill_41236SP_ABC = {}, //Last Arc and Infinite Worth's need both (input)SP AND (input)SP_ABC
Skill_41236SP = {},     //Don't know why but they do

Despite the names containing motions, these commands can have different inputs if desired. Inside the curly braces many functions and variables can be set.

List of Variables

List of Things That Can be Set (incomplete)
Function Name Comment
command = [x, y] Sets the command that this move is registered to. Multiple inputs can be set, such as command = [2A+B, 0202]
num = def_CN_Atk_AddCommandn Used to create moves such as 6CC. Each AddCommand has a unique number n to differentiate.
name = "Cmd_x" Sets the name of the move that will be looked up in the .ha6, or something like that.
UpdateTable = {name = ______} Updates the pattern that is used from the .ha6, and the MoveTable.
flags = Sets flag conditions? Havent experimented and not too sure
CmdCheck = {} Adds conditions that must be fulfilled in order for the move to register. Commonly used for conditions such as having less that 5 fireballs on screen or being on a certain pattern/move.

Character_mv_0.txt

This is where the bulk of the code is stored, and hence this section will not cover everything. You'll have to do a lot of trial and error.

The MoveTable lists every move + functions for Skills.

Editing Moves

Editing Skills

List of Variables

Editing .ha6

The HanteiKun File, also known as HA6 can either be edited using hex or more commonly Hantei-chan. Everything there is very self-explanatory, so here are a few tips that you may or may not know. TEMPORARY, WILL WRITE FULL INDEPTH GUIDE


Editing .cg

Sprite Tips

Editing .pat

The .pat files are the files that hold the animations for the effects such as Hyde's red and black slashes, Neco's Vtuber model, and basically anything that isn't a 2d pixelated sprite. These aren't required for a character to function, and if the effects are already sprites such as Ragna's drive snakes or Yu's sword smear frames, those can just be put in the .cg file and used as a normal sprite. But since the .cg requires all the images to be indexed, stuff like Hazama's chains or literally any of the Eff3D textures in BlazBlue would go into the .pat.


Basics and limitations of the .pat file

The .pat files have quite a few limitations to their parameters that might get a little confusing to work with. For starters, interpolation will only happen to layers that have the same number on the next sprite. For example, layer 0 will only interpolate to the layer 0 of the next sprite called in the .ha6. Layer 0 will not interpolate to any other layer number. And on the topic of layers, Uni, Dfc, and BBTag all have a max layer count of 40, while Lumina has a max layer count of 80 (idk about Actress Again and earlier, but those are presumably 40 too). If you put a .pat with a layer number of 40 or higher or a sprite with more than 40 layers in general into UNI and Dfc, nothing will happen except some of the layers not appearing in game, but if you put a .pat that has a layer number of 40 or higher at all, the game will crash upon loading the .pat, but this isn't BBTag modding, this is fpan modding. Some more limitations of .pats that you should keep in mind is that images must be a .dds file with either DXT1 compression, DXT5 compression, or no compression at all, and if it does compression, you will need to further compress it with a compression tool made by u4ick. It is also recommended to make the .dds files width and height multiples of 256 due to the next limitation, the UVs. UVs in .pats are weird, cause instead of being on a by pixel basis, every unit in the UV is the width/height (depending on if the unit is on the X axis or Y axis) of the image divided by 256 pixels. So if the X coordinate of the UV was 8 units, on an image of a width of 2048, that would be 64 pixels in, but if say the Y coordinate was 8 on an image with a height of 1024, that would be 32 pixels down.


"Blocks" of a .pat file

While although not required to be in this order, as these are only like this for organizational purposes, the .pat file is split into 4 "blocks" of sorts, with the first block containing the "Sprite" data, which is every parameter that starts with P_ and PR. This is where you make the actual sprites that will be shown in-game and all of the properties that will be interpolated. This is basically the AT (animation data) of a .ha6 file. Then up next is the "Object" or "Particle" data, which is every parameter that starts with PP. These are where you make the pieces that will go into a sprite. None of the data here gets interpolated. Then is the "Shape" data, which is every parameter that starts with VE or VN. This is where all that data that is used to make the special shapes that aren't just flat planes such as the green sphere in Aoko's Last Arc being a "Sphere Shape" or the web in Byakuya's Infinite Worth being made up of multiple "Ring Shapes". This data won't be interpolated either. And last but not least, the "Page" or "Texture" data, which is every parameter that starts with PG. This is what takes up 80% of the file as it is the images itself.

Editing Sound Effects

Replacing Files

Assigning Sounds

Adding New Characters

= Making Them Selectable

Now on the CSS

Head to D:\SteamLibrary\steamapps\common\UNDER NIGHT In-Birth Exe Late[st]\System\BtlCharaTbl.txt

//Section from UNICLR
Chara_Table <-
{
	// ƒLƒƒƒ‰ƒZƒŒƒNƒg—p”z’u 99 ‚ªƒ‰ƒ“ƒ_ƒ€A•K‚¸‚QŽŸŒ³”z—ñ‚É‚È‚é‚悤‚É
	// E”z—ñ‚Í“à•”‚Ì’l‚Å‚·AƒAƒCƒRƒ“‚̈ʒu‚ªˆÚ“®‚µ‚½‚è‚Í‚µ‚Ü‚¹‚ñB
	// E“¯‚¶ƒLƒƒƒ‰”ԍ†‚ª”z’u‚³‚ê‚Ä‚¢‚é‚Æ‚½‚Ô‚ñ³í‚É“®ì‚µ‚È‚¢
	// E’·‚³‚O‚Ì”z—ñ‚ª‚ ‚é‚Æ—Ž‚¿‚é
	// E”z—ñ”‚͏cx‰¡‚ª100–¢–ž‚É‚È‚é‚悤‚É
	SelectTable = 
	[
		[ 24,12,08,02,00,99,01,03,09,13,21 ],  // ‚±‚Ì—ñ‚ª‰ŠúˆÊ’u
		[ 11,10,06,04,16,18,17,05,07,15,14 ],
	],
	SelectDefault = [ 0, 1 ],  // ‰ŠúˆÊ’u 1P 2P

	// ‹­§‚Ńtƒ‰ƒO‚𗧂ĂéŽd—l ¦ƒZ[ƒuƒf[ƒ^‚ªã‘‚«‚³‚ê‚é
	_FileType = 0, //
	//_SecretFlag = 0, // ƒNƒŠƒA
	// _SecretFlag = (1<<0), // ƒGƒ‹ƒgƒiƒ€‚ªŽg‚¦‚é

	// ‰æ–ʏ㕔ƒƒbƒZ[ƒWA‘SŠp16•¶Žš‚Ü‚Å
	AcVsMes0 = "‰SŽÒ—ûK’†I",
	AcVsMes1 = "—“üŠ½Œ}I ’§íŽÒ‹‚ށI",
	AcVsMes2 = "ƒ‰ƒCƒoƒ‹•åW’†I",


	Status = [],
};

This section of code handles the cursor selection. 99 is random and every other number corresponds to a character. -1 corresponds to null or unselectable.

Player 1 and Player 2's cursors start at character 00 and 01 respectively (defined by SelectDefault) When a player inputs directions, the cursor switches to the character corresponding to the direction. For example, moving left on 00 will set the character to 02, etc. If you want to add characters around the vanilla UNI characters, you can set up something like this (using characters 25 and 26 as an example)

SelectTable = 
	[
		[ -1,24,12,08,02,00,99,01,03,09,13,21 ], // character -1/null is to the left of 24/Phonon, so pressing left on Phonon will wrap around to character 21/Mika
		[ 26,11,10,06,04,16,18,17,05,07,15,14 ], // character 26 is to the left of 11/Eltnum, so pressing left on Eltnum will select character 26.
                [ -1,25,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 ], // character 25 is underneath 11, so pressing down on Eltnum will select character 25.
	],
// Note that these characters' CSel icons will not appear in relative positions because this handles cursor logic; not visual placement

Adding CSS Visuals

Unfortunately, UNICLR's CSS is mostly hardcoded so anything other than Character portraits (left and right of the screen) cannot be modded. To add these portraits, head to grpdat/CSel/chara, and copy/paste a .pat.

Steps to take

  • Rename the file to correspond to the character project name
  • Edit the dds file using the easy .pat guide

Troubleshooting

A lot of bugs and errors can cause some glitch messes with your character / mods. Here are a few I've dealt with and some ideas for solutions.

My character freezes! / Can't Input Anything!

Caused usually by a error in the MoveTable. Check formatting for any missed comments. Also, check that variables, skills and functions are defined before they are used.

When I do a move my character gets cloned!

Caused by a spawn effect/projectile error. Spawning a pattern that doesn't exist causes the projectile/effect to set itself to pattern 0, or the idle animation. Check that the patterns you spawn are in the HA6, and that the names match that of the MoveTable.

My character turns invisible when airdashing / jumping / when hit!

Caused by Hanteichan being a nuisance and crashing while saving, corrupting the HA6 file. Nothing you can do other than save backups constantly. Usually happens when you copy and paste frames too much, so save every time before you intend to copy a frame.

The game doesn't load / gets stuck in a loop before battle!

Most likely caused by a faulty .pat or project file.

My character's grab glitches out the opponent / sticks the opponent!

Caused by incorrect .txt encoding. The UNICLR/MBTL engine use japanese characters to define types of grabs, which can be corrupted if you save with the wrong encoding. French bread uses ANSI / UTF-8. CORRECT ME IF I AM WRONG ABOUT THIS

For those using VSC, I'm afraid that I can't find a suitable encoder. Notepad and Notepad++ can save in UTF-8 which makes the Japanese characters unreadable, but still works with the engine.

My character crashes the game!

The big one. There are a few causes which I only know so few.

  • Loading character slots past (28 on MBTL) will crash the game.
  • Faulty scripts
  • Can't find HA6/HA6 is corrupt
  • .pat is corrupt

There are plenty more but these are the ones that I know of.