Skip to content

Instantly share code, notes, and snippets.

@EtiTheSpirit
Last active September 10, 2023 12:59
Show Gist options
  • Save EtiTheSpirit/7513dbd4ac84afea746abf7625320894 to your computer and use it in GitHub Desktop.
Save EtiTheSpirit/7513dbd4ac84afea746abf7625320894 to your computer and use it in GitHub Desktop.
RW Level Editor Tile Format.md

Rain World Level Editor Tile Format

Making custom tiles in Rain World requires some knowledge about how tiles actually work in the first place.

Foreword

If you are reading this line of text right here right now, this document is still in the "my personal notes from observation" stage.

That is, it is primarily written by me for me and may contain strange phrasing, be oddly condescending, or otherwise be a bit rough around the edges.

If this is a public document, it means I think it's good enough to release for now, but it may still have inaccuracies or misleading/misinterpreted information (this is based on both what I read in documents + the lingo code for the level editor).

More Reading

A huge amount of this information was derived from someone else's page (which contains vital information that you SHOULD read, such as how the text format works, because I don't have that here yet!)

I'd also like to extend a thank you to...

  • DryCryCrystal (who you may know for asset contributions to Community Editor) for dealing with my questions about making tiles.
  • SlimeCubed for extracting the lingo source code of the level editor in a more accessible, plain text format.

Tile Graphics / Image File

  • The tile image should have texture size based on the #sz property of its text entry (times 20, since tiles are 20x20). This is affected by buffer tiles.
    • See Layering Information below for semantics on how this actually works.
  • The bottom of the image is a bit like the wireframe of an entity in hammer, except its "tiles" are 16x16.
    • Only draw this once. That is, do not make a wireframe for every layer, and do not make a wireframe for every variant.
    • See Layering Information below for a catch case on buffer tiles.
  • The top row of pixels on the image must be black at (0,0) and white elsewhere.
    • This is per variant. That is, the black pixel must be in the top left of each column for each variant, not once for the entire image.
    • SPECULATION: This value likely exists for error correction (to validate that #sz actually fits into your texture).
      • There is no vertical counterpart to this, which is a bit strange.

Layering Information

  • In your tile image, layers stack down vertically, a bit like a Minecraft animated texture.
  • If you have more than one variant, this stacks right horizontally. Each vertical stack follows the same rules and must have each of its layers drawn out too.
  • If you use effect colors, double the width of the image. The left half will be used for your tiles like everything here instructs you to do. The right half will contain a grayscale gradient that overlays with the left half. This gradient is applied to the effect colors (see COLORS below) and determines their intensity, directly affecting the blue channel of the rendered level image.
  • IF YOU HAVE BUFFER TILES, act like your tile is that size (#sz + buffer on all four sides individually).
    • BUT: DO NOT draw the wireframe with this buffer size! The wireframe only ever uses #sz, so the space at the bottom of the image should use that.
    • There is a picture on the github link up top. If you find yourself needing to use that, consider explaining this better, future Xan.

Valid Colors for Tile Images

[!] TO FUTURE XAN: Remember rw color palettes have three rows of colors, for highs, mids, and darks.

[!] TO FUTURE XAN: All colors below MUST BE EXACT. These are NOT channel packed colors! Don't look at these and try to channel pack them. You will break it. If you break it you buy it and you have no money (how much does it even cost?)

Base Colors

  • Blue 0x0000FF indicates to use the HIGHLIGHT color of the palette.
    • This will cause the renderer to ensure red is 1-30 for shade, 91-120 for sun.
  • Green 0x00FF00 indicates to use the FRONT-FACING color of the palette.
    • This will cause the renderer to ensure red is 31-60 for shade, 121-150 for sun.
  • Red 0xFF0000 indicates to use the UNDERTONE color of the palette.
    • This will cause the renderer to ensure red is 61-90 for shade, and 151-180 for sun.

Platforms

  • For RED, GREEN, AND BLUE ONLY, Using 0x96 (150) instead of 0xFF (255) indicates to RENDER AS A PLATFORM.
    • Platforms have special render behavior that prevents fog from drawing on them so strongly in the foreground, and also causes them to be dark even in sunlight (forces using the darkest available sunlight color).

Effects

  • Magenta 0xFF00FF indicates to use EFFECT COLOR A
  • Cyan 0x00FFFF indicates to use EFFECT COLOR B
  • Aqua 0x00FF96 indicates to use EFFECT COLOR C1
  • Very Dark Green 0x000B00 indicates to use a constant depth of 10.

Fallbacks

  • Any color not listed above will not read, and should always render at a depth of 30 (there are odd cases where this is false, such as in color2 window.png)
  • The only exception to this is when green = 8, 9, or 10. In this case - and it only cares about green, the other two channels are ignored for this condition - the provided color will pass through directly, completely skipped by render code.
1 There is no such thing as "effect color c". This is instead what gets applied to batfly hives, and turns white in swarm rooms.

The text format

TO FUTURE XAN: This one is pretty well described in the code as it is, see https://github.com/SlimeCubed/Drizzle/blob/master/LingoSource/GLOBAL.md for the declarations and https://github.com/Rain-World-Modding/Rain-World-Modding.github.io/blob/main/pages/region-development/level-editor/Custom-Palettes,-Tiles-and-Props.md for some more english-ified information. These two sources work together to combine into a very good info source.

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