Jump to content


Photo

I've believe I've disguised a bomb truck.


  • Please log in to reply
22 replies to this topic

#1 Akkrand

Akkrand
  • New Members
  • 61 posts
  • Location:Melbourne, Australia

Posted 30 July 2004 - 06:08 AM

Yes, you heard me right.

*First, I add

Behavior = CommandButtonHuntUpdate BTDisguiseHunt ; allows use of command button hunt script with this unit.
; nothing
End

to the behaviours of the bomb truck in the .ini file (I did my test with demo gen, so in DemoGeneral.ini)

*Then, I add into the GLA Paper Work folder, "GLA Init Variables" script the lines:
Set timer 'Bomb_Truck_Disguise_Done' to expire in 1 frames.
Set Flag named 'Bomb_Truck_Disguise' to FALSE

*Then, I create 2 scripts in the Team Behaviours folder, "Demo Bomb Truck Attack" & "Demo Switch to Kill Mode"
Both scripts are subroutines(of course no deactivate on success) & active, and evaluate every 5 seconds (prob not necessary, could run every frame).

Demo Bomb Truck Attack
*** IF ***
True.
*** THEN ***
100.00% of Team '<This Team>' perform Ability 'Command_UpgradeGLABombTruckHighExplosiveBomb'.
Team '<This Team>' begins hunting using Ability 'Command_DisguiseAsVehicle'.
Set timer 'Bomb_Truck_Disguise_Done' to expire in 5.00 seconds.
Set Flag named 'Bomb_Truck_Disguise' to TRUE

Demo Switch to Kill Mode
*** IF ***
Timer 'Bomb_Truck_Disguise_Done' has expired.
*AND* Flag named 'Bomb_Truck_Disguise' IS TRUE
*** THEN ***
Team '<This Team>' begins hunting.
Set Flag named 'Bomb_Truck_Disguise' to FALSE

*Then, I create the team itself. The team has a standard build condition, Initial Team Behaviour "Normal". It's OnCreate script is "Demo Bomb Truck Attack" & in it's Generic scripts it had "GLA Apply Tank Priority" then "Demo Switch to Kill Mode".

Voila!

The trick is that the truck hunts with the DisguiseAsVehicle CommandButton, which allows it to target the closest ENEMY tank.
Then, of course, you've just got a bombtruck sitting their looking like the enemy, not attacking, so the timer gives the truck 5 seconds to find a target (prob needs less), and sets the flag telling the AI there is a truck that is disguising.
When the timer runs out, the Switch to Kill Mode script runs and tells the truck to hunt normally, but it keeps its disguise.
I've tested this, the trucks changed colours, looked like a scorpion, and showed up as 'stealthed' on the map (I play computers against each other and watch).

Implement it, check it for yourselves, let me know of any probs/difficulties.

And... enjoy!

Cheers,
Lord Akkrand

EDIT: And for those of you who aren't scripters yourselves, you can get it along with a whole world of other changes I have made (some good, some bad) at the following URL:
AkkrandAI

Edited by Akkrand, 30 July 2004 - 06:34 AM.


#2 Mithril

Mithril

    496

  • Hosted
  • 1,386 posts
  • Location:UK
  • Projects:Heh! You're not going to ask me that question.

Posted 30 July 2004 - 07:51 AM

Waa hold on a minute. I tried this once in the "On Enemy Sighted" tab and it didn't work! I suppose the trick was to use it as a regular sub...

Ubersuperb work!

I'm sure thudo will be quite happy...

BTW was happy to see you've implemented dynamic attack paths in yer AI :p

If you want I could upload the AkkrandAI.exe to the SDI with a link to your site of course..

Edited by Mithril, 30 July 2004 - 07:52 AM.

Command & Conquer: Red Alert - ReGeneration

"Not the faintest clue =\"

-ComradeJ

#3 Akkrand

Akkrand
  • New Members
  • 61 posts
  • Location:Melbourne, Australia

Posted 30 July 2004 - 08:28 AM

Sure I don't mind if you upload it to here, but I do make lots of changes, so it may go out of date quickly... but then again... I might slow down a bit now, unless there's something out there that will really make a huge difference, in which case I'll look at it...

I think the problem you may have had was that if you told the AI to hunt using the Disguise thing, they would simply change into the enemy tank, but not attack - the *attack* was disguising. The trick that did it for me was switching after a few seconds to normal hunting.

Note I just played a game and found I've forgotten to set it for all the GLA bombtruck teams, some of the non-5th-wave ones attack like they used to.. I gotta fix that... later...


Cheers,
Lord Akkrand

#4 Mithril

Mithril

    496

  • Hosted
  • 1,386 posts
  • Location:UK
  • Projects:Heh! You're not going to ask me that question.

Posted 30 July 2004 - 09:01 AM

Ah-ha! Man you may have just saved thudo's day!

Your AI is up at this location, I just invented the version number 1.0 because of probable later changes.

NP if you've got a new version, make a thread or drop me a mail though a thread is usually preferred :p
Command & Conquer: Red Alert - ReGeneration

"Not the faintest clue =\"

-ComradeJ

#5 thudo

thudo

    Wacko AI Guy!

  • Division Leaders
  • 9,179 posts
  • Location:Lemonville North, Canada
  • Projects:DoW AI Scripting Project
  • Division:DoW
  • Job:Division Leader

Posted 30 July 2004 - 01:52 PM

Wow! :p Looks good.. Could this be the proverbial "golden egg" I've been waiting for since I started work on the old Generals' scripts back in mid-'03?!?!

This could be a huge step. The things I need to determine:

This works based on finding the closest tank to disguise too which still leaves the BombTruck vulnerable until it finds a candidate to disguise and for the 5sec to then begin hunting. I'm trying to think like a Pro Player here where you don't necessarily disguise mid-field: you get intel on an enemy vehicle while the BombTrucks sit idle in the safety of your own base. Then when you spot an enemy unit, they disguise (still from within their own main base or near a secondary base) and thus go out on their mission.

I still wish I could figure out how to create an Enemy Object List so having to make the BombTruck "scout itself" for an enemy tank to mimic is not needed. Hell, I'd love someday to make a BombTruck disguise as either a USA/China Dozer (like I love doing in Pro games) and totally fool the enemy! This would make the BombTruck leathal as it would prevent the truck from being exposed as its searching for enemy targets. Then again, there has been no definative method to create an Enemy Object List.. If implemented it would look like:

Team '<This Team>' begins hunting using Ability 'Command_DisguiseAsVehicle' on nearest object of type '<USA Enemy tank>' . We would create a seperate object list that would run for BombTrucks only and would associate those in the list as enemy objects for that particular faction. It would save oodles of time and scripting and make the BombTruck disguised all the way across the map and thus supremely less vulnerable more likely to deliever its package stealthily!

Nevertheless, Akkrand, fabulous script sequences! Thats a huge degree of progress.. now we need to expand just a little more on it.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#6 Mithril

Mithril

    496

  • Hosted
  • 1,386 posts
  • Location:UK
  • Projects:Heh! You're not going to ask me that question.

Posted 01 August 2004 - 09:35 AM

Uhm.. what do we need to expand? As I see it it will do the following sequentially:

1. High explosive bomb upgrade

2. Disguise as an enemy unit

3. Attack

I believe Nr.3 could be anything, you could tell it to hunt using commandbutton ability "AttackMove" and hit anything that comes into sight, or you could tell it to move to This Player's Enemy Inner Perimeter and hunt there.. What more do we want?
Command & Conquer: Red Alert - ReGeneration

"Not the faintest clue =\"

-ComradeJ

#7 Akkrand

Akkrand
  • New Members
  • 61 posts
  • Location:Melbourne, Australia

Posted 01 August 2004 - 11:10 PM

Yeah, thudo it scans and finds a target as soon as it is built, the 5 second delay can probably be scaled down, I was just having a degree of safety - but it does the disguising while sitting in front of the Arms Dealer.
As for what it does after disguising, you're absolutely right about that: I want to change it to use an attackSequence script (actually the dynamic one - bomb trucks attacking where there are no defences to discover them!).
Also I'm going to create a new Priority set, and apply that to the truck before the disguise order - and make sure the priorities are 1000+, to overcome the 'priority decay' as described by Lion. Then afterwards I can change the priority to supply lines or whatever.

EDIT: thudo if you want to have it disguise as enemy dozers, you can just put them at the top of the priority set.
ANTOHER EDIT: I've made those changes; the bomb truck script now sets applies the priority set 'GLA Disguise Priority' before it hunts using the disguise commandbutton, then applies 'GLA Supply Priority' in the 'Switch to Kill Mode' script, and instead of hunting in there it runs the subroutine Attack Dynamic Center.
The priority set GLA Disguise has 'Tanks' at 2500, 'Anti-Air Vehicles' at 2499, 'Artillery' at 2495, and all 8 dozers at 2490 (I don't like dozers running into my base, I usually know where my dozers are, but not my army :grin: ) The reason it specifies each dozer type instead of 'Utility' is because otherwise the truck might target a GLA Worker or a Command Center, and obviously the disguise will fail if it tries this, and once those initial 5 seconds are over, it never tries again.

Also I have found the problem I noticed in the game I played Friday night, one of the Demo Gen's battlebus groups had a bombtruck and 0-8 tunnel defenders instead of a battlebus, that was the one I saw not disguising. I've fixed that. I've posted a new version of 1.01 on my site (the previous version was actually 0.80 in my 'internal' versioning, but I figure "released = v1.00" so I'll let your version stand Mithril).


Cheers,
Lord Akkrand

Edited by Akkrand, 01 August 2004 - 11:58 PM.


#8 Akkrand

Akkrand
  • New Members
  • 61 posts
  • Location:Melbourne, Australia

Posted 02 August 2004 - 05:41 AM

Hey,
I've just made a bunch of changes to the Dynamic Attack Paths bit of each generals.
Instead of the usual "Check Center" which checks if the team has reached the waypoint and been attacked, it just checks if it has reached the waypoint.
If so, it sets the team to aggressive (sometimes the guys get through, why not attack with them?) and also runs a new sub, "Check Center 2".
"Check Center 2" checks if the team has been attacked by a BD, if so, sets the _EnemyCenterHasBaseDefences to TRUE, else it sets it to FALSE.
This saves me resetting these flags every few minutes, and means I can start them in the TRUE state, which seems more logical - assume the enemy is well defended until proven otherwise. It also means that if a probe is heading for the Center, say, and is killed before he gets there, then the TRUE will mean the entrance is assumed to have defences.
As far as I'm concerned, if a team fails repeatedly to *get to* a waypoint, it can be assumed the area is defended.
I also changed the behaviour of the 20 Rebel Team in demogeneral (I assume this is to do with the Rebel Ambush, as I never see it built). The team now hunts using the capture building commandbutton, forcing the rebels close to enemy buildings; One the one hand, you might not notice and they'll take some building, on the other, if you shoot them, they are *right* next to your buildings when the detonate. Lose lose. Heheh. :grin:

That brings it to 1.02.

That'll be all the changes I make today - I gotta get some work done or my boss'll start wondering what I do all day... ^_^

Cheers,
Lord Akkrand

#9 Mithril

Mithril

    496

  • Hosted
  • 1,386 posts
  • Location:UK
  • Projects:Heh! You're not going to ask me that question.

Posted 02 August 2004 - 08:22 AM

Glad to see someone made it so that the attack path flags get updated! I'm still trying to think of a way to find out how many defenses the enemy has in any of the positions..without having to expire a timer and sacrificing a powerful team.

Priority decay? I'll better see what lion says about this.. could be exactly what I need to get another nice little theory to work..

Do you mind if I make a tutorial about making the bomb truck disguise properly?

BTW I've uploaded 1.02.
Command & Conquer: Red Alert - ReGeneration

"Not the faintest clue =\"

-ComradeJ

#10 Guest_Guest_*

Guest_Guest_*
  • Guests

Posted 02 August 2004 - 09:27 AM

I've thought about how to determine how many defences there are in a area, but the engine seems quite limited as to what you can ask of it. oh well.

IIRC, Lion says that every point of priority equals about 80 units/tiles/whatever they're called on the map... hence if the map is rather large, all the priorities will reach zero if the enemy is on the other side.

RE: making a tutorial, sure, go right ahead, I can't be bothered myself.

Cheers,
Lord Akkrand

#11 Akkrand

Akkrand
  • New Members
  • 61 posts
  • Location:Melbourne, Australia

Posted 02 August 2004 - 11:07 AM

Whoops, forgot to log in from my home computer!
I've just found a couple of major flaws in the scripts, one a typo and easy to fix, the other presents another bombtruck conundrum for us to work on.
The typo was all of the non-USA factions I had copied the Dynamic Attack scripts from a USA faction and edited them to match the faction they were now in, but for all of them, I forgot to change the action 'else' for the last 'Attack Dynamic X' script, hence all non-USA factions' teams that used this script would not attack if the enemy base had all 3 entrances defended (this became apparent as my AI now assumes all the entrances would be defended.) Easy fix, I've done that.

The other problem is more insidious. When a bombtruck is created and diguises, it sets a flag to true; then, 5 seconds later, it sets it to false when it begins hunting properly. If there are more than one bombtruck team owned by the same AI, one of them will set the flag to false and the others will not get their orders changed. I thought of using a counter instead but that's no good as it does not identify a number on the counter with a specific truck, so the same thing would happen again.

So I have made a 'quickfix' by limiting bombtrucks to 1 at a time in my teams list. Anyone got any ideas how to get around this problem? As obviously I'd want the AI to be able to use multiple bombtrucks at the same time.

Tomorrow I'll trying to find a freeware installer-program that can create a proper uninstall for my mod, as I'd forgotten that people would want to take it off to play online; I just got the one I have to make it easier to distribute it to my mates at work for the 'after-work game'.

That's all from me tonight. It's now 9pm in Oz and I've gotta get up in the morning for work.

Cheers,
Lord Akkrand

EDIT: v1.03 incorporates these 2 fixes. It's on my site. LA

Edited by Akkrand, 02 August 2004 - 11:08 AM.


#12 Mithril

Mithril

    496

  • Hosted
  • 1,386 posts
  • Location:UK
  • Projects:Heh! You're not going to ask me that question.

Posted 02 August 2004 - 12:25 PM

Hmm actually the flag is only there to make the other script fire off when the truck is disguised, right? Can't you just remove the flag and call the other "set to hunt" script as a subroutine? Subroutines can be called at the same time.

Uploaded 1.03
Command & Conquer: Red Alert - ReGeneration

"Not the faintest clue =\"

-ComradeJ

#13 Akkrand

Akkrand
  • New Members
  • 61 posts
  • Location:Melbourne, Australia

Posted 02 August 2004 - 12:38 PM

Yeah that sounds do-able. I only hope the truck will acquire a target whilst hunting with the commandbutton before it goes off attacking. Is there some action/effect similiar to 'wait for 5 seconds'? If there is I could have the Bomb Truck Attack Script run a script sequentially that says:
Upgrade the bomb truck with Hi explosive
Apply the priority set Bomb Truck Disguise
Hunt using the commandbutton
Wait for 5 seconds
Apply the Priority set Supply Lines
Run Subroutine Attack Dynamic Center

That would be good. But I fear that since in a script run sequentially each action must be completed before the next one begins, how does the AI determine whether "Hunt using CommandButton... " has ended or completed successfully?

I'll look into it tomorrow.

Cheers,
Lord Akkrand

#14 Akkrand

Akkrand
  • New Members
  • 61 posts
  • Location:Melbourne, Australia

Posted 04 August 2004 - 12:40 AM

I've got an update that pretty much solves it. In the "Switch to Kill Mode" script, I removed the setting of the flag to FALSE, and made a non-subroutine script, that evaluates every second and does not deactivate on success:
Reset Bomb Truck Flag
IF
Bomb_Truck_Disguise_Done timer has expired.
AND Flag Bomb_Truck_Disguise is TRUE
THEN
Set Flag Bomb_Truck_Disguise to FALSE

This gets around the problem of multiple bomb trucks inhibiting each other. It also has a pleasant side effect: if the bomb trucks are using the Dynamic Attack Paths, they will reevaluate their attack plan each time a new bomb truck disguises, giving it up-to-date information of the defences of the enemy (or at least more up-to-date).

I've got a new version 1.05 (1.04 was not put online, but it will create problems with my internal versions if I maintain 2 different sets), and it's on my site.

Cheers,
Lord Akkrand

#15 Guest_rigel6669_*

Guest_rigel6669_*
  • Guests

Posted 11 August 2004 - 12:37 AM

I find it a little weird to only give credit to Akkrand for finding the bombtruck to disguise properly.

He started posting about it on aug 2004 and it was already found way before in april 2003 in the full art of defense v5 map.

Its like saying ooo i invented the "hot water" today as no1 has posted it before on a website

#16 Akkrand

Akkrand
  • New Members
  • 61 posts
  • Location:Melbourne, Australia

Posted 11 August 2004 - 01:27 AM

Hey, I didn't (and don't) intend to take anyone's credit, I just posted how I did it. I didn't know it had been done by someone else, as far as I could tell from what I read on these forums it had not been done at all.
In any case, I was under the impression that the bombtruck disuise in the Full Art of Defense map was a map-specific script; as in, it did not alter the AI of the computer in skirmish play, which is what mine does. Correct me if I'm wrong, as I said, I simply posted what I had done.

Cheers,
Lord Akkrand

#17 Guest_rigel6669_*

Guest_rigel6669_*
  • Guests

Posted 11 August 2004 - 02:07 AM

The 1st guy that came up with a working disguise bombtruck script in a map was
Blue orange. He only hosted his previous maps on his own clan site

The first map that he submitted was v4
http://www.cncden.co...fDefense-v4.zip

As you can see it has been found already in 2003, he should get some credit

Its not because it has never been posted or published before .....

#18 Mastermind

Mastermind

    Server Technician

  • Undead
  • 7,014 posts
  • Location:Cambridge, MA
  • Projects:MasterNews 3
  •  The Man Behind the Curtain

Posted 11 August 2004 - 02:58 AM

When CNCDen is online again, I'll take a look at the maps. If it is done correctly, he does deserve credit, but I still believe it is very likely a map specific script.
:rolleyes:
Posted Image

Well, when it comes to writing an expository essay about counter-insurgent tactics, I'm of the old school. First you tell them how you're going to kill them. Then you kill them. Then you tell them how you just killed them.

Too cute! | Server Status: If you can read this, it's up |

#19 Mithril

Mithril

    496

  • Hosted
  • 1,386 posts
  • Location:UK
  • Projects:Heh! You're not going to ask me that question.

Posted 11 August 2004 - 08:29 AM

Yes.. I think pete said something about this somewhere too, but it was probably a map specific thing again. Here is someone who actually tells us how to do things.

I'll take a look at the maps when cncden is back online too nevertheless :rolleyes:
Command & Conquer: Red Alert - ReGeneration

"Not the faintest clue =\"

-ComradeJ

#20 Guest_rigel6669_*

Guest_rigel6669_*
  • Guests

Posted 11 August 2004 - 11:36 AM

The 1st working bomtruck disguise by blue orange:
******************************************

Bombtruck disguise script:

*** IF ***
Counter 'SpawntimeCounter' IS Less Than or Equal 870
*AND* Counter 'SpawntimeCounter' IS Greater Than or Equal To 575
*** THEN ***
Spawn an instance of Team 'Bombtrucks' at Waypoint 'AI_Start04'.
Team 'Bombtrucks' use Ability 'Command_DisguiseAsVehicle' on nearest object of type 'AircraftCessna'.


Bombtruck hunt script:

*** IF ***
Counter 'SpawntimeCounter' IS Less Than or Equal 860
*AND* Counter 'SpawntimeCounter' IS Greater Than or Equal To 565
*** THEN ***
Team 'Bombtrucks' begins hunting.


Comment in the bombtuck hunt script:

Gives 10 seconds for bombtruck to disguise...if it hunts right away, it won't disguise.


Map specific or not it worked and the principle he used can be used on any
other map




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users