Sprite Creator - Robosturm/Commander_Wars GitHub Wiki

General Spriting Information

This section deals about general limitations and options of ingame sprites.

  • Sprites can be at any size the game and the resource.xml's can deal with rescaling images to the size the game needs them. So it's possible to have sprites for terrains, buildings or units of 64x64 size or larger.
  • units and buildings for factions are seperated into a mainimage and a mask. The mainimage is the same for all faction colors, while the mask is recolored by the engine with the faction color. Take a look at the Sprite Creator Tool section for more details.
  • each building and unit is able to have an army or neutral faction specific sprite. E.g. for turning off the smoke of a factory
  • the amount of frames per unit or building can be choosen as desired the only limitation here is that the moving sprites of one unit need to have the same amount of frames. So unit a can have 5 frames while unit b has 10.
  • the engine is a 2D one and it'll never be a 3D one. However you can use 3D Models to create the 2D-Spriteframes from them.

Sprite Creator

Since Beta Release 6 Commander Wars ships with a sprite creator for units and buildings in the console.

The tool can be accessed by pressing F1 which will open the ingame console. It only accepts png-images as input. The first argument is either a file or folder. The second argument is a one pixel heigth and whatever amount of army pixel width table image, which contains the army color pixels in your source sprite. The third argument is a one pixel heigth and as width as the army pixel table with the gray color. The gray color will be mixed with the ingame selected army color and creates the actual color of the unit or army in the game.

createSprites("test/HeavyInfantryBM.png","test/orange.png", "test/neutral.png")
createSprites("test/","orange.png", "neutral.png")