Cogmind > General Discussion

Performance Mods for Cogmind [STABLE] OpenGL, modern CPUs (2007-2013+) (4k res)

(1/4) > >>

Luigi:
EDIT: Loading time also improved with separate mod
EDIT 2: You must register for the forum to see attachments on posts (and download them)


The CPU mod can be downloaded here https://github.com/aronson/SDL-1.2/releases

The "GPU" mod can be downloaded here https://github.com/aronson/sdl12-compat/releases

Hello fellow Cogminders, would you like to get anywhere between 20-400+% measurable FPS speedups on your machine?

I can make Cogmind draw on your screen faster (FPS++)!

I have found the source code to and made numerous modifications to the SDL.dll file powering the graphics for the game.

Are you running on an older/slower machine, Wine on Linux, or macOS?
Or might you be streaming Cogmind on Twitch.tv or recording it with a program like OBS or even the built-in Windows recording feature for games?

Do you have a computer that chugs a little bit now and then when you pan the map with shift and mouse aggressively? If it lags in this situation, it probably lags in other situations too. One that comes to mind is those beautiful win animations -- you rarely see them, but on WINE on regular ol' Linux you might have a 15 FPS experience as you hit that lovely high note if you have a computer from around 2014, not 2022, and you have your own reasons for not running Windows.

One can display an FPS counter with Ctrl+F3 in the titlebar and above your core to track FPS as you play, if you feel it's lagging a little bit compared to other video games on your machine.

If any of these situations apply to you, I highly suggest you try out my experimental builds of the Simple DirectMedia Library (SDL) attached to these posts with your copy of Cogmind. You can unzip these files and drop the DLLs contained within next to Cogmind. Note, this will overwrite your original files! Please either rename them to something like SDL.dll.bak first so you can restore them later, or you can click "validate local files" in Steam through the game's properties to return to the official Cogmind CPU renderer.

Please do not run random DLLs off the internet
After half a decade working as a cybersecurity engineer in network forensic analysis for a US department of defense contractor, I urge you, do not run binary files like DLL's and EXE's from sources you don't trust.


Source code is linked here ;)
CPU mod: https://github.com/aronson/SDL-1.2
"GPU" mod: https://github.com/aronson/sdl12-compat https://github.com/aronson/SDL/tree/cog-sdl2
Original sources provided by Kyzrati: https://www.gridsagegames.com/forums/index.php?topic=1566

Don't report new bugs to Kyz if you use this
I'm very interested in new bugs, but if you use this who knows what will happen. I have a pretty good idea -- massive speedups for a lot of use-cases that are outside of Cogmind but make sense in 2022 when we are running operating systems with multi-tasking. If something weird happens, restore the old DLLs and try it again first. If you see a difference, great, feel free to let me know and I'll see what I can do :) If you don't see a difference and it's buggy, well, nothing to do with me!
There is a memory leak of like a few bytes, that's why it's in the archive name. It doesn't compound unless you change the window size or borderless fullscreen/etc. setting as far as I understand, but I have not yet fixed it.

Kyzrati:
Extremely impressive work, Luigi :)

Was amazing to see how fast you hacked this out despite being totally unfamiliar with the relevant tech.

Note that Cogmind doesn't feel much different beyond 60 FPS (there are minor differences in a few animations), and it's capped there by default, so anyone wanting to take advantage of extra FPS offered here would also need to uncap theirs in the advanced options, unless you're not actually reaching that cap to begin with, which only really happens on systems over 10 years old.

As Luigi mentions, one exception might be those using non-Windows systems, who are more likely to get something out of this since those systems can often benefit from Cogmind using a hardware-based graphics solution as opposed to the software approach it's built with (although hardware-based solutions tend to run into more issues that need troubleshooting). Also this can be useful if you're streaming with a web cam and green screen etc, depending on your software.


--- Quote from: Luigi on January 04, 2022, 11:37:26 PM ---There is a memory leak of like a few bytes, that's why it's in the archive name. It doesn't compound unless you change the window size or borderless fullscreen/etc. setting as far as I understand, but I have not yet fixed it.

--- End quote ---
Yeah this and a few other tiny memory leaks are present in Cogmind, but since they don't compound and are part of the library rather than stuff that I wrote myself, I never bothered with them. (Dynamically resizing the window isn't something you can do while running the game anyway, so that particular function is only called when switching fullscreen modes, which isn't something people are repeatedly doing while playing anyway :P)

Luigi:
Keyboard fix for GPU mod on macOS

One can "just do it in the OS" with Karabiner-Elements, formerly known as KeyRemap4MacBook -- a free, open-source application that allows for complex scripting.

It can be obtained here
https://karabiner-elements.pqrs.org/

For a simple fix, press the "Add Item" button, choose "right_shift" and set it to "left_shift". Easy peasy! Included is a screenshot of how it should look when you're done.
Spoiler (click to show/hide)
Works great on my machine! I will learn how to apply it to only CrossOver, and hopefully only COGMIND.EXE at some point. This works for me for now, I hope it helps others!

Luigi:
Cogmind with Software (CPU) Blitting using SSE4.1 and AVX2 is now available!
Fastest option out there on Windows! No hacks needed, drag and drop
Note: it's also attached to the first post

What does that mean? If you have a CPU from 2013 or later this will get you free performance under load and at idle. If your CPU is older than that... you still get free performance! Isn't that great?

JellySquid and a number of other talented programmers worked with me to create this build of SDL. I have gone from 15 FPS under stress at 4k on my Ryzen 7 5800X to 77 FPS. Yeah. Crazy.

YMMV, have fun! Sources are on my github.
https://github.com/aronson/SDL-1.2

Note: This new stable release also includes debug symbols

Luigi:
Faster loading times are here!

[EDIT]: Below info is outdated, but the new DLL attached here is what you want

Try the later AVX build if your machine was made after 2013 or is not Apple Silicon.


The game ships a real old libvorbis-0.dll that doesn't have modern optimizations enabled.

I'm down from 7 minutes on my M1 MacBook to 30 seconds. It's ~100% faster now on older Intel-compat PCs (<2013).

Drag and drop and overwrite per usual.

Sources can be obtained from Xiph. I compiled with -O3 -msse4.1 -ffast-math
Note: The original release was accidentally empty, sorry about that! This new release also includes debug symbols.

Navigation

[0] Message Index

[#] Next page

Go to full version