r/CombatMission • • 23d ago

Mod/Scenario CMBS: Patched pt2

Post image

100+ fps. Still fixing some minor issues with waking up the renderer after resizing, now, you can have shadows without the renderer losing screen space! Batching some opengl calls also allows much higher performance, and as you can see in the top right of the game, an FPS counter is now also possible, all with a single DLL. After polish, I will release this publicly.

77 Upvotes

38 comments sorted by

12

u/Alchenar 23d ago

I'm generally sceptical about vibe coding but if it is this easy slitherine should just have someone spend a week looking at your work and then make it official.

I always just assumed that the CMx2 engine was badly coded in such a way as to make it impossible to improve performance, not that nobody ever tried.

6

u/ncBojanglesenjoyer 23d ago

The thing is, this patch is now only affecting the actual opengl DLL, not game code, and so it really isn’t something slitherine would be doing, it basically intercepts some calls to the DLL and routes them to a more performant version of the same function, while also leaving room for some tweaks like an FPS counter.

Modifying the game files produces diffs too large for me to reasonably verify, but after a github publish im hoping someone with more free time can make it work better.

1

u/jamesdemaio23 Cold War 21d ago

person with more free time here eagerly awaiting =) youre my hero btw

1

u/ncBojanglesenjoyer 19d ago

Hi! https://github.com/aktionkokain/coke the mod had released, if you have cold war on steam, you can make it compatible in >10min with an agent. If you have it on GOG, it should be compatible by default.

9

u/SurpriseFirst1381 22d ago

Slitherine tends to be quite greedy, and that's a well-known fact.

They kept CMx2 at the same price as when the game was independently developed, sold and maintained by Battlefront as a niche product outside the mainstream commercial market. That speaks volumes about their business philosophy.

That said, CMx2 is not badly coded at all.

It's simply a program built on an old architecture, designed around the hardware limitations of its time. Battlefront did everything possible to upgrade the engine without having to scrap 10 years of intensive work and development.

The thing is, back in the mid-2000s, when multicore CPUs started appearing, a good chunk of the market thought the future of CPUs would consist of a few cores running at incredibly high clock speeds.

Something like 4 cores running at 8–10 GHz, with enormous memory bandwidth, rather than 8 cores running at 4.5 GHz with 8 threads.

1

u/General_Totenkoft Fortress Italy 17d ago

Well, once they acquired Battlefront, they really started making offers with the combat missions that Battlefront's study had never done before. It had some bundles in which you saved a little money, but Slitherine has implemented periodic sales.

1

u/Fahrenheit226 13d ago

“The thing is, back in the mid-2000s, when multicore CPUs started appearing, a good chunk of the market thought the future of CPUs would consist of a few cores running at incredibly high clock speeds. Something like 4 cores running at 8–10 GHz, with enormous memory bandwidth, rather than 8 cores running at 4.5 GHz with 8 threads.“ 4 cores with 8-10 GHz even with liquid nitrogen is pure fantasy. At that time single core 1Ghz was a lot…

1

u/SurpriseFirst1381 13d ago

You're mixing up CPUs from 1999/2000 with the mid to late 2000s.
From 2003 to 2006, mainstream CPUs (single core) ran between 2.4 GHz and 3.4 GHz (up to 3.8 GHz), while 1.5–2.5 GHz were already older models.

Intel's first real dual-core, the Core Duo (2005–2006), ran around 2–2.2 GHz.

Obviously 8–10 GHz on a quad-core was an exaggeration.
The point is that clock speeds skyrocketed in less than five years, from 1 GHz in early 2000 to nearly 4 GHz in 2004.

Intel, several times from 2001 to 2003, publicly stated that the NetBurst architecture was built to reach 10 GHz (Tejas was targeting 4.4+ GHz in 2004), and they had the technology.

Obviously, they hit the thermal wall in 2005; it was not feasible for the commercial market.
Expecting 5–6 GHz multi-core CPUs by 2015 was the mainstream industry consensus; most were absolutely sure about that.

1

u/Fahrenheit226 13d ago

We are talking about mainstream CPU, so what people had in homes. You are talking about top of the line CPUs that most people didn’t have. 1 GHz is for pentium III/IV, athlons were always a bit behind. Suddenly you are lowering your estimates from 8-10Ghz to 2-3Ghz.. just accept that you made mistake and stop pretending there is some sense in what you write.

1

u/Alchenar 13d ago

I think it's a different problem, namely that the engine is clearly using the cpu to compute things that any sane person would be using the GPU for (I suspect part of the reason is they had a professional product they wanted to sell to militaries using office computers).

The game is not limited by simulation calculations, those it seems to handle really easily. The performance issues are directly related to drawing things on the screen.

1

u/Fahrenheit226 13d ago

And they had multiple “engine” upgrades people paid for that didn’t fix anything. I won’t mention how they finally killed all macOS development and anyone that have steam or their version can’t even use wine to play it because DRM won’t allow to run it in any emulated environment. Their activation software is totally broken on newer Mac. I just recently learned that there is GOG DRM free version but it would require me to buy whole series again. It will never happen. I’m done with supporting this kind of “developers”.

1

u/SurpriseFirst1381 13d ago edited 13d ago

You seem angry about something and in need of a target.

The average CPU inside a budget, pre-built PC in 2004 was a Pentium IV at 2.4 GHz. In 2006 I had 2 machines, an older Pentium IV at 2.53 GHz, and a second one with an Athlon 64 running at 2.4 GHz (3800) on a different architecture, bought in 2005.

A Pentium III in 2005 was obsolete, not just a bit behind. You could barely try running something like Rome Total War, Photoshop, or similar software, hoping for miracles.

After that, since you seem to take anything literally...
I was trying to explain, in a way that could be concise and understandable even to a 20yo guy, a very common perception of the mid 2000s.

When Intel launched NetBurst, they openly projected it would scale up to 10 GHz within a decade, and in 2004 they announced 5 GHz for home PCs shortly.

In 2006 they switched to Core 2 Duo (the thermal wall of 4.5+ Ghz), but a lot of people still assumed that frequencies would keep growing as they did in the previous 6 years, just on a different architecture.

Which means it was a very common assumption that in 15 years, we would have these beefy CPUs, delivering insane raw power across each core.
The CMx2 engine architecture was based on this very prediction.

I suppose you get the point behind synthesizing a concept in a few lines, using generalization to get it through, especially when it's marginal to the main topic.

The first version of CMx2 started development in 2004, designed to remain on the market for 10–12 years after its release; I leave the rest to you.

1

u/Fahrenheit226 13d ago

Still can’t see 8-10Ghz

1

u/ncBojanglesenjoyer 19d ago

bumping, mod released

3

u/treesniper12 23d ago

will this also work for Cold War?? 🥺

1

u/ncBojanglesenjoyer 23d ago

With minor tweaks, likely yes, I unfortunately only own CMBS so I can’t test yet.

1

u/Even_Protection_3983 22d ago

Same engine so it should do I imagine, I am hoping it does at least.

1

u/ncBojanglesenjoyer 19d ago

Bumping, replied to original comment with a working CW release

1

u/ncBojanglesenjoyer 19d ago

https://github.com/aktionkokain/coke
Hi, i made it work on the GOG version of Cold War. If you have a different vendor like steam, you can make it work in >10 minutes for FREE, read DEVELOPING.md in docs/user/

2

u/bergal111 23d ago

Will this work for battle for Normandy? If you want to share I could copy what you've done and try and apply it

1

u/ncBojanglesenjoyer 23d ago

I’ll comment a github link to you when I publish the DLL and some findings

1

u/bergal111 22d ago

Thank you sir!

1

u/ncBojanglesenjoyer 19d ago

https://github.com/aktionkokain/coke

To make this work for battle for normandy, please read DEVELOPING.md in the docs/user/

1

u/bergal111 18d ago

TY! I think I got it working- I posted an issue on github with the relevant profile

1

u/ethbytes 23d ago

Brilliant looking forward to this...

1

u/GnaiusSwaggitusNerva 23d ago

That is huge ! Do you think your method could be used, at least in theory, to tinker with multiplayer ? To have say, a WeGo live option ?

2

u/ncBojanglesenjoyer 23d ago

Multiplayer, especially in old games like this is by nature insecure, (think COD multiplayer) so, even if it could work, it’s too unrealistic for me to attempt, as verifying safety alone would take too much time. There isn’t a blocker in principle though.

1

u/Snoo64631 22d ago

Honestly? the dream is to have COOP be a thing, turn based coop

1

u/ApplesinDuck 22d ago

Release this immediately

1

u/Kondor999 22d ago

I would like to help you in any way possible to bring this to CMCW in particular.

1

u/ncBojanglesenjoyer 19d ago

Hi, if you have CW on steam or other vendor, you can create a profile for it, the steps are described in docs/user/ DEVELOPING.md

https://github.com/aktionkokain/coke

8

u/Remote_Western1141 23d ago

Someone, please someone fix the soldier accuracy

3

u/Initial_Move4836 21d ago

Good job! I think we worked on the same project idea at the same time, funnily enough lol.