Jump to content
chronokun

Q3 .map -> Reflex .map converter

Recommended Posts

There are a few museum maps that come with GTKradiant, this includes q3dm1, q3dm7, and q3dm17, if you have trouble accessing those.

museum.map
q3dm1sample.map
q3dm7sample.map
q3dm17sample.map

I might be able to help. But they come with GTKradiant 1.6.4.

 

Once I get my current map released, I will be testing your code to convert my AEpyra map that should yield some interesting real-world test feedback.

 

Something I would love is support for is a "simple" search and replace file, where you add the full q3a texture path on one line, and then, let the user replace it with a Reflex one. Format something like this:

// Q3ToReflex.cfg
// --------------

[Configuration Options]
Ignore_Q3A_PlayerClip_Brushes = 1

[Delete Brushes with Texture]
common/hint       // Optimizing vis via hint brushes
common/hintskip   // Advanced hinting shader, these sides to not hint.
common/weapclip
common/metalclip  // Sound of floor sounds like metal...
common/botclip    // bot clipping, especially needs to be deleted...

[Ignore Texture]
common/nodraw     // You had to place that on glass/water edges, also when joining such brushes... not used in Reflex

[Automatic Texture Replace]
common/caulk
internal/editor/textures/editor_nolight

common/clip
internal/editor/textures/editor_clip  // alas water is nontrivial, since every map bring along its own shader for that (usually)

aedm7/water
environment/liquids/water/water

common/nodraw     // best to darkcaulk it
internal/editor/textures/editor_nolight

<full texture path to searched Q3A texture 1>
<full texture path to replaced Reflex texture 1>

<full texture path to searched Q3A texture 2>
<full texture path to replaced Reflex texture 2>

...

A default search/replace would be caulk for darkcaulk:

common/caulk
internal/editor/textures/editor_nolight

I was thinking of triggers, but this is less trivial since in Q3A they are just "trigger" brushes, whereas in Reflex they are two separate textures i.e. for the JP and the TP.

 

About clipping... player clip, weapon clip, bot clip... probably delete the latter two for now. Player clip is an issue, since you need to move Reflex clip away from the walls, whereas Q3A clip will go right through everything without a problem. But if you can convert player clip to Reflex clip that would help... might be nifty to have an option to turn that off though. Maybe add an option in the above config?

 

Hint brushes... deleted automatically, since they are of no use to the Reflex engine.

common/hint
common/hintskip

Anyway, if you need help sorting out something I'll try to help.

 

BTW... do e.g. 8-sided cylinders actually work as brushes in Reflex? Because that would be geometry imported that cannot actually be created in Reflex.

Share this post


Link to post
Share on other sites

Jump pads and Acceleration Pads

 

If the brush is a "trigger_push" it is a JP or AP.

// entity 161
{
"classname" "trigger_push"
"target" "t7525"
// brush 0
{
( 1624 -1112 224 ) ( 1624 -1112 232 ) ( 1624 -984 208 ) common/trigger 0 0 0 0.500000 0.500000 134217728 7 0
( 1576 -1112 232 ) ( 1576 -1112 224 ) ( 1576 -984 200 ) common/trigger 0 0 0 0.500000 0.500000 134217728 7 0
( 1600 -982 192 ) ( 1600 -982 208 ) ( 1544 -982 208 ) common/trigger 0 0 -180 0.500000 -0.500000 134217728 7 0
( 1608 -1120 216 ) ( 1608 -1120 232 ) ( 1664 -1120 232 ) common/trigger 0 0 -180 0.500000 -0.500000 134217728 7 0
( 1568 -1112 216 ) ( 1632 -1112 216 ) ( 1632 -984 192 ) common/trigger 32 0 90 0.500000 0.500000 134217728 7 0
( 1632 -1112 228 ) ( 1568 -1112 228 ) ( 1568 -984 204 ) common/trigger -42 20 -90 1.500000 -1.500000 134217728 7 0
}
}


entity
    type JumpPad
    String32 target jp7
brush
    vertices
        -1360.000000 -302.000000 -752.000000
        -1288.000000 -302.000000 -752.000000
        -1288.000000 -302.000000 -848.000000
        -1360.000000 -302.000000 -848.000000
        -1360.000000 -318.000000 -752.000000
        -1288.000000 -318.000000 -752.000000
        -1288.000000 -318.000000 -848.000000
        -1360.000000 -318.000000 -848.000000
    faces
        0.000000 0.000000 1.000000 1.000000 0.000000 0 1 2 3
        0.000000 0.000000 1.000000 1.000000 0.000000 6 5 4 7
        0.000000 0.000000 1.000000 1.000000 0.000000 2 1 5 6
        0.000000 0.000000 1.000000 1.000000 0.000000 0 3 7 4
        0.000000 0.000000 1.000000 1.000000 0.000000 3 2 6 7
        0.000000 0.000000 1.000000 1.000000 0.000000 1 0 4 5

Converting the targets should also be possible.

 

Teleporters:

// entity 144
{
"classname" "trigger_teleport"
"spawnflags" "0"
"target" "t7526"
// brush 0
{
( 988 -360 256 ) ( 988 -320 256 ) ( 952 -320 256 ) common/trigger 22 -40 90 0.750000 0.500000 0 0 0
( 952 -360 416 ) ( 952 -320 416 ) ( 988 -320 416 ) common/trigger 22 -40 90 0.750000 0.500000 0 0 0
( 944 -368 388 ) ( 1024 -368 388 ) ( 1024 -368 260 ) common/trigger 48 15 -180 0.750000 -0.500000 0 0 0
( 944 -360 260 ) ( 944 -320 260 ) ( 944 -320 388 ) common/trigger 13 16 0 0.750000 0.500000 0 0 0
( 952 -352 260 ) ( 988 -352 260 ) ( 988 -352 388 ) common/trigger 48 15 -180 0.750000 -0.500000 0 0 0
( 1040 -360 388 ) ( 1040 -320 388 ) ( 1040 -320 260 ) common/trigger -11 16 0 0.750000 0.500000 0 0 0
}
}

Reflex:

entity
    type Teleporter
    String32 target tp1
brush
    vertices
        -984.000000 -8.000000 -552.000000
        -960.000000 -8.000000 -552.000000
        -960.000000 -8.000000 -664.000000
        -984.000000 -8.000000 -664.000000
        -984.000000 -184.000000 -552.000000
        -960.000000 -184.000000 -552.000000
        -960.000000 -184.000000 -664.000000
        -984.000000 -184.000000 -664.000000
    faces
        0.000000 0.000000 1.000000 1.000000 0.000000 0 1 2 3
        0.000000 0.000000 1.000000 1.000000 0.000000 6 5 4 7
        0.000000 0.000000 1.000000 1.000000 0.000000 2 1 5 6
        0.000000 0.000000 1.000000 1.000000 0.000000 0 3 7 4
        0.000000 0.000000 1.000000 1.000000 0.000000 3 2 6 7
        0.000000 0.000000 1.000000 1.000000 0.000000 1 0 4 5

If "common/trigger" is in ""trigger_teleport" class replace texture with... just noted Reflex TP has no texture at all, it uses an empty texture.

 

 

If interested I could add the player spawn, ammo, weapon spawns and other items (health, armour) as well.

Share this post


Link to post
Share on other sites

Player Spawns

// entity 99 - the view shown at the end of the round, when the scoreboard is shown
{
"classname" "info_player_intermission"
"angle" "225"
"origin" "264 -600 208"
}

// entity 153 -  technically the single player start, the editor spawns the player here by default also
{
"classname" "info_player_start"
"angle" "315"
"origin" "1480 -664 216"
}

// entity 104 - regular DM spawn
{
"classname" "info_player_deathmatch"
"angle" "45"
"origin" "928 -1248 88"
}

entity
    type PlayerSpawn
    Vector3 position 783.000000 -127.000000 127.000000
    Vector3 angles 215.000000 0.000000 0.000000

Presently replace all with the same "PlayerSpawn" in Reflex.

 

In theory even the default teleporter model from Q3A could be converted, including the TP target:

// entity 155 - default TP model
{
"classname" "misc_model"
"angle" "0"
"model" "models/mapobjects/teleporter/teleporter.md3"
"origin" "2560 -1216 64"
"spawnflags" "0"
}

entity
    type Effect
    Vector3 position -960.000000 -184.000000 -608.000000
    Vector3 angles 90.000000 0.000000 0.000000
    String64 effectName internal/world/teleporter/teleporter_portal


// entity 156 - Teleport Target
{
"classname" "misc_teleporter_dest"
"origin" "-200 -704 160"
"targetname" "t1"
"angle" "360"
"spawnflags" "0"
}

entity
    type Target
    Vector3 position -1932.000000 -256.000000 558.000000
    Vector3 angles 135.000000 0.000000 0.000000
    String32 name tp1

Share this post


Link to post
Share on other sites

I did a quick map convert of q3dm7sample.map, according to the Reflex spawn entity and any weapon entity, the position data, in the entity box seems to be x,z,y or y,z,x (cannot properly tell)... Anyway the converted map is mirrored in the third coordinate.

 

And boy do we need a way to ignore clipping and hint brushes. Then again I should not be so lazy and edit out all the "junk" in GTKradiant before converting... should follow my own advice. Sorry about that.

Share this post


Link to post
Share on other sites

lol I know right.  I converted my map with the new clipping swapped in and holy god everything is plastered with noclip.  I mean every single wall.  I can't remember if I did that or the engine.  Entire map is orange now covered in noclip lol.  If I did that way back then I put a ton of work into clipping and caulking.  It's everywhere.  No wonder I gave up on Q3 mapping it was insanity.  I'll upload a screenshot later, you'll recoil in horror.

 

Awesome effort finding all those entity replacements.  Keep going.  This is all excellent stuff that's going to help Chronokun make his converter even better.

 

We'll probably get weaponclip someday but for the meantime replacing it with noclip should be ok.  Can't imagine maps will have a ton of weaponclips so replacing those manually shouldn't be much effort.  Replacing nodraw with nolight can be a problem but again it's minimal use shouldn't be a problem.

 

Replacing caulk with nolight however can be a problem because caulk was invisible in Q3 and nolight is not.  You're likely to have a some caulk sticking out visibly now.  This is a minor issue in the grand scheme of things.  As long as all the major brush work is there then reworking minor details like caulk sticking out seems like small potatoes.  It is possible to build a perfect lightmap without caulk in Reflex.  I'm sooooo happy that Reflex has basically done away with the need for caulk.  That was one of the major issues with Q3 mapping that frustrated people to no end.  As long as you use nolight on every face of a non-visible brush and you have good brush work it is possible to make a leak free map without much effort and caulk is completely unnecessary.  Quake 3 (perhaps I should say radiant specifically) on the other hand always struggled with leaks to the point people came up with wild caulk techniques to help prevent leaks.  One of the best tools to help new mappers prevent leaks is mind boggling simple, dev_grid texture.  Instant win.

 

Chronokun is it possible to make a GUI for the converter?  Perhaps file browse to select instead of command line.  I mean I can do command line no problem but everyone might not be as adept in command line.  It was obvious from your instructions and inferred that the exe had to be in the same directory as the map file but not everyone might not have understood that.  At least temporarily recommend you go back and add that instruction to your op.

Share this post


Link to post
Share on other sites

The entities are all in AEdm7... so I can easily look them up. Though for the entities I might need to look into id's museum map... it contains one of everything.

 

I noted that I use Q3A nodraw with all my decals, i.e. on all the other faces on the brush... so using darkcaulk might not be too great. I guess there are some things one needs to manually fix in Radiant first.

Share this post


Link to post
Share on other sites

Hmmm you could replace it with noclip instead temporarily in some circumstances.  In other circumstances you would want to use nolight.  Not having perfect equivalents throws a slight wrench into the mix.  Have to get creative with manual fixes.

Share this post


Link to post
Share on other sites

be a little bit more thankful, i'm pretty sure chronokun is doing this on his freetime.

 

the source is on github, so if you find issues and can fix it, send pullrequests

if you need texture replacing / brush removal write a post processors

if you need a UI, make one you just need to call the exe with the parameters

Share this post


Link to post
Share on other sites

I hope the mirroring issue can be fixed, or I might have to look into mirroring the map in GTKradiant first, though I have to admit that I am less than enthused to do it... rotation and mirror work most of the time but for a whole map... tends to mess up entities IIRC. But there was a CTF tool, MiriX, that let you mirror without that issue. Might need to try that.

Share this post


Link to post
Share on other sites

So chronokun,

if the enthused constructive suggestions come across as unthankful they are not. What we have here is already way beyond anything I had hoped for. Thank you for the hard work. But as a fellow programmer I am pretty sure chronokun did not misunderstand...

Share this post


Link to post
Share on other sites

be a little bit more thankful, i'm pretty sure chronokun is doing this on his freetime.

 

the source is on github, so if you find issues and can fix it, send pullrequests

if you need texture replacing / brush removal write a post processors

if you need a UI, make one you just need to call the exe with the parameters

That's pretty much both reason why I didn't include a UI with it hehe, easier not to and it means it doesn't get in the way of scripting :)

I may add one but I don't think I will be adding scripted texture replacement since that could be just as easily scripted separately.

Mirroring issue I will fix.

N-sided brushes... I think I saw a screenshot of those working? Didn't test myself.

UT/Other game converters - I don't really see much value in that personally so it's not something I will work on.

Anyway I appreciate the suggestions and feedback but naturally some things are going to be lower priorities and I think being able to use external tools for burshwork is the most tangible benefit right now so I'm wondering if a ReflexToQ3 converter might be more useful than some of these other features?

Edit:

And just so you know the main reason I created this was because I wanted to get a more in-depth understanding of the map compilation process tools like qbsp/vbsp use so that I can create a map compiler for my own uses and this happened to require some of the same functionality (plane intersection, polygon rewinding etc.) so I figured it was a convenient stepping stone that might also be of some use to others :)

 

Share this post


Link to post
Share on other sites

In what universe did any of that come off as not thankful?  Pretty sure I made it extremely clear that his efforts are extremely appreciated.  Sounds like you just want to gnitpick at every word I say and take it out of context.  Been getting a lot of that around here and it's really getting on my nerves.  I couldn't be more thankful unless I dropped to my knees and started sucking on his robotic reflex jockstrap. 

Share this post


Link to post
Share on other sites

N-sided brushes... I think I saw a screenshot of those working? Didn't test myself.

 

I saw an 8-sided column in q3dm7, left and right of the lava pit with the gargoyles above. Was a really cool moment to see that in Reflex.

 

"I'm wondering if a ReflexToQ3 converter might be more useful than some of these other features?"

 

I actually had completely over read the implications of that. That would be pretty awesome. Only slight issue I would see with that would be the back and forth of the entities, and losing such information. Strictly from the geometry, if I understand it correctly, it would work well?

 

There are several programmers at the Quake3World forum that might be willing to create a Reflex module letting us edit with Reflex resources in GTKradiant... I have not looked into how difficult this would be but it could be an option.

 

Any work you decide to do is appreciated.

Share this post


Link to post
Share on other sites

Here are some prisms for mappers that would like to use them.

 

I've already begun replacing some of my brushwork (in my latest map) with these N-sided brushes.  Just copy/paste the brush/vertices code from this .map file into your .map file.

 

NOTE: Don't paste them at the very end of your .map.  Paste them right before the first Entity line you see, near the bottom of your map.  If you have a lot of entities, then it won't be quite at the bottom of your map, but probably half-way point.

 

Download

 

2014-12-10_00002.jpg

Share this post


Link to post
Share on other sites

No you don't need account to download.  I had to go make one after seeing Chronokun use it because forums have max size of 140KB.  Honestly dropbox is good though.  Just started using it last night.  It's basically run like tortoise cvs or a private domain shared folder (in real time).  Have to run a program and background service for it to work.   Since the ul limit on this forum is so small you'll have to use something like dropbox instead if you want to share files.  ReflexFiles is only for completed stuff not just stuff we're messing around with so dropbox does a nice job of it, can recommend.

Yeah I pretty quickly ran out of forum upload space just from maps and screenshots, then I switched to some other file hosting site that didn't require signup until I realized the files were getting deleted after a few days so I figured I'd try dropbox since I saw it recommended somewhere else on the forum and it seems to be working out well. Of course the code is also on github but since not everyone has a compiler or knows how to use it dumping the compiled executables on dropbox solves that problem.

Also don't worry, I didn't take anything you or anyone else said as demanding or unappreciative, any suggestions made I'm perfectly capable of choosing whether or not to ignore them. :)

Share this post


Link to post
Share on other sites

chronokun,

BTW... did the texture fields in Reflex have texture scaling fields already (offset and rotation I recall)? I ask because then a GTKradiant texture "fit" might make it into Reflex as well. Not sure its actually possible though... just wondering.

Share this post


Link to post
Share on other sites

chronokun,

BTW... did the texture fields in Reflex have texture scaling fields already (offset and rotation I recall)? I ask because then a GTKradiant texture "fit" might make it into Reflex as well. Not sure its actually possible though... just wondering.

They are copied across, but I'm not sure if there's any kind of coordinate transforms or anything I need to do there so they may or may not be correct.

Share this post


Link to post
Share on other sites

I finally made GTKradiant use W,A,S,D keys in the camera view (after something like 10 years)... but a quick edit of q3dm7sample.map using "select face" and the "select all of the same" via shift+a let me very quickly remove all clipping, portals, and the skybox and other junk like that. I wanted to post a screenshot. Alas not happening on this forum, I am at my quota limit :(.

 

To make it short... you fixed the mirror issue... looks great. Thank you for fixing it.

 

It also shows just how sloppy the brushwork in the sample is. Us later mappers probably overdid the brush neatness, but we felt it had to be done. Almost no caulk is being used because the map is almost completely made up of structural brushes, here the face culling happens automatically. Never understood why it was not done the same way for detail brushes, but only detail brush-work actually really needed manual caulk to remove the unseen faces getting rendered by the engine.

 

IIRC, there was some option to have the compiler (q3map2) approximate patches using brushes, e.g. a curved wall. This would create nice "rounded" areas using normal brushes. And your conversion tool would make that look amazing. Quite unseen in Reflex up to now. Alas, that would require a bsp to map conversion loosing any brushwork detail. I'll check what was up with that. But brush approximated patches would certainly look nice.

 

Dropbox: No idea what the issue was yesterday. Downloading works without an account so no problem there.

 

Note: The third position column in entities under Reflex, according to GTKradiant coordinates is x, so the box position is y, z, x (from left to right)... very unusual. You must have had a bonny time figuring that out. ;)

Share this post


Link to post
Share on other sites

you can upload releases to github if you want to dodge dropbox.

 

https://github.com/chronokun/Q3ToReflex/releases-> Create a new release

than you tag it and can attach a zip to it

Good to know, thanks :)

I'm fine for using dropbox for now though since it's basically a 1:1 ratio between commits and compiled releases at this stage I and I don't really want to tag every commit as a release lol, on that note, this version adds some brush culling and material substitutions:

https://www.dropbox.com/s/8lb776zh6gpoc7w/Q3ToReflex_r8.zip?dl=0

Share this post


Link to post
Share on other sites

IIRC, there was some option to have the compiler (q3map2) approximate patches using brushes, e.g. a curved wall. This would create nice "rounded" areas using normal brushes. And your conversion tool would make that look amazing. Quite unseen in Reflex up to now. Alas, that would require a bsp to map conversion loosing any brushwork detail. I'll check what was up with that. But brush approximated patches would certainly look nice.

I have some code that does that but it's kinda messy atm, I guess I can add it to the converter until reflex gets it's own support for patches.

I used it in the bsp->map converter I was fooling around with as seen here testing it on cpm23 'Pull your Socks Up'

CrOTjYN.jpg

Share this post


Link to post
Share on other sites

Aha:

else if(strcmp(_krInput.c_str(), "common/clusterportal") == 0)

right on the ball I see... found those only just now. Never used them much.

 

common/clip is probably left in for now? Since it actually can be replaced with Reflex "clip"... even though both clips are quite different. In Reflex we really have to keep every clip brush away from walls... not so wonderful. I hope the devs will have mercy and turn off clip "lighting" at some point.

Share this post


Link to post
Share on other sites

chronokun,

looks very nifty the patch conversion... non-trivial I would imagine... I like those tubes.

 

Hopefully not many folks will use q3a maps... since that could lead to a flood of maps that required no skill whatsoever to create in Reflex. I am looking forward to converting my AEpyra map though... for future instagib :).

Share this post


Link to post
Share on other sites

chronokun,

looks very nifty the patch conversion... non-trivial I would imagine... I like those tubes.

 

Hopefully not many folks will use q3a maps... since that could lead to a flood of maps that required no skill whatsoever to create in Reflex. I am looking forward to converting my AEpyra map though... for future instagib :).

Mmm, yeah, not really wanting to encourage people to just import maps from other games but brushes can be a pretty convenient mapping tool, similarly I am thinking a tool to take wavefront .obj 3d models and extrude each face along its normal and apply no-light to all the external faces could be quite powerful for creating complex map designs. But I'll be keeping away from releasing any kind of map decompilation/compiled map conversion for that reason ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×