Unit Design - unit property sheet/visuals

Post Reply
Stratego (dev)
Site Admin
Posts: 9674
Joined: Fri Apr 25, 2014 9:28 pm

Unit Design - unit property sheet/visuals

Post by Stratego (dev) » Fri Nov 23, 2018 2:11 pm

Here i describe the visual definition part

"visuals" part is a list, a list of visuality types of a unit eg: DEFAULT, CONSTRUCTION, JOIN, JOINX, OCCUPIED

General

here a sample:

Code: Select all

   "uiDefinition":{
      "imageFacingDirection":"RIGHT",
      "visuals":[
      
      
         {
            "imgName":"64_unit_celt.png",
            "type":"DEFAULT",
            "shiftIndicatorsDown":32,
            "typeExtra":0.0,
            "imgColumns":1,
            "imageDefParts":[
	                   {
	                      "cropToRect":{"top":0, "left":0,"bottom":32,"right":32},
	                      "layer":"OVERLAPS",
	                      "shiftCol":0,
	                      "shiftRow":-1,
	                      "clickable":false
	                   },
	                   {
	                      "cropToRect":{"top":32,"left":0,"bottom":64,"right":32},
	                      "layer":"UNITS",
	                      "shiftCol":0,
	                      "shiftRow":0,
	                      "clickable":true
	                   }
            ]
         }

         
         ]
         
         ...
     }
         
"imageFacingDirection": "RIGHT" / "LEFT" / "NOFLIP" you ca set the image direction, and if you dont want it to flip by movement/attack.
"imgName": here u give the asset image name under the assets/gfx folder
"type":"DEFAULT", this is the visuality type, DEFAULT is the normal image for unit it can be: DEFAULT, CONSTRUCTION, JOIN, JOINX, OCCUPIED
"shiftIndicatorsDown": a value how much pixe the indicators needed to be shifted down from the top left position.
"imgColumns": how many columns of the image or animation: 1: single, 2: can be 2 tile animation or an occupiable building, more: animation.
"typeExtra": some extra input for some options.
"imageDefParts": here you can define which part of the image you define to which layer
"imageDefShort" this is a simpler way to set imageDefParts


Image positioning
Use imageDefParts or imageDefShort?
if u have non animating simple unit image i suggest the short version, in any complex case the detailly configurable version.

instead of this

Code: Select all

            "imageDefParts":[
               {
                  "cropToRect":{"top": 0,"left":0,"bottom":32,"right":32},
                  "layer":"UNITS",
                  "shiftCol":0,
                  "shiftRow":0,
                  "clickable":true
               }
            ]
you can write this:

Code: Select all

"imageDefShort":"NORMAL_1x1"
also instead of this

Code: Select all

            "imageDefParts":[
               {
	       	                      "cropToRect":{"top":0, "left":0,"bottom":32,"right":32},
	       	                      "layer":"OVERLAPS",
	       	                      "shiftCol":0,
	       	                      "shiftRow":-1,
	       	                      "clickable":false
	       	                   },
	       	                   {
	       	                      "cropToRect":{"top":32,"left":0,"bottom":64,"right":32},
	       	                      "layer":"UNITS",
	       	                      "shiftCol":0,
	       	                      "shiftRow":0,
	       	                      "clickable":true
	                   }
            ]
you can write this

Code: Select all

"imageDefShort":"OVERLAP_1x2"
and we have 4 options currently:
- NORMAL_1x1 for a normal 1x1 tile unit
- OVERLAP_1x2 for a tall unit like a trebuchet, this will overlap the tile above its "foot" tile.
- NORMAL_COL2_2x1 this is for a 1x1 building that shows occupacy so image is 2x1 sized
- OVERLAP_COL2_2x2 this is for a 1x2 building that shows occupacy so image is 2x2 sized

Visual definition TYPE-s
"type":"DEFAULT", this is the visuality type, DEFAULT is the normal image for unit
other options:
CONSTRUCTION - this is used when the unit is under construction, set in "typeExtra" the readiness limits (over this limit this image is used)
OCCUPIED - this image is used if the eg. building is occupied (carried some units)
JOIN and JOINX: use these to autotile this unit: eg a wall that transforms as u put an other wall next to it (it joins)

Stratego (dev)
Site Admin
Posts: 9674
Joined: Fri Apr 25, 2014 9:28 pm

Re: Unit Design - unit property sheet/visuals

Post by Stratego (dev) » Mon Aug 19, 2019 9:26 am

new setting :
"imageFacingDirection": "RIGHT" / "LEFT" / "NOFLIP" you ca set the image direction, and if you dont want it to flip by movement/attack.

User avatar
DoomsdayDragonfire
Posts: 747
Joined: Tue Sep 06, 2016 6:20 am
Location: Terra - Brasil

Re: Unit Design - unit property sheet/visuals

Post by DoomsdayDragonfire » Fri Sep 06, 2019 3:48 pm

On an animated img, can i define the speed the game does reproduce each frame? For example, can or how i imput to game reproduce the frames at 100ms, 120ms, 150ms or some other speed? Also, whats the default speed of the animations?
Stay Awesome!
(ノಠ益ಠ)ノ彡┻━┻

Stratego (dev)
Site Admin
Posts: 9674
Joined: Fri Apr 25, 2014 9:28 pm

Re: Unit Design - unit property sheet/visuals

Post by Stratego (dev) » Sat Sep 07, 2019 9:57 am

please always try to check in modders lunge, maybe there is answer.

check here maybe that andwers the question:
Game definition jsons - Sprites and Textures

Post Reply

Return to “Unit Design”