Page 1 of 1
Dgunning Commander
Posted: 05 Nov 2005, 05:22
by Chocapic
I propose to you guys who are developing ai's to add a "simple" code on the UnitDamaged function detecting if the comm is the on being damaged to get a dgun command at the damager position, having the complication of not dgunning own stuff by comparing your units/buildings positions with the attackers position.
I know this is not the type of real improvement that is needed or so, but its a detail that actually gets nice, and makes it slightly more challengefull at an early stage of the game, for a "peacefull" few coding.
Posted: 05 Nov 2005, 12:09
by Triaxx2
I'll definitely be sure to add code so it will fire the D-Gun, but not anything simple. I've actually got an idea how to make it lead the target.
Posted: 08 Nov 2005, 22:05
by Veylon
I have it in my AI.
I also should (or maybe I did, I can't remember) add a time limit so the Commander doesn't chase the offender forever.
Also, I need to add a check to make sure he doesn't wiggle to death vs. a few flashes, as he does now.
Posted: 09 Nov 2005, 12:46
by IMSabbel
hm. I guess the exploit factor of that feature would be endless if it doesnt include a check of everything that could be hit by the dgun before fireing...
(or a player could make a ai dgun everything it already build)
Posted: 09 Nov 2005, 13:30
by Triaxx2
Possibly, but correcting it shouldn't be difficult. Something along the lines of:
Code: Select all
Underattack by= {UnitX} (pos x,y)
Last Pos 1: (x,y)\
Last Pos 2: (x,y)|--Determines if it's moving in a circle.
Last Pos 3: (x,y)/
If it's moving in a circle, it adjusts to fire a blast across the calculated path. If it's a straight line then it fires to hit there. If under attack by multiple I have to figure out how to take into account the spread of the D-Gun blast. That way I can conserve energy by getting two or three in one shot. I know how it's supposed to work, but not how to make it work.
Posted: 10 Nov 2005, 21:38
by Veylon
Now that you mention it, my Commander has done a lot of demolitions work on his own base.
I'm not to worried about saving energy. I've never seen my AI get so low on energy as to be unable to throw out a few D-Gun shots.