Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Better Vehicle AI
Better Vehicle AI [message #430375] Tue, 08 June 2010 07:04 Go to next message
Burn is currently offline  Burn
Messages: 160
Registered: November 2004
Karma: 0
Recruit
Hey guys,

I've been out of the loop for a while, and I was wondering if there's a way to make better vehicle AI now?

I've tried the M08_Mobile_Vehicle and M08_Go_Point technique but for some stupid reason my tanks completely turn around and go to the enemy base the long way (through the other entrance) when there's a perfectly straight path right in front of it.

I've also tried the CPU_Neo_Vehicle_AI thing, and all the tank did was sit there and block my human AI.

So I was wondering if there's some new way to make vehicle AI that does what you want it to do? Thanks.
Re: Better Vehicle AI [message #430411 is a reply to message #430375] Wed, 09 June 2010 00:08 Go to previous messageGo to next message
TNaismith
Messages: 86
Registered: May 2006
Location: Canada
Karma: 0
Recruit
Hey Burn,

I've had the same problems as you when using M08_Go_Point and M08_Mobile_Vehicle when scripting Coop maps. I've figured that all of the M08_Go_Points MUST have a clear path to one another to work.

http://img707.imageshack.us/img707/3711/26870809.jpg

The M08_Go_Points on the LEFT would work, because they all have a direct line-of-sight to each other, no matter which point the vehicle may choose to go with.

The M08_Go_Points on the RIGHT would not work all the time -- sometimes you'll have the vehicle run straight into the wall trying to reach another point (as far as I've tested), or you might have it choose a very wacky pathfinding to reach a destination far away.

I've adapted to using M08_Go_Points only for short distances, and within a small area. If I want the vehicle to navigate to a far-away location, like to an enemy base, then you want to start using waypaths.

As for CPU_Neo_Vehicle_AI, I've done some research on this myself and it is apparently only a beta/earlier version of the script -- it was included in jonwil's 3.4.4 scripts. However, as you've discovered, many of it's features don't work at all when attached to vehicles. It doesn't work for me either when I try to give it settings to fire at an enemy vehicle, it is bugged/incomplete as far as I can tell.

Here is the the documentation for the script from the 3.4.4 scripts folder (which I can't remember where I downloaded it from, but it's different from the actual scripts. This one includes all the 14 readme files for each set of scripts people have contributed for 3.4.4)

Quote:

; ************************* Scripts by Joshua "NeoSaber" Kraft *************************



================================================================================ ====================

; ************************* [Script Name] Neo_CreateObject_RandomTimer

================================================================================ ====================

[Description]

- This script creates a preset at the position of the object it is attached to, and sets the newly created preset to face the same way as the attached object does. It does so at random intervals, that come between the Min and Max parameters.

[Parameters]

- Preset_Name (The name of the preset to create. Default is 'blank')

- Min (Minimum value that random time could be. Default is 0.0)

- Max (Maximum value that random time could be. Default is 60.0)

- Repeat (Determines if timer starts again when it runs out. 1 = yes, 0 = no. Default is 1)

[NOTES]

- This script should probably be attached to a Daves Arrow that is placed on the map. If set to repeat, when the timer runs out the preset will be created and it will choose a new random number to set the timer to. It will continue to do so indefinitely.

================================================================================ ====================

; ************************* [Script Name] Neo_Vehicle_AI

================================================================================ ====================

[Description]

- Early version of an AI script for vehicles. It can guard allies, hunt down enemies, and does a basic threat assessment on targets. It checks if targets are vehicles or soldiers, players or not players, and distance to determine which targets are a priority to attack.

[Parameters]

- MaxRange (The maximum range, in meters, that the vehicle will attack enemies. Default is 0.0)

- vsSoldier (Ammo to use against Soldiers. Primary = 1, Secondary = 0. Default is 1)

- vsVehicle (Ammo to use against ground Vehicles. Primary = 1, Secondary = 0. Default is 1)

- vsAircraft (Ammo to use against Aircraft. Primary = 1, Secondary = 0. Default is 1)

[NOTES]

- This script should be attached to a vehicle. It doesn't yet account for players getting in and out of a vehicle so transitions should be disabled on any vehicle this is attached to. Restrictions on the vehicle's turret rotation can cause the AI to get confused in combat.

- The script currently responds to damage, sounds, and sighting enemies. When idle, if it is shot by an ally it will attempt to guard that ally. If instead it is shot by or sees an enemy it will hunt that enemy. When its target dies (whether it be an ally to guard or an enemy to kill) it will return to idle. If hunting and it finds a higher priority target, it will attack the new target instead. An example of this would be if it was hunting an AI soldier and it sees a player. Players rank as a greater threat than bots so it would turn its attention towards the player. However, if it was hunting an AI vehicle and saw a player walking around it would continue to attack the vehicle since a player walking around ranks as a lower threat than a vehicle.

- This script can also respond to several customs. The code that checks for customs may not be working right yet, so make use of it at your own risk. Here are 4 of the customs it may respond to:

- 127127: hunt at location of sender
- 781781: hunt a new player (sender)
- 329329: guard location of sender
- 983983: guard a new player (sender)

- This script is still a beta, so future versions of the script may be incompatible with this version.





And in this renegadehelp.net tutorial (Advanced Bots Tutorial), it is mentioned that there is this "is not in the latest release of Jonwil's scripts" but that it will be "added shortly". I've made the assumption that means it could be included in scripts 4.0, which Tiberian Technologies is working on.

Sorry I couldn't offer any actual solutions, I've been in the same boat as you are, and sort of still am. Hope I could shed maybe a little light on the background of it all though.

~ TNaismith
[Mission Coop] Clan Member
Coop Gamer Enthusiast


http://img33.imageshack.us/img33/7928/t2010021mcsig140.gif

[Updated on: Wed, 09 June 2010 00:12]

Report message to a moderator

Re: Better Vehicle AI [message #430425 is a reply to message #430375] Wed, 09 June 2010 11:34 Go to previous messageGo to next message
Burn is currently offline  Burn
Messages: 160
Registered: November 2004
Karma: 0
Recruit
Umm.. this is an epic response. Thumbs Up Thumbs Up

Thanks so much for shedding some light on how this thing works! I should definitely be able to make this thing work better now. And when I tried using that CPU script I attached it to the spawner, not the vehicle preset--I should try that instead. Thanks also for the documentation.

Really wish there was some script that makes AI vehicles work the same way as humans.

EDIT: What's weird is, I had a setup like your picture on the right in the earlier stages of my map, and my tanks consistently went to the enemy base (which was behind walls) with no problem, then for some reason they decided to stop following that functionality as I added more to the map. Made me sad. It was so perfect. Huh

[Updated on: Wed, 09 June 2010 11:42]

Report message to a moderator

Re: Better Vehicle AI [message #430427 is a reply to message #430375] Wed, 09 June 2010 13:04 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

You know one solution would be to use more go points and simply chain them along. Basically, have the vehicle in question go to a point nearby, then have it move to another, and continue this until you get where you want to. It'd be more accurate and you'd have a better guarantee that it'd go the way you want it to go.

-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Better Vehicle AI [message #430431 is a reply to message #430375] Wed, 09 June 2010 13:24 Go to previous messageGo to next message
Burn is currently offline  Burn
Messages: 160
Registered: November 2004
Karma: 0
Recruit
Hmm.. interesting.

If I use up all 12 of it's go points then it has no choice but to go to only those areas, so yea maybe that'd work.. I tried making 4 or 5 of them in a direct line of sight to each other and have them lead right to the enemy base so that they'd follow the line. Maybe if I made the same line but used 12 points instead it might not go clear around the mountain to go to the enemy base when the shortest path is right in front of it.
Re: Better Vehicle AI [message #430453 is a reply to message #430375] Wed, 09 June 2010 22:22 Go to previous messageGo to next message
liquidv2 is currently offline  liquidv2
Messages: 3407
Registered: February 2007
Karma: 0
General (3 Stars)
if you ask me nicely i'll drive a tank around and you can pretend i'm AI Surprised

liquidv2
Re: Better Vehicle AI [message #430464 is a reply to message #430375] Thu, 10 June 2010 05:54 Go to previous messageGo to next message
Burn is currently offline  Burn
Messages: 160
Registered: November 2004
Karma: 0
Recruit
rofl
Re: Better Vehicle AI [message #430531 is a reply to message #430453] Fri, 11 June 2010 15:12 Go to previous messageGo to next message
GEORGE ZIMMER is currently offline  GEORGE ZIMMER
Messages: 2605
Registered: March 2006
Karma: 0
General (2 Stars)
liquidv2 wrote on Thu, 10 June 2010 00:22

if you ask me nicely i'll drive a tank around and you can pretend i'm AI Surprised

you can't drive a vehicle as good as the AI, though


Toggle Spoiler
Re: Better Vehicle AI [message #430685 is a reply to message #430375] Mon, 14 June 2010 00:57 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Depending on what you're doing (making a map for release, making a mod package, making a server side mod etc etc), it's probably possible and easier to just write your own scripts.


[Updated on: Mon, 14 June 2010 00:57]

Report message to a moderator

Re: Better Vehicle AI [message #431101 is a reply to message #430411] Sun, 20 June 2010 15:03 Go to previous message
Oblivion165 is currently offline  Oblivion165
Messages: 3468
Registered: June 2003
Location: Hendersonville, North Car...
Karma: 0
General (3 Stars)
TNaismith wrote on Wed, 09 June 2010 03:08


And in this renegadehelp.net tutorial (Advanced Bots Tutorial), it is mentioned that there is this "is not in the latest release of Jonwil's scripts" but that it will be "added shortly". I've made the assumption that means it could be included in scripts 4.0, which Tiberian Technologies is working on.

Sorry I couldn't offer any actual solutions, I've been in the same boat as you are, and sort of still am. Hope I could shed maybe a little light on the background of it all though.

~ TNaismith
[Mission Coop] Clan Member
Coop Gamer Enthusiast



When I wrote that we had sent JonWil the code but then he never added it, i don't recall the reason.


WOL: Ob165ion Skype: Oblivion165 Yahoo Instant Messenger: CaptainJohn165
Previous Topic: Is it possible
Next Topic: do me a fav
Goto Forum:
  


Current Time: Mon Apr 29 01:35:15 MST 2024

Total time taken to generate the page: 0.00816 seconds