Jump to content

Triggers as a way to solve quirky AI behavior?


MiB

Recommended Posts

I was thinking about this. I doubt Steve & co would actually implement this - I'm no computer guy but I'd imagine coding it would be a nightmare on stilts - but I thought I'd share it anyway.

Lots of people are complaining about the AI and how it reacts to various situations - especially when under fire. I then remembered an old game, Starcraft, where you could make custom maps with things called "triggers."

Triggers were areas you painted on the map, within which you could use a very simple premade programming syntax to make cool things happen. For example, you could state that when a unit entered this space you just painted, it would spawn x amount of y units in another location, which you could then order to attack the area that was just entered.

I was thinking - would this kind of system work well for all the people complaining about the AI? Instead of complaining to Steve about the reaction, you could program your own.

For example, you create a new behavior that applies to all Strykers, call it "cautious" and put in language to the effect that "Whenever a Stryker is fired at by AT-infantry, it will pop smoke and reverse 25 meters"

A more aggressive commander might put his default response to immediately putting down fire at the infantry or the area if they can't see them.

What do you guys think?

Link to comment
Share on other sites

MiB,

Some sort of trigger system should definitely be implemented but just painting areas of the map isn't enough. What if no AI-controlled unit can see that area? If the AI doesn't know the enemy is there, it would be unrealistic for it to react to their presence in the area.

A better system would be to link triggers to spotting behaviour. In other words, you paint an area on the map and the trigger for that area does something if the enemy is spotted in that area, such as execute a flanking manoeuvre.

Even this isn't idea because of C2 issues. For instance, is the unit that spotted the enemy able to communicate this information to the HQ in charge of the flanking force? However, this sort of detail should probably be waived to be fair to the AI because the player-controlled force already benefits from the player's omniscience in these matters.

Other triggers should be implemented to coordinate friendly forces, such as Group A waiting for Group B to arrive at its destination before moving off.

Link to comment
Share on other sites

Lots of people are complaining about the AI and how it reacts to various situations - especially when under fire. I then remembered an old game, Starcraft, where you could make custom maps with things called "triggers."

Triggers were areas you painted on the map, within which you could use a very simple premade programming syntax to make cool things happen. For example, you could state that when a unit entered this space you just painted, it would spawn x amount of y units in another location, which you could then order to attack the area that was just entered.

I was thinking - would this kind of system work well for all the people complaining about the AI? Instead of complaining to Steve about the reaction, you could program your own.

For example, you create a new behavior that applies to all Strykers, call it "cautious" and put in language to the effect that "Whenever a Stryker is fired at by AT-infantry, it will pop smoke and reverse 25 meters"

A more aggressive commander might put his default response to immediately putting down fire at the infantry or the area if they can't see them.

There may be two ways to look at this, are you asking if you can make the painting of the trigger area's on the map while you are actually the player playing the game OR are you asking for triggers and trigger effects to be available for the scenario designer to help prompt the AI?

BOTH options would be kind of a BIG bonus and great addition to the current system, but I don't think this concept was ever part of the original design for the game. :(

(nice idea though, just needs some working out of the details as to exactly how to make compatible with elements of the game code already in the game.) AND for sure that would be the tricky part.

I am really looking to the future and hoping more options for triggers and some form of "if this then that reaction" programing is available to scenario designers for AI programing in scenario design for the eventual release of the WWII series of games some where down the road.

Its clear there are not enough tools and options to let the scenario designer script the AI to react to events other then along a linear chronological timeline in the current release of the AI and Scenario editor as it stands now.

[ November 07, 2007, 09:51 AM: Message edited by: aka_tom_w ]

Link to comment
Share on other sites

Originally posted by aka_tom_w:

Are you asking if you can make the painting of the trigger area's on the map while you are actually the player playing the game OR are you asking for triggers and trigger effects to be available for the scenario designer to help prompt the AI?

I'm referring to the latter - i.e. triggers as a tool in the editor for making the AI react to the player's moves.

I personally don't think this is too difficult to do. If you look at the way Radio IEDs are implemented, the mechanics are already in place. An activated Radio IED detonates when an enemy unit comes close enough and the trigger man has LOS to the IED. The event triggered is an explosion, but it could just as easily be to unpause a waypoint so that units start to move out, or to bring on reinforcements after x amount of minutes.

I repeat, this should not be rocket science to implement.

Link to comment
Share on other sites

  • 2 weeks later...

I'd love to see triggers in the editor. It would add a lot of possibilities to the scenario designers.

On the other hand I think BF wanted the editor to be as user friendly as possible. Not sure how succesfull they were since there aren't that many missions designed by the comunity so far.

Link to comment
Share on other sites

this is still a good suggestion, but I think the part about "coding would be a nightmare on stilts" is particularily appropriate here...

Originally posted by MiB:

I was thinking about this. I doubt Steve & co would actually implement this - I'm no computer guy but I'd imagine coding it would be a nightmare on stilts - but I thought I'd share it anyway.

Lots of people are complaining about the AI and how it reacts to various situations - especially when under fire. I then remembered an old game, Starcraft, where you could make custom maps with things called "triggers."

Triggers were areas you painted on the map, within which you could use a very simple premade programming syntax to make cool things happen. For example, you could state that when a unit entered this space you just painted, it would spawn x amount of y units in another location, which you could then order to attack the area that was just entered.

I was thinking - would this kind of system work well for all the people complaining about the AI? Instead of complaining to Steve about the reaction, you could program your own.

For example, you create a new behavior that applies to all Strykers, call it "cautious" and put in language to the effect that "Whenever a Stryker is fired at by AT-infantry, it will pop smoke and reverse 25 meters"

A more aggressive commander might put his default response to immediately putting down fire at the infantry or the area if they can't see them.

What do you guys think?

Link to comment
Share on other sites

Originally posted by aka_tom_w:

this is still a good suggestion, but I think the part about "coding would be a nightmare on stilts" is particularily appropriate here...

I have to disagree, based on my programming experience. The absolute core idea behind modern programming is that it is "event-driven".

In the old days of programming you had lots of variables in one part of the program and lots of procedural code in another. Nowadays you have "objects" that encapsulate both the variables and the procedures they use. An object's procedures (usually called methods) are often made to fire in reaction to an event. Programmers talk about event listeners and event handlers for instance, in which a part of the program checks continuously for a particular event and then fires off its associated event handlers when the event occurs.

If CM:SF has been built along the same principles, then the something you paint on the map would be an object and it would have built-in functions that are triggered when particular events occur, such as an enemy unit entering the painted area. This is not at all difficult given modern coding practices.

Link to comment
Share on other sites

TOW's mission editor uses triggers extensively. It's very powerfull. It is the only way to make troops react using the mission editor. Now in CMSF editor you can only act. The reaction is up to the TACAI.

The beauty of the conditionals/triggers is that you can do stuff like: If A sees B, A go to X. If A takes X loses A retreats to B, etc. The possibilities are endless.

Then again CMSF has a TACAI whereas TOW does not.

If they include it in the editor even in a script form it would be great. If people dont want to use it, just dont, and let the AI take care of the tactics.

But to be honest I wouldn't put this as a priority in my list if I was BF.

[ November 22, 2007, 02:54 PM: Message edited by: Webwing ]

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...