clockworkpi

How to set up your own Warehouse


Hi GameShellers!

Recently, we’ve opened our Warehouse for you guys.

Warehouse is for browsing and downloading games.

Example reference https://github.com/clockworkpi/warehouse

Currently, Launcher’s Warehouse only supports a separate repository on github.com as a warehouse.

The top-level directory of the Warehouse contains an index.json as the only index of the game category directory list in the warehouse

Each game category directory contains an index.json and all game directories, index.json is the main index of all game directories

2019 GAME JAM is a game category directory, there are 11 game directories under this directory

drwxrwxr-x 4 cpi cpi 4096 Dec 28 18:11 'AGENT OF SHINIGAMI' 
drwxrwxr-x 4 cpi cpi 4096 Dec 28 18:11 'Ancient Abyss' 
drwxrwxr-x 4 cpi cpi 4096 Dec 28 22:43 DCDOR 
drwxrwxr-x 4 cpi cpi 4096 Dec 28 18:11 'Diner Mafia' 
drwxrwxr-x 4 cpi cpi 4096 Dec 28 18:11 du-pk 
-rw-rw-r-- 1 cpi cpi 3417 Dec 29 15:05 index.json 
drwxrwxr-x 4 cpi cpi 4096 Dec 28 18:11 'Infected System' 
drwxrwxr-x 4 cpi cpi 4096 Dec 28 22:42 Omamori 
drwxrwxr-x 4 cpi cpi 4096 Dec 28 22:43 'Road Invaders' 
drwxrwxr-x 4 cpi cpi 4096 Dec 28 18:11 ShiftQuest 
drwxrwxr-x 4 cpi cpi 4096 Dec 28 22:43 SpaceShifter 
drwxrwxr-x 4 cpi cpi 4096 Dec 28 22:44 'Two Dimensions'

Warehouse game category

Each game directory has a simple rule to distinguish three warehouse game types[launcher,pico8,tic80]

  1. file
  2. shots
  3. .game

The launcher type is a folder storage method for launching games currently supported by launcher.

In simple terms

Folder / Folder.sh # .sh file of the same name, containing the command to start the game, must have executable rights (chmod + x)

Folder / Folder.png # .png file of the same name, used as the icon displayed in the launcher, the size is 80x80, optional or not

Place other files at will

launcher

The launcher type uses AGENT OF SHINIGAMI as an example:

  • The file folder contains a compressed package of the launcher game folder. The compressed package currently only supports the .tar.gz format and requires the same name as the directory, such as AGENT OF SHINIGAMI.tar.gz
  • The shots folder contains a screenshot for previewing the game, the size is GameShell’s resolution, and the file name is arbitrary
  • .game plain text file, the file name is dot + game, linux hidden file, its content is the type string of this game directory, currently only launcher, pico8, tic80, the three can only write one

The launcher game is installed under ~/aria2download/, with github user name and library name as the directory name, such as ~/aria2download/clockworkpi/warehouse/master/2019%20GAME%20JAM/

Pico-8

Pico-8 type Take du-pk as an example:

  • The file folder contains a card for a pico8 game, must be a png, and the file name ends with .p8.png
  • The shots folder contains a screenshot for previewing the game, the size is GameShell’s resolution, and the file name is arbitrary
  • .game plain text file, the file name is dot + game, linux hidden file, its content is the type string of this game directory, currently only launcher, pico8, tic80, the three can only write one

After the pico8 game is installed, it will appear in pico8. The installation path is /home/cpi/.lexaloffle/pico-8/carts

Tic80

The Tic80 type is very similar to Pico-8, except that the file folder contains a card for a Tic80 game, with the file name ending in .tic

Everything else is as same as Pico-8

The Tic80 game installation path is /home/cpi/games/TIC-80/

Add to Launcher’s Warehouse

After all the remote github.com game library is generated, please go to launcher-> Warehouse

+ Add new warehouse

Enter warehouse URL

Take https://github.com/clockworkpi/warehouse as an example

The input result is github.com/clockworkpi/warehouse , there is no need for http (s):// at the beginning, and .git at the end, which is simply github.com + github.com username + repository name.

If you have any further question, please feel free to feedback here.
LOVE & PEACE !

8 Likes

THANK YOU SO MUCH FOR THIS!! I am super excited to be able to contribute, in the form of a warehouse repository! This will make life so much more user friendly!

Im assuming this is mainly for game submissions. How would this fare for more system type submissions? Eg, themes, command hooks, installation of scripted dependencies, complete interface overhauls, modification of action configurations etc.

On another note, can this also be used to make a completely private repository to store all of your rom images online, and access them on demand as you require them? This would make the cloud type interface completely independent of a computer on the same network, and would truly free up the gameshell to be its own independent gaming device.

3 Likes

From the looks of things, this will allow you to create/use a warehouse repository of:

  • launcher scripts
  • pico8 games
  • tic80 games

This takes a .tar.gz and extracts the contents to a specific directory. Anything you can do with a launcher script today you could do with a launcher script hosted in a warehouse. This just serves as a way to distrubute the launcher script.

You could configure per-game launchers (for running a specific rom with a specific emulator core for example) and host them in your own private warehouse.

The main point is that a warehouse is just a repository with installers and other metadata, selecting something from the warehouse will install it on your Gameshell.

3 Likes

WOW THIS IS SO COOL! :raised_hands:

After a lot of fiddling around, I managed to get a warehouse up and running for our past games.

This is definitely going to encourage us to make more games and projects for the GameShell!

Moving forward, will the official clockworkpi/warehouse GitHub repository accept pull requests for additional content? Or should we just stick to our own repositories?

I really want this system to thrive!

5 Likes

Tha actually is a great idea to use Warehouse as literal.
I’m on it now~

Thanks for your support!
Now, about the question.
We definitely want more content. So if you choose to send your works to us through warehouse@clockworkpi.com , we may put them into the official repository. Or you can just submit them to https://github.com/clockworkpi/warehouse
Meanwhile, you can still keep your own repositories. It’s not an “or” situation.
If you wanted to share them privately, then a private repository would be a good idea.
Hope it helps.

2 Likes

I haven’t looked too much into the warehouse code, but does it use git commit hashes or tags or anything for versioning the entry / game?

If not, that would be a good addition, so users can easily update games to newer versions, or even get specific versions of the game in case new versions have issues, etc. So something like when you are about to install a game, it gives you an option to download / install the latest, update if you have an out of date version, or to pick from a list of all versions.

All in all, this is a really cool addition, and has a lot of potential.

it does not use any hash stuff

actually it is very simple , just pack the game into github and then you or anyone else can install it from the launcher
and if there is an update for games , then re-download the index ,remove the old game, install the new one
that’s all

1 Like

Is there any way to get some kind of debugging information? I had a working warehouse but then I broke it when I tried to add a second top level entry. The “Fetch house failed” error doesn’t give any clue as to what might be wrong. Are errors logged anywhere in the system – I don’t mind hunting down a log file if there’s a place to look.

I’ve looked over my repository and I don’t see anything wrong with it, but I’m probably missing a single character somewhere.

The current warehouse implementation is pretty opaque when trying to add stuff to one. Hopefully one day there will be tools to make the process easier!

Here’s mine if anyone wants to take a look. Everything under “Freeware box86 Games” should be fine, as it was working properly. It’s only the “Games (apt)” directory that’s new. ANd since there’s something wrong there, the previously working directory is inaccessible on the Gameshell as well until I get it fixed. :frowning:

try

cat /tmp/x.log

when you met errors

1 Like

Thanks!. I realized it was a problem with a space not being escaped to “%20”. Looks like the ware house is working now.

1 Like

Will there be support for other services instead of GitHub? And why is it limited to GitHub at the moment?

2 Likes

it is not limited to github , just use github as a first example case,the code is very easy to change to other services if they have allowed directly downloading

and what other services you will be expecting?

1 Like

Sounded like only GitHub is working. I tried with codeberg with a test repo: https://codeberg.org/Rinma/warehouse and when I enter it without https as warehouse url I get a “Warehouse url error!” message.

1 Like

Found the code and some answers to my initial question: https://github.com/clockworkpi/launcher/blob/master/Menu/GameShell/21_Warehouse/__init__.py#L96 … so still GitHub support only at the moment or is there something I miss?

1 Like

yeah you are right, GitHub support only at the moment

1 Like