Build 26694739

build

vim racer · beta, public · first seen

PICS live
2
Branches
2
Depots changed
—
Download delta
05:59 UTC
Time · UTC
Major update · published by the developer

v1.1.2 - Workshop Support

On Steam

First off, i want to say thank you for purchasing my game. Vim Motions is a very niche topic and I went into this making a game that me and some programming friends wanted. But, I, like many other programmers have had a dream of "publishing a game". So, this seemed like a simple way to do that without having to get too "creative". It also gave me the chance to play around with Godot. So, thanks for spending your money on my little game. I hope you've been able to learn a little bit of vim motions, I hope that this feature will enable you to feel a little more justified in your purchase, and I can't wait to see what people come up with. :)The following is a tutorial on making your own workshop items. I intend to share a guide later. But, this announcement should cover it as well.This update adds the ability to upload workshop items. You can now use custom files to race in vim-racer!


Making a Workshop Race

A Workshop race file is plain text with checkpoints marked by [cb=N] tags.

1. Write the text

Write a UTF-8 file in your editor. Put a [cb=N] tag immediately before the character the player must reach. The game strips the tag, so the player never sees it.

func [cb=1]search(xs []int, x int) int {

lo, hi := 0, len(xs)[cb=2]

for lo < hi {

mid := (lo + hi) / [cb=3]2

}

}

  • N sets the visit order, not the position in the file. Checkpoints can jump around, so [cb=1] can sit near the bottom of the file.

  • The numbers don’t have to be consecutive, but each one can be used only once.

  • Any [cb= that isn’t followed by digits and ] is treated as literal text.

2. Check the limits

  • At most 64 KB, 2,000 lines, and 400 characters per line.

  • Between 3 and 200 checkpoints, with N from 1 to 9999.

  • Each checkpoint must sit on a character the cursor can stand on. It can’t be past the end of a line.

  • The first checkpoint can’t be at line 1, column 1, the starting spot.

  • No two checkpoints can share a spot.

3. Add a manifest

Create a folder under workshop_local/ with two files: manifest.json and your race file.

{

"type": "race",

"display_name": "Binary search in Go",

"file": "race.txt",

"language": "go",

"description": "A short Go function with checkpoints on every branch.",

"visibility": "public",

"author": "you",

"license": "CC0"

}

  • language sets syntax colouring: go, python, c, csharp, yaml, or text.

  • visibility can be public, friends_only, or private.

  • You can add preview.png (up to 1 MB) for the Steam image. (Or upload it using Steams UI after the fact.

workshop_local/ sits next to the game’s executable in a Steam install. Use Steam’s Manage, Browse local files option to find it.

4. Check it in the game

Open Race Solo and press r to rescan. Your draft appears in the list. If it fails to load, it appears under “Not loaded” with the reason.

5. Upload

Launch the game from Steam, since uploads need the Steam client. In Race Solo, put the cursor on your draft and press u. The Upload screen shows everything that will be sent. Press y to confirm you have the right to share it.

The game plays the file once from the exact bytes being uploaded. You have to reach every checkpoint for the upload to go through. The time isn’t saved.

After the first upload, the game writes published_id into your manifest. Later uploads of the same folder update that item. To make a separate item, copy the folder and delete published_id from the copy.


Making a Workshop theme

A theme is a color palette for vim racer. It’s a small JSON file that starts from a built-in theme and overrides some colors. Like race files, nothing in a theme is run as code.

1. Make the folder

Create one folder under workshop_local/ with a manifest.json and a theme.json:

workshop_local/
└── pink_cursor/
├── manifest.json
└── theme.json

workshop_local/ sits next to the game’s executable in a Steam install. Use Steam’s Manage, Browse local files option to find it. The folder name doesn’t matter to Steam.

2. Write the manifest

{ "type": "theme", "display_name": "Pink cursor", "file": "theme.json" }
  • type must be "theme".

  • display_name is the title on Steam and in menus, up to 200 characters.

  • file is the plain file name of the theme JSON, with no folders.

  • You can also add description, visibility, author, and license, as for race files.

3. Write the theme file

{
"base": "Tokyo Night",
"dark": true,
"colors": {
"Accent": "#ff79c6",
"NextTarget": "#50fa7b"
}
}
  • base is required. It names a built-in theme, either by its Settings name ("Gruvbox Dark") or without spaces ("GruvboxDark").

  • colors is optional. Any slot you leave out comes from base. Colors are #rrggbb hex with no alpha.

  • dark is optional, but it must match the result. Set it to true if the background is darker than the text.

  • The file can be at most 16 KB.

The color slots are:

Group

Slots

Background

Bg, BgFloat, CursorLineBg, Border, ColorCol

Text

Fg, FgDim, GutterFg, GutterActiveFg, Error, ListChar

Cursor and targets

Accent, AccentFg, NextTarget, FutureTarget

Syntax

SynKeyword, SynString, SynComment, SynNumber, SynType, SynFunction

4. Keep it readable

After your overrides are merged, the game checks these WCAG contrast ratios. A theme that falls below any minimum is rejected.

Pair

Minimum

Fg on Bg

3.0

Fg on CursorLineBg

3.0

Accent (the cursor) on Bg

1.5

AccentFg (character under the cursor) on Accent

2.0

NextTarget on Bg

1.5

If a theme is rejected, the game tells you which pair failed. Adjust that color and try again.

5. Check it in the game

Open Settings. The draft appears as “Name (draft)”, so you can try it before uploading. Press r in Settings to rescan if you added it while the game was open.

6. Upload

Launch vim racer from Steam, since uploads need the Steam client. In Settings, select your draft theme and press u.

Unlike race files, a theme doesn’t need to be played through. It’s shown live while the Upload screen is open, and it uploads as soon as you confirm. Press y to confirm you have the right to share it.

After the first upload, the game writes published_id into your manifest. Uploading the same folder again updates that item. To make a separate item, copy the folder and delete published_id from the copy.

To remove an item, delete it on its Steam Workshop page.

Per-depot manifest changes

Depot changes

All depots
DepotNew manifestPrevious manifest
49352824113203233426868107189658814991696663
493528385076628237700497665909950066412722311