2022-08-20 15:04:13 +02:00
2022-08-20 15:04:13 +02:00
2022-08-24 18:44:11 +02:00
2022-08-24 18:44:11 +02:00
2022-08-20 15:04:13 +02:00
2022-08-24 00:31:10 +02:00
2022-08-24 19:05:45 +02:00
2021-08-05 16:44:53 +02:00
2022-08-24 18:44:11 +02:00
2022-07-30 22:17:48 +02:00
2022-07-30 22:17:48 +02:00
2022-08-24 19:05:45 +02:00

RogueSquadron Extractor - TERRAIN module

Inspired by the work of dpethes (https://github.com/dpethes/rerogue) 👏

This set of git repos are a compilation of tools coded in C to make RS modding far more than a dream! The collection consist of few independants modules, each of them deals with specific data like sound, textures, heightmaps, etc...

All modules are independants. This is the 'TERRAIN' module.

Build Status

TERRAIN MODULE

It's extract terrain datas from Rogue Squadron 3D (PC) game map files (hmp).

This module can do:

  • Interpolate 3D model mesh of the terrain,
  • Export it as OBJ model file (pretty heavy (~15MB), not to be use directly for display),
  • Export an heightmap-like PNG,
  • Multiple inputs files.

TODO

  • Add textures to terrain.
  • Adding LOD method to optimize datas manipulation and rendering.
  • Discover all last unknowns fields, etc.

Using

RSETerrain [options] <hmp files...> or you can simply drag&drop HMP files on it.

A futur main program can extract all HMP files directly from DAT file. Due to issue with copyrights, I can't provide samples... You need to extract HMP files yourself.

Options

  • -h Print this message
  • -v,-vv Activate verbose/debug output mode respectively
  • -no-subdir Export models inside current folder
  • -no-mtl Disable texture exporting
  • -invZ Invert Z axis when parsing
  • -neg Negative heightmap output

Dependencies

Compiling

You can compile on both Windows (MinGW) or native Linux system thanks to CMake, you only need to adjust your dependencies on Windows or use Conan packages manager (https://conan.io). zlib-dev (zlib1g-dev) and libpng16-dev distrib packages can be used on debian/ubuntu.

To compile, just clone (don't forget git submodules) and launch cmake:

cmake .
make
make install

On Windows system, I can suggest you to use Conan support to help you with dependencies:

mkdir build
cd build
conan install .. --build=missing
cmake .. -G "MinGW Makefiles"
make

If you want to do it manually without Conan support, you will probably need to specify the dependency flags for CMake. Ex:

cmake.exe -D"ZLIB_INCLUDE_DIR=zlib/1.2.11/include" -D"ZLIB_LIBRARY=zlib/1.2.11/lib/libzlib.dll.a" -D"PNG_PNG_INCLUDE_DIR=libpng/1.6.37/include" -D"PNG_LIBRARY=libpng/1.6.37/lib/libpng.dll.a" . -G "MinGW Makefiles"

We can also use cross-compilation (after installing mingw64 and cmake packages on your distrib):

mkdir build && cd build
cmake -DGNU_HOST=x86_64-w64-mingw32 \
	-DCMAKE_TOOLCHAIN_FILE=../cmake/mingw_cross_toolchain.cmake \
	-D"ZLIB_INCLUDE_DIR=zlib/1.2.11/include" \
	-D"ZLIB_LIBRARY=zlib/1.2.11/lib/libzlib.dll.a" \
	-D"PNG_PNG_INCLUDE_DIR=libpng/1.6.37/include" \
	-D"PNG_LIBRARY=libpng/1.6.37/lib/libpng.dll.a" \
	..
cmake --build .
Description
Rogue Squadron 3D (PC) game terrain files (hmp) extractor
Readme GPL-3.0 167 KiB
2023-02-05 15:26:49 +01:00
Languages
C 70.4%
CMake 20.4%
Python 9.2%