Skip to content

Instantly share code, notes, and snippets.

@TrashboxBobylev
Last active March 3, 2023 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TrashboxBobylev/aa7f68abba4bc8e38878c3ec6c47bbf2 to your computer and use it in GitHub Desktop.
Save TrashboxBobylev/aa7f68abba4bc8e38878c3ec6c47bbf2 to your computer and use it in GitHub Desktop.
Doukutsu Randamu modding resource

Updated for 1.40.

Doukutsu Randamu features many files that can be edited to alter the behavior of the game or its contents.

Basics

Most of file formats stay true to vanilla Cave Story, documentation for which can be found here. This section will discuss some additions Randamu uses for its data.

Images in general

All spritesheets and images use PNG's format encoded in sRGB and using alpha channel support.

'Resources' folder

This folder holds some media contents that are stored in executable of default Cave Story.

  • BITMAP - files for now unused credit sequence illustrations (except for Credit15 and Credit19).
  • CURSOR - ico files for mouse cursor used when mouse is inside game's window. CURSOR_IKA is unused.
  • ORG - the soundtrack stored in Organya format. The full description of it will be later in this document.
  • WAVE - stores binary file (Wave.dat) with waveforms used to shape how music sounds in-game. You can use this program to modify this file.

'PixTone' folder

Stores all SFXs used in-game. They can be edited using this program. The only modified sounds are sounds 40 and 41 which are used to represent the wind on King's Table level.

'ScriptSource' folder

Stores text scripts (TSC) in plain text format without encryption. They are useful for reference but otherwise are only relevant if you edit the game using Booster's Lab.

'Font' folder

Stores the font used to display text in-game. One of files (c) is deprecated version of Monogram without support for non-Latin characters. The actual used font is font (without extension).

'Tags' folder

Stores JSON files used by Tags system. The full description of tags will be described later in this document.

'mrmap.bin'

Stage table format used by Cave Story's engine reproduction which lies in base of Randamu. Its format is very similar to stage.tbl used in Cave Story+, the loose description of it can be found here.

Legacy versions of UI

ArmsImageLegacy.png, TextBoxLegacy.png and ItemImageLegacy.png are files used instead of ArmsImage.png, TextBox.png and ItemImage.png when Legacy Graphics config option is activated or computer's time is set to April 1st.

Misc sheets

bkChtulhu.png is used for various menus, including Character Select and Rankings. It's not used in any game's stages. death.png shows all of the game's enemies and hazards to show them as death's causes in Rankings screen. fgOverlay.png is used for half-opaque overlay effect triggered when the game is paused for a reason or another. mapFrame.png is used as UI decoration for Improved Map System. MyAccs.png is used to display supported items on playable characters as visual effect. They follow the same format as MyChar.png's animations. bkWater2.png is not a background but rather a base for rising water effect in Marine Caves stage. StageImage.png is used for game's crafting system rather than teleportation system of vanilla Cave Story. As such, it shows items which items are combined to create a new item.

Resource overrides

Resource override packs (or resource packs for short) allow for any content in data folder to be overriden without overriding actual content in data folder. They are stored in resources and loaded after game's start.

list.json

The JSON file that describes the resource packs that should be loaded and in which order. Its structure is defined as this:

{
  "enabled": [
    "foo", "bar", "bez"
  ]
}

foo, bar and bez in this example correspond to folder names for resource packs you want to enable. You can have as many resource packs in this list as you want. The order in which resource packs will be loaded is from start of the list to the end: the lower pack in list will override any resources that are loaded by packs that came before it.

info.json

For resource pack to be loaded, it needs the valid info.json in its folder. The structure of it is defined as this:

{
  "name": "Example Pack",
  "description": "This is example pack.",
  "isJapanese": false
}

All elements are optional and can be omitted if you don't want to specify them (leaving only {} as file's contents). name and description are used for in-game Resource Overrides menu to show pack's name and description. isJapanese, if specified, will configure the game to use Japanese-specific code (such as loading TSC scripts in Shift-JIS encoding). This value is used for official Japanese translation pack. generatedStageID, if specified, will configure the game to use level with specified ID in mrmap.bin as basis for procedurally generated levels. By default, this is ID 13, aka Start.pxm level. resolution, if specified, will specify, at what relative size all sprites should be loaded. For reference, 2x is resolution used by Cave Story+ version of the game. By default, the resolution is 1. windowTitle, if specified, will configure the game's window title; by default this is "Doukutsu Randamu".

icon.png (optional)

The resource pack can use icon.png to add an icon into Resource Overrides menu.

Known issues

  • Some files might be still not possible to overload with this system.

Tags

Tags are JSON files used to customize in-game constants. They are split into two formats: arbitrary objects and value arrays.

Value arrays are used to store certain values, usually numbers, like this:

{
  "values": [
    22, 34, 1, 89, 100
  ]
}

All of current value array tags require type of values to be the same, so you can't define an array of strings and ints in one place.

Arbitrary objects can use any number of fields with any values in them. This type of tags is usually used for external strings for translation purposes.

{
  "foo": "bar",
  "boo": "faz",
  "lol": 22
}

There is 14 defined tags in current version of the game.

aquaticEnemies

Type: value array Used to define which entities are affected by Fishy Tube. By default those are Kulalas and Jellies.

bonkableEnemies

Type: value array Used to define which entities can be attacked by dash attacks of Copper Bulwark and Sacred Aegis. By default those entities are most of enemies and pots.

characterNames

Type: arbitrary object Defines how characters should be named according to certain NPC flags. One field should be always defined, which is default. It's used if PC is Quote or if character doesn't have associated name. This tag also serves as reference which NPC flags define what character will be used in-game.

difficultyNames

Type: value array Used to define in-game difficulty names. They must be in order defined by default version of tag: Basic, Hardened, Reinforced and Resonant. While values past Resonant can be defined, they will function as Resonant difficulty if selected in-game and feature glitched graphics.

etherealEntities

Type: value array Used to define entities that can be damaged (if their NPC table flags allow to do so), but will not lose any HP, do not emit hurt particles and will not affect the piercing of bullets that go through them. By default those entities are grass and fire projectile.

generationMetadata

Type: arbitrary object Used to define all necessary data for generation code to work. All content in default version of this tag is mandatory and defines metadata for game's default generation algorithm.

generationOrder

Type: value array Used to define what generation procedures should be called and in what order. Each member of this array should have corresponding key in generationMetadata tag. By default the content of this array specifies everything used by game's default generation algorithm.

gimmickNames

Type: value array Used to define stage gimmick names. First value should be always here and used to define the stage with no gimmick. Values past 9th are ignored.

knockbackImmune

Type: value array Used to define entities which are immune to knockback effect inflicted by Floodtide, Missile Launcher or any bullets with Lead Weight item equipped. By default those are enemies that use no motion in their AI.

lifeIncreaseImmune

Type: value array Used to define which entities will not be affected by HP gain set by difficulties higher than Basic. By default those are entities that depend on their default HP for their AI, such as deleets, laser projectiles and Ballos P1.

messages

Type: arbitrary object Defines messages that are used by UI and menus for translation purposes. If certain message is missing, it will be replaced in-game by !!!TEXT NOT FOUND!!!. Default formatting of this tag splits messages into categories for easier understanding.

npcSpawning

Type: arbitrary object Defines metadata that describes how enemies and other objects should spawn on the level. Each key has few possible members to specify and modify:

  • ID: the ID of object that should spawn.
  • minCount and maxCount: the amount of objects on the level to place, the final number will be rolled between them.
  • minDepth and maxDepth: the depths on which objects will be spawned.
  • scaling: the amount of objects that will be added to number rolled between minCount and maxCount if player is past minDepth.
  • spawnNormally: boolean value that will make the object not spawn on the levels, unless level's tileset is equal to blacklist_tileset in npc_spawning generation metadata (by default it is Shadowbuilt Crags tileset).
  • affectedByCountModifier: boolean value, that makes object's count on the level be affected by level's NPC size modifier (by default it is true).
  • modifiers: arbitrary object, which lists the letter IDs or names of tilesets as keys and amount modifiers as values, used to specify, on which tilesets there should be more or less objects spawning.
  • secondCampaign: boolean value, specifies if object should spawn on depths before or after Doctor boss (by default false, before Doctor).
  • parent: allows to specify, from which key in this tag to copy all values; they can be overriden if necessary.
  • tileset: specifies letter ID or name of the only tileset, on which the object will allowed to be spawning.
  • gimmick: specifies letter ID or name of the only gimmick, on level with which the object will allowed to be spawning. Note than for name of tileset/gimmick to be valid, the name should come from last loaded resource pack.
  • trapBlock: boolean value, specifies if object should go down by one tile and replace it by air. Used for flamethrower obstacles, by default is false.
  • sideOffset: specifies by how many units (1/8192 of a tile) the object should be pushed on horizontal plane. This number should be positive; the direction in which object is pushed is determined by existence of solid block on right side of the block.
  • verticalOffset: specifies by how many units (1/8192 of a tile) the object should be pushed on vertical plane.
  • faceAwayFromWall: boolean value, specifies if object's direction should be opposite to solid wall next to it, if it exists.
  • direction: specifies the direction in which object should be facing.
  • distance: specifies how far in tiles the object should be from player character when being spawned, basically a radius.
  • allConditionsMustBeTrue": a boolean value, which specifies if condition-type values should be all accounted at once or one is enough for object to spawn (by default true`).
  • surface: a condition value, specifies if object needs a surface to spawn (true by default).
  • air: a condition value, specifies if object needs an empty space to spawn.
  • ground: a condition value, specifies if object needs to be inside solid blocks to spawn.
  • ceiling: a condition value, specifies if object needs a solid ceiling to spawn.
  • wall: a condition value, specifies if object needs a solid wall to spawn.
  • canOverlap: a condition value, specifies if object can spawn on top of object with same ID.
  • npcToSearch: a condition value (the only one that is not boolean), specifies the ID of object, which is needed to be in position for current object to spawn.

stageNames

Type: arbitrary object Defines tileset type names. Each field corresponds to letter tileset is using (this letter also characterizes the tileset sheet in Stage folder, which will be discussed later). If certain stage name is missing, it will be not visible in-game.

waterBullets

Type: value array Used to define bullets which will make enemies wet, making them move at 50% speed, for several frames and kill fire projectiles. By default those are bullets used by Bubbler and Floodkite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment