Author Topic: [HOW TO] Designing BaseScape Facility sprites (1x1 and 2x2 )  (Read 7661 times)

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
As I experienced it, and not without some difficulties, I thought it could be useful for others, so I try to share a short description on how to build a new BaseScape Facility sprite

A) 1x1 FACILITY

Assuming that we will not build facilities of shape different from square, octogonal or cross !

To Do :
- SpriteFacility has to be designed, referenced under section "extraSprites:", then assigned to "spriteFacility:" attribute under section "facilities:"
- SpriteShape has only to be selected/chosen between vanilla shapes (see below), then assigned to "spriteShape:" attribute under section "facilities:"


1) SpriteFacility

     1.1) Design it
     - without borders
     - of dimensions 24x24 (could be eventually a little bigger, depending if you want to fully cover the wall, but better to make a first version 24x24)
     - in a 32x40 sheet
     - to be positioned in (4,3), given that first is (0,0) !

     1.2) Declare it under "extraSprites:" section, let's say from 100
Code: [Select]
100: MyPath/MyFacility_SpriteFacility.PNG

     1.3) Assign it to "facilitySprite:" attribute
Code: [Select]
spriteFacility: 100


2) SpriteShape

     2.1) Select the adequate shape in vanilla [1,2,3]
     Also :
     - 1 for square, or
     - 2 for octogonal, or
     - 3 for cross

     2.2) Assign it to "facilityShape:" attribute
Code: [Select]
spriteShape: 1


How it works in game

When placing it on BaseScape, engine will use [4 or 5 or 6] for the green shape + new SpriteFacility for the inside

When built, engine will use back [1 or 2 or 3] for the Shape + SpriteFacility for the inside


Example


Security Room (1x1-square)

Spoiler:
facilities:
# Security Room
  - type: STR_SECURITY_ROOM
    spriteShape: 1 #Vanilla Square
    spriteFacility: 100
    buildCost: 200000
    buildTime: 16
    monthlyCost: 20000
    personnel: 5
    storage: 5
    mapName: XBASE_56

extraSprites:
  - type: BASEBITS.PCK
    files:
      100: Resources/Facilities/SecurityRoom_SpriteFacility.PNG



A) 2x2 FACILITY


Assuming that we will build only facilities whose square-shaped !


To Do :
- SpriteFacility has to be designed, referenced under section "extraSprites:", then assigned to "spriteFacility:" attribute under section "facilities:"
- SpriteShape has to be designed, referenced under section "extraSprites:", then assigned to "spriteShape:" attribute under section "facilities:"


1) SpriteFacility

     1.1) Design it in 4 files
     Perhaps should it be done in one big, then split, but I did not experienced it yet ; anyway, I guess it should be easier to work first with a unique big file in order to avoid linking issues
     I tried also to create a unique 128X40 sheet, but it causes a crash, so I assume 4 files are mandatory

          1.1.1) NW corner
          - with borders
          - of dimensions 31x31 (could be eventually a little bigger, depending if you want to fully cover the wall, but better to make a first version 31x31)
          - in a 32x40 sheet
          - to be positioned in (1,1), given that first is (0,0) !

          1.1.2) NE corner
          Same but to be positioned in (0,1), also have to let a 1-sized border line on external shape

          1.1.3) SW corner
          Same but to be positioned in (1,0), also have to let a 1-sized border line on external shape

          1.1.4) SE corner
          Same but to be positioned in (0,0), also have to let a 1-sized border line on external shape

     1.2) Declare them under "extraSprites:" section (let's say from 101 to 104)
Code: [Select]
101: MyPath/MyFacility_SpriteFacility01.PNG
102: MyPath/MyFacility_SpriteFacility02.PNG
103: MyPath/MyFacility_SpriteFacility03.PNG
104: MyPath/MyFacility_SpriteFacility04.PNG

     1.3) Assign it to "facilitySprite:" attribute
Code: [Select]
facilitySprite: 101

2) SpriteShape

     2.1) Create "Building Queue" shapes
     Design them as vanilla BaseBits sprites 13 to 16

     2.2) Declare them under "extraSprites:" section as below
Code: [Select]
105: MyFacility_SpriteShape01.PNG
106: MyFacility_SpriteShape02.PNG
107: MyFacility_SpriteShape03.PNG
108: MyFacility_SpriteShape04.PNG

     2.3) Assign it to "facilitySprite:" attribute as below
Code: [Select]
spriteShape: 101
It has to be 101 and not 105 !


How it works in game

When placing it on BaseScape, engine will use 105 to 108 ; it will also not display the inside, but only the green shape, as for vanilla hangars. In this, behaviour is different from 1x1 facilities

When built, engine will use back 101 to 104 (for shape and facility)

I think we could design SpriteShape to include SpriteFacility without its borders, so that it is displayed as for 1x1 facilities (green shape + the inside)
But the advantage to stay vanilla is that we will be able to reuse easily the 4 SpriteShape files for any other 2x2 facility, just copying and renaming files


Example

Security Fortress (2x2-square)

Spoiler:
facilities:
# Security Fortress
  - type: STR_SECURITY_FORTRESS
    spriteShape: 101 #Building Queue
    spriteFacility: 101 #Basescape and Ufopaedia
    buildCost: 800000
    buildTime: 32
    monthlyCost: 80000
    personnel: 25
    storage: 25
    size: 2
    mapName: XBASE_50

extraSprites:
  - type: BASEBITS.PCK
    files:
      101: Resources/Facilities/SecurityFortress_SpriteFacility01.PNG
      102: Resources/Facilities/SecurityFortress_SpriteFacility02.PNG
      103: Resources/Facilities/SecurityFortress_SpriteFacility03.PNG
      104: Resources/Facilities/SecurityFortress_SpriteFacility04.PNG
      105: Resources/Facilities/SecurityFortress_SpriteShape01.PNG
      106: Resources/Facilities/SecurityFortress_SpriteShape02.PNG
      107: Resources/Facilities/SecurityFortress_SpriteShape03.PNG
      108: Resources/Facilities/SecurityFortress_SpriteShape04.PNG

Warning : Regarding 2x2 facilities, palette is not exactly the same for the first and for the three others  :o

« Last Edit: August 03, 2014, 11:05:55 am by Aldorn »

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: HOW TO : Designing BaseScape Facility sprites (1x1 and 2x2 )
« Reply #1 on: July 30, 2014, 05:44:59 pm »
FYI here is an example how the base config for a 3x3 sprites should be
and some posts later there is a mod that clarifies how to do the maps for such mod (nightly needed 1.0 has bugs for sprites>2x2)

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: HOW TO : Designing BaseScape Facility sprites (1x1 and 2x2 )
« Reply #2 on: July 30, 2014, 05:46:35 pm »
FYI here is an example how the base config for a 3x3 sprites should be
and some posts later there is a mod that clarifies how to do the maps for such mod (nightly needed 1.0 has bugs for sprites>2x2)
Argh....

I completely forgot it !

Anyway, I had a look, and I experienced using sprite 9 does not work...

But as I made many and many tests, perhaps I was to tired and missed something

Better is to have two explanations rather than one

And thanks for the info  :)
« Last Edit: July 30, 2014, 05:51:25 pm by Aldorn »

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11668
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: HOW TO : Designing BaseScape Facility sprites (1x1 and 2x2 )
« Reply #3 on: July 30, 2014, 05:54:16 pm »
I've never dealt with new facilities, so I can't say much, but it looks very competent, Aldorn.

Would you consider turning this into an Ufopedia article?

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: HOW TO : Designing BaseScape Facility sprites (1x1 and 2x2 )
« Reply #4 on: July 30, 2014, 05:58:10 pm »
I've never dealt with new facilities, so I can't say much, but it looks very competent, Aldorn.

Would you consider turning this into an Ufopedia article?
Thanks

I could, but I never did so

I will have a look, but before I prefer experiencing it a little more

(but feel free to put it on ufopaedia if it was your intention  :P)

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11668
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: HOW TO : Designing BaseScape Facility sprites (1x1 and 2x2 )
« Reply #5 on: July 30, 2014, 05:59:06 pm »
Thanks

I could, but I never did so

I will have a look, but before I prefer experiencing it a little more

(but feel free to put it on ufopaedia if it was your intention  :P)

Nah, I only submit articles that I can understand well. :P

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: HOW TO : Designing BaseScape Facility sprites (1x1 and 2x2 )
« Reply #6 on: July 30, 2014, 06:00:31 pm »
Nah, I only submit articles that I can understand well. :P
Do you mean I am not clear ??

Right, I will join some screen shots for a better understanding

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11668
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: HOW TO : Designing BaseScape Facility sprites (1x1 and 2x2 )
« Reply #7 on: July 30, 2014, 06:05:15 pm »
Do you mean I am not clear ??

Right, I will join some screen shots for a better understanding

Ah no, that's not the point. I just have no experience with facilities, so I don't feel qualified.