View Full Version : how-to tired of your infantry not staying put?
asynd
17th Jan 07, 11:18 AM
in order for you to follow along,you will need Corsix’s mod tools that can be found here (http://www.corsix.org/cdms/).
this is just a simple edit to keep an infantry squad holding their ground at all times.
1.open Corsix’s mod tools > open your mod, if you don’t have one follow the instructions on Corsix’s website on how to get started.
2.navigate your way to the attrib >sbps>allies>soldiers
http://asynd.net/coh/how/pausescreen/bb.jpg
3.double click on infantry_rifleman.rgd. extend the squad_combat_behaviour_ext
http://asynd.net/coh/how/pausescreen/aa.jpg
4.delete the entries from
squad_ai_file
squad_ai_pinned_file
squad_ai_reaction_file
squad_ai_retaliation_file
you dont need to delete the children from the tree, just the actual entries.
5.save,run your mod from the tools. once in game build a rifleman squad
now when your squad is ingaged in combat they will not move, they will hold their ground. this small edit is mainly useful if you find that you have trouble keeping your infantry behind sandbags or other defensive positions.
Until a new function can be added that will allow any infantry unit to hold their ground(im attempting to do this right now).This little change might help you ease your frustrations with the way some of the infantry types behave. i personally dont like building sandbags or putting a squad behind a concrete wall only to watch them move around to the exposed side, even though they are still being shown as they have heavy /light cover , it doesnt look too realistic when they do that.
Saldrin
17th Jan 07, 11:40 AM
Nice find! I'm a little hesitant in deleting those though, what happens if a squad gets pinned?
I found some entries in the tatics.ai file, starts about line 430-475. Interestingly, there is a line that is commented as "-- never move closer to any of your targets" which I don't think is working. AI programming is not a skill of mine.
As a work around I've been placing a row of sand bags in front of a row a sand bags and posistioning my troops behind the furthest row. This way when they move up, they are still behind sandbags.
But I think there is something funny about how the AI recognizes cover ( as described in lines mentioned above) and is not using the anchor properly. I didn't notice a condition that looks to see if "already in cover->stay." Unless it found the cover and the "retailation" AI is kicking in?
asynd
17th Jan 07, 11:59 AM
when they are pinned they will hit the dirt, the only reason why i removed those lines is, i was looking at one of the vehicles combat_ext's trying to figure out what keeps the from moving and they didnt have any squad files.
im not a programmer either, but i do know alot about copy & pasting ;)
yea i used to do the 2 rows of sand bags too, im hoping that il be able to make a new button that appears when you select the squad called "hold ground" and when its clicked it will change plan files to one that tells the squad to not to move. im not sure if its possible or not, but im giving it acouple tries.
yea i think the retailation AI is the reason why the squad doesnt want to stay in cover,it might be ok just to remove just that plan now that i think about it.
Jarhead
17th Jan 07, 4:16 PM
Hey guys, that actually solves a problem in a thread i posted. So thanks for the tip :Hail:
Im interesting in editing the squadai files that these refer to, to see if there is some code in there to stop them moving. Or failing that im happy to use the Hold Ground function
immortal44
23rd Jan 07, 7:41 PM
Hold ground order would be ideal if it is possible, since there are benefits to the AI moving.
djukel
24th Jan 07, 6:14 AM
It is hard to understand why Relic left out some important functions like Hold, Guard and Patrol from an RTS game!!!!!! Big mistake.:(
asynd
24th Jan 07, 11:39 AM
i personally dont see a need for a patrol function since combat usually takes place pretty fast in the game to where you dont need a force patrolling a large territory but it would have been nice if they would have included the hold ground feature or gaurd unit. but i guess it could be useful for when players set up matches on the really big maps but only 2-4 players are on them.
Im still trying to implement the new button ingame, if i make any progress with it il create a new topic about it .
Jarhead
24th Jan 07, 3:58 PM
I have actually found by modifying the reaction-plan-squadai to something like:
-- command macros
import("squadai-util")
-- squadai plan file
------------------------------------------------------------------------------
-- sound options
sound =
{
soundDirectory = "Battle_Chatter",
soundPercentage = 30.0,
}
------------------------------------------------------------------------------
-- plan
plan =
{
------------------------------------------------------------------------------
-- phase0: Before First Bound
{
type = DATA_PHASE,
name = "START PLAN: INFANTRY REACTION",
--
{
apply_to = ET_All,
actions =
{
ACTION_MOVE_POSTURE_EXT( DT_AWAY_FROM_TARGET, 1.0, 5.0, 80.0, "", PACE_VERYFAST, PACE_VERYFAST, POSTURE_PRONE, POSTURE_PRONE, 0.0, true, true, false ),
}
},
},
}
Its seems to work ok with these files still in place.
Havent looked at this too much yet, but a quick fix for now?
Sgt. D. Pilla
10th Mar 07, 10:50 PM
asynd...any luck on the ingame button...??
asynd
11th Mar 07, 10:47 PM
I have the button icon made for it and some of the files for it, but to be honest Sgt. D. Pilla i havent touched anything for COH modding since the end of Jan. I have a pretty good idea on how to go about getting it to work, but I had a feeling the official tools(ie model importers etc) werent going to be released anytime soon so I stopped all of my little projects I had planned. But Il try to finish this task that I had started, since I didnt think anyone really cared about the feature until I saw more post on it.
Sgt. D. Pilla
11th Mar 07, 10:55 PM
Ohh well i know how you feel...But to be completly honest ive been waiting for this feature for AGES because it really bugs me off how the dont stay in the one spot...then advance into a tanks line of fire???WTF yes lets all stand infront of a tank...LOL...AHH FLY ON MY HAND..
But yeah i hope you can get this working cause i would absolutly love it...
Any Help you need...you know where i am!
banereaver
12th Mar 07, 2:03 AM
Im waiting on this too. I thought it would have been implemented in the game from the start most other rts have them and its kind of important, holding strategically important areas is needed and charging from perfectly good cover at a HMG squad is geting irritating.
Kyranzor
12th Mar 07, 5:47 AM
i have been working on a Hold position button for quite a while. it acts like a toggle button (like camo) and when on, it makes the squad have a move speed of only 0.001 or something close to that. UNFORTUNATELY the modifier_apply isnt working, and when the button is pressed, it doesnt activate the movement change. i beleive i must use the same modifier/action as the medic kit, how it slows movement, but it doesnt quite work...
oh well, i shall continue work on it if you guys think it is soo interesting.
by the way, i would only remove these two entries for the ai lines
squad_ai_reaction_file
squad_ai_retaliation_file
because the pinning and basic movement of the AI should still be there, just not the combat reaction for cover seeking towards the enemy...
asynd
12th Mar 07, 12:18 PM
I wouldnt change the speed of them Kyranzor
The method ive been trying to use, is to set it to where the hold button activates a trigger -1 to true, setting a new ai file that has the line that makes them move from cover to missing, then when the button is depressed it goes back to false allowing them to move again while in cover
Kyranzor
18th Mar 07, 4:03 AM
well, there is soo many possible ways i have yet to try, i'm sure i could start with AI scripts now, as you said, by making a toggle on/off for certain AI files (like those four above).
you can trigger posture groups, so why not ai files? :P
asynd
18th Mar 07, 8:58 PM
i was trying the ai files..then i got side tracked with the UI colors haha. i have the button in game but the bugger wont go to where i want it, its an easy fix im just having what we like to call, a brain fart and im not seeing the simple solution to the problem.
anywho this is what it looks like ingame, im stepping away from it for a day or two while i try to come up with a fresh idea on going about getting everything implemented.
http://www.asynd.net/coh/slightprogress.jpg
Kyranzor
22nd Mar 07, 1:59 AM
i beleive that spot cannot be used, because that is where "force fire" is for bazookas etc.. you have to use the other 8 slots below that top 4...
asynd
22nd Mar 07, 2:28 AM
yea thats what i was thinking. if i can get this to work. im hoping on adding a hold fire ability to the mortar teams once im done with this. since i get annoyed with my guys get taken out by friendly incoming rounds.
Sarge
24th Mar 07, 2:49 AM
I cannot WAIT for this...Im so relieved that someone is actually trying to implement this. I hope its released soon.
Sarge
25th Mar 07, 9:03 PM
Any Idea of when it may become avalible???
I am attempting the Hold Fire, command for the mortors, for you.
asynd
28th Mar 07, 12:24 AM
i hate to say it, but i dont think this is possible at the current time. ive tried a few of different methods that i thought would work and still nothing.all i can say is, the little simple fix that i first posted about is the only way to get them to hold their ground. if anyone else out there has an idea on how to do it, post it here and il give it a try if i havent already.
and if anyone from relic reads this. we(i) would love you forever if you released 2 new functions. i know they arent hard to implement i just cant do them with the given tools/knowledge of modding for coh i have.
im sure im not the only one when i say this, but we would appreciate it if you would add a hold ground ability to the infantry, and hold fire to mortar(shouldnt be hard for me to add) units and other units that use artillery as a free fire. nothing is more frustrating than having to move your mortar teams out of range just so they dont accidently drop a round ontop of one of your squads
for future ref if anyone else wants to try this, il share what methods ive tried.
1.by looking at how the sniper uses the camo ability, that ability is a trigger, changing something from true to false, by basing my button on that. i tried to get a new ai plan to be called for the infantry unit that was selected. that file wouldnt include the code that makes your guys run around like morons and leaving perfectly good cover. when it was turned off, the default plan would be switched back.
i was never able to get it to work. i think it has to do something with a new table that needs to be created and im not sure how to do all of that. maybe theres someone out there that knows how to do it.
2.pulled some hair out and gave up for the time being.
Sarge
28th Mar 07, 12:47 AM
So how about a "quick fix" which just reduces the speed to like "Kyranzor" said 0.000001 and then back to default...would that be possible?? or even just to 0
banereaver
28th Mar 07, 8:09 AM
the only thing i can think of for the mortars is to have the mortars be permanently camoflauged then change the modifier that sets the squad to actually being camoflauged so that the hold fire button is still useable.
dont know if that made too much sense. but it might work.
Mikolas
28th Mar 07, 11:19 AM
Sarge: 1000 times was told before, speed of infantry can not be changed like that way.
Sarge
28th Mar 07, 6:33 PM
and yet Kyranzor i sware said he managed...hmm odd that
asynd
28th Mar 07, 9:16 PM
no, i believe that he said that he was never able to get the modifier to work properly.
--i dont think that would work honestly. if you modify the speeds, i would assume that would change the speed of the units ability to attack. ie a slow-mo looking rifleman getting gunned down while he tries to turn to shoot at the enemy.
the quick fix i was talking about is what i discussed in my first post, remove the plan files.
Baneraver for the mortars, my idea was, when the camo ability is activated, a trigger takes place and makes the hold fire icon appear, i was planning on just making the hold fire button appear in spot 4 or 5, the hold fire changes the attack stance of the sniper, im not sure if other units have that same stance. but i was going to give it a try later tonight.
look at the camo bag tree, and you'll see what im talking about. there are acouple different files that the sniper uses right now.
Sarge
28th Mar 07, 10:07 PM
OHHHK...lol thanx asynd, yeah after reading his post i understand...DAMN it i never read properly...ohwell
Well to bad you were unable to get that operational...hopefully you can get the holdfire working, cause just last night i lost 4 squads of riflemen just as they went under by 3 mortors which were told to stop shooting...and naturally the tanks they went to stop got throw basically un harmed and destroyed my base...ALL because of mortors not using their brains :(
Kyranzor
30th Mar 07, 7:31 AM
not quite right asynd
if you modify the speeds, i would assume that would change the speed of the units ability to attack. ie a slow-mo looking rifleman getting gunned down while he tries to turn to shoot at the enemy.
the speed is really only their ground movement speed. NOT the turn speed/rate or their basic movement speed for animations etc.. i could be wrong of course...
i wish the multiplier of 0 worked for the damn modifiers... anything times 0 = 0, so you would get a 0 speed. but it doesnt seem to work that way!!
asynd
30th Mar 07, 1:00 PM
hmm. have you just modified their default speed to check if it works?
i just assumed that it would cause them to slow down all together (just experience ive had from modding from other games).
Does anyone know if all of the units share the same combat stances? I havent dove into it quite yet, but i know the camo ability enables the hold fire button for the sniper and the axis AT. and i think the storm troopers have hold fire, so i would think other units could have it also but im not sure yet.
i tried changing the default stance to that of a hold fire for a mortar team just to see what would happen, didnt do anything which i didnt think it would in the first place.
mnbvcxz3210
8th Apr 07, 9:15 AM
will it help if copy the relative files from DOW to COH? Just a thought.. since DOW units have stances, and also use .lua and .rgd files, plus the table entries looks similar..
and for the mortar holding fire, there is a hold_mortar.rgd under type_holdable, but the content cannot be viewed in Corsix's tool..
UberBugz
14th Apr 07, 11:01 AM
Howdy all,
Not sure if anyone is still interested in this thread, but I think I may have come across a possible compromise between infantry staying put behind cover, and advancing on the enemy. What if it's all about timing?. Delay the move action called by the squad retaliation plan to something more appropriate.
If you look in */sbps/*/*/squad_combat_behaviour_ext, you'll see plans set up for retaliation (mostly 'infantry-idle-plan' or 'default-plan'). Same for vehicles, ecxept that the retaliation entry is set to "empty-plan" --> Ever seen a vehicle advance all by itself?... Nope. What about a mortor crew? Nope.
Sure, you could if you wanted, change the infantry retaliation plan to "empty-plan" and get what you expect --> Infantry stray put (whilst shooting) when an enemy unit enters its LOS. Infantry stay put behind sand bag walls whilst shooting at the enemy ect... But could this affect the skirmish AI in some way? I'dunno, hopefully some modders out there will test this and report back.
What I suggest is altering both the 'infantry-idle-plan.squadai' and 'default-plan.squadai' files located in /data/squadai/. To understand what I'm talking about, take a look at the definitions in 'squad-util.squadai'. This is mostly self-explanatory. Everything you see in this file is used in some way within all the other files located in the directory. Most importantly, notice the "max_order_delay" parameter.
In the case of 'infantry-idle-plan.squadai' change the 'max-order-delay' value from 1.0 to 5.0, 10.5, or even 30. And then start your mod. I'm guessing you'll notice that your squads stay put instead of acting like idiots and running around sand bag walls or giving up light cover just to advance on the enemy and end up in open cover. Likewise, the skirmish AI now behaves differently as well. It seems to me that this added delay allows squads to shoot at an enemy where they are for a specifed time, before they decide (or not) to advance and seek cover towards an enemy.
I've tested this with vanilla COH, my own personal mod, Commando Realism, and the mighty Kmod. I like the results I'm seeing. But I could be wrong. It'd be nice if someone else could confirm any of this.
HTH
djukel
14th Apr 07, 12:41 PM
I hope it wasn't imagination but I saw improvements on soildiers behaviour. I set value to 30. Thanks
asynd
14th Apr 07, 10:15 PM
the ai units will always move, from my testing atleast. in every single game ive played i have yet to see a friendly ai or enemy ai just let their soldiers stay in place, usually they always move unless supressed/ but that was just on my end. You can edit the squad files, but i didnt want to do that personally(im lazy at times) but if anyone can find out any better methods, by all means suggest them.
UberBugz
15th Apr 07, 3:24 PM
"Djukel":
Howdy, I was wondering if it wasn't just my imagination as well. Thanks for the reply. Are the improvements you notice related to the human side or the pure skirmish AI? Human players put squads behind sand bag walls and expect them to stay there. The pure skirmish AI could care less about sand bag walls and basically does it's own thing. <-- Or so I think.
BTW - Djukel, I can see where you've been mucking around with *.squadai files in the WarOnAI mod. Good stuff. Hope you keep updating the mod. Having tanks behave intelligently (After getting their main gun blown off) is sheer genius. No, nothing to do with sqaudai files, but a slick concept nonetheless. A salute...
--
"asynd":
I think you might be right. The changes I suggested don't really seem to affect the pure skirmish AI at all. Well, at least I haven't seen an AI squad sit in open cover for more then 30 seconds without moving. Maybe the changes I suggested only affect the human player (Semi AI squad control) and not the pure skirmish AI (Full AI squad control).
[Shrug]
Whermacht
18th Apr 07, 7:14 AM
:Hail::Hail::Hail::Hail::Hail::Hail::Hail::Hail::Hail::Hail::Hail: WWOOTT perfect!!!
Mr_Cellophane
25th Apr 07, 10:51 AM
I opened the infantry-idle-plan.squadai but I don't see any max order delay parameter.
Can anyone help me? I am getting annoyed with this as well.
Anyways thanks
asynd
25th Apr 07, 9:38 PM
i believe its in the reaction plans. skim through all the plans the infantry use. and you'll see the parts that make them move/scatter/seek other cover
UberBugz
28th Apr 07, 10:50 AM
"Mr_Cellophane":
Open 'squadai-util.squadai' and take a look at that. The position of the max_order_delay parameter (For all functions) is named there. For the 'infantry-idle-plan.sqaudai' file you'll want to change 1.0 (Last number value before the "false,false,false" parameters to 30.5 or more. Good luck.
--
By the way, since asynd said to suggest better(?) methods, here's one that follows along the lines of what asynd suggested in the first place... And it's cheap and simple. If you can use explorer to copy, paste and rename files, you can do this.
The main problem with squads moving like idiots has to do with the retaliation plan (only the retaliation plan!) kicking in. asynd suggested deleting the retaliation entry with mod studio for squads. And that works rather well. Perfectly even. But this is the same thing as using the 'empty-plan.squadai' file.
So here's what you can do:
1 - Rename both 'default-plan.squadai' and 'infantry-idle-plan.squadai' by adding "_BACKUP" to the end of the file name.
2 - Make two copies of 'empty-plan.squadai'.
3 - Rename those two copies of empty-plan to "default-plan.squadai" and "infantry-idle-plan.squadai".
4 - Fire up mod and notice squads stay put. Unless hit by grenade, mortor, or big gun fire. If done correctly, this should end being a global change. All squads using the newly created "empty" plans should stay where you put them.
I've been using this method with warnstaffs 'Stock infantry Only' mod and I like it better then what I suggested about max_order_delay.
HTH
vBulletin v3.0.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.