How does 5D space work?

Have a question, suggestion, or comment about Aleph One's features and functionality (Lua, MML, the engine itself, etc)? Post such topics here.
Post Reply
Qweasy908
Born on Board
Posts: 24
Joined: Jul 18th '18, 22:45

I'm trying to figure out how portal rendering makes 5D space possible. Where in the Aleph One source code are the parts that make 5D space happen? I want to know why the space inside each polygon is separate from other polygons.
User avatar
treellama
Vidmaster
Posts: 6107
Joined: Jun 2nd '06, 02:05
Location: Pittsburgh
Contact:

Basically, everywhere in the source. Any time you specify an object's location, it is x / y / z / polygon (then time would be the 5th dimension). This affects monster AI, sound, etc. Not just rendering.
User avatar
Pfhorrest
Vidmaster
Posts: 1825
Joined: Oct 12th '07, 22:08
Location: California
Contact:

and the "how does portal rendering help" answer is that any time you look across multiple polygons, you're looking through a portal on the edge of each polygon into the adjacent polygons, etc, so it doesn't matter if another polygon occupies the same 3D location, if the line from you to that 3D location doesn't pass through an edge of the poly you're in into another poly connected at an edge to another connected to that and so on, you won't end up seeing through to that unconnected polygon even though you "should" if all that mattered was 3D geometry. so you can have two different paths from one place to another place, through two different chains of connected polygons, ending up at two different polygons in the same place, but because neither of those end polygons is directly connected to the other, you don't see one of them from the other.
User avatar
ravenshining
Vidmaster
Posts: 889
Joined: Jun 17th '17, 22:50
Location: Hawai'i

Those are perhaps the best explanations I've heard :-)

I might add that when two polygons share a line, they must be on opposite sides of that line. Otherwise, although it will load and render, this happens when something hits that side:

Code: Select all

alephone: map.cpp:1429: short int find_adjacent_side(short int, short int): Assertion `line->counterclockwise_polygon_owner==polygon_index' failed.
And this is why we're able to have 5-D space, but not 3-D features like bridges. I imagine a portal engine written to allow for this could have both, but I think ours relies heavily on the fact that there can only be one polygon on the other side of a line- basically, it maps the polygons out in 2 dimensions and then adds height effects, which is why we call also call it a 2.5D engine.
Qweasy908
Born on Board
Posts: 24
Joined: Jul 18th '18, 22:45

Thanks for all the information. I've got plans to make a map viewer when I understand the source code.
Post Reply