Author Topic: Trying to add new alien craft.  (Read 7541 times)

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Trying to add new alien craft.
« on: April 13, 2023, 01:09:47 am »
I'm trying to create a map pack for TFTD using Wolwerin's alien crafts from this thread: New ships [UFO/TFTD]

Although I did get the ship to load in "New Battle" I don't think I've set it up correctly as there are two problems that are present.

The first is that no aliens are spawning inside the alien craft regardless of the percentageOutsideUfo: settings.
Spoiler:




The second is that X-Com can walk through some of the crafts walls.
Spoiler:

What am I missing?

Here is the mod I've been working with:
Wolwerin Map Pack V0-1.zip

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11705
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Trying to add new alien craft.
« Reply #1 on: April 13, 2023, 12:13:48 pm »
Regarding the walls: there were several issues with tile placing. I fixed them, see attached. (No guarantee that all the errors were caught, as this needs testing.)

Regarding spawning: no surprise here, as there are no nodes or routes at all, the ROUTES file is empty. This needs to be done from scratch. If you want, I can help with it.

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: Trying to add new alien craft.
« Reply #2 on: April 14, 2023, 04:46:03 am »
Thank you I would appreciate your help with the map files.

I'll download KevL's MapView2 and try to run it with Wine (I'm on Linux) unless there is a different program you would recommend for editing these files?

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11705
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Trying to add new alien craft.
« Reply #3 on: April 14, 2023, 09:55:53 am »
Thank you I would appreciate your help with the map files.

I'll download KevL's MapView2 and try to run it with Wine (I'm on Linux) unless there is a different program you would recommend for editing these files?

There's also MapView 1, which is a significant downgrade in terms of ergonomics, but can do the same things.

I'll post the routes when ready.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: Trying to add new alien craft.
« Reply #4 on: April 14, 2023, 10:07:27 am »
@The Martian

you could also try Automated builds for Mono only: https://lxnt.wtf/oxem/#/MapView by Stoddard.

sort by Time column to find the latest:
MapView-4bceb665-2022-10-11-mono.7z 10/10/22 6:50 PM 494 Kib

https://github.com/kevL/OpenXCOM.Tools/tree/master/Distribution

Stoddard set up automated builds against my repo ... but see notes at the Distribution link above.

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11705
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Trying to add new alien craft.
« Reply #5 on: April 14, 2023, 10:15:54 am »
Meanwhile, here is the routes file.

I did my best to emulate the TFTD routing style, which means (among other things) that there are no routes leading away from the UFO. Apparently this is how TFTD maps operate.

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: Trying to add new alien craft.
« Reply #6 on: April 15, 2023, 07:09:00 am »
I think I've got MapView2 working how do I load a new map into it?

Spoiler:

I tried dropping UFO_GT0006.RMP & UFO_GT0006.MAP into the /TFTD/ROUTES/ & /TFTD/MAP/ folders but they don't seem to be appearing in the "tftdShips -> USO" file tree on the "Map Editor" window.

you could also try Automated builds for Mono only: https://lxnt.wtf/oxem/#/MapView by Stoddard.
Thank you I'll use Stoddard's mono build as a backup if Wine fails.

So far everything seems to be working but it is great to have more options.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: Trying to add new alien craft.
« Reply #7 on: April 15, 2023, 08:15:07 am »
I think I've got MapView2 working how do I load a new map into it?

I tried dropping UFO_GT0006.RMP & UFO_GT0006.MAP into the /TFTD/ROUTES/ & /TFTD/MAP/ folders but they don't seem to be appearing in the "tftdShips -> USO" file tree on the "Map Editor" window.

rightclick in the MapTree brings up a menu. (select the node you want to adjust, before choosing an action)

The thing to get used to is that there are 3 levels (of nodes) in the MapTree

GROUP -> CATEGORY -> TILESET (or Map)

so at Group-level you can add a Category, and at Category-level a Map/Tileset can be added ...

Add Tileset brings up the Tileset editor -- that's where your custom stuff gets added (take your time and feel free to ask Solarius questions ;)


iirc, Solarius likes to edit MapTilesets.yml in the /settings folder manually ... but the TilesetEditor ought work ok as well ...


btw, in TopView i notice you're getting blacked quadrants. Could try turning on UseMono in MainView's Options,

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11705
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Trying to add new alien craft.
« Reply #8 on: April 15, 2023, 12:51:55 pm »
Well, I'll be blunt: adding files from the interface scares me... Don't get me wrong,I'm sure it works just fine, but I won't allow a program to organise my data without any control, and also obviously without anchors. ;) It's a way for me to mentally follow what I'm doing.

Also, learning the quirks of the process is wasted mental energy. Just like using Windows 10 is way more confusing than Windows 95, because it does everything automatically, in the background, and not the way I want.

Adding a map in the text file is super easy and nice by comparison.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: Trying to add new alien craft.
« Reply #9 on: April 15, 2023, 03:35:26 pm »
absolutely. If the shoe fits wear it

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11705
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Trying to add new alien craft.
« Reply #10 on: April 15, 2023, 05:47:18 pm »
For those who prefer to type things directly into the ruleset, like me, here's the anatomy of an entry:

Code: [Select]
  - type: URBAN00        <-- map block
    terrains:            <-- which tilesets are used and in which order
      - ROADS
      - URBITS
      - URBAN
      - FRNITURE
    category: Urban      <-- subcategory; usually a particular terrain, like city. jungle, alien base, etc.; you can define new ones as you wish
    group: UFO - Terrain <-- general category; normally it's UFO ships, UFO terrain, TFTD ships and TFTD terrain, but you can make new ones if you like



ADDENDUM:
Note that every map block is declared independently, so each block needs to repeat all the definitions. This really bloats the file and makes it hard to read, so I prefer to use something called anchors. It's not a MapView specific thing, but a general YAML feature. It looks like this:


Code: [Select]
  - type: URBAN00
    terrains: &Urban
      - ROADS
      - URBITS
      - URBAN
      - FRNITURE
    category: Urban
    group: UFO - Terrain
  - type: URBAN01
    terrains: *Urban
    category: Urban
    group: UFO - Terrain
  - type: URBAN02
    terrains: *Urban
    category: Urban
    group: UFO - Terrain
  - type: URBAN03
    terrains: *Urban
    category: Urban
    group: UFO - Terrain
  - type: URBAN04
    terrains: *Urban
    category: Urban
    group: UFO - Terrain

The part starting with "&" marks the anchor's definition, and the parts starting with "*" refer to it. With this, the entire "terrains:" part is automatically copied to all places where it's needed. Make sure to set the anchor on your FIRST instance, as the engine can't look up, only down.

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: Trying to add new alien craft.
« Reply #11 on: April 16, 2023, 12:44:34 am »
alternately, the TilesetEditor

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: Trying to add new alien craft.
« Reply #12 on: April 17, 2023, 09:28:02 am »
btw, in TopView i notice you're getting blacked quadrants. Could try turning on UseMono in MainView's Options,

Selecting "UseMono: True" does display the previously blacked out images correctly. However it also causes the program to run at what feels like 1 frame per 60 seconds. (I tried Stoddard's build but the result was the same.)

I think I can work around it for now using the "UseMono: False" setting even with the graphical errors as the only effected areas seem to be the 'Floor' 'West' 'North' 'Content' 'Part' icons in the "Top/Route Views" and the "TopView" windows.

Is this tile normally black in the "TileView" because it fills the currently selected tile with nothing leaving it empty/blank or is it a graphical error caused by me not using the Mono = True setting?
Spoiler:


To confirm if I understand the RouteView controls correctly, to place and link alien movement nodes:
. Right click an empty tile to create a new node.
. Select one of the Link1 through Link5 options
. Assign "Dest" to the number of another existing Node.
. Assign "Unit" to the type (Or any if all aliens) are able to move from the selected node to that "Dest" node.
. In the "Node data" settings assign it a "Patrol Priority" of at least 1 so that the alien has a chance of wanting to vist that node from other nodes.
. Aliens may now choose to move from the selected node, configuration is complete and up to 4 (5 total) other nodes can be linked from the selected node.


And to make the Node a spawn point for an alien unit:
. Select an existing node.
. In "Node data" select "Node Rank" and assign it the value of the rank of alien to be spawned from the alienRaces: .rul file.
. So long as "Spawn Weight" is set to greater than 0 that tile 'could' be used to place one of the aliens of that type.

Do I need to make sure each node links to another node without going through walls or solid objects, or will aliens automatically path around everything to get to the other linked node?


To make sure I'm understanding this correctly as an example I've altered UFO_GT0006-1.RMP from this:
Spoiler:

to this: (Here is the edited route file: UFO_GT0006-2.RMP)
Spoiler:

With this new node between the two alien crafts aliens can choose to move to from node 1 or node 6 to node 49.

Have I done this correctly?
(Node 49: Link1 = 1, Link2 = 6)
(Node 1: Link4 = 49)
(Node 6: Link5 = 49)

The part starting with "&" marks the anchor's definition, and the parts starting with "*" refer to it. With this, the entire "terrains:" part is automatically copied to all places where it's needed. Make sure to set the anchor on your FIRST instance, as the engine can't look up, only down.

The "&" "*" method looks very useful. I was only aware of using refNode: to do something like this:
Code: [Select]
items:

  - &STR_EXAMPLE_ITEM
    type: STR_EXAMPLE_ITEM


  - type: STR_DUPLICATED_SECOND_EXAMPLE_ITEM
    refNode: STR_EXAMPLE_ITEM

If I understand correctly the contents of the "terrains:" list is the only thing being duplicated when "terrains: *Urban" is written elsewhere in the code. It isn't also duplicating these lines:
Code: [Select]
    category: Urban
    group: UFO - Terrain

Can I use this in any YAML .rul file wherever a list was going to be?

For example instead of creating three different weapons like this:
Code: [Select]
items:

  - type: STR_EXAMPLE_WEAPON_01
    compatibleAmmo:
      - STR_AMMO_A
      - STR_AMMO_B
      - STR_AMMO_C

  - type: STR_EXAMPLE_WEAPON_02
    compatibleAmmo:
      - STR_AMMO_A
      - STR_AMMO_B
      - STR_AMMO_C

  - type: STR_EXAMPLE_WEAPON_03
    compatibleAmmo:
      - STR_AMMO_A
      - STR_AMMO_B
      - STR_AMMO_C

It could be written like this:
Code: [Select]
items:

  - type: STR_EXAMPLE_WEAPON_01
    compatibleAmmo: &StandardAmmoTemplate
      - STR_AMMO_A
      - STR_AMMO_B
      - STR_AMMO_C

  - type: STR_EXAMPLE_WEAPON_02
    compatibleAmmo: *StandardAmmoTemplate

  - type: STR_EXAMPLE_WEAPON_03
    compatibleAmmo: *StandardAmmoTemplate
« Last Edit: April 17, 2023, 09:31:04 am by The Martian »

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: Trying to add new alien craft.
« Reply #13 on: April 17, 2023, 10:15:17 pm »
Selecting "UseMono: True" does display the previously blacked out images correctly. However it also causes the program to run at what feels like 1 frame per 60 seconds. (I tried Stoddard's build but the result was the same.)

I think I can work around it for now using the "UseMono: False" setting even with the graphical errors as the only effected areas seem to be the 'Floor' 'West' 'North' 'Content' 'Part' icons in the "Top/Route Views" and the "TopView" windows.

/* snip */ Is this tile normally black in the "TileView" because it fills the currently selected tile with nothing leaving it empty/blank or is it a graphical error caused by me not using the Mono = True setting?

The black sprite in TileView is the eraser (nul part). That sprite is part of the same monotone spriteset that the (black) quadrant-parts are in TopView -- the spriteset is internal (hardcoded). So it's just a graphical error. I'll take a closer look to see if i can see what's making that spriteset so 'special' ...

As long as those quadrants show the actual part-sprites once you click on (select) a tile proper, you should be okay. The (black) sprites in the monotone spriteset are just markers/placeholders ...

Quote
To confirm if I understand the RouteView controls correctly, to place and link alien movement nodes:
. Right click an empty tile to create a new node.
. Select one of the Link1 through Link5 options
. Assign "Dest" to the number of another existing Node.
. Assign "Unit" to the type (Or any if all aliens) are able to move from the selected node to that "Dest" node.
. In the "Node data" settings assign it a "Patrol Priority" of at least 1 so that the alien has a chance of wanting to vist that node from other nodes.
. Aliens may now choose to move from the selected node, configuration is complete and up to 4 (5 total) other nodes can be linked from the selected node.


And to make the Node a spawn point for an alien unit:
. Select an existing node.
. In "Node data" select "Node Rank" and assign it the value of the rank of alien to be spawned from the alienRaces: .rul file.
. So long as "Spawn Weight" is set to greater than 0 that tile 'could' be used to place one of the aliens of that type.

sounds reasonable. Solarius has a more practical understanding of routes and map-making so ...

One thing I am wary of when making routes, however, is that large units, which occupy four tiles, need space to spawn and move. The node(s) they spawn at and want to move to seems to be their upper left quadrant, so try to ensure that nodes for large units have the other three tiles unobstructed.

eg. don't let large units try to walk down (or spawn in) singlefile corridors,

Other than that, the nuances of the rules get kinda obscure, and I suspect that experienced modders just try things within reason until they like what works

Quote
Do I need to make sure each node links to another node without going through walls or solid objects, or will aliens automatically path around everything to get to the other linked node?

I believe they'll find a path ... with the caveats above.

Quote
With this new node between the two alien crafts aliens can choose to move to from node 1 or node 6 to node 49.

Have I done this correctly?
(Node 49: Link1 = 1, Link2 = 6)
(Node 1: Link4 = 49)
(Node 6: Link5 = 49)

it's likely all good -- have a look at the routes of some other Maps to get a feel for it ...

----
yaml ptrs are not my dep't :|

Offline The Martian

  • Commander
  • *****
  • Posts: 754
  • "It implores you to listen to its arguments..."
    • View Profile
Re: Trying to add new alien craft.
« Reply #14 on: April 18, 2023, 12:00:23 pm »
Thank you KevL, I appreciate the screenshot:


Here is the edited map and route files for Wolwerin's Double Scout (GT0005)
Spoiler:
UFO_GT0005-3.MAP
UFO_GT0005-3.RMP

Code: [Select]
    terrains:
      - UEXT2
      - UEXT3
      - UINT1
      - UINT2
      - UINT3

If I've done this correctly the map now supports this many spawn points inside the alien craft:
Soldiers: 5
Squad Leader: 1
Medics: 1
Technician: 1
Leader/Commander: 2
Terror #1: 1
Terror #2: 1
Spoiler:

I've also made it so that if Terror units #1 or #2 are used for a flying unit it will move to a patrol pattern above the ship.


Do I need to set "Patrol Priority" to "1 : Lo" for every node or can I leave them at "0 : LoLo" and still have the AI use them? (UFO_GT0005-3 is setup to use "1 : Lo" for almost all the nodes.)
« Last Edit: April 18, 2023, 12:34:38 pm by The Martian »