Coder Social home page Coder Social logo

tarmac's People

Contributors

cliffchapmanrbx avatar lpghatguy avatar misteruncloaked avatar nicell avatar oltrep avatar rgychiu avatar zotethemighty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tarmac's Issues

Alpha bleed unpacked images

The support I landed for alpha bleeding only applies to spritesheets since we don't make any attempts to decode single images.

We should apply this transform to individual images as well.

--require-up-to-date option

It would be useful to have a flag that tries to run a sync operation and fails if anything needs to be synced. This would be used in CI environments to ensure users have deployed any assets that have changed.

Support codegen that automatically picks correct DPI scale

We're going to support high DPI images for users that manually import them for sure at first. It'll look like this:

local logo = require(Assets.logo)
local logo2x = require(Assets["logo@2x"])

if isHighDpi then
    label.Image = logo2x
else
    label.Image = logo
end

It's then up to the user to pick the correct asset for the current resolution scale. That isn't very fun, and I think Tarmac is in a good position to help.

One approach would be to write a new codegen mode that returns images as a thunk taking the DPI scale, used something like this:

local logo = require(Assets.logo)

-- This isn't a real property yet, but core scripts have access to something similar
label.Image = logo(screenGui.ResolutionScale)

Documentation

Currently, Tarmac is pretty unstable.

Once it's more stable, we should build a documentation site for it to help users adopt it.

Support uploading assets to groups

Instead of having images scattered among developer's accounts, it would be useful to require that all images are uploaded to a given group. This makes it easier to take inventory of them, protect them from moderation actions, and monitor them for problems.

Upload models

We have tarmac upload-image right now. As a holdover for other tools, it might be useful to introduce tarmac upload-model to upload models.

AssetNames collide with included projects

Currently, if I include two projects that both have assets/foo.png in them, one of them will overwrite the other. Tarmac assumes that AssetName is unique across an entire project, but does not correctly prefix paths from other projects currently.

Support tagging inputs with more specific type information

Some file types can be uploaded to multiple different kinds of asset.

Model files, for example, have the rbxm extension and can represent models, plugins, packages, animations, and probably more. In order for Tarmac to upload these asset types correctly, we'll need to explicitly tell it what a group of models represent.

Handle Roblox API invalid name

Repro: Upload a file named Panda Fox.png, with

tarmac upload-image images/image.png -- name "Panda Fox.png" -vvv

You will get an output similar to this:
image

Roblox is responding by telling Tarmac that the name is inappropriate, however, tarmac will immediately error, thus cancelling any work it has done

This is problematic as

  • It is not a graceful way to handle the error
  • All previous images uploaded must be reuploaded (very time consuming)

Local development plan

Currently, Tarmac supports uploading to Roblox.com only. For fast local iteration, it would be useful for Tarmac to copy your assets into your local Roblox Studio content folder temporarily.

To do that, we could introduce a new value for --target named something like local-studio:

tarmac sync --target local-studio

This command would:

  1. Locate your local Roblox Studio install using roblox-install
  2. Perform a sync. For any files that have changed, copy them to $INSTALL/content/.tarmac/<hash>.
  3. Perform codegen, using a path like rbxasset://.tarmac/<hash> for any assets that have no asset ID.

Add retry behavior to work around rate limiting

The Roblox upload endpoint will rate-limit, which can cause problems when running Tarmac on large sets of assets. This can be especially troublesome when integrating with CI.

The upload API returns a 429 error when rate limiting occurs, and the budget is per-minute. We should be able to provide Tarmac an optional retry count, so that when it receives a 429 it will wait for one minute, then retry with the last file it was attempting to upload.

Option to alpha bleed images

This might be out of scope for Tarmac, but there's never a case where I want an image with transparency uploaded but not alpha bled.

@Quenty released an article titled "Fixing images in Roblox UI". In this article, he explains how due to a bug, images with transparency form ugly pixels around them. The solution is to change the RGB values of the alpha to coincide with the border.

XAXA released a tool for this that I use regularly. It would be very useful if Tarmac could automate this process.

Unmaintained

Tarmac is a great tool for any Roblox developer, it's a shame that the "official" version doesn't work. For anyone who's looking for a working version of tarmac, you can find a working fork at https://github.com/rojo-rbx/tarmac, it's even in the rojo-rbx organization, which was the original organization that started tarmac.
This issue should probably be pinned unless work is done to fix tarmac, or the repository may as well just be archived and the fork advertised in the README. Otherwise I'm sure a lot of people will end up not using tarmac due to it seeming completely broken.

Support codegen into larger units

Right now, the plan is to imitate the semantics that tools in the JS ecosystem have for dealing with assets, where we can pretend to import asset files like they're modules:

local CancelIcon = require(Assets.CancelIcon)
local ConfirmIcon = require(Assets.ConfirmIcon)

cancelBox.Texture = CancelIcon
confirmBox.Texture = ConfirmIcon

We do this by generating Lua files next to each asset that we want to be able to import:

Assets/
├─ CancelIcon.png
├─ CancelIcon.lua
├─ ConfirmIcon.png
└─ ConfirmIcon.lua

Another approach would might want to support is grouping together the generated code into one or more batches of files containing assets keyed by name:

local Assets = require(Assets)

cancelBox.Texture = Assets.CancelIcon
confirmBox.Texture = Assets.ConfirmIcon

With a corresponding directory structure:

Assets/
├─ CancelIcon.png
├─ ConfirmIcon.png
└─ init.lua

The configuration for a project like this might include this bit in its tarmac.toml:

[[inputs]]
glob = "Assets/**/*.png"
codegen = { type = "batch-asset-url", output = "Assets/init.lua" }

Option to create a .d.ts file alongside .lua

It would be useful as a developer who uses roblox-ts if the generated .lua files had an associated .d.ts file with it too.

For the files that are just return "rbxassetid://?????", this should be as easy as export = string or something.

Add progress bar or similar

There's a few ways this could be done nicely. For example, the current message could be changed like this:
Old: [INFO] Uploading {} to Roblox
New: [INFO] Uploading {} to Roblox (5/250)

Or, we could use a terminal progress bar, like any of the ones from here
I'm happy to submit a PR for this myself. Just waiting for approval from a maintainer so I don't do useless work.

High DPI unpacked images

#31 was a partial solution to the high DPI problem, and provided new a new code generation style for assets that have high DPI variants available (foo.png, [email protected], etc). However, for images where packable is not set, each high DPI variant still generates code independently.

Tarmac should merge these inputs and generate one file containing all of the high DPI variants.

9-slice data for images

It's common to use 9-slice images when building Roblox UI. Slice coordinates need to be scaled to account for DPI.

It'd be neat to be able to associate some metadata with each image about whether they're intended to be sliced and how, and have Tarmac automatically scale up and encode that data into the generated code.

Incremental sync (watch mode)

Once we have a workflow for local development, allowing Tarmac to watch for files to be changed, added, or deleted would be useful when paired with Rojo.

I propose:

tarmac sync --target local-studio --watch

Break apart `sync` command

tarmac sync is very complex. It's effectively the only command in Tarmac.

It would be useful to create smaller commands that contain each auxiliary piece of functionality, which should help us manage complexity.

  • tarmac sync will just sync assets to the Roblox cloud
    • The --target parameter should be removed.
  • tarmac dev will just sync assets to a local installation to work on in development mode
  • tarmac generate-cache, pitched in #15, will generate a cache from the current state
  • tarmac create-path-map (#38) will write a map of all assets managed by Tarmac
  • tarmac verify-synced will validate that the project is in sync with the Roblox cloud
    • Can we verify moderation status in this subcommand?
    • Can we verify that assets are uploaded to the correct group here?

Alpha bleeding

In order to improve behavior of images when they're resized, we should run an alpha bleed step on all images.

Option to populate a cache directory

Some consumers of Tarmac, like Roblox, want to have local copies of each uploaded asset, indexed by asset ID.

Tarmac should support an additional flag or separate command to create an output cache out of whatever the current state is by downloading images from Roblox:

# As a flag
tarmac sync --target roblox --cache-dir my-cache/

# As a separate command
tarmac sync --target roblox
tarmac make-cache my-cache/

Handle Roblox API 429 response

Currently, Tarmac will error when it hits a 429 error response from Roblox with the following error:
thread 'main' panicked at 'not yet implemented: Handle bad responses', src\roblox_web_api.rs:75:13

https://github.com/rojo-rbx/tarmac/blob/2448e694ce8fe6461e4818ee000b001dd1eb95b5/src/roblox_web_api.rs#L75

This is not preferred as it causes tarmac to immediately exit and not create the manifest / cache previous images it has uploaded (so the user can wait and reupload at a later point)

Additional debug with headers responded:
429-tarmac.txt

Update asset references in models

We have a clear plan for how to handle assets that are used programmatically, but that's only a small fraction of the way that assets are used in Roblox.

It would be a good idea to build a tool that can traverse models and places to update their asset references when they need to be updated. This might not fit into Tarmac, but Tarmac should be able to produce the data needed to build a tool that can do this.

Improve uploaded spritesheet names

Currently, all spritesheets get uploaded as spritesheet.png. We should include a descriptive name, like from the project name or a name added to the input group. We could also include information like the DPI scale of the input group.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.