Minecraft to Quake3 level converter

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
o40
Posts: 8
Joined: Sat Aug 20, 2011 4:10 pm

Minecraft to Quake3 level converter

Post by o40 »

Ever wondered how it would be to strafejump through a minecraft level?
I did. So I started a minecraft to quake3 level converter as a small programming project.

It was not hard to read the block information from the minecraft server_level.dat,
and with some simple algorithms I filtered out all the blocks you cannot see or reach,
and merged the other blocks as good as I could.
Then to write the blocks as brushes to create the .map file.

I released the map for the defrag mod here: http://ws.q3df.org/map/mineqraft/

The map area is 110x110 brushes which is about the limit of what I could compile with q3map2.exe.
The VIS stage is just too heavy (and memory consuming).

I decided to release the current state of the code on github.
It is not good looking or has good names for everything but at least it gets the job done.

https://github.com/o40/Mineqraft

I will continue working on this sporadically to implement som better optimization and some other features I want to try out.

The big limitation for me at the moment is that I used the old (and simple) minecraft level format and I
have not yet managed to connect to the server with a client to do some alterations of the level generated by the server.

If you like to contribute to this project send me a PM.

The thing I want most is some kind of parser for the minecraft region format (.mcr) so I can use the latest version of the server.

If you just want to test this converter out you can grab the code from github and compile it yourself,
or send me a PM and I can make you a binary.

Image Image

http://koponen.biz/mc2et/shot0004.jpg
User avatar
Hipshot
Posts: 1547
Joined: Sun Jan 20, 2002 8:00 am

Re: Minecraft to Quake3 level converter

Post by Hipshot »

That's pretty cool =)
Q3Map2 2516 -> http://www.zfight.com/misc/files/q3/q3map_2.5.16_win32_x86.zip
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
Ouija
Posts: 55
Joined: Tue Aug 16, 2011 9:11 pm

Re: Minecraft to Quake3 level converter

Post by Ouija »

To improve vis, make the thing mark unimportant (not covering much) blocks as detail and use caulk on the invisible sides. I can't help you much in regards on how should detail be discriminated from structural, but your best bet would be to have this converter look for natural "rooms", that is boundaries of a cavern - and base structural on that as opposed to single blocks. While I'm a shitty programmer, I don't think that implementing it to behave based on a simple grid of 4x4x4 and 2x2x2 chunks would be that hard. Last but not least, it should merge as many detail brushes as possible afterwards. Below is how it'd work if done in 2D, but you can adapt that to voxels as well. Color means priority of blocks, red being structural, green detail while yellow could be either depending on settings.
Image
dghost77
Posts: 174
Joined: Tue Aug 23, 2011 8:28 pm

Re: Minecraft to Quake3 level converter

Post by dghost77 »

Amazing!
Silicone_Milk
Posts: 2237
Joined: Sat Mar 12, 2005 10:49 pm

Re: Minecraft to Quake3 level converter

Post by Silicone_Milk »

This is indeed pretty badass. I was thinking to myself for a while that it would be cool to import .map files in to minecraft so we could build castles and such with brushes in GtkRadiant.

Awesome to see others are having similar thoughts.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Minecraft to Quake3 level converter

Post by obsidian »

LOL... I made a copy of Q3DM6 on the old Q3W Minecraft server, about time we could do things the other way around.

For VIS, you are better off converting everything to detail and then manually drop caulk and hint brushes in as necessary. Just leave the outer box as structural by default.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
deqer
Posts: 298
Joined: Mon Dec 28, 2009 6:30 pm

Re: Minecraft to Quake3 level converter

Post by deqer »

In GTKRadiant 1.4, you can make brushes detail by selecting them and pressing CTRL+M. You can see which brushes are detail or not by pressing CTRL+D(turns on/off detail brushes from view).
IveGotPenisEnvy
Posts: 71
Joined: Tue May 24, 2011 7:36 pm

Re: Minecraft to Quake3 level converter

Post by IveGotPenisEnvy »

What? THIS IS QUAKE III ARENA!
o40
Posts: 8
Joined: Sat Aug 20, 2011 4:10 pm

Re: Minecraft to Quake3 level converter

Post by o40 »

Ouija: Thanks for the nice picture. It is a very nice suggestion. I will play around with this when I get home.

I can post some screens of how it looks today if you are interested.
User avatar
Eraser
Posts: 19175
Joined: Fri Dec 01, 2000 8:00 am

Re: Minecraft to Quake3 level converter

Post by Eraser »

That's really cool. How long did it take to compile this map?
o40
Posts: 8
Joined: Sat Aug 20, 2011 4:10 pm

Re: Minecraft to Quake3 level converter

Post by o40 »

Uhm, 7 hours I think, VIS was probably >90% of that time.

Some screens of brush optimization:

Image
Image
Image
Ouija
Posts: 55
Joined: Tue Aug 16, 2011 9:11 pm

Re: Minecraft to Quake3 level converter

Post by Ouija »

Obsidian: Hints aren't necessary, while placing things outside the hull won't be as efficient as structural/detail when it comes to culling.
Consider using different voxel chunk sizes for structural depending on settings, higher chunks = faster vis but slower runtime. Q3 handles open spaces badly so some vis is necessary here and there.

Detail brushes need manual merging, q3map doesn't do that for you I think. Even if it does, for the sake of cleaner .map files - below is the depiction of an algorithm that takes care of detail merging. (could apply to structural as well) Again, it's 2D but you can adapt it for voxels:
Image
I forgot to take textures into account, but I guess you can figure that one out on your own. Honestly, I'd rather just code all that crap by myself but making changes to someone else's code is too much of a pain in the arse for me.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Minecraft to Quake3 level converter

Post by obsidian »

Ouija wrote:Obsidian: Hints aren't necessary, while placing things outside the hull won't be as efficient as structural/detail when it comes to culling.
Whether hints are necessary would depend on the layout of the map, wouldn't it? On a simple box map, no; on a map with valleys and turns, yes.

I'm not sure what you mean by "placing things outside the hull", anything outside the hull isn't even part of the map. Perhaps I'm misunderstanding you and something is lost in the translation (I don't think English is your primary language?).

Ouija wrote:Consider using different voxel chunk sizes for structural depending on settings, higher chunks = faster vis but slower runtime. Q3 handles open spaces badly so some vis is necessary here and there.
You may want to read about how vis works. Look up SPoG's technical articles, djbob's hint tutorial and the hint tutorial I wrote here on Q3W. You're right about Q3 handling open spaces badly because there is little suitable geometry for occlusion, but using larger or smaller brushes on planar surfaces won't affect in game performance if your PVS includes the entire map. You're better off converting all the voxels to detail so your map actually compiles. The principle problem the OP was having was that VIS was getting too complex, so converting to detail simplifies the VIS process when the PVS is completely futile anyway. Merging brushes will only help with rendering performance because there are less polygons to render.

Ouija wrote:Detail brushes need manual merging, q3map doesn't do that for you I think.
Q3Map2 doesn't generally merge structural or detail brushes at all. There are some special cases, but I wouldn't depend on Q3Map2 doing it for you. Some type of scan-line or ray-trace algorithm as you suggested would probably be a good idea though.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
o40
Posts: 8
Joined: Sat Aug 20, 2011 4:10 pm

Re: Minecraft to Quake3 level converter

Post by o40 »

I am doing some tests with making everything detail and then hinting it. For this test I used a bit too large hints but you get the idea.

Before:
Image

After (with 4x4 block large hints):
Image

I have a lot of code cleanup to do though, and I just feel like playing Deus Ex at the moment.

Other stuff I might do on weekends:
http://i.imgur.com/JueBw.jpg
4days
Posts: 5465
Joined: Tue Apr 16, 2002 7:00 am

Re: Minecraft to Quake3 level converter

Post by 4days »

Hipshot wrote:That's pretty cool =)
Post Reply