Skip to content
Viewer for Relic Entertainment Homeworld 2 backgrounds
Python
Branch: github
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
background
doc
.gitignore
COPYING
README.md
TODO.md
parse_bg.py
screenshot.png
transformations.py
visualize.py

README.md

Screenshot

Description

This tool can be used to view the space backgrounds from the game Homeworld 2.

What makes backgrounds these special from a technical viewpoint is that they are not background or cubemap textures but tesselated spheres with vertex colors. The geometry is more finely tesselated in places where more precision is needed in the image.

For further information on the way that the Homeworld 2 backgrounds work please refer to these Simon Schreibt articles:

Dependencies

The following dependencies are needed to run the program:

  • Python 3.x
  • PyOpenGL (apt install python3-opengl)
  • numpy (apt install python3-numpy)

Python 2

Alternatively, Python 2 should still be compatible. The following dependencies are neccessary:

  • Python 2.7+
  • PyOpenGL (apt-get install python-opengl)
  • numpy (apt install python-numpy)

Launch the program with:

python2 ./visualize.py background/m01.hod 

Usage

Launch the program from the command line with the name of the background to display,

./visualize.py background/m01.hod 

Drag with the left mouse button pressed to rotate the view.

Press 'w' to toggle wireframe mode.

Extracting the data files

The data files in background/* are part of the original game and cannot be distributed with this program.

Extracting the .hod files can be done in the following way:

  • Install homeworld 2 from the CD

  • Apply patch to 1.1 (not sure this is needed)

  • Extract background/ from homeworld2.big The big file format is described in doc/big_file_format.html in this repository. I used the UnfBIG tool for this (can be found here ) You just need to extract the files, no deobfuscation of the lua files is needed.

  • Find .hod files that have associated _light.hod. The _light.hod variants contain the position of the lights and are not needed at this point.

These are the following:

background/black.hod
background/m01.hod
background/m02.hod
background/m03.hod
background/m04.hod
background/m05.hod
background/m06.hod
background/m07.hod
background/m08.hod
background/m09.hod
background/m10.hod
background/m11.hod
background/m12.hod
background/m13.hod
background/m14.hod
background/m15.hod
background/white.hod

The hod files in other directories space ship models and such. These can not currently be viewed with this tool as the vertex format is different.

You can’t perform that action at this time.