Cell Types
From OPU Wiki
Wondered what those cell types exactly mean? This article will explain the concept to you.
| Table of contents |
What is a Cell Type?
In an Outpost 2 map, every single tile is assigned a 5 bit value, otherwise known as a cell type.
A cell type determines the speed and attributes of each tile. For example, plains are assigned a Passable cell type, while craters, ice, rocks, etc. are assigned Impassable cell types.
Cell types control everything from the speed of vehicles moving over the ground, to construction speeds, to the presence of tubes, walls, and rubble, and even blight growth speeds!
Assigning Cell Types
It used to be a common myth that the type of tile that was placed (e.g. sand tile) automatically carried a specific cell type with it. (For example, the belief was held that rocky plains always carried a cell type of Fast Passable 1). This is not true, and you must assign cell types manually for each tile.
Furthermore, it is totally possible, although not recommended, that you could make a cliff passable by setting parts of it to passable. Likewise you can make open land impassable.
The following table lists the different cell types.
Passable / zPad Cell Types
| Fast Passable 1 | rock / vegetation |
| Fast Passable 2 | rock plains |
| Medium Passable 1 | dirt / flat sand |
| Medium Passable 2 | lava rock (ancient flow) |
| Slow Passable 1 | dark lava rock (active flow) |
| Slow Passable 2 | rippled sand dunes / lava rock bumps |
| zPad 12..20 | None of the official maps used these, but it makes vehicles move insanely fast. (Faster than scouts) The lower the number, the faster the terrain. |
Impassable Cell Types
| Impassable 1 | rock / lava rock mound / ice / volcano (weak weapons can't fire over) |
| Impassable 2 | craters / cracks / crevasses (weak weapons can fire over) |
| North Cliffs | should be used on cliff tiles that slope toward the top of the map |
| Cliffs - High Side | should be used on the higher layer of cliff tiles (on the cliffs which are 2 tiles high) |
| Cliffs - Low Side | should be used on the lower layer of cliff tiles (on 2 tile high cliffs) |
Miscellaneous Cell Types
Note: None of these cell types are normally found in a .map file. They are generally used in saved game files (which have a very similar structure to .map files) to indicate to the game which tiles have been altered by putting tubes, walls, fumaroles, etc.
| Vents and Fumaroles | indicates a magma vent / fumarole (you should never have to use this. The game sets this automatically when a vent or fumarole is created) |
| Dozed Area | indicates bulldozed terrain, and thus the land has the movement characteristics as such |
| Rubble | indicates rubble pieces |
| Normal Wall | indicates land which contains a Concrete Wall |
| Microbe Wall | indicates a Microbe / Blight Wall |
| Lava Wall | indicates a Lava Wall |
| Tube0..6 | indicates a tube. Terrain underneath buildings get the Tube0 cell type assigned. All tubes use Tube0 cell type, it isn't apparent what the "extra" types are for. |
Caveats and "Features"
- Setting land to one of the miscellaneous types, to try and get a wall, tube, etc pre placed, doesn't always work. However: You can predefine a wall, tube, or other feature by setting the correct tile image, and then setting the appropriate cell type. For example, if you place an image of a normal wall on the map, and then set the cell type to Normal Wall, you will get a wall in game. The same works for rubble and tubes. However you may wish to leave the cell type as it would be normally (without the object on the ground), and set the object at runtime in your mission.
- You must leave the entire bottom row of terrain on your map at I1 (impassable). If you change this, the game will crash if any game objects move into that area!
- It is preferable to set impassable and cliff types correctly. Check already-made maps to see how it's done. (Blight and weapons fire works odd otherwise, because of the way blight growth "spills" over cliffs).
- Avoid using the fumarole type if you can -- it isn't necessary as CreateBeacon automatically sets it. Likewise, it is unnecessary to tube underneath a building, because CreateUnit automatically does it.
- Use Tube0 for tube types if you are defining tubes in the map file. However you can use CreateWall to create tubes in the DLL file. (OP2Helper.h also defines a function that makes tube creation easier)
- You can use
GameMap::GetCellTypeandGameMap::SetCellTypein code to get and set the cell types. See the CellTypes enum for a list of the different values.
Hopefully, this article will have served to explain what cell types are and how to use them!
