CodeWalrus

Featured Member Projects => Completed and Inactive Projects => [Inactive] X3D (TI-89/92+/v200/Nspire/PC) => Topic started by: catastropher on December 30, 2016, 09:09:31 PM

Title: XBuilder - A Level Editor for X3D
Post by: catastropher on December 30, 2016, 09:09:31 PM
So one of the things that's made developing anything for X3D difficult is the lack of tools. So, I've been working on a new level editor called XBuilder! It will provide GUI tools for easily making levels. It'll also handle a number of tasks (such as building light maps) that are currently done by the engine itself. This will greatly reduce the complexity of X3D's source code. Originally, it was just going to be an X3D application, but now I'm integrating in ImGui so it'll have a real GUI. Here are a few screenshots of what I have so far. Anything in red is geometry that already exists, blue means it's selected, and gray means it's a preview of what the resulting geometry would be. Also notice that it supports input in different distance units:

[spoiler=XBuilder]
(https://img.ourl.ca/xbuilder1.png)

(https://img.ourl.ca/xbuilder2.png)

(https://img.ourl.ca/xbuilder3.png)
[/spoiler]

The source is of course on github. I'm going to be adding several more tools in the coming weeks. I'm going to need alpha testers so please let me know if you're interested! For the time being, I'm going to work on the texture tool so you can put a texture on a face :D
Title: Re: XBuilder - A Level Editor for X3D
Post by: Dream of Omnimaga on December 31, 2016, 06:22:55 AM
Nice to see an editor and level maker. Will we be able to import textures directly in it by the way? X3D is coming along pretty nicely :3=
Title: Re: XBuilder - A Level Editor for X3D
Post by: catastropher on January 01, 2017, 07:16:34 AM
Quote from: DJ Omnimaga on December 31, 2016, 06:22:55 AM
Nice to see an editor and level maker. Will we be able to import textures directly in it by the way? X3D is coming along pretty nicely :3=
Thanks! Indeed, textures can be imported into it directly (though they shouldn't be bigger than 128x128 for speed reasons!) Phase one of texture editing is done: you can now import textures and select a texture from a texture picker I created. Here's a screenshot with a bunch of textures I stole from a quake texture pack:

[spoiler=Texture Picker](https://img.ourl.ca/xbuilder-texture.png)[/spoiler]

The next phase is actually being able to attach a texture to a wall! This will require modifications to the level format, a new tool for the GUI, and various other changes. I'll post an update when I have it working! :D
Title: Re: XBuilder - A Level Editor for X3D
Post by: Dream of Omnimaga on January 02, 2017, 03:11:01 AM
Awesome! I definitively can't wait to give this a try :) (with my own textures too)
Title: Re: XBuilder - A Level Editor for X3D
Post by: catastropher on January 16, 2017, 02:53:33 AM
I finally got the primary texture tool working! :D It allows you to put textures on the walls and adjust the following parameters:
This comes as part of a huge upgrade to how X3D does texture mapping. Instead of having separate wall textures, decal textures, lightmaps, etc, everything gets built into one combined "surface" for each wall. I will make a post later on explaining why surfaces are awesome, but for now, here are some screenshots of the primary texture tool:

[spoiler=Primary Texture Tool]
Outside the level:
(https://img.ourl.ca/xbuilder-surface1.png)

Top down:
(https://img.ourl.ca/xbuilder-surface3.png)

Inside looking up:
(https://img.ourl.ca/xbuilder-surface2.png)
[/spoiler]
Next up is working on putting decal textures on wall e.g. an Aperture Science logo :D After that, I'll be writing a new lightmap compiler and updating the surface rendering to do perspective-correction every 16 pixels. I'll post an update when I have more!
Title: Re: XBuilder - A Level Editor for X3D
Post by: Dream of Omnimaga on January 16, 2017, 05:58:00 AM
By having everything into one combined surface for each wall, does this mean this take more RAM? Because that could be problematic on lower-end platforms such as the TI-84 Plus CE if you ever decided to port X3D to them. Or is it just for the editor?

Nice to see new progress :)
Title: Re: XBuilder - A Level Editor for X3D
Post by: catastropher on January 16, 2017, 06:10:07 AM
Indeed, each surface will take more RAM. However, I'm taking the approach that Quake did: surface caching. When the level first loads, none of the surfaces are built. When a wall is seen, the surface is built and cached. In subsequent frames, the cached version of the texture is used. If the wall hasn't been seen for a few frames though, the memory is released. As only a portion of the walls are ever visible at any given moment, the memory penalty shouldn't be too high. Quake reserved 500k for surface cache iirc. It's difficult to estimate how much memory will be necessary though... I'll have to experiment once I have a real level to play with :)
Title: Re: XBuilder - A Level Editor for X3D
Post by: Dream of Omnimaga on January 16, 2017, 06:12:10 AM
Maybe on lower-end platforms you could just use smaller textures? The PS1 and N64 often made use of low-res textures like this. The TI-84 Plus CE only has 150 KB of user RAM (I think 256 KB total?)
Title: Re: XBuilder - A Level Editor for X3D
Post by: TheMachine02 on January 16, 2017, 10:58:50 AM
Yeah I dont know if surface texture in the same way quake did could be possible. In my undrstanding it also add quite some work per pixel although this might come from the SBuffer. I would love to see X3D on CE though, keep up the good work !
Title: Re: XBuilder - A Level Editor for X3D
Post by: catastropher on January 20, 2017, 03:39:33 AM
Thanks guys! :D I'm going to take development one step at a time. First I'm going to get it to run, then I'll make it run fast and with low amounts of memory. For now though, I have an exciting new feature working: decal textures! In addition to being to put a primary texture on a wall, you can now add decal textures (such as Walrii and the Aperture logo in the screenshot below!)

[spoiler=XBuilder Decal Textures](https://img.ourl.ca/xbuilder-decal.png)[/spoiler]

I have many more exciting features in the works! Mwhahahah- *cough cough wheeze*
Title: Re: XBuilder - A Level Editor for X3D
Post by: Dream of Omnimaga on January 20, 2017, 06:05:59 AM
Are decals textures textures that only takes a part of a surface or are not necessarily bitmaps?. Also looks cool, as always

:3=