Jump to content
Sign in to follow this  
BoA

Realistic Detection System

Recommended Posts

I think OFP has a strong lack of Detection System. For example:

AI will never get aware of dead bodies, when heard shooting noise AI will get down for a while(in fact, the AI's then status isn't "AWARE"), but then put their guns back again and so on.

These lacks will immediately lead to unreal. Also, to solve these problems isn't easy work.So I think it's necessary to hold a discussion for this. In the discussion, we can together solve these problems, put forward new ideas and live them. Hope you guys will like this.

Well, I just start:

1.As mentioned above, how can we solve the "dead bodies" perfectly? Does somebody have ideas?

2.About "Shooting noise". In the real world, when a soldier hears the shooting noise, he will sure ring the alarm. So, I've ever tried something like this:

behaviour everyone == "AWARE" then alarm = true

But it completely didn't work for I've found that, when the soldiers get down after hearing something strange, their status are still "SAFE", not "AWARE" as they may look like. So, again, does somebody have some talent ideas?

Maybe for some wonderful wishes: When a soldier hears clear strange noise, he will immediately shout and ring the alarm while if the noise isn't that clear, he will go to the direction where the noise come from and check it.

Share this post


Link to post
Share on other sites

I think the problem is something else. OFP was designed for the simulation of medium sized skirmishes on relatively open terrain. Maybe always in mind the final goal to create a usefull training tool for the military. SpecOp infiltrations are not supported by default.

But with the scripting possibilities and some creativity you can add all the realism you need. It's just not placing some units here and there and hoping they will knew what they have to do.

This could help you:

http://www.mapfact.net/include....tid=433

Share this post


Link to post
Share on other sites

Well Grouplink do make enemy units react on shots fired and go search the area they heard the shot from, so that should solve that problem.

Share this post


Link to post
Share on other sites
Quote[/b] ]I think OFP has a strong lack of Detection System.

OFP has a wealth of tools available to script any kind of detection. Audio, visual, proximity or residual.

If you want a bunch of guys to react to a gunshot, add a fired event to the opposing side. That sets a global Alarm variable. Check the distance if you cant guarantee, their going to be within ear shot. Then you can tell your guys exactly where to move to, and what to do.

Share this post


Link to post
Share on other sites

A lot of the required stuff is already hard-coded into OFP, it just isn't configured properly.

Soldiers DO react when they hear a gun fired near them. The problem is, units aren't configured to have sensitive enough ears! (Or eyes for that matter)!

So if these 'sensitivity' values were increased in either a user-made addon, or the game's main config, then you could have soldiers that can actually hear from a realistic distance. (Alternatively, you could increase the 'volume' of every weapon, but it would be simpler to do it the first way).

Once units 'hear' gunfire, the default OFP AI will make them go into 'combat' mode, and from there they will react depending on their current waypoint type. If they hear the gunfire well enough, they will be able to locate exactly where it is coming from, and may seek out and engage the shooter.

So, basically, the framework is all there, BIS just didn't configure their own game well enough. smile_o.gif The solution lies in either a conversion mod like ECP, or BIS shaping up for Game2.

--------

Although soldiers within a group will all share the same information (about enemy locations, etc), one problem is that BETWEEN groups, no information is shared. So even if one group hears and reacts to the gunfire, another group further away (but close to the 1st group) may not. This can be fixed with my "AI information sharing" script, which can be downloaded from OFPEC.

---------

As for dead bodies, I agree that this is a problem with the AI. One way to fix this might be to create an invisible object whenever a unit is killed, which would be recognized as an 'enemy' to the other side. Don't know if it would work, but it might.

Share this post


Link to post
Share on other sites
Quote[/b] ]As for dead bodies, I agree that this is a problem with the AI. One way to fix this might be to create an invisible object whenever a unit is killed, which would be recognized as an 'enemy' to the other side. Don't know if it would work, but it might.

I've tried it long long time ago. But I failed. At first, I just thought the work would be very easy, but ont the contrary, it's such hard work.

At the very beginning, I thought up something like this:

Create a trigger where an enemy is dead. The trigger is activated by enemy side, a circle set to 50,50(for example). Once a certain trigger is activated, then alarm = true, and delete all such triggers. But for some reasons, eventually it wasn't practical. According to my BAD memory, it seems that the reason is that you can never create a trigger like that.

After that, I came up with something like yours. But it also failed. There are many problems about this idea. Just make one example: The invisible object will draw the enemy's attention, then being shot at or something like that will happen...

Oh I forgot just now:

Thank you Trapper!

Share this post


Link to post
Share on other sites

Even though OFP was not designed with stealth in mind it is possible to force units to detect dead bodies using invisible targets like Lester's ones.

I've made a script that create such a target (from the kill event) at the body position every time a unit is killed. Then, as soon as it is detected, I switch the detector(s) group(s) in AWARE mode and remove the target. Then I order the detectors to move to the body and raise the alarm when they get there. The alarm is not raised if they are killed before they get to the body. The same script also check if the body is hidden and remove the invisible target if it is. Other things are also checked and the target is in fact only deleted if the body is hidden.

I'm sorry but I'm not home for the hollidays and my gaming computer is not with me so I dont remember all the details but it works perfectly (as perfectly as the knowsabout command can work). I'll put the script here as soon that I'm back home sometimes in January. But using what I've just said I would love to see other people's work on this and we could compare with the script I've made later.

Happy Hollidays

Share this post


Link to post
Share on other sites

To AliMag:

I wonder how do you detect whether the object you create is detected. If you are using "knows about", then how do you name the object you create. Or will we just place the needed objects at first, then "setpos" without using "create unit"?

BTW, thanks for your invisible targets. But really, I just want a target configed as empty object that can't be seen by player but can be detected by AI without any other functions(the target you mentioned has other functions). Simply, a "H(invisible)" that can be detected by AI or something like that. smile_o.gif

Share this post


Link to post
Share on other sites

Hi,

This thread may be helpful.

http://www.flashpoint1985.com/cgi-bin....2;st=15

You have to wade through a load of SPAM, to get to the essence. So I've quoted the bit I think will be useful.

Quote[/b] ]1. put some player unit on the map (preferably a SpecOp unit armed with a HK)

2. make a trigger "Civilians detected by East" and put the following into its 'on activation' field: s2 switchCamera "INTERNAL"; HintC "DETECTED"

3. inside the trigger put two East units and place them so they do not see each other - and do not group them together. Name them 's1' and 's2'. Also, set ammount of their ammo to zero, so they cant kill the player (that could ruin our little test).

4. make a trigger with condition "not Alive s1" and on activation "[s1] Join Player; s2 Move getPos s1"

I think it works on the basis that, when an soldier is killed his dead body is classed as Civilian. But because the dead soldier is still grouped to an East group (for example), it wont show up using a Civ detected by East trigger. So once a soldier is killed, you need to join his dead body to a different group. In the above example he used the players group. But you could set aside a Civ group for the purpose. I tested this in the editor and it does work, it just needs tidying up if you want to use it in a mission.

Full credit to 5133p39 for discovering yet another useful function within the OFP engine.

Share this post


Link to post
Share on other sites

@BoA

It's simple. You have an empty array (vBodies=[]). When a unit dies, you create an empty target (_target="tragetClass" createVehicle [0,0,0]) that you after setpos at the body position. Then, you just save both in the array (vBodies=vBodies+[[_target,_body]]). Then you just check if any remaining unit knowsabout any '_target' in the array. If anyone does, then you send him to the corresponding '_body' position.

Sorry if its not that clear but I hope you get the picture. I really regret that I dont have the script with me. I assure you that it works. I'm really not in the mood to try to recreate the whole script here I'm on vacation an my brain is in vacation with me (to much beer)

Cheers

Share this post


Link to post
Share on other sites

So thanks UNN!

Now, I think we've found a perfect solution to the "dead body" problem! Cheers to all you guys! yay.gifyay.gifyay.gif

But as you know, the final victory never comes to a real OFP mission editor. Here comes another problem. That is how to make units responce to strange noise? crazy_o.gif

Share this post


Link to post
Share on other sites

Well, the noises should include the sound of firing, the sound of bullet when hit something and the sound of a dead person when hit the ground(if possible) biggrin_o.gif

Share this post


Link to post
Share on other sites

@UNN:

sad_o.gif I've tried 5133p39's idea. But it doesn't work as he(she) said. As I tested, no matter if you will join the dead into the enemy side or not, the trigger would be activated without the body actually being seen, as long as you put them very near (more or less 10m). And when the distance is above that (even <=50) all the things work well. That is to say, the trigger will only be activated when the dead body is actually seen.

Sorry for my poor English.

Share this post


Link to post
Share on other sites
Quote[/b] ]That is to say, the trigger will only be activated when the dead body is actually seen.

Yeah, that was the idea. Did you want the trigger just to activate when someone is killed?

Share this post


Link to post
Share on other sites

The problem with that my idea is, that it still rely on the someone knowsAbout deadBody value (even if you are using a trigger i described, because internally the trigger works with the knowsAbout values - or at least it seems so).

So, if you let the Guard see the victim (and thus setting the Guard knowsAbout victim to 3 for example), then move the Guard away, and then you kill the victim, the Guard will know instantly that the victim was killed, because the appropriate knowsAbout value was still high enough.

So this is not the solution sad_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]The problem with that my idea is, that it still rely on the someone knowsAbout deadBody value (even if you are using a trigger i described, because internally the trigger works with the knowsAbout values - or at least it seems so).

True, but everyone has that problem. Many a time I've wanted to reset a units knowsabout. I think AI on the same side, kind of share info across groups anyway. I'm guessing BIS added that to help improve the AI, when fighting against a player. There is not much you can do without scripting a Line of Sight system, which I'm half way though doing. But will be a while before I get anything finished.

The only other thing I can think of, is finding ways to reset the KnowsAbout value. Normaly you can only do that, by deleteing the target unit. Has anyone ever tried experimenting with commands like setCaptive or joining a unit to another side or group?

Share this post


Link to post
Share on other sites
Quote[/b] ]I think AI on the same side, kind of share info across groups anyway. I'm guessing BIS added that to help improve the AI, when fighting against a player.

In what way? Are you sure about this, because I'm pretty sure the exact opposite is true.

For example, you can have two units in two different groups standing right next to each other, facing opposite directions. If one of those units sees an enemy and starts firing on him, the other guy will still stare dumbly in the opposite direction, clueless to the enemy's existance. This was one of the reasons I wrote my AI infosharing script.

It definately is true that units WITHIN a group share information, however. In fact, all units within a group know EXACTLY the same information about friendly and enemy locations. All units within a group essentially share the same "brain".

Quote[/b] ]The only other thing I can think of, is finding ways to reset the KnowsAbout value. Normaly you can only do that, by deleteing the target unit. Has anyone ever tried experimenting with commands like setCaptive or joining a unit to another side or group?

I'm pretty sure these don't work, although I can't remember if I have tested it or not. "Knowsabout" doesn't only tell you if a group knowsabout an enemy, it also tells you if they know about friendly units or (I think) static objects/vehicles as well; so these things shouldn't really affect its value.

Share this post


Link to post
Share on other sites
Quote[/b] ]In what way? Are you sure about this, because I'm pretty sure the exact opposite is true.

I would not say I'm sure, otherwise I would have said "The AI do share info", rather than "I think AI on the same side, kind of share info" smile_o.gif

On more than one occasion, I have seen seperate AI groups firing on units that could not have been identified by themselves. But getting back on topic, spotting in OFP "appeares" to be an abstraction. So perhaps, expecting it to be perfect for Covert missions. May be asking to much?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×