A tool to unpack, repack, edit and play 2d animations from Supercell games

Overview

SC Tools

This module is intended to unpack, edit and repack .sc files from Supercell games.

SC files are unpacked to disk as projects. Projects contain textures and readable configuration files. These files can be edited, and a new SC file can be repacked from a project at anytime.

For a better understanding of SC file structures, look at the files in the lib/supercell-sc directory.

This tool has been successfully tested on Brawl Stars assets from Q1 2022.

Todo:

  • Add engine web example
  • Check sc compression perf

Recipes

Unpack SC File(s) to Project(s)

import { basename, join } from 'path';
import glob from 'glob';
import { unpack } from '@ultrapowa/sc-tools';

const sourcePattern = 'path/to/apk/assets/e30a1e4a93c76bea755877299ebebf535e1b3d73/sc/*.sc';
const projectDir = 'path/to/local/workspace/brawl-stars-33.127';

const files = glob.sync(sourcePattern)
  .filter((filePath) => !filePath.includes('_tex.sc')); // those will be processed within the regular .sc files

for (const filePath of files) {
  const projectName = basename(filePath, '.sc');
  await unpack(filePath, join(projectDir, projectName), {
    shapeOuterColor: { // remove this options for total transparency
      red: 0, green: 255, blue: 0, alpha: 255,
    },
  });
}

Pack Project to SC File

import { pack } from '@ultrapowa/sc-tools';

await pack('path/to/local/workspace/clash-royale/spell_goblin_barrel');

Extract SC File Shapes as PNG Images

import { basename, join } from 'path';
import glob from 'glob';
import { unpack, buildPngShapes } from '@ultrapowa/sc-tools';

const sourcePattern = 'path/to/apk/**/*.sc';
const projectDir = 'path/to/local/workspace/brawl-stars-38.111';

const files = glob.sync(sourcePattern)
  .filter((filePath) => !filePath.includes('_tex.sc')); // those will be processed within the regular .sc files

for (const filePath of files) {
  const projectName = basename(filePath, '.sc');
  const projectDirectory = join(projectDir, projectName);
  await unpack(filePath, projectDirectory, { flattenShapes: true });
  await buildPngShapes(projectDirectory); // still sync
}

Export Movie Clips to Render in a Browser

This part of the code is not migrated yet.

import path from 'path';
import { exportMovieClips } from '@ultrapowa/sc-tools';

const filePath = 'path/to/apk/assets/e30a1e4a93c76bea755877299ebebf535e1b3d73/sc/level.sc'; 
const outputDir = 'path/to/workspace/rendering';

await exportMovieClips(filePath, outputDir);
You might also like...

A react and framer motion app to play some quizzes !

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: ya

Jan 7, 2022

Social media platform that hosts community-driven challenges where everyone can play and compete

Social media platform that hosts community-driven challenges where everyone can play and compete

Komo A social media platform that hosts community-driven challenges where everyone can play and compete. How To Install Komo TBA Preview Home Screen A

Jun 13, 2022

Make friends through music. Discover great sound tracks on Solana and play them with your buddies :dancer:.

Make friends through music. Discover great sound tracks on Solana and play them with your buddies :dancer:.

Acoustic Licious COVID-19 has significantly impacted the mental health of children and adults alike. Globally, the population suffering from lonelines

Oct 28, 2022

Use thirdweb's token, edition drop, and a custom contract using thirdweb deploy to build a Play-to-Earn game!

Use thirdweb's token, edition drop, and a custom contract using thirdweb deploy to build a Play-to-Earn game!

thirdweb Play-to-Earn Example This example project is a simple Play-to-Earn (P2E) game! The Idea The game is a "mining" game, where your character min

Jan 2, 2023

Plug-and-play, faster-than-native promise/callback event emitter

Plug-and-play, faster-than-native promise/callback event emitter

kNow Blazing-fast callback/promise-based events with a tiny footprint What is this? With kNow (pronounced "now"—the k's silent), JavaScript event mana

Sep 11, 2022

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.

Phaser - HTML5 Game Framework Phaser is a fast, free, and fun open source HTML5 game framework that offers WebGL and Canvas rendering across desktop a

Jan 7, 2023

This is a simple web application of a To-do List in which you can add, remove and edit all your tasks and also you can mark each task as completed and delete all completed ones.

To-Do List A simple web application of a to do list Built With HTML, CSS, JS, ES6 & Webpack Getting Started In this repository I created To-Do List SP

Apr 11, 2022

Play bad apple in Node.js

Bad Apple Nodejs Play Bad Apple in console with Nodejs! Requirements and Installation You can either git clone or download the repository as a zip. Se

Sep 8, 2022
Owner
Jean-Baptiste Martin
Founder at Ava
Jean-Baptiste Martin
A daily print-and-play roguelike adventure you can play offline.

Chronicles of Stampadia A print-and-play roguelike with a new adventure every day! Play today's adventure | Read the manual | Learn how to play | Disc

Francesco Cottone 36 Oct 15, 2022
Danger is near (play to earn game, gamefi on near chain testnet) - user play as a fireknight in a PIXELVERSE world who go to forest and kill monster.

Danger is near (play to earn game, gamefi on near chain testnet) - user play as a fireknight in a PIXELVERSE world who go to forest and kill monster. User can earn $DANGER token and score to compete with others user.

Jason Factor 21 Dec 30, 2022
Play logic games and claim exclusive NFTs!

Bit Gaming Samruk Hackathon Winner ?? Play-to-earn DAO with exclusive NFT collection Idea We are bringing together curious minds and reward them with

Temirzhan Yussupov 3 Jun 21, 2022
API, web and mobile application for finding a partner to play online multiplayer games.

Duo Finder Duo Finder is a simple mobile and web application for gamers looking for partners to play a game with. It's basics was developed during the

José Guilherme Fernandes Moura 2 Sep 20, 2022
Chakra UI Animations is a dependancy which offers you pre-built animations for your Chakra UI components.

Chakra UI Animations Chakra UI Animations is a dependancy which offers you pre-built animations for your Chakra UI components. Installation yarn add @

Code Chemistry Inc. 9 Nov 19, 2022
Digispark Overmaster : free IDE TOOL allows to create and edit Digispark Scripts by the drag and drop technique,with cool GUI and easy to use it

Digispark_Overmaster Digispark Overmaster : free IDE TOOL allows to create and edit Digispark Scripts by the drag and drop technique,with cool GUI and

Yehia Elborma 5 Nov 14, 2022
Tumaini Maganiko 7 May 9, 2023
Playful and Colorful One-Page portfolio featuring Parallax effects and animations. Especially designers and/or photographers will love this theme! Built with MDX and Theme UI.

Gatsby Starter Portfolio: Cara Playful and Colorful One-Page portfolio featuring Parallax effects and animations. Using the Gatsby Theme @lekoarts/gat

prashanth s 1 Dec 24, 2021
An app to manage tasks. A user can add, delete and edit a task and mark it as completed, It uses simple GUI and relies on DOM manipulation in pure JS and using local storage.

An app to manage tasks. A user can add, delete and edit a task and mark it as completed, It uses simple GUI and relies on DOM manipulation in pure JS and using local storage.

KHITER Mohamed Achraf 6 Aug 20, 2022