BZ-Next WebGL2 Map Viewer & Editor (Desktop version available)
Posted: Fri Feb 16, 2024 1:03 pm
I adapted my new BZFlag renderer into a basic map viewer and editor that uses WebGL2 and ImGUI to allow you to load, preview, and edit maps, all in the browser.
The prototype is online at https://bz-next.github.io/mapviewer3/mapviewer.html
The editor supports most advanced map features, like meshes, materials, animated materials (texture matrix, dynamic color, etc), drawInfo meshes (with the exception of angvel).
It will automatically fetch textures from images.bzflag.org. (Thank you blast for enabling this on the images.bzflag.org server-side.)
If your map uses textures from another site, they will not load in the online editor. I am making a desktop version of the editor that will not have this limitation, to be released soon. Also, please make sure your map doesn't use includes, as you can only upload a single file at a time. If your map uses includes, you can just copy/paste the includes directly into the .bzw file to use it with this tool.
To do:
- Error messages in a messages window in the app, rather than just in the JS console
- Fix an issue where certain maps don't generate the default teleporter material
- Finish porting the latest updates to the desktop version
- Add copy/paste to/from the browser (currently the clipboard is confined to the WebGL window, so you can copy/paste within the app, but it doesn't grab stuff currently in your main clipboard.)
- Some textures on images.bzflag.org have weird formats. The formats that are currently supported are PNGs with pixel formats RGB8Unorm, RGBA8Unorm, RGB16Unorm, RG8Unorm (second channel as alpha), R8Unorm (monochrome, no alpha). If a texture doesn't match one of these formats, it will currently fail to load. If there are any other weird formats on images.bzflag.org, I'll write a converter for them.
- Add a built-in list of openly licensed, popular maps. That way it could function as a kind of map archive too.
- Explore using the docking version of imgui, which could allow a more integrated blender-like UI with panels that snap to window edges and stuff.
- Search and find/replace in the editor.
It also serves as a tech demo of the bz-next project (https://bz-next.github.io) which is focused on providing a new, modern renderer for BZFlag, hacking on the codebase to enable the new renderer, enhancing cross-platform support, and just generally trying to modernize the game. The focus of the project is to provide essential infrastructure and tools to allow developers to build new features, and to get a version of the game based on the new renderer into a playable state.
The prototype is online at https://bz-next.github.io/mapviewer3/mapviewer.html
The editor supports most advanced map features, like meshes, materials, animated materials (texture matrix, dynamic color, etc), drawInfo meshes (with the exception of angvel).
It will automatically fetch textures from images.bzflag.org. (Thank you blast for enabling this on the images.bzflag.org server-side.)
If your map uses textures from another site, they will not load in the online editor. I am making a desktop version of the editor that will not have this limitation, to be released soon. Also, please make sure your map doesn't use includes, as you can only upload a single file at a time. If your map uses includes, you can just copy/paste the includes directly into the .bzw file to use it with this tool.
To do:
- Error messages in a messages window in the app, rather than just in the JS console
- Fix an issue where certain maps don't generate the default teleporter material
- Finish porting the latest updates to the desktop version
- Add copy/paste to/from the browser (currently the clipboard is confined to the WebGL window, so you can copy/paste within the app, but it doesn't grab stuff currently in your main clipboard.)
- Some textures on images.bzflag.org have weird formats. The formats that are currently supported are PNGs with pixel formats RGB8Unorm, RGBA8Unorm, RGB16Unorm, RG8Unorm (second channel as alpha), R8Unorm (monochrome, no alpha). If a texture doesn't match one of these formats, it will currently fail to load. If there are any other weird formats on images.bzflag.org, I'll write a converter for them.
- Add a built-in list of openly licensed, popular maps. That way it could function as a kind of map archive too.
- Explore using the docking version of imgui, which could allow a more integrated blender-like UI with panels that snap to window edges and stuff.
- Search and find/replace in the editor.
It also serves as a tech demo of the bz-next project (https://bz-next.github.io) which is focused on providing a new, modern renderer for BZFlag, hacking on the codebase to enable the new renderer, enhancing cross-platform support, and just generally trying to modernize the game. The focus of the project is to provide essential infrastructure and tools to allow developers to build new features, and to get a version of the game based on the new renderer into a playable state.