Creating a map converter

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
Cyborg
Posts: 86
Joined: Jul 18th '18, 22:45

I'm trying to make a map converter that changes lines to planes for my new portal renderer.
I modified the OBJ exporter from Weland to get the vertices and indexes of the vertices.
A plane is vertices going around in clockwise order with a front and a back.
A plane has two sides like a line.
Save the geometry of the walls and floors and save the portals.
What I've made is a text file loader that puts the data into lists and saves it then loads it and creates everything.
It would be easier if I could automatically create the data.
I know how to create the vertices and triangles.
I don't know how to get the textures and normals.
The way it will work is to make the line a plane then if the polygon owner is a solid line then create the side.
Polygons become sectors and lines become planes.
User avatar
Meerjel01
Mjolnir Mark IV
Posts: 422
Joined: Nov 4th '17, 09:59

Hello. I was gonna DM you about something similar to this. But for my Homebrew Xbox engines. As in convert a simple text file with vertex and sector details into a map. Since you've asked this just recently I add this up.
Qweasy908
Cyborg
Posts: 86
Joined: Jul 18th '18, 22:45

Meerjel01 wrote: Sep 12th '23, 15:23 Hello. I was gonna DM you about something similar to this. But for my Homebrew Xbox engines. As in convert a simple text file with vertex and sector details into a map. Since you've asked this just recently I add this up.
The text is a JSON file with vector3 and ints for lists of classes.

The JSON file saves the basic information of your class.
In C++ you can use a library to make a JSON file.
You make a class to hold the data.
I'm still studying OpenGL, but I have some idea to check if a side is visible then send its data to the graphics card.

To make the lists I made the class in a list one at a time then saved it to a JSON file.
User avatar
Meerjel01
Mjolnir Mark IV
Posts: 422
Joined: Nov 4th '17, 09:59

I actually meant for my own engine using a custom file format. I usually does that. I can cook up an example and show if needed.
Qweasy908
Cyborg
Posts: 86
Joined: Jul 18th '18, 22:45

I know how everything works in Unity C# and now I want to make the portal renderer with OpenGL.
Qweasy908
Cyborg
Posts: 86
Joined: Jul 18th '18, 22:45

Meerjel01 wrote: Sep 12th '23, 19:56 I actually meant for my own engine using a custom file format. I usually does that. I can cook up an example and show if needed.
How do you make a custom file format?

I've been using JSON text files.
Qweasy908
Cyborg
Posts: 86
Joined: Jul 18th '18, 22:45

Sorry, can you tell me how to make a custom file format or are you asking for what data the map converter saves?
User avatar
Meerjel01
Mjolnir Mark IV
Posts: 422
Joined: Nov 4th '17, 09:59

No I mean I'm making new engines using DirectX 8 on the OG Xbox and has a level generator idea similar to Marathon's except true 3D without portals. It's a retro engine that makes a map from a file with predefined coords for vertices, walls, sectors and uv settings. I think you can help with getting the code together as I don't know it myself.
Qweasy908
Cyborg
Posts: 86
Joined: Jul 18th '18, 22:45

Meerjel01 wrote: Sep 13th '23, 05:52 No I mean I'm making new engines using DirectX 8 on the OG Xbox and has a level generator idea similar to Marathon's except true 3D without portals. It's a retro engine that makes a map from a file with predefined coords for vertices, walls, sectors and uv settings. I think you can help with getting the code together as I don't know it myself.
Are you making a Marathon clone or a Halo clone?

Both games use portals.

You need portals to check for the visibility of a sector.
Sectors are used to reduce the amount of triangles the engine has to draw.
If you don't have portals then you are drawing the entire scene each frame.
You find the sector the player is in then draw that sector and begin checking the current sector portals for visibility of the adjacent sector.
To check if a portal is visible, you do a intersection test with the camera and the portal.
Marathon sectors are convex polyhedron that can use point in polyhedron.
Halo used a BSP tree to find the player and do rendering.

The reason why Marathon is convex is because I can put in planes for each side of the sector and it will not work if the sector is concave.

I know how to convert a 2D Marathon map to 3D, but the portals are important.
Qweasy908
Cyborg
Posts: 86
Joined: Jul 18th '18, 22:45

Meerjel01 wrote: Sep 13th '23, 05:52 No I mean I'm making new engines using DirectX 8 on the OG Xbox and has a level generator idea similar to Marathon's except true 3D without portals. It's a retro engine that makes a map from a file with predefined coords for vertices, walls, sectors and uv settings. I think you can help with getting the code together as I don't know it myself.
I don't exactly know how Direct X works, but I could research it and come up with a good structure for rendering triangles.
User avatar
Meerjel01
Mjolnir Mark IV
Posts: 422
Joined: Nov 4th '17, 09:59

Qweasy908 wrote: Sep 13th '23, 10:45 I don't exactly know how Direct X works, but I could research it and come up with a good structure for rendering triangles.
Thank you. I'll take your advice and go with portal rendering for the game. For the DirectX part, I can show an example mesh generation of it.
xbdev
Qweasy908
Cyborg
Posts: 86
Joined: Jul 18th '18, 22:45

Meerjel01 wrote: Sep 13th '23, 14:25
Qweasy908 wrote: Sep 13th '23, 10:45 I don't exactly know how Direct X works, but I could research it and come up with a good structure for rendering triangles.
Thank you. I'll take your advice and go with portal rendering for the game. For the DirectX part, I can show an example mesh generation of it.
xbdev
Marathon is Portal-based Occlusion Culling.

https://www.youtube.com/watch?v=8xgb-ZcZV9s

Study the different ways to do occlusion culling for your game.

Now for my Aleph One related question.

How does Aleph One build the map data?
deram_scholzara
Born on Board
Posts: 16
Joined: Apr 4th '11, 03:20
Location: Los Angeles, CA
Contact:

You're welcome to steal stuff from Forge+, which steals stuff from Weland to produce 3D geometry from maps in Unity (which you can then export to FBX from Unity Editor, if you want). Full geometry and texturing support - the only missing bit is that it doesn't generate "portal" side geometry, but you could probably modify the source to make those generate as well.

http://forgeplus.artleaping.com/

Most (all?) of the code you'd need to mess with is in this folder:
https://github.com/deramscholzara/Forge ... meSurfaces
Qweasy908
Cyborg
Posts: 86
Joined: Jul 18th '18, 22:45

deram_scholzara wrote: Feb 4th '24, 06:54 You're welcome to steal stuff from Forge+, which steals stuff from Weland to produce 3D geometry from maps in Unity (which you can then export to FBX from Unity Editor, if you want). Full geometry and texturing support - the only missing bit is that it doesn't generate "portal" side geometry, but you could probably modify the source to make those generate as well.

http://forgeplus.artleaping.com/

Most (all?) of the code you'd need to mess with is in this folder:
https://github.com/deramscholzara/Forge ... meSurfaces
Thanks, I'll use the GPL license.

I'm on a quest to create an advanced Marathon game.
Post Reply