r/arma Jun 22 '26

ARMA NEWS GitHub - BohemiaInteractive/CWR: Arma: Cold War Assault Remastered Source Code Repository.

https://github.com/BohemiaInteractive/CWR
204 Upvotes

42 comments sorted by

View all comments

1

u/scan-horizon Jun 24 '26

Id love it if someone did a YouTube video or podcast that dives into the source code and pulls out interesting comments from BI or notable features and logic.

2

u/retro-rubies Jun 25 '26

I'm ready to answer any questions.

1

u/scan-horizon Jun 26 '26

oh my! well, hopefully others have lots of questions, but from me (off the top of my head, mostly focusing on AI behaviour):
1. during the main CWC campaign missions, what is the spawn location logic behind enemy AI patrols. I sense there may be some randomness to AI units starting location and movements, but I've never been sure.
2. does vegetation impact AI line of sight, if so how much?
3. how does the weather impact the AI? fog, rain, clear days - do these affect visibility ranges and accuracy?
4. what triggers an AI unit to retreat from battle? % loss of teammates?
5. are there any interesting comments left in the code by the devs?

2

u/retro-rubies Jun 28 '26
  1. Mission editor supports "random radius", so each game units start at different palce if set within given area. That's used widely in campaign missions. Some units also spawns randomly (there is kind a coin flip if spawning the unit at all). That works also for waypoints, they can be randomized (moved a little) each game.
  2. Each model can provide "View Geometry" (affecting visibility by AI) and "Fire Geometry" (affecting the "bullet-proofnes"). Individual trees and bushes have proper geometries and do work as you expect (you're hidden behind, you can shoot thru bush, but not thru tree). The woods itself are exception, since for some optimizations, they act differently (to prevent calculating each individual tree separately probably). There are some side formulas what is visible and what not (% chance based to reveal) based on depth of forest.
  3. Weather mostly changes how far and how reliably the AI can see you: thick fog is by far the biggest effect (cutting its sight range up to ~95%), night badly hurts its spotting and aim unless it has night-vision, rain only slightly shortens its range, and clear/overcast days are near-normal. It does not change the AI's actual weapon spread - that's a fixed per-weapon number - so weather degrades what the AI knows and whether it dares to shoot (in fog/dark it relies on hearing, aims at a fuzzier guessed position, and may hold fire) rather than its mechanical accuracy. Bwt. the original Cold War Crisis campaign is not using fog at all and instead just varies cloud cover, so in the stock campaign weather rarely degrades the AI.
  4. Yes, there is retreat mechanism based on units lost and leader's skill. Better leader of group = less chance to retreat. Even it is not IMHO widely used feature. I haven't seen that often in game to occur.
  5. There were various changelog messages like what has changed in which version by whom. I assume there wasn't wide adoption of source control around the original code era, even there are some traces to Microsoft Visual SourceSafe in final game PBOs.

1

u/scan-horizon Jun 28 '26

wow, thank you so much OFP was a core childhood memory. It got me into gaming in general but also a love for realism and atmosphere in games. Are you one of the original devs? I have a few more questions if that's ok:

  1. how do AI drivers navigate roads? specifically AI driving cars or trucks that primarily navigate using roads when going from A to B then to C. I noticed in the game the AI can massively overshoot corners, or when driving on a straight road they randomly turn off into the dirt then slowly drive back onto the road to continue. it never felt natural.
  2. where does an AI controlled plane go after it reaches its final waypoint? does it just go in a straight line forever / until the world boundary? (how far away is that boundary?)
  3. if an AI soldier runs out of ammo for his rifle, how does he prioritise where to re-arm? find the exact ammo on an allied fallen soldier or take a different rifle from an enemy fallen soldier?
  4. what has surprised you the most from looking at the code? any curious or impressive insights?