True Room Over Room Mapping Guide

From EDukeWiki
Revision as of 16:44, 5 April 2012 by Micky C (talk | contribs)
Jump to navigation Jump to search
Build/Mapster32 Map Editing


True Room Over Room is a feature new to EDuke32 that allows for the construction of sectors in a vertical arrangement. Other build games (Shadow Warrior, Blood, Redneck Rampage) are able to fake ROR by having sectors in different parts of the map and rendering them on top of each other, and EDuke32 has a similar feature using Sector Effectors. The difference between game ROR and TROR is that the sectors are physically on top of each other, making editing a lot easier and more automatic, while also making it easier to visualize what you're building. For the more technically minded, TROR is part of the engine and map format themselves, instead of an effect bolted on in the game code.


TROR Editing Modes

There are two modes you should be aware of before starting to build with TROR.

Side view (orthographic view) mode

This mode allows you see a 3D representation of your map while in 2D mode. This is toggled with [F3]. It can be rotated with the [Q] and [W] buttons, and the angle of viewing can be changed by pressing [A] and [Z]. This mode is absolutely essential not only because it allows you to actually see what you're doing, but because in order to properly use TROR, you need to designate which is the 'active' layer that new sectors will connect to.


This can be done in 2 ways.

The first way is to press [Ctrl-A] which will grey out all other layers except the one the viewpoint (the arrow in 2D/side view mode)is in, which is the active layer. You can move the view point up and down, allowing you to edit above and below layers, by either pressing [page up] and [page down] respectively, or more accurately by pressing down the [middle mouse button] and moving the mouse forward or backwards. This method is usually prefered as it gives you much more control over the vertical position of the viewpoint. If you find the greyed-out walls distracting, you can remove them altogether by pressing [Ctrl-Alt-A]

The second way allows for more precision as you can narrow the active editing range to the height of a single (or set of) sectors. Firstly, select the sector(s) that you want to be able to edit with [Right-Alt], and press [Ctrl-R]. It's as easy as that. Press [Ctrl-R] without having any sectors highlighted to unlock the range again and be able to edit them normally.


Invisible surfaces viewing mode

This is for 3D mode when you want to toggle seeing invisible objects. All you have to do to toggle this mode is press [I], which primarily allows you to see objects you've made invisible with [Quote-I]. However, the reason why it's so useful here, is that it also shows you the boundaries between TROR layers (which are invisible in-game). This is a huge benefit when you want to visualize/figure out what's actually going on. It also allows you to edit the TROR surfaces and apply transparent or masked floors, and edit characteristics like the blocking and hitscan bits.


Properties and Terminology

TROR is created by selecting a sector and extending it (this will be covered later in method). This means that it creates a new sector directly on top of or below the selected sector, which is exactly the same size and shape as the original. The ceiling of the bottom sector is linked with the floor of the top sector. It then makes sense that the extended sector is called an extension.


You can have more than one extension on a sector. You can extend it above and below, then take the bottom and extend that down again and again, and the same with the top. You are effectively stacking sectors on top of each other, so these sectors are part of a stack. The great thing about stacks (even with only one extension) is that if you move the vertex of a wall of one layer, it will automatically move the vertices of all the other layers, so that they're easy to change the shape of without worrying about breaking the connection.


You can highlight a group of sectors and extend them all at the same time so that there can be a single extension covering them all. This is useful because it saves walls, and you can still edit all the child sectors with ease. Now, as soon as you extend these sectors so that they share an extension, they all become a part of the same bunch.


If you take a room with a child sector in the middle, and extend everything upwards except the child layer, there will now be void space in the top layer where the child sector is. If you press [Ctrl-S] there to make it into a child sector in the top layer, you'll then find that you have a floating normal (non-TROR) sector between the two TROR layers that you can do with as you please. This is called an island. I suppose it's still an island even if you don't make it a child sector in the top layer but hey, now you can create floating sectors. These can potentially be glitchy if you're not using the polymer renderer, but we'll get onto that later.

TROR related keys

The following are a list of keys which are related to editing TROR. They can also be found in the mapster32 keyboard commands page

2D mode

E+CTRL sector extension prompt (sectors to extend must be highlighted)
E+CTRL make sandwich [needs better explanation]
E+CTRL punch loop through extension (loop points must be highlighted, e.g. with RSHIFT+LCTRL)

A+CTRL toggle auto-grayout of non-extended sectors
J+CTRL TROR-join sectors. The selection must consist of the two sets of sectors you wish to join.
U+CTRL Clear extension: delete the bunch (i.e. ceiling-floor connection) of the aimed-at sector's floor
PGUP/PGDN Change 'player' height in discrete steps in order to go through the different levels
TAB+CTRL Display one currently aimed at sector (of potentially many that lie under the mouse crosshair)
HOME and END as modifiers to AltGr: select all sectors whose floor's/ceiling's bunchnum equal the bunchnum of the aimed at sector (useful for further operations on whole bunches)

3D mode

I invisibility preview: toggle fake ROR texture on non-masked portals
LENTER+CTRL When aiming at an extended floor/ceiling, paste to all floors/ceilings of the bunch of the aimed at one
T, B and H work as with walls, though they set/toggle the bits only on one side


TROR Mapping Examples

Manhole Sewer Example

In this straightforward example, you're going to make a manhole that goes below a street, and some area around the end of the hole at the bottom.

1. Create the child sector where you want the manhole to be.

2. Highlight the sector with [Right-Alt].

3. Press [Ctrl-E]. Mapster will prompt you whether you want to extend up or down.

4. We want to extend down so press [Z] ([A] if you're extending up).

5. Go into side view mode with [F3], and move the viewpoint down until you're editing the bottom layer.

6. The child sector you created should now have a white boundary, with the street sectors above either greyed out or gone depending on your settings.

7. Now you can treat the manhole sector (the extension) as the very first room you've made on a new map. You can draw sectors on the side of it to attach some rooms there. If you go into 3D mode, you should be able to see that if you go down that manhole, there should now be some area at the bottom which overlaps the street. This was not previously possible without using some kind of cheap trick. Congratulations, you've just made TROR.


Retro-fitting via Joining Example

If you're absolutely clueless with the whole idea of extending, or you want to go back and retrofit some TROR into maps you've done in the past, there's a very easy way of joining them to form TROR. If you have two sectors that have the same shape, area, and external vertices have the same relative positions (essentially they're the same sector, at least as far as their edges are concerned), then all you have to do is highlight both sectors with [Right-Alt], and press [Ctrl-J] to join, the same as joining two sectors normally. It will then prompt you with a few questions such as which sector you want to have on top of the other, which sector(s) you want to move (doesn't matter most of the time), and whether you'd like to move all the connected non-TROR sectors as well (definitely yes).


The good thing about this method is that besides the questions you have to answer, mapster does everything automatically, it even moves the heights for you. Now there'll be a quick example of this method below.


1. Make a child sector in a larger sector and copy-paste it into void space.

2. Give the floor of the original child sector and the ceiling of the new sector the water texture.

3. Highlight both the child sector and new sector with [Right-Alt].

4. Press [Ctrl-J] and answer the simple questions.

5. You should end up with a TROR water sector just as you would via the extension method. You can now alter the transparency of the water to your preference.


Sandwiching and Sector Punching

It's possible and easy to create a new TROR layer between two TROR layers. All you have to do is highlight one of them, and extend it as you would normally, and it automatically adds a new layer in the middle.


It's also possible to easily create an island sector in the middle of a TROR sector. This is called sector punching, and mainly involves stamping a child sector into the sector below or above. Follow the example below.


1. Extend a sector downwards.

2. Create a child sector in the original sector.

3. Select the vertices of the child sector with [Right-Shift] or [R-Ctrl + R-Shift] and press [Ctrl-E] as though you're extending a sector.

4. It will prompt you whether to punch up or down, in this case, choose down and hit [Enter]. A sector identical in size, shape and position should now be in the bottom layer.

5. Point the mouse cursor at the child sector in the top layer and press [Ctrl-U]. It will prompt you whether you want to break the connection, and unless you press [Ctrl-U] accidentally, you usually do.

6. The child sector should now be a floating sector island. Have fun.


Note that [Ctrl-U] only breaks the connection of a single sector if that sector has been punched. Otherwise it'll break the connection of the entire bunch, which is usually bad.


Visual Glitches and Workarounds

Software renderer

Even though TROR sectors are already physically overlapping, the 8-bit software renderer still needs to render them separately, having to do an extra rendering pass for each additional TROR extension in view. Theoretically if you create a huge amount of extensions in the same area the framerate could potentially drop to unplayable levels, however this is far fetched and I wouldn't worry about it.


The real problem with the software renderer is HOM glitching. In each rendering pass, there can only be one area along the x-interval drawn. For example, if you have an island on the ground, the area between you and the island will be fine, but everything on the other side of the island will show HOM. Try it out yourself to see what I mean. Technically this means that TROR extensions cannot contain islands (although it's been kind of hacked in to do exta-extra passes to overcome this problem, I wouldn't rely on them for perfect drawing.)

However, this can be overcome by breaking up the sector surrounding the child sector, and extending each sector individually. This means there will be multiple drawing portals around the island instead of one big one, and none of the individual extensions would contain the island, hence it should draw fine.


This HOM doesn't just occur due to islands, it can also happen when part of a normal sector is jutting out into a TROR sector, this can be thought of here as a mini-island even though it's connected to something. Don't call it a mini-island, I only called it that to explain why it would cause that glitching. This means that TROR extensions should be convex, i.e if you draw a straight line through a TROR portal so that it leaves the sector, and then comes back, it is not convex (and is most likely due to something jutting out.) However if you draw a line through it and this does not happen, as is the case for a circle, square etc.. then it is convex, and should draw fine.


Polymer renderer

Masked floors and ceilings in polymer are always the last thing drawn on the screen. That means if you have a transparent surface such as a masked wall or sprite, it would cause everything all the TROR masked surfaces behind the transparent surface to stop being drawn and become invisible. There's no real work around for this, just try not to use masked walls or sprites with big transparent surfaces around TROR masked surfaces.


Other than that, polymer is by far the most stable renderer for TROR, and apart from what's written above, is 100% glitch free. Despite being slow sometimes, it is the renderer of choice for TROR. It works by drawing the entire scene, TROR and all in a single rendering pass.


Polymost renderer

The polymost renderer is bad, M'kay? It's like a comic relief in bad Hollywood films who can't do anything right. Don't use it.


Random Trivia

Extended sectors can be sloped, but the bunch has to be 1:1 in that case. I.e you can't have any child sectors within a sloped TROR sector.

Maps containing one or more TROR bunches are saved in a new map format (v9) since some fields had to be taken over: xrepeat is unavailable on TROR'ed floors and ceilings, and on walls it's lotag if the ceiling, and extra if the floor of the wall's sector is extended. When in-game, these get transferred to internal arrays though.

The system is supposed to be used for 'large-scale' RoR, as a rule of thumb each affected sector should be at least a Duke high [that's too strict though].