sprites/

directory
v0.0.0-...-3befcbb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2023 License: GPL-3.0

README

Spritesheet overview

This directory contains scripts that help prepare files from our animation team for use in the API. Sprites are hosted in a static GCP bucket here.

About scripts

We're using Go to script some of these actions. Because of the way Go needs things named; we have to separate those scripts into folders or receive a compiler error when building for CI.

Spritesheet details

Mapping human readable names to computer readable names

The API understands how to serve Sprite Sheets based on the Item ID in our PGSQL database – so we need a process to map the human readable names to ones our database can understand. The script 01_rename_sprites_from_animators.go attempts to solve that by mapping filenames to the ones stored inside items.json – which is a dump from our Production Database.

How the API serves sprite sheets

Once hosted on the GCP storage bucket these files are composited into usable sprite sheets by the API if you pass a correct URL to it like - https://api.dopewars.gg/hustlers/1/sprites/composite.png – where 1 is the ID of a Hustler.

The API does this by querying items that belong to a Hustler, and then the sprite field that belongs to each of that Hustler's items in the PGSQL database.

Source files

Animation team Spritesheets

Original files from animation team can be found in /packages/pixelart/raw_sprites. Using the script go run img2id.go will rename files in the ./in folder into usable files for the API. They were not the most meticulous at naming things, so that file contains some custom logic to fix filenames instead of asking them to rename things strictly.

MrFax Spritesheets

Not all files came from the animation team. Mr Fax provided a number of animation files as well, especially for custom CNY accessories. Those are in the /packages/pixelart/raw_sprites directory.

Uploading to GCP Bucket

You must have GCP access for the dopewars.gg organization to view them – or ask for a HMAC key from an admin to access cloud files with something like Transmit.

Directories

Path Synopsis
** EXPECTED FILE STRUCTURE + FORMAT ** Inside the same directory of this file you should have the following: ./in
** EXPECTED FILE STRUCTURE + FORMAT ** Inside the same directory of this file you should have the following: ./in
Updates the "sprite" field for db tables "items" and "body_parts" which hustlers.go reads to composite the sprite for a Hustler.
Updates the "sprite" field for db tables "items" and "body_parts" which hustlers.go reads to composite the sprite for a Hustler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL