Home   Help Search Login Register  

Author Topic: Urban Ai  (Read 8967 times)

0 Members and 1 Guest are viewing this topic.

Offline Sentinel

  • Contributing Member
  • **
  • World is tough and I'm tougher!!
Urban Ai
« on: 12 Dec 2004, 22:33:56 »
Here's a little something I made. The orginal idea is from Tomasz but the script is my made. It's for making ai move better in urban areas. Though the squad leader has to be player  :P

Any feed back is good, even crushing ones  ;D

Though I might get offended...

Man I forgot to add the gif.... though i think it's too big (50kb limit)
« Last Edit: 12 Dec 2004, 22:43:05 by Sentinel »

Offline Sentinel

  • Contributing Member
  • **
  • World is tough and I'm tougher!!
Re:Urban Ai
« Reply #1 on: 12 Dec 2004, 23:45:51 »
Here's the zip with movement.gif file  ;D

Sorry again...  :-[

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Urban Ai
« Reply #2 on: 13 Dec 2004, 07:32:54 »
hmm, it sounds very interesting.

d/l now.

maby as this script sounds limited you should find a way for AI units to find cover against the direction fire is comming from and add it.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Urban Ai
« Reply #3 on: 13 Dec 2004, 07:45:25 »
ok i tried the demo,

i tried moving just as it said in the gif

the men bunched up fine

i ran across, and only one followed, he then got excited and ran right through the building and out the wall on the other side and got shot.

then the rest all ran across at once, 1 stopped in middle and got shot

the rest bunched around me and i couldnt see,

next thing i know one of my guys pulled out a nade and tried to throw it at who knows what, the grenade hit the wall next to me and the entire surviving squad was blown to pieces(including me).

i dont know what you were trying to do but, as the demo went

before the script if i tried to have them run across, 2 or 3 would die

with the script if i try to run across everybody died(me included).

maby work out some bugs in this.

Offline Sentinel

  • Contributing Member
  • **
  • World is tough and I'm tougher!!
Re:Urban Ai
« Reply #4 on: 13 Dec 2004, 10:13:05 »
AI could use this with real waypoints or with moving script. Though it would made ai very much scripted and predictable.

The idea is to move as ypu would move in real combat, or at least close to it. Use buildings as cover and face yourself where the guys should look. Try ceasing fire until few guys have been placed.

Also ai moves as normally weirdly, so try to avoid standing right next to a wall. Make few feet between.

 ;D The demo mission is crappy, I know. Didn't bother to make better. Try taking few men off your squad.

Thanks for trying   ;D

Tomasz

  • Guest
Re:Urban Ai
« Reply #5 on: 13 Dec 2004, 19:38:47 »
It works fine for me. I played in montignac, with a four man squad, and took out two 12 men squads loosing two men. The best way is to make a semi-cercle around them with your squad, once you take one guy out, the enemy disperses going right into your net. :D

Due to the fact that you show your squadies where to stand and how to move, they use effectively the urban terrain.

Tomasz

Sophion

  • Guest
Re:Urban Ai
« Reply #6 on: 13 Dec 2004, 21:45:52 »
I also did it on Nagova (Modrava) work nice for me...

aoulthough it could go without the hints but thats something i can do.

Rynkky

  • Guest
Re:Urban Ai
« Reply #7 on: 13 Dec 2004, 22:50:30 »
Oh man this AI rocks! It really brings action on the streets of Flashpoint.


Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Urban Ai
« Reply #8 on: 20 Dec 2004, 22:49:33 »
Wow, this is a very creative script! Looks great! I'll have to check it out later though...
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

Offline lendrom

  • Members
  • *
Re:Urban Ai
« Reply #9 on: 22 Dec 2004, 10:24:40 »
Would it be possible rewrite this script to allow mission designer to pre create those nodes (? i dont know how to name it not to be mistaken with mission editor waypoints)  and store them in a file so AI would automaticly chose way to the waypoint it is ordered by crossing the nearest nodes in the path? (oh that was too long sentence. I hope it was understandable ::) Some bots for fpp games (CounterStrike for example) used such a way to know the map - nodes of different types and relations between them. I dont know if it would work with OFP way-too-slowly-moving AI but mabey it's worth to try...
Blessed are those who have nothing to say and yet they remain silent.

DBR_ONIX

  • Guest
Re:Urban Ai
« Reply #10 on: 23 Dec 2004, 00:22:26 »
That idea sounds good..
Anyway, tested script..
Without enabling, I had to kill the squad (Bar 2), with it, I had to kill 2, the squad done the rest :)
- Ben

HotShotAce

  • Guest
Re:Urban Ai
« Reply #11 on: 25 Dec 2004, 03:45:32 »
I tried your script and all I have to say is it is excellent. This opens up a whole new chapter in OFP. Excellent idea. But now I have some suggestions that could improve this Urban AI concept (not changing your script lol).

- Some sort of system that allows you to control your squads grenade launcher. Something like you select the grenadier, and click on map where he shoots. Also suppressive fire the same kind of way.

- Make it so your men crouch at certain waypoints.

- Also, is it possible to remove the hints at the top and in the radio chatter.

Well those are my ideas but your script is great and I hope my ideas are possible ( I know nothing about scripting, lol)
« Last Edit: 25 Dec 2004, 06:37:24 by HotShotAce »

Offline General Barron

  • Former Staff
  • ****
  • Semper Fi!
Re:Urban Ai
« Reply #12 on: 25 Dec 2004, 10:43:58 »
Quote
Something like you select the grenadier, and click on map where he shoots. Also suppressive fire the same kind of way.
That's a very, very good idea!!! I hope you don't mind if I use it...
HANDSIGNALS COMMAND SYSTEM-- A realistic squad-control modification for OFP
kexp.org-- The best radio station in the world, right here at home! Listen to John Richards!

DBR_ONIX

  • Guest
Re:Urban Ai
« Reply #13 on: 25 Dec 2004, 11:45:28 »
Mmm.. Full Spectrum Warrior...
:P
How about a cmaer.asqs type thing that gets the point where the camera is facing, and makes the grenadier/rifle people fire there? Or get the dir/heading (The back/pitch script work on people?) of the leader?

- Ben

HotShotAce

  • Guest
Re:Urban Ai
« Reply #14 on: 25 Dec 2004, 12:02:33 »
Quote
That's a very, very good idea!!! I hope you don't mind if I use it...


I would be glad if you could implement that into OFP, it would make urban ai so much better.

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Urban Ai
« Reply #15 on: 28 Dec 2004, 22:57:44 »
Quote
I would be glad if you could implement that into OFP, it would make urban ai so much better.

not sure but i think he ment put it in ecp

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Urban Ai
« Reply #16 on: 28 Dec 2004, 23:12:49 »
it would still be implemented nonetheless

Offline Sentinel

  • Contributing Member
  • **
  • World is tough and I'm tougher!!
Re:Urban Ai
« Reply #17 on: 29 Dec 2004, 01:11:23 »
Wow  :o

First this post was silent as space, and now these posts...  :D

Thanks for the feedback, I've already made some changes but christmas times and coming new year celebration has taken and will take all my time, but after that I'll get back to your great ideas.

Thanks again for the feedback

Lean Bear

  • Guest
Re:Urban Ai
« Reply #18 on: 29 Dec 2004, 19:22:19 »
While browsing through your great script (you should touch up the mission though, that is probably the worst place on Everon to have it. Try something with some buildings :P  I tried St Pierre and it was fine.

The only thing I will say is that the waiting times for everyone to get into possition can get really long at times. Is there a way to do this without waiting for everyone to catch up first?

Also, whilst browsing through your script I saw the following line:

hint format ["%1", _poss]

Is this really necessary? Surely this is the hint that everyone keeps complaining about.

HotShotAce

  • Guest
Re:Urban Ai
« Reply #19 on: 31 Dec 2004, 03:09:27 »
Well i dont know how to get rid of the hints but if you look in the readme it'll tell you how to make units go faster.


Lean Bear

  • Guest
Re:Urban Ai
« Reply #20 on: 31 Dec 2004, 10:21:25 »
Oh yeah, I remember noticing something about that. Thanks for reminding me. :)

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Re:Urban Ai
« Reply #21 on: 31 Dec 2004, 17:41:51 »
Quote
hint format ["%1", _poss]

Is this really necessary? Surely this is the hint that everyone keeps complaining about.

To get rid of the hint, open up the script, put a semicolon (;) in front of it in the line like this:

;hint format ["%1", _poss]

Or remove the line alltogether.

Save and close the script and no more hint!

                                                                   Wadmann
Check out my Camouflage Collection! New items added 31 July 2005.

SilentHunter_764

  • Guest
Re:Urban Ai
« Reply #22 on: 08 Jan 2005, 12:39:59 »
With the script where you get a grenadire to fire on a certain spot, could it like spawn a H (Inivisible) or something where you clicked, the dude fires, then when his ammo is 0 or whatever he stops and the H is deleted?
Loose

Lean Bear

  • Guest
Re:Urban Ai
« Reply #23 on: 08 Jan 2005, 17:56:57 »
I think that something like that would need to happen.

I deffinately think that the "onMapSingleClick" command shuold be used.

Offline Sentinel

  • Contributing Member
  • **
  • World is tough and I'm tougher!!
Re:Urban Ai
« Reply #24 on: 10 Jan 2005, 23:16:43 »
Here's v1.1

No grenade support (at least yet  :P)

Better waypointing for ai by using action menu

Thanks for feedback!

HotShotAce

  • Guest
Re:Urban Ai
« Reply #25 on: 11 Jan 2005, 12:27:26 »
allright! a new version... testing now.

HotShotAce

  • Guest
Re:Urban Ai
« Reply #26 on: 11 Jan 2005, 13:07:30 »
Ok i tried it out and the new "mark position" feature is really helpful, good job on that, now I can take my time moving my men around ;D. Also it would be good if you changed the radio text at the bottom to something like "Move out!" or somethin like that if its possible. Good job on the script though.

BronzeEagle

  • Guest
Re:Urban Ai
« Reply #27 on: 24 Jan 2005, 16:38:56 »
If you ever need real people to do the talking for this script let me know.  

Offline 456820

  • Contributing Member
  • **
Re:Urban Ai
« Reply #28 on: 02 Feb 2005, 19:44:09 »
ive had a problem when i turn on the urban ai then no one follows me or does wat i want then when they get put into combat they all die

Offline 456820

  • Contributing Member
  • **
Re:Urban Ai
« Reply #29 on: 02 Feb 2005, 19:45:04 »
ive had a problem when i turn on the urban ai then no one follows me or does wat i want then when they get put into combat they all die

Offline 456820

  • Contributing Member
  • **
Re:Urban Ai
« Reply #30 on: 02 Feb 2005, 19:45:38 »
sorry i thought i didnt post it first time then i found out i did sorry

Offline Sentinel

  • Contributing Member
  • **
  • World is tough and I'm tougher!!
Re:Urban Ai
« Reply #31 on: 04 Feb 2005, 15:09:26 »
Are you having other ai-scripts running? It probably will cause problems.

In what situation you are using this?

Offline 456820

  • Contributing Member
  • **
Re:Urban Ai
« Reply #32 on: 04 Feb 2005, 17:15:55 »
i just tried it with one west and east infantry squad and that was the only script that was on at the time and throught the whole mission. when i activate it my men bunch up fine then just stay there when i tell them to move they just ignore the script and run around and get shot.

Offline Sentinel

  • Contributing Member
  • **
  • World is tough and I'm tougher!!
Re:Urban Ai
« Reply #33 on: 05 Feb 2005, 11:09:44 »
Did you init following variables?

UrbanAi = false
UrbanAiPos = false
EnableUrbanAi = player addaction ["Enable Urban AI","UrbanAi.sqs"]

RedHouse

  • Guest
Re:Urban Ai
« Reply #34 on: 09 Feb 2005, 20:33:54 »
i just read through this topic and going back i saw something about the grenadeir firing where you click on the map. i thought the best way to do this would be by useing the nearestobject command to get the grenade, then to setpos it at the location you want. You could also use things like the setformdir command to make it look realistic when the grenidier is aiming. You could do a check to make sure the grenidier doesnt end up fireing 20 km away. and you could relate distance to the amount of time it takes for the grenade to hit the ground. Hope thats some help

I know sentinal is completly capable of these things, cause hes better than me at scripting but its just a few tips for any of you who want to make this script.

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Urban Ai
« Reply #35 on: 11 Feb 2005, 06:07:06 »
Possibly use of the 'fire' command (So the AI Fires straight up, but looks like he's mortaring something) then use setvelocity?

STGN

  • Guest
Re:Urban Ai
« Reply #36 on: 12 Feb 2005, 19:25:51 »
I just saw this and thort great idear thi is what I have been sheaching for a long time, but I was a bit anoid but also sees alot of potential(I don't know enything about Scripting).

Right now this is a bit better than ingame pointing on the location you want the soldier and telling him where to look. cause as I see this is just a way to place your men a bit faster than what I just described. insted of having the squad stopping up and waiting for me to mark two points they should all move whit me in a collum whit 1,5m distance and only the last soldier should stop and cover then the second last soldier should stop at the next and so on, and when all had thier own point and I marked another then they should all move at the same time(not 1...ready,2....ready,3....ready) this way you could move thrugh the streets much faster not having to wait half an hour till they all have moved one point at a time.

Even better would be if you had two options where you could do as I just sugested and have an option to just hav the hole squad follow you in a close colum or a close staggered colum. you could also do so that you could select only one soldier. then mover to the point you would him to be and where he should point and the mark this just for him then he would move over ther and could be used for what ever you want.
STGN

Offline The_Mark

  • Members
  • *
Re:Urban Ai
« Reply #37 on: 05 Mar 2005, 16:39:42 »
I tried this few months ago, but haven't had the time to post here (read: I was too lazy), but nevertheless, this is a very good script; it makes AI behave believably in towns. Too bad it's only for the player's squad. Regarding this I got an idea, although it would require a lot of work it's possible (well, with most of it already done, just scroll through script snippets), and would make OFP a completely new game in towns.

Pre-define the nodes with a few parametres like a firing sector, the direction from which it prevents getting shot at, prefarable stance etc. For example: [[12345.2,1234.5,0],90,180,"crouch"] = [[node position], fire sector=east, covers from fire coming from south, crouch while in the node (if possible)]

Then make a script which is monitors if the squad is in a noded area (i.e. town) and if he is, it checks if there are any known enemies in the area. If is, it uses a threat matrix-type script to identify threats and according to them it assigns the squad's members nodes to use in order to defend, attack or withdraw from an area.

That's the idea in a nutshell. Imagine fighting in a town against AI that uses dynamically cover, advances with fire support etc., kinda like in CoD, just in OFP  ;D
Silent enim leges inter arma.

Offline lendrom

  • Members
  • *
Re:Urban Ai
« Reply #38 on: 05 Mar 2005, 17:00:37 »
@The_Mark

Quote
Pre-define the nodes with a few parametres like a firing sector, the direction from which it prevents getting shot at, prefarable stance etc. For example: [12345.2,1234.5,0],90,180,"crouch"] = [node position], fire sector=east, covers from fire coming from south, crouch while in the node (if possible)]

Quote
Would it be possible rewrite this script to allow mission designer to pre create those nodes (? i dont know how to name it not to be mistaken with mission editor waypoints)  and store them in a file so AI would automaticly chose way to the waypoint it is ordered by crossing the nearest nodes in the path? (oh that was too long sentence. I hope it was understandable  Some bots for fpp games (CounterStrike for example) used such a way to know the map - nodes of different types and relations between them. I dont know if it would work with OFP way-too-slowly-moving AI but mabey it's worth to try...

I suggested it on the firs page of this topic but either noone understood my english  ::) either noone thinks it's a good idea...  :'(  :P  ;)  :)
Blessed are those who have nothing to say and yet they remain silent.

Offline The_Mark

  • Members
  • *
Re:Urban Ai
« Reply #39 on: 05 Mar 2005, 17:31:11 »
lol.. Now as this has been suggested twice soneone HAS to try it. Sentinel could refine his script a big bit further, or if he wouldn't do it, I could try to do it (providing I have time for it.. I should be doing a poem analysis right now), if Sentinel doesn't have anything against it. Nevertheless, someone should do it.
Silent enim leges inter arma.

Offline 456820

  • Contributing Member
  • **
Re:Urban Ai
« Reply #40 on: 22 Mar 2005, 09:59:12 »
what does the action mark point or mark position do i tried looking where i wanted them to go the press enter but 2 just says ready and doesnt move and also they dont seem to follow me and when i give them a move waypoint they ignore the script and then get slaughteres

Offline supershooter

  • Members
  • *
  • 2+2=4
Re:Urban Ai
« Reply #41 on: 31 Mar 2005, 22:59:23 »
-------

I can see the advantage of this script but it needs more work. The Ai seemed a little unresponsive and it'd be better if they didn't come 1 at a time. I'd also like to point them to where they should go so I can be covering from a corner whilst they sprint from builbing to building. Developing from that point they can sometimes stop between buildings and open fire on the enemy. AHHHH!!! The idiots, why do they think I am sitting there shooting (no, I am not doing it for fun) - I am saving their damn lives. But despite all this I still realise how bad OFP is with urban combat. Thumbs up for a 100% improvement in OFP2!!!!!

- supershooter

Offline 456820

  • Contributing Member
  • **
Re:Urban Ai
« Reply #42 on: 03 Apr 2005, 16:12:00 »
and another thing if i tell my squad to move somewhere using 9,5,1,9 to tell them to move to the next waypoint they just run there normally. but it is very usefull if russians are heading my way except one genade takes us all out