News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

dmap in RBDOOM-3-BFG

Started by nemyax, November 03, 2018, 06:03:29 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

nemyax

It looks like there's a complete implementation of the dmap compiler in RBDOOM-3-BFG (with mesh-to-BSP support no less!). But there aren't any makefiles for building a dmap executable. Is it even supposed to be a standalone executable, or is it an engine console command?
Has anyone tested compiling maps from brush-free polygon data?

trebor

I did this stuff years ago and never found time to document it.

You can convert any map from the old .map format to a new JSON based map format with the console command "convertMapToJSON game/<mapname>"

It will convert the brush and patch primitives to polygons that can be read into Blender. I wrote importers and exporters for Blender which are very very basic but allow to load the JSON file into Blender and export it back to RBDOOM without any los of data.
Converting brushes and patches to polygons is something that dmap already did. All I had to change was to tell dmap that it works with polygon based data.

Python supports JSON without the need of any libraries so getting this stuff into Blender was quite straightforward.

You can model maps in Blender and compile them with dmap in RBDOOM. Once they are compiled you can load them.
The only part that is still missing is that the AAS compiler has no clue about the new format as it still requires brushes.
It is something that could be fixed however I stopped working on RBDOOM because of lack of time.

Right now I'm porting RBDOOM to Vulkan with the help of the vkDoom 3 code by Dustin Land but this is more or less a learning excercise to get into Vulkan programming.

You can see how D3DM1 looks in Blender: https://imgur.com/a/GujrC8z

So instead of this brush data:

ersion 2
// entity 0
{
"classname" "worldspawn"
// primitive 0
{
brushDef3
{
  ( 0 0 -1 256 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_wall/lfwall27d" 0 0 0
  ( 0 0 1 -272 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_wall/lfwall27d" 0 0 0
  ( -1 0.0000001344 0 -192.0000152588 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_wall/lfwall27d" 0 0 0
  ( -0.0000001344 -1 0 -128.0000152588 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_wall/lfwall27d" 0 0 0
  ( 1 -0.0000001343 0 -191.9999389648 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_wall/lfwall27d" 0 0 0
  ( 0.0000001343 1 0 -256 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_wall/lfwall27d" 0 0 0
}
}
// primitive 1
{
brushDef3
{
  ( 0 0 -1 -16 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_wall/lfwall27b" 0 0 0
  ( 0 0 1 0 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_wall/lfwall27b" 0 0 0
  ( -1 0.0000001344 0 -192.0000152588 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_wall/lfwall27b" 0 0 0
  ( -0.0000001344 -1 0 -128.0000152588 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_wall/lfwall27b" 0 0 0
  ( 1 -0.0000001343 0 -191.9999389648 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_wall/lfwall27b" 0 0 0
  ( 0.0000001343 1 0 -256 ) ( ( 0.015625 0 0 ) ( 0 0.015625 0 ) ) "textures/base_wall/lfwall27b" 0 0 0
}
}
...
}
// entity 1
{
"classname" "info_player_start"
"name" "info_player_start_1"
"origin" "128 64 0"
"angle" "180"
}
// entity 2
{
"classname" "light"
"name" "light_2"
"origin" "-128 192 128"
"noshadows" "0"
"nospecular" "0"
"nodiffuse" "0"
"falloff" "0.000000"
"_color" "0.78 0.78 0.84"
"light_radius" "225 225 225"
}


it works with a format like this

{
"version": "3",
"entities":
[
{
"entity": "0",
"classname": "worldspawn",
"primitives":
[
{
"primitive": "0",
"original": "brush",
"verts":
[
{ "xyz": [192, -128, 256], "st": [-2, -2.998046875], "normal": [0.003921628, 0.003921628, -1] },
{ "xyz": [-192, -128, 256], "st": [-2, 3], "normal": [0.003921628, 0.003921628, -1] },
{ "xyz": [-192, 256, 256], "st": [4, 3], "normal": [0.003921628, 0.003921628, -1] },
{ "xyz": [192, 256, 256], "st": [4, -2.998046875], "normal": [0.003921628, 0.003921628, -1] },
{ "xyz": [-192, 256, 272], "st": [4, -2.998046875], "normal": [0.003921628, 0.003921628, 1] },
{ "xyz": [-192, -128, 272], "st": [-2, -2.998046875], "normal": [0.003921628, 0.003921628, 1] },
{ "xyz": [192, -128, 272], "st": [-2, 3], "normal": [0.003921628, 0.003921628, 1] },
{ "xyz": [192, 256, 272], "st": [4, 3], "normal": [0.003921628, 0.003921628, 1] },
{ "xyz": [-192, 256, 256], "st": [-4, -4], "normal": [-1, 0.003921628, 0.003921628] },
{ "xyz": [-192, -128, 256], "st": [1.9990234375, -4], "normal": [-1, 0.003921628, 0.003921628] },
{ "xyz": [-192, -128, 272], "st": [1.9990234375, -4.25], "normal": [-1, 0.003921628, 0.003921628] },
{ "xyz": [-192, 256, 272], "st": [-4, -4.25], "normal": [-1, 0.003921628, 0.003921628] },
{ "xyz": [-192, -128, 256], "st": [-3, -4], "normal": [0.003921628, -1, 0.003921628] },
{ "xyz": [192, -128, 256], "st": [3, -4], "normal": [0.003921628, -1, 0.003921628] },
{ "xyz": [192, -128, 272], "st": [3, -4.25], "normal": [0.003921628, -1, 0.003921628] },
{ "xyz": [-192, -128, 272], "st": [-3, -4.25], "normal": [0.003921628, -1, 0.003921628] },
{ "xyz": [192, -128, 256], "st": [-2, -4], "normal": [1, 0.003921628, 0.003921628] },
{ "xyz": [192, 256, 256], "st": [4, -4], "normal": [1, 0.003921628, 0.003921628] },
{ "xyz": [192, 256, 272], "st": [4, -4.25], "normal": [1, 0.003921628, 0.003921628] },
{ "xyz": [192, -128, 272], "st": [-2, -4.25], "normal": [1, 0.003921628, 0.003921628] },
{ "xyz": [192, 256, 256], "st": [-3, -4], "normal": [0.003921628, 1, 0.003921628] },
{ "xyz": [-192, 256, 256], "st": [2.998046875, -4], "normal": [0.003921628, 1, 0.003921628] },
{ "xyz": [-192, 256, 272], "st": [2.998046875, -4.25], "normal": [0.003921628, 1, 0.003921628] },
{ "xyz": [192, 256, 272], "st": [-3, -4.25], "normal": [0.003921628, 1, 0.003921628] }
],
"polygons":
[
{ "material": "textures/base_wall/lfwall27d", "indices": [0, 1, 2, 3] },
{ "material": "textures/base_wall/lfwall27d", "indices": [4, 5, 6, 7] },
{ "material": "textures/base_wall/lfwall27d", "indices": [8, 9, 10, 11] },
{ "material": "textures/base_wall/lfwall27d", "indices": [12, 13, 14, 15] },
{ "material": "textures/base_wall/lfwall27d", "indices": [16, 17, 18, 19] },
{ "material": "textures/base_wall/lfwall27d", "indices": [20, 21, 22, 23] }
]
},
...
{
"entity": "1",
"classname": "info_player_start",
"name": "info_player_start_1",
"origin": "128 64 0",
"angle": "180"
},
{
"entity": "2",
"classname": "light",
"name": "light_2",
"origin": "-128 192 128",
"noshadows": "0",
"nospecular": "0",
"nodiffuse": "0",
"falloff": "0.000000",
"_color": "0.78 0.78 0.84",
"light_radius": "225 225 225"
},
{
"entity": "5",
"classname": "light",
"name": "light_5",
"origin": "128 -64 128",
"noshadows": "0",
"nospecular": "0",
"nodiffuse": "0",
"falloff": "0",
"_color": "0.78 0.78 0.84",
"light_radius": "225 225 225"
}
]
}

nemyax

trebor
Thanks!

Quote from: trebor on November 03, 2018, 09:34:08 AMThe only part that is still missing is that the AAS compiler has no clue about the new format as it still requires brushes.
Is AAS only needed for multiplayer? Generally, is it right to say that you don't need a brush-based editor anymore to make your own singleplayer Doom 3 BFG maps?

Quote from: trebor on November 03, 2018, 09:34:08 AMI stopped working on RBDOOM because of lack of time.
Well I went with RBDOOM because it supports Linux. Discontinued or not, it's still a working engine.

Quote from: trebor on November 03, 2018, 09:34:08 AMYou can model maps in Blender and compile them with dmap in RBDOOM.
Do I run dmap from the engine console?

motorsep

Quote from: nemyax on November 03, 2018, 10:55:51 AM
Is AAS only needed for multiplayer?

No, AAS is for AI. Maps have to have that for AI to properly and effectively navigate the map. Nothing to do with multiplayer.