Software rendering the statusbar?

Moderator: GZDoom Developers

Lehdari
Posts: 2
Joined: Sat Nov 26, 2022 3:18 pm
Operating System Version (Optional): Ubuntu 20.04
Graphics Processor: nVidia with Vulkan support

Software rendering the statusbar?

Post by Lehdari »

Hi,

(This is not that much of a feature suggestion but a development support request, please move the thread to a correct subforum in case there is one that's more fitting.)

Me and a friend of mine are currently developing an AI research platform similar to ViZDoom but with a C++ interface and one based on GZDoom. In similar fashion to ViZDoom, the plan is to implement an interface based on the cycle of [ assign an action ] -> [ update the game state ] -> [ fetch game state (such as the pixel buffer, player status, etc.) ] -> [ repeat ]. As the game won't be played by a human and we want to be able to run the game with highest framerate possible, we don't have use for the game window. Furthermore, we would like to use as much of the GPU horsepower for AI as possible and utilize software rendering instead.

So the plan is to remove all SDL / OpenGL -related features and build a custom interface like described above. Work on this is currently well underway: we can already provide actions as inputs and have the pixel buffer communicated back as an output. We also found out that the GZDoom's truecolor software renderer is very flexible and relatively easy to modify (I already implemented depth rendering using it), so we'd very much like to use it instead of renderers in other doom source ports.

Now the only hurdle we really hit the wall with is the status bar / HUD rendering. Apparently it's completely implemented with hardware rendering, even when software renderer is used for the 3D scene. Now after a couple of days of hacking attempts and comparisons with the old ZDoom source code, I've found out that there are still remnants of the old status bar rendering code present in the code base but they're apparently unused. (I might be speaking out of my ass here as the code is somewhat.. convoluted.)

So my question is that is it possible to render the HUD / status bar with software only? If not, could it be achievable with relatively little amount of work (that is, retrofitting the old renderer code from ZDoom isn't an option for example - during my darkest moments I gave that a try too :p)? If it is, would you be able to provide a couple of pointers how I might want to go about this? So far I managed to reutilize the DSBarInfo::_Draw by wrapping the StatusBar and SBarInfoScript[SCRIPT_CUSTOM] to a DSBarInfo object, but for some reason the script object doesn't contain any draw commands (commands buffer in SBarInfoCommandFlowControl is empty and only contains NULL values).

Thanks!
User avatar
Rachael
Admin
Posts: 13211
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Software rendering the statusbar?

Post by Rachael »

Software rendering is out of scope of the GZDoom project, at this time.

As interesting as this may sound, the implications of such a project like this run very deep, and I also want no part in that. I believe in the long run, when you see the forest instead of the trees, a project like this could lead to real life human suffering and I want nothing to do with it. Humans playing Doom may know when to stop pressing the "fire" key when they return to real life. A bot might not.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48543
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Software rendering the statusbar?

Post by Graf Zahl »

The 2D software rendering code was removed because it stood in the way of streamlining the engine at a time where very few people were still using it
You will have to go back to GZDoom 3.3 to find a version capable of full software rendering - but good luck integrating it with the current code base. For obvious reasons we can not offer any support for such an undertaking.
Lehdari
Posts: 2
Joined: Sat Nov 26, 2022 3:18 pm
Operating System Version (Optional): Ubuntu 20.04
Graphics Processor: nVidia with Vulkan support

Re: Software rendering the statusbar?

Post by Lehdari »

Graf Zahl wrote: Sun Nov 27, 2022 1:17 am You will have to go back to GZDoom 3.3 to find a version capable of full software rendering - but good luck integrating it with the current code base. For obvious reasons we can not offer any support for such an undertaking.
This already helps a lot, let's see what we can make happen. Cheers!
Rachael wrote: Sat Nov 26, 2022 8:55 pm As interesting as this may sound, the implications of such a project like this run very deep, and I also want no part in that. I believe in the long run, when you see the forest instead of the trees, a project like this could lead to real life human suffering and I want nothing to do with it. Humans playing Doom may know when to stop pressing the "fire" key when they return to real life. A bot might not.
In case you're talking about automated warfare - that is very much already a thing and this project has nothing to do with it. Doom just happens to have multiple good qualities as a reinforcement learning platform compared to other games/environments that are popular in the current literature. Just to be clear, I don't want anything to do with combat robotics either but regardless of that it seems to be the future we're heading into.

Return to “Closed Feature Suggestions [GZDoom]”