Creating your first Cell

From RPG Creation Kit
Jump to navigation Jump to search

In this tutorial we're going to create a new Cell, in particular, a new Interior Cell. It will represent the Interior of a shack situated in the Cell "Virrihael(0,-2)".

Primer on Cells

In this section we're going to quickly analyze how a Cell is composed.

Focus on the "Cell View" window and select as Worldpsace "Virrhael", then load the Cell with ID "Virrihael(0,2)".

The first thing that you should notice straight away, it's that it is the Cell present in the demo, and more in particular it's the house we go and search with Ryan in the Demo, during the quest "The Southern Harvest", playable by joining The King's faction. You can notice it is an Exterior Cell, because it's a Cell that is a tile of a bigger world.


Let's take a look in the Hierarchy. Every cell is composed of at least those GameObject:

  • CellInfo: Contains the script responsaible for storing the Information of a Cell, such as the Cell file, the Cell Entry, all the doors, paths, Action Points etc. present in the Cell.
  • Entry: Represents the Entry Point of the cell, it is usually always in the middle of it.
  • Structures: Is just a GameObject that contains every structure of the Cell, such as houses, Items in World, props and so on and so forth.
  • Paths: Contains all the NPC Paths present in this Cell.
  • AI_Container: Contains all the AI placed in this cell.
  • CreatedItemsT: Is just a GameObject that will contain every item the Player will create inside this cell by dropping them into the Inventory or dragging them to this cell from others.
  • Navmesh: Is the GameObject who has the Component responsabile to generating the Navmesh of the cell.


Now I want to say something that you should take as a rule, you should always have few GameObject in the root of your scene. Just as it happens here, the scene is composed of 11 "father" GameObject, and every other GameObject is a child of one of those 11. You should always keep your "father" GameObjects count low and put everything else inside them, for both having the Scenes tidy and ordered but most importantly because some Editor code will reference to that, and the loading times for some action will take longer if the Scene is disorganized.

Doors and Cells

The Door inside the "Virrihael(0,2)" cell that will bring the Player into another Interior Cell.

Great, now if you take a closer look at the Cell, you will notice that on the House's door, there is a white box with an arrow. You're in the presence of a Door, a connection between Cells and Worldspaces. Every Door has a white box that represents where the Player or NPC will spawn when the opposite door is used. That is the "Door Teleport Marker". Make sure to read the Door article before going forward.

Now click on the door and take a look at the "Door" component.

We're interested in the "Door Teleport" section, you can see that this door is used to Teleport who uses it to another Cell, and this cell is "[CELL] Virrihael02_VerasFarmhouse".

Now look at the bottom the "Door Link" section, here you'll see (and set) what is the opposite door, what is its ID and if you click on "View Linked Door", the Editor will open the connected Cell and bring you immediatly there.

The connected Interior Cell to the door we've analyzed, loaded in the Editor with the "View Linked Door" button.


Perfect, we're able to switch back and forth Cells & Worldspaces. Notice that in the Interior Cell the structure is the same, there are few father GameObjects and everything is else is a child of them.

Play a little bit with it, maybe load the cell "Virrihael(0,0)" go in the City and try to enter a few Interiors.

⠀⠀

⠀⠀

⠀⠀

⠀⠀

Creating a New Cell

In this section we will actually create a new cell, there are two ways you can do that, creating a new cell from scratch or duplicating an existing one.

I'm gonna show here how to do it by duplication, since it will allow us to already have the house interior 3d models and collisions.The Cell we are going to duplicate is the Inteiror we just saw, the "Veras Farmhouse".