Author Topic: [Unity] Convert a .map to Unity 3D (map to model)  (Read 634 times)

0 Members and 1 Guest are viewing this topic.

Offline kat

  • Administrator
  • Hero Member
  • *
  • Posts: 2083
[Unity] Convert a .map to Unity 3D (map to model)
« on: November 18, 2016, 12:29:01 PM »


Unity 3D is not able to use brush-volume based, MAP formatted, or BSP styled, data structures by default, they need to be converted to a supported 3D mesh format. Although this is a relatively straightforward process it's not expressly practical to use the end result of the conversion directly, to convert and use the map as is, largely because it will likely still contain the game specific entities and objects, which need to be cleared from the file.



Beyond this its simply a question of BSP-only compiling the level (optionally using "-meta" and/or "-patchmeta" as required) and then converting the resulting *.bsp by running the compile process again with the "-ase" switch. This produces an intact *.ase model that can then be opened in another 3D application for further editing and/or export to a Unity 3D supported format, typically *.fbx or *.dae for dynamic models, *.obj for static (when editing, texture path information will need to be updated before use).
Quote
Design note: converting a level or map for use in Unity 3D presents a number of optimisation issues that will need to be addressed - namely that the resulting model is likely to be extremely large, polygon dense, and carrying a lot of material information that has to be loaded into game at the same time. This raises the probability of there being an 'overflow', memory or processing problem because the data is being parsed as a single unit rather than in smaller chunks or batches. Further editing may be (is typically) required.

IMPORTANT
Using third-party content may present Copyright issues - seek permission where necessary.

Step 1: strip game entities
Open the level into GtkRadiant, QuArK or other *.map editor, select and delete all game entities (this may include brush-based entities so special consideration should be allowed for these, either delete or break them down into standard brush volumes as reference for additional modelling). In Radiant hide "World" objects, "View Filter World", leaving only game entities visible (which also includes static models). In the XYZ grid draw a brush volume large enough that it encompasses everything that needs to be removed and click the "Select Inside" button (or click "Selection Select Select Inside").

Step 2: encase the entire level in a caulk hull
Once the entities have been cleared, re-place an "info_player_start" entity somewhere in the level then draw out a second brush volume encasing the entire map - allow some overlap. Click the "CSG Hollow" button (or "Selection CSG Make Hollow") creating a box around the entire level.
Quote
Design note: the process being described is essential the exporting of a large model not specifically a 'map'. As such the process is the same, i.e., info_player_start and enclosing the brushwork in a caulk box.

Step 3: compile as BSP only
Once the map is ready compile it to BSP (produces as *.bsp file) using the standard "BSP" compile switch, or optionally with "BSP - meta" to optimise the resulting triangle 'soup', or "BSP -meta -patchmeta" to include patch mesh objects in the optimisation.
Quote
Design note: where possible build as much of the level from brush volumes.

Step 4: convert *.bsp to *.ase
Once the *.bsp file is available convert it to an ASE model using the "ase" compile switch - this might typically be done opening the BSP file into Q3Map2Toolz and running "BSP" on the selected *.bsp file with "ase" as the "convert" option. The map will be parsed, converted and saved to the "maps" folder.
Quote
Design note: conversion includes structure, materials, UV map and texture information.

Step 5: import into 3D application
Once the level is converted it needs to be imported into the 3D application cleaned up and exported to *.fbx, *.dae, etc. For Blender this is a two step process, first import the ASE into Blender 2.49 using the available import script (Blender 2.49 + GoofosASE), then once saved, open the resulting *.blend file into whatever version is being used for production and export.
Quote
Design note: the imported mesh may need varying degree of prep depending on requirements, at the very least textures will need to be reassigned and objects joined to for more sensible file organisation. For export to *.fbx meshes may need to be rotated -90 on the "X" axis ([Unity] fixing Blender model rotation).

IMPORTANT: Unity's unit of measurement is the same as Blenders so models converted from Radiant will be several (c. 100x) times larger than might be necessary - a door being 72 units tall in Radiant, is 72 units in Blender and Unity but because Unity's default measurement system is "metres", such a door would stand 72 metres high in the editor. The size disparity also makes using Unity's editor clunky because the size of game entities and objects is based on the much smaller unit scale (a lamp icon is minuscule in comparison to the lamp mesh it may be illuminating, making it difficult to see, select and/or manipulate).


Additional Resources
- Overview of the process of converting brush volumes into models and importing the result into Blender.
- Making models from BSP brushes or maps (export maps as models).
- Make ASE models from brush volumes (map).
- [Blender] brush-based structures.


 

RSS Content is copyright © KatsBits™ 2017 unless otherwise stated. All Rights Reserved.
No part of this web site may be reproduced (except for personal use, or otherwise stated) without prior written permission from KatsBits.com. For more infomation on copyright click here.
Web design cpdtAdvertisePrivacy PolicyDMCA (about DMCA) Home Store Workshops Blog Jobs Support About Katsbits Contact Site Search KatsBits Help Site Map RSS feed Forum Old Forum YouTube FaceBook LinkedIn Twitter IMVU