Anachronox

Anachronox

Not enough ratings
Anachronox Hub [Modding]
By дариус and 3 collaborators
Basics of Anachronox modding, links, resources.
   
Award
Favorite
Favorited
Unfavorite
INTRODUCTION


This guide is based on the latest patch of the game. (1.02)

It doesn't cover everything, it is just our own approach to explain what can be done. For more information please visit: Anachrodox[anachrodox.talonbrave.info] There is plenty of information, probably even more than you will ever need.
RESOURCES
— EXTRACTION [.DAT files]
To start extracting files you will need either DATExtract[anachrodox.talonbrave.info], or AnachronoxDAT[github.com].

-DATExtract-[anachrodox.talonbrave.info]The interface is really simple and easy to use.

In order to start extracting execute DATExtract and select the .DAT archive you wish to extract from anoxdata folder:
Anachronox DAT File Extractor Version 2 by John Rittenhouse cryect@captured.com 6/30/2001(Updated 7/1/2001) Loading File C:\Program Files (x86)\Steam\steamapps\common\Anachronox\anoxdata\GRAPHICS.dat ... 1 anoxcurshad3.pcx 2428 bytes 2 anoxcursor.pcx 2781 bytes 3 anoxcursor3.pcx 2270 bytes ...
Example of DATExtract output after selecting the .DAT archive. Press space to extract everything from the archive.

I would also recommend to make a separate folder for the .DAT file and put it there before the extraction, because DATExtract will dump the files into the .DAT's directory which may make the anoxdata folder look like a mess.

-AnachronoxDAT-[github.com]
A GUI version of DATExtract created by GeneralProtectionFault.

https://steamuserimages-a.akamaihd.net/ugc/2026107656164060256/1465567FBA27131889D4DEBAD80B39DD328833D9/?imw=256&&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=false
Just select the folder you want the files to go to, then select the .DAT file you want to extract. A list of available files will populate. Select one and click the "Extract Selected File" button to extract only that file to the selected output folder. Alternatively, simply click the "Extract ALL Files" button to extract the entire list of files to the folder.




NOTE: Anachronox patches should be applied after extracting .DATs to insure data from patches takes precedence over old data extracted from .DAT files.
— VIEWING EXTRACTED CONTENT
After the content is extracted it might be hard to distinguish things with just a name. You might want to look at what you extracted before going further. To do that there is a convenient tool – particleman[anachrodox.talonbrave.info] which can be located in the Anachronox folder.
— IMPORT
Use folders in /anoxdata/ to append new resources. Recreate the folders if needed (paths should be identical to the .DAT archives).

I'd recommend to extract all .DAT archives first to get a grasp on what the internal structure of the archives looks like so you are able to recreate it in anoxdata (it partially is by default since the latest patches use this feature to edit the files).
APE
Originally posted by Anachrodox:
A.P.E. (Anachronox Programming Environment) is the scripting language layer that controls most of the standard interactivity within the world. If you can click something in the world that triggers a dialog, interface, or event, then chances are APE has played a major part in it. Now before you hop straight into APE, there are a few things you should know about it.
However prior to changing anything you'd need to either decompile the script you want to change or to download already decompiled one from:
Github[github.com] or GoogleDrive[drive.google.com]
Afterwards change whatever you want to, compile the file with dparse which can be found in the main directory of Anachronox along with the game's executables.

AnoxTools[code.google.com]
Richard Tew <richard.m.tew@gmail.com> made that possible. The above repository contains decompiler for APE scripts written in Python.
Backed up here[drive.google.com] just in case.
MAPS
— DECOMPILATION
MAP DECOMPILATION

Before making any changes to the maps you would need to decompile them. There are 2 decompilers known to me that work well with Anachronox:

The maps above were not edited and are just the result of using these tools. Which means that they need to be tweaked first since after decompilation there are usually several leaks which will prevent the map from compiling back and loading in-game. There may be also sometimes some objects which will have wrong surface flags (clip brushes for instance). If map compiles successfully that doesn't mean that everything works, the maps should be tested to work in-game since sometimes there are objects which can prevent them from loading, therefore before going any further these objects must be found and edited or deleted. That's why there is a list of repaired and updated maps in the section below.

If map does not decompile using winbspc like "bricksb.bsp" for example. There's a way around:
  1. Decompile the map using "bn-bsp-lump-tools". It will still won't open in TrenchBroom but it will in Netradiant[github.com] for example.
  2. Re-save the map using Netradiant and it should be open-able in TrenchBroom from now on.
— EDITING
For that task we need a map editor. There is AnachroRadiant but it was not updated for quite a while so it may be better to check out something new. TrenchBroom[kristianduske.com] works great for that task. Here's a little video showing off what it can do:

Setting it up is quite easy and the tool is available for several platforms.

Since we are editing as if for the original Quake 2 it is not allowed to use .TGA nor .PNG textures, they must be converted to .WAL format.

  • Conversion of textures can be done using Wally[valvedev.info].
  • pak0 can be taken from Quake 2 demo. The demo is also available on Steam.

Example of editing rowdys.map

Qpakman[github.com] is a cross-platform command-line tool that can be used for examining original pak archives or creating new ones to use with TrenchBroom.
—— Entity definition [.FGD]
Entity definition file, if present, allows to see previews of the models in the editor.

Rowdy's model defined in .FGD file.

Unfortunately by default the entity list from Anachronox nor the models or textures are incompatible and require to be converted first. But as you can see it is possible.

@PointClass base(Npcs) model(":models/newface/rowdy/tris.md2") = npc_rowdy : "Rowdy" []
Line used to define Rowdy for the editor.

Model conversion process will be in the "Model" section of the guide.
— COMPILATION
As any Quake based game there are 3 stages of compilation: BSP > VIS > RAD. Any compiler goes for Anachronox as long as the output is BSP of version 38[www.flipcode.com].
There are two sets of tools that can be used:
  1. Geoffrey DeWan's Quake 2 Compilation Tools[home.insightbb.com] — Compatible with Anachronox, seem to be more advanced and give a lot of options before compilation.
    Build for Linux[github.com]
  2. Anachronox Compilation Tools[drive.google.com] — Take "aarghrad3" RAD compiler from here if you want to compile maps with original lighting.
Rules of compilation are the same as for any Quake 2 map. Leaks is the most common problem with the maps after decompilation or while making a new map.

Section about map compilation on Anachrodox[anachrodox.talonbrave.info].

Regarding RAD compilers. There is a custom, advanced light compiler that adds a lot of details to the lightmaps — Light[ericwa.github.io]. However it is required to modify light and worldspawn keys in order to make it work right.

TyrUtils[disenchant.net] compile the map files without any errors but the game doesn't load them saying that the version of BSP is wrong.
—— Lighting | ericw-tools
Replicating the original lighting:

There is a conflict between the way Anachronox and the new compiler treat the "surface light" system. It makes both implementations unusable. [?]One of the ways to fake surface lights (for example neon signs):
  • Turn the brush with emmisive surface into a "func_wall".
  • Add entity keys:
    "minlight" "1000" "_lightignore" "1"
  • Add optional point light near the surface to simulate it emmitting light.
"Falloff" key on the lights must be removed or edited since both the original and the new light system are using it but scaling is different which makes lights to dissappear if they remain with the original values.

Originally posted by by Spike » Thu Dec 22, 2011 9:42 am:
there's a fixed 1:16 ratio between lightmap samples : sw texture samples.
source[forums.insideqc.com]
The size of lightmaps depends on the raw texture resolution.

rowdys.map Light preset:
./light -bounce 0 -spotlightautofalloff 1 -dirt 1 -dirtgain 1 -dirtmode 1 -dirtdepth 128 -phong 1 -soft 3 -gamma 0.75 -minlight 75 rowdys.bsp
— EDITABLE & UPDATED MAPS
Name
Link
Current issues
rowdys
[.MAP][drive.google.com]
BIG-JIM'S neon sign in the bar prevents the map from loading in the game by default. Changing the texture to static sign instead of animated (procedural) for now.
sphere
[.MAP][drive.google.com]
A lot of supposedly unused geometry and entities.
Map will not pass the checksum verification by default if started from the main menu.
bricksb
[.MAP][drive.google.com]
bricksc
[.MAP][drive.google.com]
One of the doors has misplaced textures.
bricksd
[.MAP][drive.google.com]
zordos
[.MAP][drive.google.com]
3D MODELS
GENERAL INFO
As for now there are 3 ways to rip the in-game models: (after DatExtract you have to convert the models into a suitable format because they are using the modified MD2 model format)
  • lw2md2
  • Ripping the models using third party model-ripping software like NinjaRipper
  • Alpacas Anachronox MD2 import add-on for Blender 2.8x
LW2MD2
The tool handles conversion between Lightwave and .MD2 model formats, it seems to be perfectly functional in terms of converting .LW into .MD2 but not vice versa. If you were to reverse the process it will only be able to extract the mesh without UV maps (textures will not align properly). Regarding animation the output will be not a single mesh, but a set of separate meshes, one for each frame of animation (Milkshape's ASCII files).

Download lw2md2[anachrodox.disinterest.org]
Backup on GoogleDrive[drive.google.com]

To work with the models extracted this way you will need MilkShape[en.wikipedia.org] using which, the models can be converted to be edited for the software you like. On the website you will find more tools and guides about how to work with 3D meshes.
!NOTE. lw2md2 tends to crash when it is ran without any arguments, so it is advised to start with
lw2md2 -help
in cmd.


RIPPING MODELS

Currently that is the only way to extract the models from the game without losing the texture coordinates (UVs).

NinjaRipper[gamebanana.com] — is the tool that works well with Anachronox. There will be no tutorial on how to use it since it is the same as for any other game.
The best way to extract the models is to target Particleman application which resides in the Anachronox folder, it is used for model viewing, however you need to extract the MODELS.DAT archive before you can load any models.

After the model is extracted it will have doubled vertices which need to be removed. Sometimes the UV maps can be flipped as well.

Anachronox MD2 import add-on for Blender 2.8+

Currently the best way to extract models. Retains texture coordinates (UVs), materials, and animations. Imported models can then be exported to multiple different formats.

GeneralProtectionFault/Anachronox MD2 import add-on for Blender 2.8+[github.com].

— QUAKE-COMPATIBLE MD2
To make the models appear in the editor we need to make them Quake-compatible. Means converting the models into actual .MD2 and the textures into .PCX with the correct palette. First rip a model from the game using NinjaRipper[gamebanana.com].

The next step is to convert it all into MD2. Export the extracted model from your 3D editing application (like Blender), put it's texture into the same folder.

There is a plug-in for Noesis that allows to import ripped data directly, without converting or editing it first in the 3D editor. However I don't know if that's a good idea since ripped models usually have flipped normals and doubled vertices which needs to be fixed before doing anything else.

Load up Noesis[richwhitehouse.com]. Navigate to your model and export it as MD2 for the mesh and .PCX for the textures.
You might need to click on the checkbox "rotate 90 degrees" if you were exporting with the default settings from Blender[www.blender.org].

We are using Noesis to convert models because it makes it much easier than it used to be. For example if you were to export MD2 from Milkshape you'd need to assign all vertices of the model to some bone/joint, write a script that will denote all frames and skins included in the model and only after all that you can export.

Keep everything in the same folder. To be true to the original and avoid naming errors rename your mesh into "tris" and the texture into "skin". So at this point you should have 2 files in your folder: tris.md2 and skin.pcx.

Now since you've changed the name you need to reasign the skin to the model, this stage is also helpful in reviewing if the model has been converted properly.
NPherno's Skin Tool[planetquake.gamespy.com] — Is what I find to do the job quite well. Import the model, it will throw a warning that the skin for the model is not found and will make a blank one. Delete it and open your own texture from the skin menu. Then find a "Link" option and point out the texture again. After that save and everything should be working now.
— MD2
The format the game uses is heavily modified. Here be all the assumptions and the progress regarding reverse engineering process.
To ease the research here are the original and converted model files from the game to test:

[GoogleDrive] boots.md2 and related files[drive.google.com]

Structure explanation:
extracted:
amb_a_007.txt is ASCII Milkshape frame. Its the first frame of boots.md2 (extracted using lw2md2)
amb_a_007.md2 the frame above converted into default md2 format
original:
Contains all the data from MODELS.dat /newface/boots without any modifications.

[GoogleDrive] All frames from boots.md2 as Milkshape's ASCII[drive.google.com]

[GoogleDrive] List of vertices and triangles from first frame of boots.md2 (original model converted into .OBJ)[drive.google.com]
"amb_a_007"...717 triangles, 366 vertices, 362 normals.

TBD output from NinjaRipper of boots.md2 or any other ripper


*** If there is someone who is interested in helping with the development of the software for the conversion process there is a breakdown of the .MD2 format Anachronox uses, it is not complete, but it is at least something. (scroll down a bit to the MD2 section Link[anachrodox.disinterest.org])

Originally posted by Stiv:
Here's what I can recall of the md2 format changes:
- modified identifier in the header
- an additional byte that describes the byte-depth used for vertex information (3, 4 or 6)
- the normal table resolution is much higher depending on the MD2 version (the engine does an automatic upgrade/translation for old models)
- there's an additional chunk of data that describes the triangle -> material/texture relationships
TEXTURES
  • Upscaled textures can be used freely without any engine modification, although cap values are unknown. (x4 upscaling is possible and works).
  • Environment textures (covering base geometry of the maps) do not adapt automatically when the size changes. You can however replace the textures folder during gameplay and use flushtextures command. That way the textures will update and match the surfaces.
  • Texture size is tied to the size of lightmaps which has its own cap and can break maps if it is reached. (max_map_patches, max_map_lightmaps and etc)
  • Unlike Quake 2 Anachronox does not require the textures to be converted into .WAL extension to be usable. Most of the textures have either .PNG or .TGA extension.
.ATD

ATD files are used to set-up procedural textures in Anachronox. They usually reside among the texture files they use.
Example of ATD file[drive.google.com]
  • Procedural textures require their size to be listed in .ATD file, otherwise if there is a mismatch between the actual size and the one listed in file the texture will not load in-game or end up downscaled. (A big portion of characters use procedural textures).
  • Texture filtering can be controlled via these files as well. The "bilinear" key is used to do it.
gl_texturemode doesn't work (texture filtering seems to be handled manually, per file, instead of a global switch like in Quake 2), this is original command from Quake , but it is disabled. Quake 2 Engine has bilinear interpolation, but texture resolution can't support it well turning character models into blurry mess. (subjectively)
More about procedural textures[anachrodox.disinterest.org]]
Links
BSPs:
  • QuakeWiki[quakewiki.org] — Getting Started Mapping with TrenchBroom.
  • ValveDev[valvedev.info] — GoldSrc works similarly to the original Quake engine in many ways. The guides are of high quality and help a lot to grasp the basics.
  • Anachrodox[anachrodox.talonbrave.info] — Anachronox specific stuff.
  • Gamedesign[web.archive.org] — Quake 2 - Polygon Count Reduction.
  • ZHLT[zhlt.info] — Common Half-Life mapping problems & compile errors.
  • TCRF[tcrf.net] — The Cutting Room Floor. Unused content from the game.
  • APE Archive[github.com] — Decompiled scripts from the game, can be used to alter events in the game.
46 Comments
Creaper  [author] 16 Jun @ 7:08pm 
@vadeem-kitoboy Those pictures were a test to see whether I could export models and maps from Anachronox and recreate them in Unreal Engine. There is no mod or anything to download other than the tools listed on this page, particularly GeneralProtectionFault's newer tools.
Creaper  [author] 16 Jun @ 7:06pm 
Here is something I have been working on lately for anyone still interested. New Models [imgur.com]
Creaper  [author] 16 Mar @ 1:46am 
Great news!

GeneralProtectionFault has created an Anachronox to Blender map importer. I will get this added to the modding tools list ASAP. For now it can be download at:

GeneralProtectionFault/idTech-2-BSP-Blender-Importer [github.com]
vadeem-kitoboy 18 Feb, 2024 @ 3:06am 
@Creaper hi! lots of work done) is this mod (with UE) available for download/patching?
Creaper  [author] 20 Dec, 2022 @ 5:53am 
Yes you can. The Steam version is already patched to the official 1.02 so you just need the unofficial 44, 45, and 46 patches plus any of the other MODs you may want like the widescreen fix and Alpacas hi-res textures.
Xaliber 2 Aug, 2021 @ 3:59am 
@Creaper: can we just install the patches from Anachrodox to the Steam version?
Angle 5 Apr, 2021 @ 1:51pm 
I know it's been awhile since anyones posted here but I've been doing fixes over the last few months and I thought I'd share it with others

https://www.moddb.com/games/anachronox/downloads/anachronox-sounds-and-fixes-v01
Creaper  [author] 13 Nov, 2019 @ 2:46am 
Sorry for the late reply. I have not been on Steam much lately, I have been spending a lot of time learning Blender.
I did not get to the point of documenting all of the models in Anachronox. There are a thousand or so of them.
Endarire 19 Oct, 2019 @ 9:32pm 
May we get the newest Anachrodox link in the links section?