Advertisement

Author Topic: More bullets, less hits, more wounded, more real?  (Read 6685 times)

0 Members and 1 Guest are viewing this topic.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
More bullets, less hits, more wounded, more real?
« on: 14 Mar 2003, 04:49:26 »
Started this in sdvanced scripting forum but thought it be better here so I closed the other thread ;D

ok

Ive thought about the AI and their firing in the game, seems its either way too accurate sometimes or rediculously lame.--EG choppers firing at ground troops--even when the chopper does fire sometimes he can empty his entire browning MAG at a spot one foot away from a stationary careless target  and all the bullets went into the same hole  

So i made this wee script but need help to make it so the AI doing the firing also sprays a bit above and below the target also.

Its works quite well actually, it only activates when an AI fires and deactivates 0.5 seconds after he has fired.

tried it on infantry and a lot more bullets went flying than normal, less hits--I thought with propper tweaking it could resemble more wot real weapons and average soldiers would be really like.

Perhaps more real if it were applied only to certain types of weapons. I dunno too much about ballistic and such but I wonder sometimes about AK accuracy and how AI fire--looking more for the "pray and spray" effect here by AI that is

We all know that when humans in the game apply suppressing fire I SURE as heck get my butt down to cover.

Funny thing is that in some circumstances this lil script actually makes guns MORE effective in killing--eg Machine gun. An old soldier told me once that u dont wanna MG to be too accurate--u want it to scatter fire and blanket an area.

Well the following makes for one HECK of an extended FIRE FIGHT between AI-- and I dont think they are too inaccurate at all. However tweaks will be needed.

Its WAY cool.  

#1The AI dont all kill each other in 5 seconds.

#2 Sporadic firing all over the place

#3 heaps more wounded

#4 the script doesnt alter the accuracy of the first shot--so the first shot always goes where it should. They only spray after the first shot.  ;D So if AI are using single shot (bolt action) or sniper rifle it doesnt affect em.

I mean thats more real aint it? the first shot is the one that counts methinks?




activated by this in INIT: of unit

unit addeventhandler ["fired", {_this exec "spray.sqs"}]

;spray script

Code: [Select]
   _man = _this select 0
   _count = 0
   _start1 = "start1"
   _start2 = "start2"
   _start1_and_start2_array = [_start1, _start2]
   _random = random (count _start1_and_start2_array)
   _random = _random - _random % 1
   _randomstart = _start1_and_start2_array select _random
   _man removealleventhandlers "fired"
   _mandir = getdir _man
   goto _randomstart

#start1
   _man setdir _mandir
   _mandir = _mandir + 0.06
   _count = _count + 1
   ? _count > 50: goto "end"
   ~0.01
   goto "start1"

#start2
   _man setdir _mandir
 Â Â Â _mandir = _mandir - 0.06
   _count = _count + 1
   ? _count > 50: goto "end"
   ~0.01
   goto "start2"
#end
   _man addeventhandler ["fired", {[_this select 0]  exec "spray.sqs"}]
exit



Your thoughts, suggested improvements welcome

Especially for firing above and below target--I dunno if thisll work for a gunner in a chopper cause it uses setdir and when a guy is in a chopper I think his direction is determined the direction of the chopper , not where hes facing. I could be wrong tho.


attached test map, for really extended fire fight. Ive made player immortal so sit amongst the guys and hear all the bullets whizz past around you ;D

Zay out

« Last Edit: 14 Mar 2003, 04:53:57 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

red devil

  • Guest
Re:More bullets, less hits, more wounded, more real?
« Reply #1 on: 16 Mar 2003, 15:19:11 »
THIS SOUNDS SO COOL!! 1 thing tho does it work 4 fixed mgs please say it does I SO NEED IT TO!!!! (please)

Offline Terame

  • Members
  • *
  • Nice one OFPEC
    • http://fantasyscifi.com/main/ fantasy scifi sci-fi
Re:More bullets, less hits, more wounded, more real?
« Reply #2 on: 17 Mar 2003, 08:24:46 »
I'll test it tonight will edit this post after the trial with some mates coming over for OFP and beer ;)
You can travel to infinity though the endless passages of the cosmos. Even
better this belongs to you. This is your mind

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:More bullets, less hits, more wounded, more real?
« Reply #3 on: 17 Mar 2003, 14:04:19 »
Excellent idea, which should have been in the game right
from the release.
Works fine Zayfod, makes assaults more realistic now, as
a squad doesn't get  kiled too early when doing an assault
now.

One thing you could try to implement:

Code: [Select]
_mandir = _mandir + 0.06
Instead of 0.06 you could use a variable, which you alter
in game, to simulate the nervousity of the units.

What i mean is: if let's say two eastern units have to
fight 20 western units, they sure will be very nervous and
wouldn't fire that accurate, as if they only have one enemy
in sight.

One way to check if they are outnumbered could be using
side/present trigger and compare them amongst eachother.

Anyway just a thinking  ;)

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Fox2

  • Guest
Re:More bullets, less hits, more wounded, more real?
« Reply #4 on: 17 Mar 2003, 14:49:10 »
Yet another idea, and I've discussed this a bit with Zay, is to have some sort of AI reaction to suppressive fire beyond the standard "go prone, turn to face threat, shoot threat's head off" routine when you fire at an AI. This is something of a continuation of your variable idea, Chris.

Maybe have a global variable for each soldier (that you'd like) that represents his anxiousness/efficiency rate. This could even bounce off of the skill setting used in the mission editor, so that the more experienced soldiers don't react to suppressive fire as bad as the rooks.

Here's an example scenario. A light US patrol is walking along the treeline of an Everonian forest. It's mostly a novice patrol, the highest ranking officer of the bunch only being in-country for 2 weeks. The rest are fresh replacements. Out of nowhere, RPK fire lunges out at them from the belly of the forest. The gunner is an elite Red Army regular, a veteran of the Afghanistan War of the 70's. He is attached to a squad of long-time comrades, on a recon mission. They've found the light patrol, and decided to seize the opportunity. 3 of the US soldiers are killed instantly. The rest jump for any cover they can find. The relatively low skill level of the soldiers and the fact that half of their patrol was just waxed makes them all nervous, scared, and panicked. The fact that they were surprised brings their morale down even lower. They freeze under the suppressive RPK fire, the fledgling CO without a clue as to what to do. Out of options, the young CO fires a wild spray of bullets in the direction of the machine gunner. The rounds land mere inches from the RPK operator's body, but he is unfazed, only momentarily ceasing his barrage of bullets. The Americans realize all too late that half of the enemy squad had flanked them. Their deaths were quick.

Imagine if that scenario could be played out with the use of scripts. I think it's possible. Every soldier would have a "anxiety level" or "morale" that would be influenced by both skill setting as well as circumstance (whether the enemy surprised them or not, casualties they've suffered).

A good example of something to borrow from is the freeware game America's Army. In the latest build, they include a "Combat Efficiency Meter." It represents your accuracy at the current time. As is typical, stance, speed, etc. affect it, but so do circumstancial factors. If someone is shooting at you, it plummets dramatically. If an explosion goes off next to you, it decreases even further. If you're wounded, it also decreases. You get a small bonus the closer you are to your squad leader (simulating the CO encouraging his troops to fight on).

These and other factors could and should be implemented into OFP. Who's with me?  ;D

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:More bullets, less hits, more wounded, more real?
« Reply #5 on: 17 Mar 2003, 15:08:44 »
EDIT: OK Ive played with the settings a bit and rather than 0.06 try 0.1 --It rocks. I played a soldier this time with only open sights gun and they stilled killed me real quick but boy o boy did the bullets fly all round --WEEEEEEEEE



terame look forward to your feedback

red devil --Im working on it  ;)


Chris Death thanks fer  an awesome report.   ;D


and Fox2



:o Holy COW :o

TOM CLANCY--eat yer heart out. Fox dude u should be a writer.  ;D

Yeah hell yeah that would be way COOL.

um I get the feelin this wee script of mine may turn into a  :wow:MONSTER :wow:

I will def need the help of u guys if thats our goal.

But like they say "if u dont aim high itll never take off" or sumthing like that  ::)

Yup, almost anything is possible with the game engine. We are only limited by our imagination.

« Last Edit: 17 Mar 2003, 16:32:26 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:More bullets, less hits, more wounded, more real?
« Reply #6 on: 17 Mar 2003, 16:11:12 »
i started workin on AI script long time ago 2 make da AI make tactical desicions (didnt finish em cuz dey were even dumber wen dey were under da scripts opeation  ::)  ;D)

but here is somin dat can b good 4 da mission ;D - use knowsabout 4 each soldier 2 know how meny soldiers he knows  ;) :) do somin like dat

soldiers skill loop  :) (make array of all enemies @ start of da mision

Code: [Select]
_knowsabout3 = []
_knowsabout2 = []
_knowsabout1= []
_knowsabout3f = []
_knowsabout2f = []
_knowsabout1f= []
_skill = (1-(skill _unit))
#loop
"if (_unit knowsabout _X > 3) then "_knowsabout3 = _knowsabout3 + [_X]" foreach enemysoldiersarray
"if (_unit knowsabout _X > 2) then "_knowsabout2 = _knowsabout2+ [_X]" foreach enemysoldiersarray
"if (_unit knowsabout _X > 1) then "_knowsabout1 = _knowsabout1 + [_X]" foreach enemysoldiersarray

"if (_unit knowsabout _X > 3) then "_knowsabout3f = _knowsabout3f + [_X]" foreach friendlysoldiersarray
"if (_unit knowsabout _X > 2) then "_knowsabout2f = _knowsabout2f+ [_X]" foreach friendlysoldiersarray
"if (_unit knowsabout _X > 1) then "_knowsabout1f = _knowsabout1f + [_X]" foreach friendlysoldiersarray
_knowsabout2 = _knowsabout2-_knowsabout3
_knowsabout1 = _knowsabout1-_knowsabout2
_knowsabout1 = _knowsabout1-_knowsabout3
_knowsabout2f = _knowsabout2f-_knowsabout3f
_knowsabout1f = _knowsabout1f-_knowsabout2f
_knowsabout1f = _knowsabout1f-_knowsabout3f
_count3 = (count _knowsabout3)/3
_count2 = (count _knowsabout2)/5
_count1 = (count _knowsabout1)/10
_count3f = (count _knowsabout3f)/3
_count2f = (count _knowsabout2f)/5
_count1f = (count _knowsabout1f)/10

_afraid = (_skill*_count3)+(_skill*(_count2/2))+(_skill*(_count1/3))-(_skill*_count3f)-(_skill*(_count2f/2))+(_skill*(_count1f/3))
~10
goto "loop"

da higer da _affaraid is da more affriad he is ;D (dat is rough example change it 2 b good ;d)

:cheers:

LCD OUT
« Last Edit: 17 Mar 2003, 16:12:13 by LCD »
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

red devil

  • Guest
Re:More bullets, less hits, more wounded, more real?
« Reply #7 on: 17 Mar 2003, 17:40:32 »
This will be gooooooood does any1 else no if it is possible to do this with fixed mgs any help would be great.

Teryan

  • Guest
Re:More bullets, less hits, more wounded, more real?
« Reply #8 on: 17 Mar 2003, 23:32:54 »
I liked it alot.
Especialy when you turn it into night and in slow motion.

Slow night of watching the run, when all the sudden an MG opens up, then a huge fire fight persues and you finally find out how many there are when nades go off.  Very cool.

Offline Terame

  • Members
  • *
  • Nice one OFPEC
    • http://fantasyscifi.com/main/ fantasy scifi sci-fi
Re:More bullets, less hits, more wounded, more real?
« Reply #9 on: 18 Mar 2003, 00:06:12 »
Excellent!

I'm incorporating into a "Mog" mission - now just need a decent script for ricochets and rappelling from a blackhwak and I am done
You can travel to infinity though the endless passages of the cosmos. Even
better this belongs to you. This is your mind

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:More bullets, less hits, more wounded, more real?
« Reply #10 on: 18 Mar 2003, 01:01:00 »
Zayfod - wot about implementing following?:

check in the script, wether the unit is using single, o burst/autofire mode (not sure if auto-fire is relevant here)

btw- it's _this select 3, which indicates the firing mode when
passing _this to the script, but i think you already know it.

Code: [Select]
?(_this select 3 == "single"): exit
Code: [Select]
?(_this select 3 == "burst"): spray_value = 0.06
Code: [Select]
?(_this select 3 == "FullAuto"): spray_value = 0.10

And wot about:

implementing tanks or apc's, when firing their secondary weapons (machine-guns)

?(_this select 1 == "machinegun_12-7")

:note - not sure about the weapon name of the mg - i'm at work
and can't check this ingame right now, but i think it shouldn't
be that hard for you to check if i'm correct here  ;)

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Fox2

  • Guest
Re:More bullets, less hits, more wounded, more real?
« Reply #11 on: 18 Mar 2003, 03:32:21 »
The problem with using this with vehicles (fixed MGs, tanks, helicopters) is that the way the current script works is it uses SetDir in a loop.

In the case of a Fixed, MG, the tripod would begin to change directions suddenly, the tank's body would move, and the helicopters fuselage (rather than the gun) would change direction.

Another thing to remember is the reason that these bullets are being dispersed is the fact that the wielder is flesh and blood. He's having a hard time controlling the fully automatic fire from an unsupported weapon (no tripod, stable tank turret, etc) So this script would be little use for vehicles. However, fire suppression and morale could be used...For instance, a helicopter under fire might postpone an extraction because of the enemy resistance.

A thought just occured to me. We need to get toadlife (maker of the AI Group script) in here. In the Group script, the AI compares the enemy forces to their own, and depending upon that, either continue on to attack, retreat, or call for reinforcements. He would be great to talk to about how he got it all to work, and perhaps helping in applying the same concepts to our little "morale/suppressive fire" scripts.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:More bullets, less hits, more wounded, more real?
« Reply #12 on: 18 Mar 2003, 04:52:52 »
Yep, i've got your point Fox2 - didn't think about the difference
between eye- and turret-facing.

The comparisation like Toadie did in his grouplink script
shouldn't be that hard to implement, as he already did
it (no need to stress him - let 'im continue workin on
'lojack newer version)  ;D

Still the firing mode could be implemented, as single fire
mode shouldn't let the script continue, while bursts or autofire
should (and autofire should beat bursts on the spray effect).

For static mg's, i think the heading could still be used, as
the facing of the mg = equal to the facing of the gun itself.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Fox2

  • Guest
Re:More bullets, less hits, more wounded, more real?
« Reply #13 on: 18 Mar 2003, 08:55:30 »
Quote
For static mg's, i think the heading could still be used, as
the facing of the mg = equal to the facing of the gun itself.

I believe that is inaccurate. Try dynamically changing the direction of an AI MG mid-game using SetDir. The tripod itself moves.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:More bullets, less hits, more wounded, more real?
« Reply #14 on: 18 Mar 2003, 09:08:18 »
Yes Fox2 this is correct unfortunately  :-\

However the effect of spraying still seems to work --not quite as good as with AI soldiers but he does fire a lot more.

I guess if u are will to put up with seeing the tripod slowly turn left and right then it aint an issue.

But we are all perfectionists right?

So lets get it right, ;)

Still working on it

Zay out
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"