Do objects ever overlap recursively?
Posted: Sat Aug 25, 2012 2:57 am
Hi all,
I've got a slightly odd question about level design, as the answer will influence how the Camoto level editor works. This applies to other games too, as well as Keen.
Ignoring map layers, if you consider that a bunch of tiles represent an object (like a sign, or a platform), and some objects might appear behind or in front of others (like a sign appearing in front of the platform, because if the sign appears behind the platform you can't see it), do you ever have a situation where an object needs to appear in front of some objects, but behind the *same* set of objects? This is really hard to explain, so I will attempt a diagram:
Here you can see that A is at the bottom, B sits above, then C is on top. If you use a Z order, with each number representing a depth, A=0 (bottom), B=1 (mid) and C=2 (top). By way of a level example, A could be the level background, B could be a moving platform, and C could be some foreground wall in a secret area, which obscures the moving platform as it goes behind the wall.
But once you introduce D, this no longer works:
Where does D fit? It's above C, so the Z order should mean D=3. But that would mean it's also above A, which it isn't. So for situations like this, using a Z order number won't work.
So my question is this. Will this situation ever arise during level editing? Using a Z order number is very fast, but it will mean you cannot make levels where things overlap like in the above diagram. You will only ever be able to put objects entirely above or below other overlapping objects, like this, where D is entirely above or below, and not above *and* below at the same time.
I hope this makes sense!
I've got a slightly odd question about level design, as the answer will influence how the Camoto level editor works. This applies to other games too, as well as Keen.
Ignoring map layers, if you consider that a bunch of tiles represent an object (like a sign, or a platform), and some objects might appear behind or in front of others (like a sign appearing in front of the platform, because if the sign appears behind the platform you can't see it), do you ever have a situation where an object needs to appear in front of some objects, but behind the *same* set of objects? This is really hard to explain, so I will attempt a diagram:
Code: Select all
+---------+
| |
| A +-------+
| | |
+------| |
| B |
| |
+---------+ |
| |----+
| C |
| |
+---------+
But once you introduce D, this no longer works:
Code: Select all
+---------+
| |
+-----| A +-------+
| | | |
| +------| |
| D | | B |
| | | |
| |-------+ |
+-------+ |----+
| C |
| |
+---------+
So my question is this. Will this situation ever arise during level editing? Using a Z order number is very fast, but it will mean you cannot make levels where things overlap like in the above diagram. You will only ever be able to put objects entirely above or below other overlapping objects, like this, where D is entirely above or below, and not above *and* below at the same time.
Code: Select all
+---------+ +---------+
| | | |
+-------+ A +-------+ +-----| A +-------+
| | | | | | | |
| |----| | | +------| |
| D | | B | | D | | B |
| | | | | | | |
| |-------+ | | +---------+ |
+-------+ |----+ +-----| |----+
| C | | C |
| | | |
+---------+ +---------+