Modifying an existing level

From OniGalore
Jump to navigation Jump to search

Instead of creating a new level, you may want to export, modify and re-import an existing level.

Export of static geometry

After the .oni files have been exported, the extraction of objects can fail if their textures can't be found. Those objects probably use textures stored in level 0.

In that case use the "-search" argument to make the correct extractions. The commands will look like this:

OniSplit.exe -export level0_files level0.dat
OniSplit.exe -export levelX_files levelX.dat
OniSplit.exe -extract:dae levelX_geometry levelX_files/AKEV*.oni -search level0_files

Possible output files:

  • level_bnv.dae
  • level_cons.dae
  • level_door.dae
  • level_env.dae
  • level_env_markers.dae
  • level_furn.dae
  • level_script_N.dae (by OniSplit v0.9.90.0+)
  • level_trig.dae
  • level_turr.dae

Reimporting DAE files (except for env_markers) will merge them with "env" (the core AKEV geometry).

Export of animated geometry and cameras

(OniSplit v0.9.90.0+)

This is also known as a scene export. All content exported by the scene file will be combined and saved in a single DAE.

OniSplit.exe -extract:dae path_to/output_directory path_to/scene.xml

For the following example, the scene.xml must be present in a folder containing all files used by the scene. In this case it's level3_Final ("lab").

<Node Name="camera">
     <Camera />
 <Node Name="motorcycle02">
     <Node Name="hubs">
     <Node Name="hubs_rear">

When you load the DAE in XSI you'll find the motorcycle and the intro cutscene camera. If you select the camera (for better visibility) and press play, you'll get to see the motorcycle intro animation that you know from the game.

For real-time playback, click on the "Playback" option button and then choose "Real-Time Playback".

File structure
  • The scene contains one or more nodes.
  • Each node represents either one 3D object or one camera whereby the node name determines the object name inside the DAE.
    • 3D objects do have a <Geometry> tag.
    • Cameras do have a <Camera /> tag.
    • Each 3D object or camera can have one or multiple <Animation> tags. Multiple animations will be combined.
    • 3D objects can be organized in a hierarchy that is created with the help of sub-nodes. Each sub-node can also have animations.

Scene import

According to Neo that feature is still under development. RIP.

Recycle object lists

The following files can be reused under <Objects> without any drawback:

  • BINACJBOCharacter.xml
  • BINACJBOFlag.xml
  • BINACJBONeutral.xml
  • BINACJBOParticle.xml
  • BINACJBOPatrol Path.xml
  • BINACJBOPowerUp.xml
  • BINACJBOSound.xml
  • BINACJBOTrigger Volume.xml
  • BINACJBOWeapon.xml

Lock lights

Door lock lights must be transferred by hand from an old ONLV (ENVP instance) to a) a new ONLV or b) to an OBJC particle file.

For method b), you could use THIS script. The advantage is that you don't need to edit the new ONLV afterward.

OBJC and vertex coloring

  • Object (XML) import via <Object> tag (master XML file) will get you objects without any vertex coloring. (OniSplit will pick *.oni class files from the shared folder.)
  • Object (DAE) import via <Model> tag (master SML file) should get you objects with vertex coloring, but no BSL functions. In that case you must add the corresponding OBJC files by hand.

You can choose between these two methods for consoles, triggers, turrets and furniture without particles. Doors and furniture with particles always require the XML method.

Manual reimport of physics

Don't want to make a scene.xml and physics.xml file? All animated physics can be restored if you aren't afraid of post-editing the ONLV.

  1. Look in the original level folder and copy the OBAN and M3GM files to your project's output folder.
  2. Create your level. Then convert the new ONLV to XML. Now you are able to compare the new and old ONLV file.
  3. Get all original OBOA instances that aren't doors or empty.
  4. Each OBOA has a <Geometry> tag which links to an M3GA instance by ID. Collect all the M3GAs that are used by your OBOAs.
  5. Add these collected OBOAs and M3GAs to your new ONLV. Make sure that your M3GA IDs aren't already taken; change them if necessary.
  6. Save the ONLV and convert to .oni. Make a package or plugin and test your reimported level.