-
Notifications
You must be signed in to change notification settings - Fork 8
Exporting Games
Once the game creation process is complete, game authors have to face the problem of efficiently releasing and distributing the game to their end users. This is no trivial problem - it is necessary to conduct multiple operations to transform a bunch of game descriptors and resources into a single bundle that can be easily delivered and run. The eAdventure editor facilitates this task by providing game authors with features to get their games exported in compliance with different formats. These features are accessible through the File > Export menu.
A game exported as a JAR file is self-contained. This means it is a single file that contains all the code and resources needed to run the game. However, it is required for the end user to have installed a Java JRE for the game to work.
The jar game produced has the next internal structure:
-
assets/ A directory containing all json files describing the game and also all the images used in the game. * game.json The main game descriptor, containing information like the initial scene and the dimensions of the game (width and height). * scenes/sceneX.json The scenes subfolder contains all the sceneX.json files describing scenes, where X is the number of the scene starting at 0. * images/ Subfolder with all the png, jpeg, etc. images referenced in the scenes.
-
META-INF/MANIFEST.MF File that determines which is the main class responsible for launching the game: es.eucm.ead.engine.EngineJarGame
The rest of the contents are the code for the eAdventure and third party libraries needed to run the game.
When the game is exported as a JAR game, the flow is as follows:
-
An ExportGame action is created by the UI. (
Controller.action(ExportGame.class);) -
The ExportGame action gets the location (i.e.) of the output jar as an argument. It also gets the location (i.e. path) of the engine library used for creating the output file. This is a property provided in the release.json file.
ExportGamealso receives as a third argument ExportCallback, a callback that gets updates on how the exportation process goes. The action collects all three elements and delegates to Exporter. -
Exporter is placed into a separate project so it can be also used without the editor. The ExporterApplication tool can be used for that purpose. It is devised as a command line tool that gets a list of game projects (source), a list of target jar files (destiny), the location of the engine jar file and which gets the games exported.
Exporter does something quite simple:
- It copies all binary files (e.g. images) to a temp folder.
- Iterates through model entities in the game project and gets them cloned without any EditorComponent. That gets a clean model with just the information the engine needs.
- Saves the cloned entities to the temp folder.
- Merges the temp folder and the engine jar lib into the target destination.
- Cleans up the temp folder.
eAdventure - eUCM research group
- Setting up a Development Environment
- Contributing Guidelines
- Build Process
- Project structure
- Schema
-
Engine
- Files paths and FileResolver
- Binding Schema elements with Engine elements
- Managing the game view through Layers
- Game loop and scene management
- IO
- File Resolver
- Assets: Converting schema objects to engine objects
- Engine Objects
- Actors
- Effects
- Testing the engine
- Editor
- Remote communication
- Release Process
- Other documentation