Skip to content

Distrubution

piitex edited this page Feb 15, 2025 · 3 revisions

Distributing

This will be a full guide to distributing games, addons, and updates. Note, RenJava does not natively support Steam releases.

Game

There are a few ways you can distribute your game. The best way is to pack the game environment into a compress archive. The most standard compress archive is zip. There are other zip formats but operating systems won't natively support them. You can use zipping tools such as 7Zip and WinRar.

The zip file should be as follows. Please make sure you have a root directory in the zip.

MyGame-1.0.0.zip
  └─MyGame-1.0.0
    └─game
    └─jdk
    └─start.bat
    └─start_linux.sh
    └─MyGame.exe
    └─MyGame.jar

Assets

Assets make up 99% of your games file size. You can distribute the assets with the games jar file. A higher jar file size will result in higher resource usage for the JVM. It is recommended to pack the assets with the zip rather than the jar file.

file.jar
  └─game
    └─audio
    └─css
    └─fonts
    └─images
    └─media

To compile assets into the games project file, you will have to modify the pom.xml. The <resources> tag is what tells the compiler to pack the resource folder into the jar file.

    <build>
        compiler settgins...
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <includes>
                    <include>**/*.*</include>
                </includes>
            </resource>
        </resources>
    </build>

Your resources folder should have a game folder which contains all assets.

src
  └─main
    └─resources
        └─game
          └─audio
          └─css
          └─fonts
          └─images
          └─media

Exclude

Some files you may want to exclude. The renjava directory does not have to be distributed. You can also exclude debug.bat, debug.sh and the logs folder if you have it.

Updating Game

This section explains best practices when releasing updates to your game.

Overwriting

The standard way to release an update is to re-pack the game again. Saves are stored locally on the system and can transfer between versions. There are some cons to consider. The more the game is updated with newer stories and events the bigger it gets. Re-packing the game will result in larger downloads and more disk usage.

All-In-One

The AIO (All-In-One) is an updating method which lets you update a game without re-packing the environment. This will result in a significantly smaller download size. Just pack the added or changed assets into the jar file. Then all you need to do is just release the jar file. This way the player/consumer only downloads what is necessary. There are some cons to consider. The consumer will have to have the latest release for the game. You cannot skip versions when using this method of updating.

Utilizing Both

You can utilize both methods to make the download process easy. Pack the full game for anyone who is new to the community and release an update jar for those who have the latest release. This way the new players can get started with a singular download and the existing fan base only has to download the changes that are necessary.

Addons

Under Construction!