SUPPORT BOARD OVERVIEW & TIPS:

About Receiving Help from the Support Board: While all members may answer questions posted in the Support board, you should only rely on responses posted or confirmed by support moderators and website administrators. Any solutions provided by members of the community that are not verified by a staff member (as indicated by a light-green background) are provided as-is, and we cannot take responsibility for any of the results of said actions.

About Responding to Support Threads: If you feel you know the answer to a question, you are welcome to respond to the thread and politely offer assistance. Please be courteous and try to provide detailed and helpful solutions to users who may not be as advanced as you. We ask that you refrain from posting one-sentence solutions.

Please search for existing topics before creating one! It's quite likely someone else has already encountered a similar issue which was resolved. You can search for existing support threads by clicking here .

About Topic Tags:

* Topics denoted with the [OPEN] tag are awaiting a response from the end user. You are welcome to post in these threads if you are experiencing a similar issue so we may provide further support.

* Topics denoted with the [RESOLVED] title have been successfully answered and confirmed by a support moderator and the end user, and should be used as a reference. These topics are locked.

* Topics denoted with the [CLOSED] tag were either inactive for more than 30 days or the end user did not respond to a suggestion and confirm if the issue was resolved. These topics are locked.

exclamation-circle Is their a hidden Direct X or vulkan backend? AMD RX 570 poor Open GL peformance

  • CHIEFISREAL
  • CHIEFISREAL's Avatar Topic Author
  • Visitor
  • Visitor
26 Apr 2022 06:05 #1
Hi

I have 2 computers: one with a Nvidia GTX 1080 and a Intel i7 8700k the other an AMD RX 570 with an AMD R5 3600. Both on paper should run this game with flying colors but the AMD RX 570 system stutters quite a lot and cant maintain a frame cap of 60 despite lowering settings (GPU utilization is nowhere near maxed out also depends on which level). Once I learned from Afterburner that Marbleblast is OpenGL based I theorized that its just AMDs terrible GPU support of OpenGL and testing with the GTX 1080 system proved that theory Maintaining a steady 144hz with everything maxed on the same track (I used the marbleblast gold level intermediate 1 to test both systems).

On both systems the game is installed on a M.2 Nvme pcie 3.0 drive, both systems have 16 gb of ram only difference is the GTX 1080 system has windows 11 (should make no difference logically).

This has to be Documented by this point with players that are using AMD GPUs not playing well with OpenGL which has been well known for some time. Is their a hidden option to change the backend the game is using to DirectX or Vulkan? That would solve everything. I think I need to talk to one of the Devs.

Thanks!
  • Posts: 238
  • Thank you received: 17
27 Apr 2022 00:24 #2
Are you having this issue with Marble Blast Gold or PlatinumQuest?
  • Chiefisreal
  • Chiefisreal's Avatar Topic Author
  • Visitor
  • Visitor
29 Apr 2022 19:33 #3
PlatinumQuest
  • Posts: 11
  • Thank you received: 0
29 Apr 2022 19:42 #4
PlatinumQuest

I made an account due to the delay between when I post and when my post actually shows up. Sorry for duplicates Sorry for duplicates
  • Kalle29
  • Kalle29's Avatar
  • Offline
  • Moderator
  • Moderator
  • I blame ping for losing
  • Posts: 986
  • Thank you received: 756
29 Apr 2022 22:39 #5

CHIEFISREAL wrote: PlatinumQuest

I made an account due to the delay between when I post and when my post actually shows up. Sorry for duplicates Sorry for duplicates

Hey, sorry about the delay, we need to manually approve posts by guests and new accounts to prevent bot spam.

༼ ͡◕ ͜ ʖ ͡◕༽ You have been visited by the Nivea™ Donger of moisture. Soft skin and good fortune will come to you, but only if you post "thank you Mr. Skeltal" in this thread ༼ ͡◕ ͜ ʖ ͡◕༽
  • Posts: 11
  • Thank you received: 0
02 May 2022 04:39 #6
Soooooooo is there an ETA on when I might get a useful response on this
  • Kalle29
  • Kalle29's Avatar
  • Offline
  • Moderator
  • Moderator
  • I blame ping for losing
  • Posts: 986
  • Thank you received: 756
02 May 2022 22:17 #7
The reason you're not getting a good response is because I don't think anyone really knows if DirectX even exists in PQ anymore. The original developers are not working on this project anymore. You could however still join our discord server if you still wish to speak to the current developers. discord.com/invite/UEkTDwg

༼ ͡◕ ͜ ʖ ͡◕༽ You have been visited by the Nivea™ Donger of moisture. Soft skin and good fortune will come to you, but only if you post "thank you Mr. Skeltal" in this thread ༼ ͡◕ ͜ ʖ ͡◕༽
  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
03 May 2022 01:23 #8
There is no DirectX support in PQ. Support in MBG was flaky at best and PQ dropped the feature for easier compatibility between mac/windows renderers.

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }
  • Posts: 11
  • Thank you received: 0
04 May 2022 11:42 #9
I see well then remove information that says AMD GPUs are supported because in reality there not because it's a stutter mess that's easily reproduceable. AMD GPUs can do everything but edge cases where Open GL is used. I'll get a Nvidia GPU for the secondary system then. Disappointing.

How the hell dose this supposedly work on Mac when Macs use AMD Gpus and this is open GL based? Same problem would exist unless people are happy wither stutters and don't mind terrible frame consistency that's my only explanation.

Last question I've herd latter versions of Open GL Eg: 4.6 work better with AMD gpus then older versions. What Version is MBP using?

Thanks!
  • RandomityGuy
  • RandomityGuy's Avatar
  • Offline
  • Administrator
  • Administrator
  • This entire place is bruh
  • Posts: 272
  • Thank you received: 81
04 May 2022 15:37 #10
The version of OpenGL rendering done by PlatinumQuest comes under OpenGL 2.1 immediate mode rendering which modern hardware does not seem to like (except for the shaders/post processing, they use the modern rendering methods).

People running the game on M1 mac through wine face heavy performance issues(~15-45fps) and bugs. On Intel macs, the performance isn't much better.

One of the major bottlenecks of the game is that it runs on a single thread and interpreting a fair amount of Torquescript every frame due to which combined with immediate mode OpenGL, the rendering is tied to how fast the engine can process this code.

Github:
github.com/RandomityGuy
Feel free to support me at ko-fi.com/randomityguy
The following user(s) said Thank You: NF
  • Posts: 11
  • Thank you received: 0
05 May 2022 02:38 #11
Sounds like performance is bad across the board on everything but an Nvidia Chip. Open GL 2.1 is quite old and isn't helping my AMD GPU issue at all and I suspect is the source of the problem. Is there any way to bump the OpenGL verson up to 4.6+ (I know this is easier said than done probably)? This mirrors the Minecraft issue people with AMD gpus have where they had at least in the past terrible performance in Minecraft due to its very old version of OpenGL it used but then Use a mod like optifine or sodium to use a much more modern verson OpenGl eg: 4.6+.

Now since this a cross platform game with mac and windows (I get why direct x isn't a thing now), mac has depreciated open GL support, but older versions still work however to my knowable Vulkan is fully supported in MacOS, performs well across the board on basically everything (except intel igpus ive herd) and is more multithreaded in nature. I know this is asking for the world but in theory would it be possible for a vulkan backend to exist? (I know this is a hell of a lot easier said than done but I just want my marble to run smoothly lol) also is this project open sourced?

One odd thing ive noticed on problem levels which includes marble blast gold level pack intermediate level 1 ramps, it would stutter for a while then be perfectly smooth on my AMD rx 570 kind of acting like emulators are when shaders are being generated but then if I backout to the level and go back in it still stutters again.

Anyways thanks for your incite hope to gain even more on this. I first played marble blast gold in a mac lab in 7th grade and the game stook with me.
  • RandomityGuy
  • RandomityGuy's Avatar
  • Offline
  • Administrator
  • Administrator
  • This entire place is bruh
  • Posts: 272
  • Thank you received: 81
05 May 2022 03:55 #12
I did try to bump the OpenGL context version to 4.6 once for testing and it did not improve the performance slightest. Most likely due to the fact that the game is still using the obsolete OpenGL immediate mode rendering. This can only be changed by...rewriting all of the rendering code for everything to use modern OpenGL features.

Vulkan backend could in theory exist if a large amount of time was invested in making it by doing the rendering code rewrite. It is not something I or the other devs can do currently.

PlatinumQuest scripts are open sourced at github.com/The-New-Platinum-Team/PlatinumQuest-Dev However the engine that the game uses is not and we do not have its sources so we cannot recompile the binaries. PlatinumQuest instead uses github.com/RandomityGuy/MBExtender to inject code into its binaries for various features such as shaders. So a rendering rewrite will also involve reverse engineering the binaries to find where the rendering functions are located and what data is used by them so that it code can be injected in those places.

TLDR: It's a mess due to the game using obsolete methods of rendering and a rendering rewrite is not currently feasible.

Github:
github.com/RandomityGuy
Feel free to support me at ko-fi.com/randomityguy
  • Posts: 11
  • Thank you received: 0
05 May 2022 05:32 #13
Sounds like I actually got to a Dev..Cool!

Which Gpus did you test with the 4.6 OGL? I would think the AMD gpu would benefit at least some in that jump.

I've been looking into OGL to Vulkan wrappers but it's all a little over my head even as a computer science student, could some implication of a translation layer possibly be added? I figure that would be simpler than a from scratch Vulkan backend rewrite, by a lot. Has this by chance been experimented on?

The nature of OGL is hurting AMD here I'm sure as well as AMD seems to stick to stock OGL and is single threaded bound while NVidia has some hacked multithreading thing going on boosting the performance from what I've read, and I suppose after reading above brute forcing its way to run MBP with high frame rates when literally nobody else can apparently.

Out of curiosity and the fact I'm bored out of my mind whit all the time in the world what would be some of the first steps in reverse engineering the binaries? like what tools are used etc. Problem with my programming assignments is their all boring to me I have no connection to them therefore don't really care, this I care about therefore I'm interested in learning more.

Anyways thanks for the nice conversation regardless!
  • RandomityGuy
  • RandomityGuy's Avatar
  • Offline
  • Administrator
  • Administrator
  • This entire place is bruh
  • Posts: 272
  • Thank you received: 81
05 May 2022 06:30 #14
Unfortunately I only tested the OpenGL 4.6 hack on my own NVidia GPU. I can send the patched binaries if you want to test.

So far the only OpenGL to Vulkan "wrapper" I could find was Zink , which you could try to see if it works before I actually add support for it, which is much easier than the backend rewrite.

As for reverse engineering the binaries, you need a IDA/ghidra disassembler(any disassembler works as long as it has "translate to C"), the Torque Game Engine source , the MBG windows and mac binaries and C/C++ knowledge. Then you throw in both the windows and mac binaries into the disassembler. The mac binaries still have their function names and symbols into it. Then the "task" is to find the appropriate functions that you want to override in the windows disassembly by comparing the with the Torque source code as well as the mac disassembly, theres lots of operations that is "obfuscated" due to it being converted into pointer arithmetic such as accessing class members/fields. One of the most easily accessible things in either of the binaries is the virtual function table, basically a list of consecutive virtual functions for a class, the order being the same in both the binaries. Once you find these out, you can find the starting points of from where to carry out the above task. Once you find the appropriate functions, you then copy its address and make a new entry in the MBExtender source code in the appropriate location, and then you can override that function using the extender plugins. You can see the plugin source codes , the function addresses , etc in the above mentioned MBExtender source.

Github:
github.com/RandomityGuy
Feel free to support me at ko-fi.com/randomityguy
  • HiGuy
  • HiGuy's Avatar
  • Offline
  • Lead Developer
  • Lead Developer
  • PQ Developer Emeritus
  • Posts: 1334
  • Thank you received: 605
05 May 2022 08:08 #15
We looked into rewriting the parts of the engine that used immediate mode OpenGL 1.1 graphics, somewhere around 2015. We determined that trying to patch such a change into the game was way outside the ability of anyone on the team, and the best we could get would be OpenGL 2.1 under the compatibility profile with some basic shaders. So what we ended up with was a weird chimera hybrid of 2003 immediate mode rendering code (CPU tells the GPU where the triangles are, one vertex at a time, it's really slow) and a 2015 implementation of shaders from like 2006. The amount of context switching the game ends up doing is considerable, trying to support both of these different pipelines on each frame, and the costs add up pretty fast.

At the time we were testing on a couple different setups, notably Intel Iris Pro (MacBook Pro ~2015) and GTX 1060/similar. This was before AMD GPUs really took off again and we didn't have the resources to test on systems other than the ones we used daily. My FPS target upon release of 2.0 in 2017 was 60fps on that MacBook in nearly all PQ levels. Since then, more features and graphics settings were added, decreasing frame rates without as much performance testing. Combine that with hardware/software moving beyond those older graphics modes, and many implementations just being shims over modern APIs (OpenGL on M1 is just a crappy wrapper around Metal), the frame rates never really recovered.

Also mentioned by RandomityGuy is how the engine itself is single-threaded, and the scripting language is really slow. There is A LOT of script code in PQ that executed every frame, and it can take upwards of 5-10ms on a decent setup. We ported a number of features to C++ that were really slow in MBP <2.0 (radar, network physics, and the new team ported moving objects), but even so there is plenty more that was not. Scripting overhead is not super affected by Wine/M1 translation the way rendering was, but it still adds considerable cost to every frame.

Reverse engineering for MBP/PQ was mostly done using Hopper Disassembler ($80) because it was available for macOS and cheap. A couple people used IDA Pro, but licenses for that start at around $10,000 so you probably won't get your hands on a legal copy. Later on in development, other tools like Ghidra (free) and Binary Ninja ($300) became available and we played around with them, but by that point the mod had shipped and most of the development had been scaled back. These days there is also Cutter (uses Ghidra's backend but with rizen as a core?) and angr Management (under heavy development and imo unusable), but since Ghidra is free and legal that's probably what you'd use for this now.

Most of the reversing I did was on straight assembly since Hopper's decompiler was hot trash, but the people using IDA had access to decent decompiled source code that was a lot easier to read. I would recommend a good decompiler if you're starting out, since assembly (and x86 in particular) has lots of weird semantics that are confusing and require you to read lots of manuals to understand what is going on.

The general process used for reversing the game was to look for functions that sounded like they did what we wanted, and then replace them with our own versions. We were lucky that in the mac version of MBG, the function names were still available. This made it pretty easy to search for functions by name, which we could then use to find those same functions in the Windows version. That process was generally done by looking up strings that were used only in our target functions and finding functions on the Windows version that had the same strings. It worked pretty well. Also helpful was finding the VTables used for all the C++ classes, which showed us where all the virtual functions were for each class.

Secondarily, we also had to reverse engineer structures and classes used in the engine. Luckily for us, we found a copy of a very similar version of the Torque engine, and most of the header files lined up with what MBG did. In cases where there were differences, we cursed a lot and basically just guessed as to what each member of a structure did, using clues from the assembly/decompilation for more accuracy. Hopper had extremely garbage support for structures, so this was mostly just throwing numbers into a header and running the game to see what values came out.

If you're interested in reverse engineering and have a decent computer science background, I would recommend looking into beginner-level CTFs like OverTheWire. I ended up getting a career in that industry, aided by all the skills I picked up reverse engineering MBG, and it's a challenging but rewarding space if you're interested. Also the salaries are astronomical in case that matters to you.

Whew this was a bit of a diversion. Hope this clarifies some of the process by which PQ got to its current state. It's hard to teach an old engine new tricks and you can really see in the subpar performance. I'm not sure of any good solution other than someone like RandomityGuy pouring 100s of hours into profiling and optimization, and I don't think he'd particularly want to do that. You might see some gains with an OpenGL wrapping layer, but the overhead of translation is probably not greater than the savings, and it won't do much to improve script performance. It's worth a shot though if your performance is bad, I just don't know any tools for it off-hand that I would recommend.

This signature is real code
Code:
function clientcmd12dothepq() { commandToClient(LocalClientConnection, '34onthedancefloor'); }
  • Posts: 11
  • Thank you received: 0
05 May 2022 09:21 #16
I appreciate the incite! I am a computer Science student, but we haven't done anything like this yet. Best I can do is try RandomityGuys 4.6 GL binaries and try the vulkan wrapper.

Speaking of which I'm looking into the wrapper atm it seems far more straight forward then the documentation makers it out to be. it asks me some questions I'm not sure what answer to put for some of them maybe you can help?

64 bit app? No I know that one
do I want Desktop OGL drivers?
Open GL ES support? what dose this mean?
off screen rendering?
graw library?

Regardless ill probably pick up a rtx 4080 when it comes out and replace my RX 570 with my current GTX 1080. Amd's biggest problem is OpenGL always has been everything else works fine but OpenGL just crashes and burns quite sad. AMD should just release a driver level wrapper that can be turned off and on at this point per app. Even with all the bottlenecks in the game my 1080 pushes out 144 frames a sec with no hiccups. NVidia's OGL is just unbeatable.

Thanks Again!
  • Posts: 11
  • Thank you received: 0
05 May 2022 09:29 #17
Yea those binaries sound useful I can definitely check them out.

I also came across that wrapper I was playing with it earlier today but some of the options I don't know what to select maybe you can help?

64 bit app? No, I know that one
Do I want Desktop open GL drivers?
Do I need OpenGL ES support?
off screen rendering?
Graw Library??

Thanks!
  • RandomityGuy
  • RandomityGuy's Avatar
  • Offline
  • Administrator
  • Administrator
  • This entire place is bruh
  • Posts: 272
  • Thank you received: 81
05 May 2022 12:21 #18
For the wrapper I mentioned, the "per-app" installation does not seem to work with PQ on my system and I have not tried the system wide installation(would rather not). The answer to all the settings is "no".
As for the binary, it is in the attachments, replace <PQ Install Location>/plugins/GraphicsExtension.dll.

Github:
github.com/RandomityGuy
Feel free to support me at ko-fi.com/randomityguy
Attachments:
  • Posts: 11
  • Thank you received: 0
06 May 2022 07:47 - 06 May 2022 08:41 #19
Ok...I am confused

My initial results of testing those newer OpenGL binaries were that the issue has been fixed and the massive stuttering is gone! However, I went back to the old binaries and that one level in marble blast gold that had the massive stuttering, and it still didn't stutter with the old ones.

But with the newer OGL binaries there are other levels in the ULTRA maps that stutter for 2-3 seconds and then play perfectly fine after that, so I think 4.6 dose have an Improvement for AMD and maybe should be implemented into main game.

But things get interesting after that: I did some other testing and both with the new binaries and the old ones if the frame cap was set to 100 the game ran perfectly fine regardless except massive frame tearing. I then went to add the game to my AMD control panel to activate fast sync considering my 1080P projector is 60hz and I need around 100 FPS to remove all stutters I go to launch the game itself and its very broken when not launching with the launcher (pics attached I couldn't describe this if I tried). I tried adding the launcher itself, but my fast sync setting didn't apply to the main game because I had the launcher selected. Expected that but still tried. This strange behavior happens on both my AMD GPU pc and Nvidia as well. The AMD GPU performs more consentient at a higher framerate then a locked lower one. Usually, lower frame rate caps are established to maintain more consistent performance but for this case I had to do the opposite with a dramatic improvement to smoothness.

If I could launch the game directly and not use the launcher but only to check for updates I, then could use AMD fast sync with a 100 fps cap and any frame drops I would have would be above my 60hz projectors output therefore would produce a perceived flawless experience. Is directly launching the game possible? Is this fixable? Is their another way to add MBP to the control panel?

Thanks!

(None of the images are cropped in any way or form this is just how the screen looks.)

Also what is fast mode in the game settings do? Seemed to do nothing when I tried it.
Attachments:
Last edit: 06 May 2022 08:41 by CHIEFISREAL.
  • RandomityGuy
  • RandomityGuy's Avatar
  • Offline
  • Administrator
  • Administrator
  • This entire place is bruh
  • Posts: 272
  • Thank you received: 81
07 May 2022 04:43 #20
Oops sorry for the bugs, you can fix those if you download this file here and put it in PQ/platinum/client/scripts/optionsGui.cs. This should fix the broken "lower resolution rendered at higher resolution" bug. However you won't be able to get into the Online leaderboards for a while until the next update when this fix will be in it.
Fast mode tries to reduce the "amount of torquescript running per frame" by disabling/reducing calculations of certain things such as cannon trajectories.

Github:
github.com/RandomityGuy
Feel free to support me at ko-fi.com/randomityguy
  • Posts: 11
  • Thank you received: 0
07 May 2022 10:22 #21
Any ETA on when the next update would come out?

Ill try those files if that allows me to use fast sync then ill consider this to be a good workaround for AMD GPUs. Is their any technical explanation for how a game would perform better at higher framerates then lower ones? Just curious.

Thanks!
  • RandomityGuy
  • RandomityGuy's Avatar
  • Offline
  • Administrator
  • Administrator
  • This entire place is bruh
  • Posts: 272
  • Thank you received: 81
08 May 2022 08:14 #22
Between 3 weeks to a month before the next update, if lucky, it can happen earlier.
The explanation for your question I could find out was www.reddit.com/r/computergraphics/commen...below_60_if_without/

Github:
github.com/RandomityGuy
Feel free to support me at ko-fi.com/randomityguy
  • Posts: 11
  • Thank you received: 0
08 May 2022 14:58 #23
I downloaded your optionsGui.cs file and put it in PQ/platinum/client/scripts folder along with the already existing optionsGui.cs.dso file that's their and nothing changed when launching from the Game directly. Still broken like my screenshots, big sad. Also, on my Nvidia PC screen is zoomed in to the bottom left quadrant with or without your new file. Tried alt = enter to maybe hope for a windowed mode shortcut so I could set a new Screen res and the game crashes. Attached is the Nvidia PC screenshot.

Am I missing something?

Thanks!
Attachments:
  • RandomityGuy
  • RandomityGuy's Avatar
  • Offline
  • Administrator
  • Administrator
  • This entire place is bruh
  • Posts: 272
  • Thank you received: 81
08 May 2022 19:06 #24
Thank you for the bug report, it looks like a crucial bugfix I did for the next update is still incomplete. I would like to investigate more into this. As the bug does not occur on my PC, can I get your Discord or any other instant messaging platform contact details so we can debug this faster?

Github:
github.com/RandomityGuy
Feel free to support me at ko-fi.com/randomityguy
  • Posts: 11
  • Thank you received: 0
09 May 2022 04:07 #25
Sure CHIEFISREAL#7013
Moderators: Doomblah
Time to create page: 1.379 seconds