Jump to content
The Dark Mod Forums

Recommended Posts

Posted

Cheers!

I've been wondering for some time now if it would be possible to compile the source code of TDM to the Raspberry Pi, especially the models 3 and 4.

I've seen some videos online of people running Doom3 on it, so how hard would it be to compile the source of TDM for the raspberry pi? Would it need a major rewrite of some parts of the code?

I've been "tinkering" with the source for some days, and as I was expecting, all the configuration files are made for x86 architectures (Linux and Windows). I've been searching online for some info about the toolchains needed to even start compiling the source for these arm machines, but the information has been quite lackluster and outdated. I've managed to track down a toolchain to compile c++ code for the raspberry pi, made by the pi foundation but I'm not quite sure how to use it and I guess the support for it has been dropped for quite some time now.

Anyway, I figured that instead of wasting more of my time, it would be best to ask here what you guys think.

Is it possible to even think about this, or does TDM use some kind of libraries or other external code which makes it impossible to compile for the pi? Is there anything related to the game that makes almost impossible or too much of a hassle to try to port the game for the raspberry pi? Performance isn't an issue for me. I just want to know if it can be run in that machine.

If it is possible to do this without a major code rewrite of the game, where should I start? I have no experience on compiling anything for arm, only some experience in x86, so this might be a fool's errand, but I would like to give it a try nonetheless.

If it is possible to do this and if some of you could help me in any way, that would be appreciated. On the other hand, if you think this is a really hard thing to even try to do, please feel free to tell me so I don't waste more of my time.

Thanks in advance

 

  • Like 1
Posted

As I understand it from a few searches, the raspberry pi architecture only supports Opengl 2.1 and doesn't work with stock Doom 3.  The Dhewm port of the D3 source uses Vulkan which is apparently supported on Pi 4.  

Dark Mod is now running on Opengl 3.1 if I recall and I doubt there are any plans to abandon that for Vulkan.  

Someone with a better working knowledge may prove me wrong on all of that but that's my understanding.

  • Like 1
  • 5 months later...
Posted

I'm interested in building TDM for khadas vim3.  The new open-source panfrost drivers support up to opengl 3.1, so TDM could be in-scope for mali g52 and g72 GPUs.

Beyond the -sse2 in CMakeLists.txt there is code requiring intel's SIMD instructions

idlib/sys/sys_defines.h

renderer/tr_light.cpp

I haven't looked further.  These would need to be modified to use arm NEON or plain old c++.

It can be done - I have doom3 running on aarch64.  I'm not qualified to do it though.

Cheers

Posted
36 minutes ago, clort said:

I'm interested in building TDM for khadas vim3.  The new open-source panfrost drivers support up to opengl 3.1, so TDM could be in-scope for mali g52 and g72 GPUs.

TDM 2.09 requires OpenGL 3.3.

Quote

 

Beyond the -sse2 in CMakeLists.txt there is code requiring intel's SIMD instructions
idlib/sys/sys_defines.h
renderer/tr_light.cpp
I haven't looked further.  These would need to be modified to use arm NEON or plain old c++.

 

I built TDM for Elbrus, so the architecture by itself should not be a problem.
But Elbrus compiler supported SSE intrinsics.

I have a plan to clean this mess in 4550. Did not get to it yet.
The plan was to ensure that all intrinsics are disabled if __SSE__ and __SSE2__ are not defined. It should be enough to make TDM compile on various architectures, as long as they have good GPU support and normal Linux OS.

 

To be honest, the fact that this vim3 uses Android instead of standard Linux will be the critical problem. If it won't work on X windows, then someone will have to rewrite quite a bunch of OS-specific code to make TDM run.

  • Like 1
Posted (edited)
1 hour ago, stgatilov said:

"TDM 2.09 requires OpenGL 3.3"

Ok after a good cry, I've recovered. 😕  Will look at older revs.

Quote

"To be honest, the fact that this vim3 uses Android instead of standard Linux will be the critical problem. If it won't work on X windows, then someone will have to rewrite quite a bunch of OS-specific code to make TDM run."

Good news here!  It runs bog standard linux too!  Currently running devuan beowulf on it.

Building now with sse2neon.h headers and it looks like it might work.

https://github.com/DLTcollab/sse2neon

It's a bit more involved.  The Simd.cpp wants AVX stuff, which might be supplyable with:

https://github.com/kunpengcompute/AvxToNeon

Which does build on my box and passes tests

AVX2NEONTest Complete: Passed 335 tests : Failed 0

--------------------

Since we won't be getting opengl 3.3 soon (all that gl 4 compute stuff would need backporting), I'll look at the last TDM that uses opengl 3.1. 

Can anyone suggest a mission with low amount of geometry in the assets?  I'd be wanting around 130k triangles or lower.

 

Cheers!

Edited by clort
typo
Posted
7 hours ago, clort said:

Can anyone suggest a mission with low amount of geometry in the assets?  I'd be wanting around 130k triangles or lower.

Closemouthed Shadows is my FM of choice when I need level of minimum size.

  • 1 month later...
Posted

I have covered all the x86-specific trash in proper ifdefs (see 4550).
Even managed to cross-compile TDM for 64-bit ARM (stopped at linking phase).

Note however that:

  1. Recent trunk requires OpenGL 3.3 (perhaps revert required version to 3.1 and check what stops working after that).
  2. In order to link TDM, you have to build all third-party libs for your platform via conan --- that could be hard.

 

  • Like 2
  • 1 year later...
Posted

I was able to install, launch, and watch the opening videos of TDM 2.10 on a Pi 4b via Box86 by setting the environment variable MESA_GL_VERSION_OVERRIDE=3.3 first. However, it froze after a frame or two of gameplay. I haven't tried to debug that yet. Note that TDM 2.08 and earlier use GL3.1+extensions (but still probably require 3.3-compliant hardware unless you're up for some hacking) and 1.08 and earlier are judt Doom 3 mods (but incompatible with Dhewm3).

  • 1 year later...
Posted

Now that Mesa 23.3.4 supports OpenGL 3.1 on V3D, the pre-built x64 version of TDM works great with Box64. I still had to set MESA_GL_VERSION_OVERRIDE=3.3. Frame rate was quite playable on RPI5, although I bet it would chug on RPI4.

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • thebigh

      Starting a playthrough of the whole Dark Mod, from oldest mission to newest. I've knocked over the first few already and about to start Living Expenses. Only ~170 missions to go!
      · 9 replies
    • Ansome

      I'm back! Happy new years, TDM folks!
      I brought with me a quick update for my first FM that fixes up a lot of small issues that didn't get caught in beta testing. I didn't exactly expect it to take me nearly 9 months to release a patch, but it's been a wild year to say the least. Teaching, finishing up my Master's of Education, and all manner of other events forced me to drop out of the anniversary FM contest and ate up all my time, but I'm back again in a comfortable position to start catching up on all the new FMs. I may even start work on another spooky project of greater length and difficulty in the coming year.
      Thanks again for the warm welcome to the community and have a happy new year!
      · 3 replies
    • JackFarmer

      I got myself the apple tv trial subscription. I have to say, “Foundation” (season 1) is very exciting. Shall I read the books as well?
      · 2 replies
    • datiswous

      One more like..
       

      · 3 replies
    • snatcher

      TDM Modpack v4.6 released!
      Introducing... the Forward Lantern mod.
      · 0 replies
×
×
  • Create New...