#roblox #assets #game #upload #group #edge #sync

app asphalt

Upload and reference Roblox assets in code

25 releases

Uses new Rust 2024

new 1.0.0-pre.2 Mar 27, 2025
0.9.1 Feb 13, 2025
0.8.3 Dec 26, 2024
0.8.2 Nov 19, 2024
0.4.0 Mar 30, 2024

#6 in Games

Download history 2/week @ 2024-12-06 92/week @ 2024-12-20 48/week @ 2024-12-27 3/week @ 2025-01-03 100/week @ 2025-01-10 25/week @ 2025-01-17 2/week @ 2025-01-31 223/week @ 2025-02-07 56/week @ 2025-02-14 20/week @ 2025-02-21 25/week @ 2025-02-28 1/week @ 2025-03-14 57/week @ 2025-03-21

88 downloads per month

MIT license

74KB
2K SLoC

Asphalt

Asphalt is a command line tool used to upload assets to Roblox and easily reference them in code. It's a modern alternative to Tarmac.

Features

  • Syncs your images, sounds, models, and animations to Roblox
  • Generates Luau or Typescript code so you can use them in your game
  • Can target Roblox users or groups
  • Processes SVGs into PNGs and alpha bleeds images for crisp edges
  • Allows defining existing uploaded assets, so all of your stuff can be referenced in one place

Features Coming Soon

  • Capablility to pack your images into spritesheets for lower client memory usage

Installation

Homebrew (macOS/Linux)

brew tap jacktabscode/tap
brew install asphalt

Pesde

pesde add --dev pesde/asphalt --target lune

Aftman or Rokit

aftman add jacktabscode/asphalt

Cargo (build from source)

cargo install asphalt

Asphalt cannot be installed with Foreman.

Commands

asphalt init

Guides you through setting up a new Asphalt project in the current directory.

asphalt sync

Syncs all of your assets defined in your inputs.

There are three targets you can use to sync assets:

  • cloud: Uploads your assets to Roblox. This will generate a asphalt.lock.toml file which you should commit to source control. This is the default target.

  • studio: Syncs assets locally to Roblox Studio. This is useful for testing assets in Studio before uploading them to Roblox.

  • debug: Syncs assets to an .asphalt-debug folder in the current directory. You can use this option see how Asphalt will process your files.

asphalt sync # Equivalent to --target cloud
asphalt sync --target studio
asphalt sync --target debug

You can also perform a dry run to verify which assets will be synced. This exits with a non-zero status code if any asset hashes have changed. You can use this for CI checks to ensure that your assets are up-to-date.

asphalt sync --dry-run

asphalt migrate-tarmac-manifest

Will migrate over an existing tarmac-manifest.toml to asphalt.lock.toml.

Configuration

Asphalt is configured with a project file called asphalt.toml. It is required for the program to run.

Example
[creator]
type = "user"
id = 9670971

[codegen]
typescript = true
style = "flat"

[inputs.assets]
path = "assets/**/*"
output_path = "src/shared"

[inputs.assets.web]
"some_sound_on_roblox.ogg" = { id = 123456789 }
"some_image_on_roblox.png" = { id = 987654321 }

Format

  • creator: Creator
    • The Roblox creator to upload the assets under.
  • codegen: Codegen
    • Code generation options.
  • inputs: map<string, Input>
    • A map of input names to input configurations.

Creator

  • type: "user" or "group"
  • id: number

Codegen

  • typescript: boolean (optional)
    • Generate a Typescript definition file.
  • style: "flat" | "nested" (optional)
    • The code-generation style to use. Defaults to flat, which makes accessing assets feel like writing file paths. You may consider using nested if you are not a TypeScript user, however, as Luau does not support template literal types.
  • strip_extension: boolean (optional)
    • Whether to strip the file extension. Defaults to false for the same reason described above.

Input

  • path: glob
    • A glob pattern to match files to upload.
  • output_path: string
    • The directory path to output the generated code.
  • web: map<string, WebAsset>
    • A map of paths relative to the input path to existing assets on Roblox.

WebAsset

  • id: number

Code Generation

The formatting of code generation (such as spaces, tabs, width, and semicolons) is not guaranteed by Asphalt and may change between releases without being noted as a breaking change.

Therefore, it is recommended to add Asphalt's generated files to your linter/formatter's "ignore" list. Here are instructions for the most commonly used tools:

API Key

You will need an API key to sync with Asphalt. You can specify this using the --api-key argument, or the ASPHALT_API_KEY environment variable.

You can get one from the Creator Dashboard. Make sure you select the correct group and Asset-related permissions.

You will need a cookie to upload animations to Roblox. This is because the Open Cloud API does not support them. It will automatically detected from the current Roblox Studio installation. Otherwise, you can specify this using the --cookie argument, or the ASPHALT_COOKIE environment variable.

You will probably want to disable Session Protection if you are using Asphalt in an environment where your IP address changes frequently, but we don't recommend this on your main Roblox account, as it makes your account less secure.

Animations

[!WARNING] This feature is experimental, and Roblox may break the API we use or change its behavior without warning.

To upload animations, make sure you specify a cookie as noted above.

Asphalt expects a single KeyframeSequence to be saved as either a .rbxm or .rbxmx file.

Attributions

Thank you to Tarmac for the alpha bleeding and nested codegen implementations, which were used in this project.

Dependencies

~27–44MB
~744K SLoC