Skip to content
tommo edited this page Sep 10, 2017 · 3 revisions

Here is some simple notes about Gii

About

Gii is a game development environment targeting MOAI game engine, it's written to working together with MOCK. It is made of following components:

  • A Python environment including dependent libraries.
  • A Command line based sub-tool framework
  • A PyQT based IDE

Gii Command Line Usage

Create a empty project

	gii init <PROJECT_NAME>

Startup the IDE

	gii ide

Project Structure

<Project Root>
	-- game						(game content)
		-- lib					(runtime library)
		-- asset				(game asset)
	-- bin						(executable binaries)
		-- osx
		-- win
		-- python
		...
	-- host						(binary source files/ build script)
		...
	-- env						(editor related environment)
		-- workspace			(personal workspace data files)
		-- config				(project config data)
			-- cache			(asset building cache)
			-- game				(game runtime config data)
			-- modules			(module-specified editor config data)
		-- packages				(project local packages)
		-- shell				(project local shell scripts)
		-- data					(project local extra editor data file)

Asset Pipeline

Gii has a generic asset management system.

Importing assets

In Gii, we treat asset files as 'Source' files, the import process is to 'Build' intermediate or runtime 'Object' data from these 'Source' files. Asset manager is the one for the job. During import process, asset managers are called in priority order, the asset manager

Deploying assets

By default, asset manager will simply copy the "object" file of the asset node into deployed package. But you can always customize deployment process for each asset type. For example, we can do additional optimization or compression during deployment process as we need.

An example

Let's have a look at a real-life example of asset management in Gii, a texture file:

  1. User drop an image file into asset folder.
  2. Filewatcher detected filesystem changes and notify the editor to do asset scanning.
  3. Asset library sees the new image file and start importing.
  4. Asset library tries to import the file with each registered asset manager, in priority-order, until the texture asset manager accepts the file.
  5. The texture asset manager does the actual import process:

    specify the asset's type, which is 'texture' in this example request a cache file handle from cache manager convert the image file into internal format, save the converted file as the cache file. point the asset's "object" file to the built cache file

  6. During depolyment, asset manager does any additional process assigned like texture-compression or advanced atlas reconstruction.
  7. To use this texture asset, game engine will look into the asset node's "object" field to find actual data to load.

    in editor previewing, the "object" file is the cached intermediate file. in deployed runtime, the "object" file is the depolyed data.