Skip to content

Instantly share code, notes, and snippets.

@lucasw
Created June 20, 2017 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasw/974c9f60a5903770f9c80de39000debf to your computer and use it in GitHub Desktop.
Save lucasw/974c9f60a5903770f9c80de39000debf to your computer and use it in GitHub Desktop.

Open source Dark Forces tools?

Specification of GOB format, engine descriptions?

@lucasw
Copy link
Author

lucasw commented Jun 20, 2017

DarkXL / XLEngine

https://github.com/luciusDXL/XL-Engine

Is this the same as the DarkXL demo videos on youtube showing Dark Forces levels?
(presumably those are on Windows- but is the code the same or is the github an even less finished restart of the engine?)

How to build it? There aren't any makefiles.
There is a branch with one:
https://github.com/lacc97/XL-Engine/tree/cmake

but

CMake Error at XLEngine/CMakeLists.txt:28 (add_subdirectory):
  The source directory

    /home/lucasw/other/games/darkforces/xlengine/XLEngine/Math

  does not contain a CMakeLists.txt file.

so add one:

target_sources(xlengine
                PRIVATE
                    "${CMAKE_CURRENT_SOURCE_DIR}/crc32.cpp")

but then

/home/lucasw/other/games/darkforces/xlengine/XLEngine/imageLoader.cpp:7:19: fatal error: IL/il.h: No such file or directory

That isn't in the source, what is it?

sudo apt-get install libdevil-dev
/home/lucasw/other/games/darkforces/xlengine/XLEngine/Sound/midi.cpp:8:26: fatal error: wildmidi_lib.h: No such file or directory
libwildmidi-dev

Then it finishes.

It seg faults if run, does it need to be run in data dir of game?

It was crashing because of first line failing

    Log::open("Logs/log.txt");

So mkdir Logs

Log opened.
XL Engine 0.2.0 (Beta 1)
OpenGL Window initialized.
3.0 Mesa 12.0.6
Graphics Device "OpenGL 1.3" successfully created.
Segmentation fault (core dumped)

Commented out glXSwapIntervalEXT(s_display, s_win, enable ? enableValue : 0 );
in XLEngine/Graphics/Linux/graphicsDeviceGL_Linux.cpp and now it gets to black screen:

Graphics Device "OpenGL 1.3" successfully created.
glExtension enabled: "GL_EXT_framebuffer_object"
glExtension enabled: "GL_ARB_texture_non_power_of_two"
Maximum 2D Texture size: 8192
Memory Pool Allocated, count = 1.
Could not open font
Could not open font
Could not open font
[New Thread 0x7fffe2bc0700 (LWP 21973)]
[Thread 0x7fffe2bc0700 (LWP 21973) exited]
[New Thread 0x7fffe2bc0700 (LWP 21974)]
[New Thread 0x7fffe23bf700 (LWP 21975)]
[New Thread 0x7fffe22be700 (LWP 21976)]
Sound System initialized.
libWildMidi(_WM_BufferFile:132): ERROR Unable to stat Sound/freepats/freepats.cfg (No such file or directory)

Cut and paste proper location of freepats.cfg.
The go address those font problems - need to point to right location.
Don't see any of the png images that are supposed to get loaded, e.g. XL_Engine_2_Small.png.
Can get them from windows version? http://xlengine.com/downloads/
No don't have matching images.

Moved Inconsolata.otf font to expected relative location, still get black screen.
Need to make font loading and image loading print error messages and even exit the program if they fail.

Don't see any references to GOB files in code, or lfd files.

Settings

xlgames.ini is getting loaded but no ini exists in the repo, maybe can reverse engineer it and create one?

Need to run in same dir as buildVersion.txt, which is in the repo, or copy that file to where xlengine is being run.

Tried creating own xlgames.ini

fullscreen=1
immediateExit=0
showAllGames=1
uiGlow=0
colorCorrect=1
# setting this true crashes on Intel graphics adapter
# TODO try Radeon HD 8790M with DRI_PRIME
vsync=0
reduceCPU=0
launchGame=-1
frameLimit=30
brightness=100
saturation=50
contrast=50
gamma=50
musicVolume=50
soundVolume=50
# gus, gravis, sf2
midiformat=gus
# TODO string type
# patchloc=
# openGL 1.3
# openGL 2.0
# openGL 3.2
graphicsDevice=autodetect
windowScale=50
gameScale=50
# TODO what is this?
# gameCount=0
# TODO
# keyMapping=0

Got a little further and now there is an xlsettings.ini (Where did it come from?)

#Flags
fullscreen=false
immediateExit=false
showAllGames=true
uiGlow=false
colorCorrect=true
vsync=false
reduceCPU=false

#Video
windowScale=50
gameScale=5
graphicsDevice="autodetect"
frameLimit=30
brightness=100.000000
saturation=50.000000
contrast=50.000000
gamma=50.000000

#Sound
musicVolume=50
soundVolume=50
midiformat="gus"
patchloc="/etc/timidity/freepats.cfg"

#Engine Settings
launchGame="None"

#Game Data

#Action/Key Mapping

Now get blank blue screen, and:

No such file or directory : UI/Sounds/sub_bass_mouseover.wav
No such file or directory : UI/Sounds/echo_affirm.wav
No such file or directory : UI/Sounds/echo_affirm1.wav
No such file or directory : UI/Sounds/echo_deny.wav

http://vincent.polenordstudio.fr/snap/sub_bass_mouseover.wav

@lucasw
Copy link
Author

lucasw commented Jun 20, 2017

Open Source Tools

https://github.com/sheepandshepherd/archammer

This has a gob loader (or writer, or both?), and documents the file format, but is written in D.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment