|Document Data structures|
|Concepts illustrated here are relevant to understand what kind of data FIFE engine is able to process.|
The purpose of this page is to explain the FIFE XML object format in full, with all the elements and their attributes fleshed out.
Object File Structure
Object files begin with an object header: <?fife type="object"?>. After this, the object is defined between a set of <object></object> tags. Only one object may be declared per file. The components of the <object> section and its subsections are explained in the following sections of this page. Here is an example definition of an object file:
- id: The identifier for this object. Type = string
- parent: Identifier of the parent object. Type = string. Optional.
- namespace : Namespace of the object. Type = string. Required.
- blocking: Defines if object blocks the movement. Type = bool (0/1). Optional, default = 0
- static: Defines if object does not move (ever). Used to optimize pathfinding. Type = bool (0/1). Optional, default = 0
- pather: Defines which path finder object should used. If none defined, uses engine default. Type = string. Optional
- Currently supported pathers = "LinearPather" and "RoutePather"
- action: See action section
- source: Location of the image in the filesystem. Type = string
- direction: Direction where this image is pointing to (i.e. facing direction if there is such). Type = int
- x_offset: X offset for image. Type = int, Optional
- y_offset: Y offset for image. Type = int, Optional
An action is always embedded in an <object> section of a dataset
- id: The identifier for this action. Type = string
- animation For animation file definitions, see animation format
Since FIFE 0.3.3 there's a new format called Animated spritesheet supported. Suppose you have object definition:
One of the animation.xml file could look like this:
Now, with the old format, you needed to create one object xml file and eight animation xml files plus each of the frame was a separate image file. In total you needed 8*4+8+1=41 files to describe an object. That's a lot. With a new syntax you only need one object xml file and one .png image file for every action:
Each of the row consists of animation for specific direction with consecutive frames. The only requirement is that every frame is the same size.
Corresponding animated spritesheet looks like this:
In order to quickly convert all your animated files FIFE provides a simple conversion tool in tools/pack_anim.py.