Smarter Opponent AI and Bugfix Mod

Close Combat - Cross of Iron is based on Atomic Games award Winning Close Combat Series. Close Combat is a real time game were you take command of German or Soviet squads on the Eastern Front during World War II. This version is being developed by CSO Simtek and will include many new features and improvements.
Post Reply
Cppdude
Posts: 4
Joined: Thu Nov 28, 2024 9:30 am

Smarter Opponent AI and Bugfix Mod

Post by Cppdude »

This is a mod that alters the opponent AI in Close Combat 3, and potentially improves it. It’s an early version. I intend to release major updates approximately once a year.

Requirements:
- A legal copy of Close Combat 3 or Cross of Iron from GOG or Steam. I haven’t tested the original CD version but its “full install” might work… maybe.
- You need to place all the ZIP’s contents including CC3Mod.exe in the same folder as the CC3 executable for your version of the game (that might be CC3.exe or cce.exe for Cross of Iron) or set the current directory accordingly. The original executable must not have been renamed since it is opened by CC3Mod.exe.

Download link: https://www.dropbox.com/scl/fi/oz71bt08 ... cfgwi&dl=0

You need to run CC3Mod.exe as described above to launch the mod. Yeah it’s scary. Apply Occam’s Razor though: I am likely not posting something like this in a niche game community to infect you with malware. And nobody can change the AI behavior in this game without a custom executable.

Features:
- Is compatible with recent Close Combat 3 and Cross of Iron releases.
- The AI requisition logic has been somewhat improved.
- The AI is A LOT better at defending.
- The AI has a currently screwy but sometimes passable attack strategy which means you might actually be pressed a bit.
- Has a rewritten renderer based on SDL. It is more likely to work properly with modern Windows.
- Some crashes in the original have been solved although there’s some rare ones still.

Limitations and future improvements:
- The AI was tweaked on the original CC. It works in CoI as well but is simply somewhat worse there because some values are hand picked for the original game.
- The AI needs to learn how to use mortars, flamethrowers, MGs on offense, and some other special unit types.
- The attack logic needs a lot of work still, e.g. it struggles against mortars.
- The AI uses the old pathfinding currently, which means it will get stuck in things and might not find its way on the Stalingrad maps.
- The old refit logic is used which tends to lead to over-investment into vehicles when more infantry is needed in campaigns.
- I’ve disabled multiplayer, the bootcamp, and the battle maker, because those are not the focus of the mod and would take me a lot more effort to support.
- The videos don’t work for now.
- There are some graphics bugs remaining that I hope to sort out the coming year.
- The zoom in mode has been disabled due to most of the graphics bugs being there.
- I intend to get rid of all ancient dependencies that remain by replacing them with modern libraries, like DirectSound.

If you find the original AI difficult and the game works well for you, the mod is not for you. If you on the other hand place your troops, go AFK, and found that the opponent has lost the game while you were doing your dishes, this mod is for you. Or, if you purchased CC3 on Steam but can’t play it due to crashes, this mod is also worth trying.

I don’t want to exaggerate how good the opponent is. But the very fact it behaves differently to before should feel fresh for a few hours before you figure out how to beat it. There’s also the potential for future improvements.

Suggested settings:
- Play with the 2 min victory timer after capturing all locations.
- Don’t put a too short overall time limit, the opponent will likely take at least 20 minutes to clear a map even if you’re AFK. It will be stuck on the two last Stalingrad maps.
- The opponent AI was designed for fog of war. It can handle it but doesn’t really need the full vision settings, dealing with and enacting surprises in the fog of war is of course the core of the game.
- Always disable the Act on own initiative for both sides because that setting is basically like “commit suicide at random”, in a game where the loss of a single unit iss very noticeable.
- Restrict yourself from using mortars for now because the opponent won’t use them and haven’t been taught how to survive them.

As you know, there’s a terrible war going on in the region that this game covers. The game is a historical document and reflects the era it was made, i.e. the late 1990s. Don’t apply it to recent events. Slava ukraini!
User avatar
Kanov
Posts: 350
Joined: Mon May 21, 2012 2:02 pm
Location: México

Re: Smarter Opponent AI and Bugfix Mod

Post by Kanov »

Hi,
This is a big surprise, I will check it out once when I get home.

what is meant by this?
-Has a rewritten renderer based on SDL. It is more likely to work properly with modern Windows.

Also, do you plan to improve the AI on other games from the series?

cheers and keep improving!
Hard-core Spectre
Cppdude
Posts: 4
Joined: Thu Nov 28, 2024 9:30 am

Re: Smarter Opponent AI and Bugfix Mod

Post by Cppdude »

Kanov wrote: Thu Nov 28, 2024 3:44 pm Hi,
This is a big surprise, I will check it out once when I get home.

what is meant by this?
-Has a rewritten renderer based on SDL. It is more likely to work properly with modern Windows.

Also, do you plan to improve the AI on other games from the series?

cheers and keep improving!
Thanks, let me know how it goes.

SDL: https://www.libsdl.org/ Basically, Microsoft had this library called DirectDraw (a part of DirectX) in the late '90s to enable direct access to graphics hardware on Windows. Unfortunately it was locked to just Windows. SDL was created to use a similar set of interfaces for programmers to be able to target any platforms. More importantly, DirectDraw has been deprecated long ago and if you want to use DirectX today you have to use the (for 2D games) much too complicated Direct3D interfaces. SDL is an easy replacement.

In practice that sentence might be better reformulated as: it's a replacement of the graphics code that (ideally) shouldn't be noticeable from your perspective, and fix bugs for people whose computers don't like DirectDraw, which includes mine. But like I said, there are a few bugs like the explosion/smoke not having proper transparency right now. It still looks good enough to be enjoyable BTW.

Other games: Short answer: No. There are some reasons, the two most unlikely to change being 1) Close Combat 3 is my favorite CC game, 2) doing this takes a lot of my free time.
Cppdude
Posts: 4
Joined: Thu Nov 28, 2024 9:30 am

Re: Smarter Opponent AI and Bugfix Mod

Post by Cppdude »

So I tried downloading it myself and Windows Defender claims it's a virus, sloppy AV heuristics like these piss me off. Will see if I can report it to Microsoft for them to fix Windows Defender.

Edit: Submitted it, will see if it gets whitelisted. I expect it will take Microsoft at least a week to look at it, if they do at all. It really pisses me off to spend years of work on something and then get blocked by a shitty antivirus algorithm though. A game I developed in university 17 years ago had the same problem and it's been the same ever since, because AV makers basically resort to blocking anything they haven't whitelisted that needs to do any kind of hardware/filesystem access. Hell I've had players/customers to one of the most played games on Steam have their AV shut down the game executable after a regular update... and it is a recurrent phenomenom, lol.

It was possible to bypass Windows Defender by allowing the fake "threat" and re-downloading the auto-deleted ZIP. But I can understand this is scary and not normally recommended practice.

Edit 2: Here' a nice comparison from a malware analysis engine of my CC3Mod.exe versus the CC3.exe from the GOG release. Both score as "suspicious but safe", however the original CC3.exe has a higher suspicion score (probably because some code did not make it into my mod).
- CC3Mod.exe: https://www.hybrid-analysis.com/sample/ ... bcca4ddec9
- CC3.exe: https://www.hybrid-analysis.com/sample/ ... b0642cff8e

I think I will for the next update simply go through and remove a bunch of old API calls from CC3 and see if that makes CC3Mod.exe rank higher or preferably fully avoid getting a malfeasant denouncement by Windows Defender.
User avatar
Kanov
Posts: 350
Joined: Mon May 21, 2012 2:02 pm
Location: México

Re: Smarter Opponent AI and Bugfix Mod

Post by Kanov »

just occured to me... could it be possible to use say PNG format images instead of TGA with this new render library SDL?

is the reason for the videos not working the format they are rendered? if so could one convert them to another more modern video format in order to have them play in-game?
Hard-core Spectre
Cppdude
Posts: 4
Joined: Thu Nov 28, 2024 9:30 am

Re: Smarter Opponent AI and Bugfix Mod

Post by Cppdude »

Kanov wrote: Fri Nov 29, 2024 8:24 pm just occured to me... could it be possible to use say PNG format images instead of TGA with this new render library SDL?

is the reason for the videos not working the format they are rendered? if so could one convert them to another more modern video format in order to have them play in-game?
Yes, any format changes to any files in the game are possible. Whether probable: Depends on effort and gain. My main interest is the AI. I am happy to _eventually_ fix bugs and maybe make modding easier.

I think the videos' .AVI format is fine, it's just the library that caused me headaches. I'm not thinking it's going to be a big thing to fix for my mod, but the videos are very peripheral to the game so it hasn't been a priority of mine.

My nearest focus bugfix wise will probably be to see if I can get rid of the fake virus warnings because those are going to scare a lot of people out of trying the mod.
SchnelleMeyer
Posts: 255
Joined: Wed Mar 26, 2014 3:29 pm

Re: Smarter Opponent AI and Bugfix Mod

Post by SchnelleMeyer »

Wow! This is a great start to improve this old game. I have DL'ed and will test later today. Looking forward to more from you in the future.
Post Reply

Return to “Close Combat - Cross of Iron”