Modern Warfare Mod brings World in Conflict from the Cold War into the Modern Age. It also ups the ante on realism and authenticity in every role – Infantry, Armor, Support and Air, while trying our best to keep everything relatively balanced for fun and interesting gameplay.

  • View media
  • View media
  • View media
  • View media
  • View media
  • View media
Add media Report RSS Patriot Heavy SAM AI Script - Page 2 (view original)
Patriot Heavy SAM AI Script - Page 2
embed
share
view previous next
Share Image
Share on Facebook Post Email a friend
Embed Image
Post comment Comments
P3ACE753
P3ACE753 - - 651 comments

*still reading*

Reply Good karma Bad karma+4 votes
Torrisco Creator
Torrisco - - 34 comments

LOL

Reply Good karma+2 votes
Delta.Boy
Delta.Boy - - 139 comments

damn.....I'm so glad that there is a computer to do all this stuff

Reply Good karma Bad karma+1 vote
LeafFriend
LeafFriend - - 33 comments

& finished reading.
How long did the team took to finish scripting this ?

Reply Good karma Bad karma+2 votes
blahdy Author
blahdy - - 997 comments

A few weeks from design to finish.

In a normal domination match, the SAMs sucked so badly at detecting, tracking and engaging a ballistic missile (because it was busy trying to kill choppers), so that is the result of the new software version you're seeing in the flowchart.

To defeat fast ballistic missile threats while engaging helicopters and cruise missiles simultaneously, we needed a software that truly multi-tasks and can detect and engage several threats at once simultaneously.

Reply Good karma+1 vote
Aico
Aico - - 238 comments

Does this script support more than one thread? If so is there a significant increase in performance?

Great mod you have here. It was at least 75% of the reason I bought the game.

Reply Good karma Bad karma+1 vote
blahdy Author
blahdy - - 997 comments

Yes, the script is multi-threaded.

In WiC, each thread is actually run by a shooter python object owned by a game unit entity (known as WICO).

To support multi-threading, we separate Sector Scan and Engagement_Initiate() and related tracking and missile guidance functions onto radar units. This means if all radars are dead, SAM site is dead too. Missile launch control and inventory management functions are done on the missile launch station (TEL) units, and missiles themselves are also units as well.

All of these different threads run by each wico object entity share the same database to exchange information and data between each other. The database, such as the TWS_Queue that contains list of targets being tracked by radar, is protected by primitive semaphores and object oriented scripting to prevent race conditions.

So for example, normally, when a unit acquires a target and is about to fire a projectile at it, it has to calculate the target's position and compensate (lead) for its movement in advance (aka generate fire solution). In this software, the missile launch stations do not do that at all -- instead, when software commands them to open fire, they just blindly launch missiles in general direction. Once missiles are spawned, they follow the last recorded target intercept location calculated by radar units during routine TWS update that occurs every often. This significantly improves performance and also makes the system behave closer to real-life SAM systems.

Reply Good karma+1 vote
brody9311
brody9311 - - 589 comments

good job

Reply Good karma Bad karma+1 vote
TigerF14
TigerF14 - - 320 comments

ummm... WTF!?

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account:

Description

Script showing the programming routine behind Patriot Heavy SAM's AI system in game.