This page is in the process of being written. Many details may be inaccurate or missing completely.
Packaging for Xeiso involves manual work, but is fairly easy. It is good to know a bit about Python and Pyglet; read on to see why.
The Structure
Xeiso packages are .tar.gz archives with an .xpk extension. Xeiso does not currently handle extracting of these archives; for the time being it only reads packages as a directory tree.
The general layout of a Xeiso package is:
packagename.xpk
`-- packagename/
|-- __init__.py
|-- packagename.ini
|-- packagename.sh
|-- package-logo.png
`-- datafiles/
Replace all three instances of packagename with the name or ID of your package.
Basic package requirements:
- A
packagename.inifile that contains metadata and other information about your game. __init__.pyomust exist. When developing, this may be__init__.py, but when packaged for distribution this should be compiled to ensure quick loading.- You must have a logo image somewhere. No naming requirements; this is specified in
packagename.ini. - A packagename.sh script (in any scriptable language) that will launch your game
Everything else is technically optional, though you might want to at least have an executable if the game is not available on the destination system.
packagename.ini
Your .ini file contains basic information needed by Xeiso to load your game into memory. Let’s take a look at demo.ini from the demo game:
[Demo Game]
spec: 2
description: This is a demo package intended for developers and packages as an example.
logo: demo.png
version: 0.2
fullscreen: 0
hwaccel: 0
joypad: 0
mouse: 0
players: 1
network: 0
parental: 0
Starting from the top: [Demo Game] should be the full name of your game. Keep the brackets intact. spec should always be set to the latest package specification, currently 2. When you upload your package to Xeiso Connect (coming soon!) it will be checked for this.
description should be self-explanatory, just keep it all on one line.
logo is the name of the logo image for your game, relative to your .ini file.
version is your game’s version number. Increment this to trigger an update if your game is listed on Xeiso Connect.
fullscreen should be 1 if your game runs in fullscreen by default, or 0 if it absolutely has to run in a window.
hwaccel should be 1 if your game uses OpenGL or requires hardware acceleration to run well, 0 otherwise.
joypad and mouse are values that can be set if your game supports or requires either:
- 0 = not supported
- 1 = supported
- 2 = required
players should be set to the amount of players that can play on a single system. Do not count online connectivity.
network: 1 if your game supports online content or play, 0 otherwise.
parental will be used for future parental controls. A minimum age value of 8, 12, 16, or 18 should be set, or 0 if the game is appropriate for all ages1.
__init__.py
This file contains all of the control variables and functions needed to make your game work. It contains everything from launching the game process to custom animated banners. A basic init file is as follows:
import xeiso.package
class Package(xeiso.package.Package):
def show_banner(self):
pass
def hide_banner(self):
pass
def update(self, dt):
pass
def draw(self):
pass
Note: __init__ is deprecated as of spec 2. Metadata about your game should go in your .ini file.
If you find you are not using a particular function of a package, delete the function definition. Xeiso will try to assign a sane default for your game.
Game Banners and Animation
See the demo game package for an example.
Launching your Game
When your game is launched, a number of things occur in the background:
- xeiso-launch starts up.
- xeiso-ui shuts down.
- xeiso-launch loads your game and launches it as a subprocess. (Game is now running.)
- When your game exits, xeiso-launch checks to make sure everything was successful.
- xeiso-ui is started.
- xeiso-launch passes any error messages along to xeiso-ui.
Your game is launched by a script that should be in your package with the same name as your package basename with a .sh extension. For example, the ‘demo’ package runs as ‘demo.sh’. The launch script could be as simple as:
#!/bin/sh
./demo-game
The first line (shebang line) is the interpreter to use; replace this if you would like to use Perl or Python instead to launch your game. If your game is extremely simple, it could actually live entirely inside this script without any additional executables needed.
Footnotes
1 Currently not used by Xeiso, but expected in a later version.