Jump to content


Photo

The Markus-is-Modding Thread


133 replies to this topic

#41 jONES1979

jONES1979

    eL-jONESON

  • Members
  • 1,720 posts
  • Location:Еду в Саратов стрелять в пиратов!

Posted 23 March 2010 - 01:34 PM

I added the last if-check to stop my squad from dancing. But they still tend to not hold still when they're in shooty stance and something is trying to engage them in melee.


See inside Data\ai\core\tactics\infantrytactic.ai file for function InfantryTactic:CheckForDance() and you will see how really affect CheckDance() function to Dance behavior.

Is this my fault or is something else kicking in making them run around for no reason apparent to me?

There is a more probably, that you squad just retreat from more powerful enemy...

--
So, you override a default tactic for GK and you are want to GK always melee-fight the necron_night_bringer (untill death :mellow:)??? I question it because sometime I don't clear understand English.

Edited by jONES1979, 23 March 2010 - 01:56 PM.


#42 Markus Ramikin

Markus Ramikin
  • Members
  • 86 posts

Posted 23 March 2010 - 03:50 PM

No, I want them to run from the Nightbringer but NOT from anything else.

Like, they switch to ranged stance if, for instance, around cultists. This is good because cultists die easily to stom bolters and there's no need to chase after them to use melee weapons. Chasing is bad for us, it reduces accuracy.

However, cultists are a melee squad and will try to fight them in melee. This would be good too, because now we could use melee weapons without having to chase... except for some reason the squad starts dancing away from the cultists.

And no, this isn't when around a more powerful enemy, unless the AI can see beyond the fog of war or the unupgraded turret was counted or something...

---

In other news, dowai people, why does the attackstrategy "Waiting..." involve walking through the enemy army repeatedly so they can mow you down? :mellow:

#43 thudo

thudo

    Wacko AI Guy!

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

Posted 23 March 2010 - 03:54 PM

Good luck trying to fix that.. it can be map-dependent.. we're tried to fix that where an AI army will try to regroup somewhere else but doing so it part of it gets slaughtered as it move through enemy troops. Trust me: we looked into that years ago.. its hard as nails coding it otherwise as a lot of it is based on a map. There are MANY parts of the adv. DoW1 AI that we worked on.. I mean we had 5+ years doing it. There is only so much LUA coding can achieve when the core AI engine has constraints.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#44 Markus Ramikin

Markus Ramikin
  • Members
  • 86 posts

Posted 23 March 2010 - 05:00 PM

*grin* understood. Yeah, I can probably see that it was due to the map this time. I was testing vs Necrons (who seem to be the hardest race for my GKs to beat) on Deadman's Crossing and they tried to regroup at the "closer" relic which, topologically, was farther. And the necron army was in the valley. Wallbanging ensued.

Edited by Markus Ramikin, 23 March 2010 - 05:09 PM.


#45 jONES1979

jONES1979

    eL-jONESON

  • Members
  • 1,720 posts
  • Location:Еду в Саратов стрелять в пиратов!

Posted 23 March 2010 - 05:02 PM

No, I want them to run from the Nightbringer but NOT from anything else.

Like, they switch to ranged stance if, for instance, around cultists. This is good because cultists die easily to stom bolters and there's no need to chase after them to use melee weapons. Chasing is bad for us, it reduces accuracy.

However, cultists are a melee squad and will try to fight them in melee. This would be good too, because now we could use melee weapons without having to chase... except for some reason the squad starts dancing away from the cultists.


So, You are wrong in understanding dancing. Dance is escape a melee fight, when Ranged(only) unit engaging XtX by melee unit

Tacticals(and Terminators) are Ranged squad. Cultists are Melee. But tacticals are NOT AVOID melee vs Cultists STRICTLY (by that code), because Cultists are weak even in melee vs Space Marines.

So code about GK you added makes similar behavior: If AI will count GK as Ranged and Night_Bringer will melee GK, in that case GK will fighting melee and do not execute dancing

#46 Markus Ramikin

Markus Ramikin
  • Members
  • 86 posts

Posted 23 March 2010 - 05:13 PM

You are wrong in understanding dancing. Dance is escape a melee fight, when Ranged(only) unit engaging XtX by melee unit

Tacticals(and Terminators) are Ranged squad. Cultists are Melee. But tacticals are NOT AVOID melee vs Cultists STRICTLY (by that code), because Cultists are weak even in melee vs Space Marines.

Yes, I understood that perfectly, which is why I decided to use similar code.

So code about GK you added makes similar behavior: If AI will count GK as Ranged and Night_Bringer will melee GK, in that case GK will fighting melee and do not execute dancing

Did you notice that I added a NOT to my condition?

Take a look at the original code:

if (oSquad:GetSquadName() == "chaos_squad_cultist") then
			return false
		end
This means, "if the enemy is cultists, do not dance".

What I used is:

if (not (oSquad:GetSquadName() == "necron_night_bringer") ) then
			return false
		end
This means "if the enemy is NOT nightbringer (i.e. if the enemy is anything else), then do not dance."

#47 jONES1979

jONES1979

    eL-jONESON

  • Members
  • 1,720 posts
  • Location:Еду в Саратов стрелять в пиратов!

Posted 23 March 2010 - 05:22 PM

Did you notice that I added a NOT to my condition?

No, I didn't :mellow:

But anyway, it seems that your code will never executed. I think that AI will never count GK as ranged squad.
I think so because of that:
GameData["squad_melee_stance_ext"] = Reference([[sbpextensions\squad_melee_stance_ext.lua]])
GameData["squad_melee_stance_ext"]["default_to_melee"] = true

But for sure, it is require a test.

Edited by jONES1979, 23 March 2010 - 05:30 PM.


#48 Markus Ramikin

Markus Ramikin
  • Members
  • 86 posts

Posted 23 March 2010 - 08:21 PM

Actually, the relevant code depends on the IsRanged function. This returns the actual current stance rather than the "default" one. I just tested using aitrace.

#49 Markus Ramikin

Markus Ramikin
  • Members
  • 86 posts

Posted 23 March 2010 - 10:59 PM

LOL. Srsly. LOL.

I just had the AI try to build 8 or so Sacred Artefacts. May end up being more once I unpaused after this post. :mellow:

I know this isn't due to dynamic building, because that building is not in there at all. (I think it was and I deleted it). It -may- be due to the fact that i have a number of researches in a row at that point in the build program, but seriously, shouldn't there be some sort of a check on that in the Core?

#50 Markus Ramikin

Markus Ramikin
  • Members
  • 86 posts

Posted 23 March 2010 - 11:13 PM

Hahaha 20 and counting.

AI1000 23:16 BuildBuildingPlan: Time out! Abort building space_marine_ability_building

I think it's due to a dreadnought getting stuck with a servitor, blocking it from moving. Has this happened to anyone before?

#51 Markus Ramikin

Markus Ramikin
  • Members
  • 86 posts

Posted 29 March 2010 - 04:13 PM

OK, due to the very remote and unlikely possibility that anyone even cares :xcahik_:, I've pretty much made my mod work like I wanted it, and fixed most of the issues I had raised. Thanks again for the help, guys.

In fact even my earlier fix to the relay problem seems to have worked, surprisingly enough. Although that's only from observing gameplay 'cause, clever human being that I am, I didn't think to leave AItracing on and so I can't be 100% sure that that's what was going on.

(But yeah, some of that stuff is Core and the cancelling of interrupted building programs could use looking at, I had this sacred artefact issue come up again and it kept happening even while the origial problematic building did get completed. And I'm 100% sure it's not due to any of my modifications.)

I think the most fun bit of it all - not counting making the Daemon Prince spawn Horrors - was learning how to make a unit adapt their stance depending on what's around it, works perfectly like I wanted it to. It's a bit involved though and multiple calls to a hardcoded function, so not sure this would be a great idea on a weaker machine than what I'm using :p but I'm still happy with it, damn it!

#52 thudo

thudo

    Wacko AI Guy!

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

Posted 29 March 2010 - 04:16 PM

Map-dependant, bro.. and yeah it happens.. sometimes even in other RTSes but its rare.. thankfully. :xcahik_:

Edit: hmmm would like to know what you've changed? There are still a few things to add to a possible 3.30 AI.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#53 Markus Ramikin

Markus Ramikin
  • Members
  • 86 posts

Posted 29 March 2010 - 04:55 PM

Map-dependant, bro.. and yeah it happens.. sometimes even in other RTSes but its rare.. thankfully. :p

You were referring to the building spamming? It's just due to the way the building program handles incomplete buildings that it's given up on. For one, it should delete them because it will try a new instance soon anyway, and for two, once this happens it seems to remember the need to retry the same building no matter what, which causes the spamming. I might take a closer look at the code some time to find where the problem is exactly, but yeah, this is Core and more like your job. ;)

Edit: hmmm would like to know what you've changed? There are still a few things to add to a possible 3.30 AI.

Most of it was related to the specific changes my mod introduces, so not useful to you. Hm, let me think.

One of the things I did that you might want to consider was cancelling that part of the build program strategy where it reverts to buildprogram 1 if a rush is aborted. This is generally a bad thing when the AI does it, IMO. I mean if you've teched up to tier 2 and laid down a vehicle building, and something gets close to your base, it makes sense to continue what you were doing and start churning out the vehicles you teched for so you can defend it. Instead of sinking your remaining requisition into a barracks and possibly armory because you're now following a build order that requires barracks.

So what I did was leave the code that cancels the rush alone - so it is now free to build units as it can - but commented out the buildprogram changing:

if (self.m_iPrepareRush > 0 and cpu_manager:GetCriticalSituation() > 0) then

		-- Abort rush
		aitrace("ABORT RUSH")
		self.m_iPrepareRush = 0
		self.m_iFinishedRush = 4
		
		-- Switch to standard build program
-- Markus Ramikin: Actually the changing of programs tends to end worse than continuing it, 
-- so I'm turning that off fow now
--		self.m_iCurrentBuildProgram = 1
	end
In my experience observing AI since then, that tends to work out pretty well, especially compared to how screwed the computer was before if a rush was interrupted. So just something to think about if you want.

Other than that... hm, I don't suppose that stance-changing stuff I'm so happy with is something you want, since vanilla units are generally good at either one thing or another. The only reasons I wanted it for my mod is that 1. I made chaos horrors good at melee vs infantry, so they want to fire at vehicles and buildings but go into melee vs infantry, and 2. I made GK storm bolters particularly good against light infantry, so it makes sense for them to just shoot instead of chasing cultists and stealthsuits uselessly. But if you're interested, I can post it.

I'm a bit busy today so won't do it now, but soonish I'll update my changelog and look through it to see if anything else looks like it might be useful. But I seriously doubt I've come up with anything you guys haven't. You're the experts, I'm the newbie, remember :xcahik_:

#54 thudo

thudo

    Wacko AI Guy!

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

Posted 29 March 2010 - 05:28 PM

Yeah cool man.. we also have code that properly allows the AI to use squads that have target abilities like Grenades properly now. In our 3.20 release, if one squad lobs a grenade, others will not because then all such squads share the same recharge timeout even though other squads never lobbed their own. This was fixed and its quite critical for the AI to have this resolved. Also, Dark40k created new AI code which allows us to choose how close we want X kind of units to deepstrike into the enemy. ie. you don't want Marines who are shooty to deepstrike into an enemy mass but instead further back so they can go all shooty and not engage in melee HOWEVER we would want a Dread to deepstrike as its a melee-killing machine much like Grey Knights and Assaults. This deepstrike code is useful for this so it keeps shooty deepstriking units from being too close to the heart of battle.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#55 Markus Ramikin

Markus Ramikin
  • Members
  • 86 posts

Posted 29 March 2010 - 05:40 PM

Sounds good. Hopefully I'll live to see DC updated, because I'm sure as hell not going to play SS. :xcahik_: But, hm, I might end up installing your SS AI just to see that improved code.

#56 thudo

thudo

    Wacko AI Guy!

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

Posted 29 March 2010 - 05:44 PM

Bah.. SS is dirt cheap now.. its over 2years old now (came out 2nd week of March '08) so go get it.. Hell.. you can easily within a few clicks away get it ahhemm.. off many dubious methods but that's not condoned here, mister!
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#57 Markus Ramikin

Markus Ramikin
  • Members
  • 86 posts

Posted 29 March 2010 - 06:08 PM

Oh, I know. I just think it's a sucky game. As much as I like SoB in principle, I much prefer DC. Which btw, I do own legally. :xcahik_:

Edited by Markus Ramikin, 29 March 2010 - 06:11 PM.


#58 thudo

thudo

    Wacko AI Guy!

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

Posted 29 March 2010 - 06:10 PM

Not the point -- you are missing lots of new 3d content + most future mods support SS. It makes sense to have it just as a backup for whats coming.
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#59 Markus Ramikin

Markus Ramikin
  • Members
  • 86 posts

Posted 29 March 2010 - 06:15 PM

Yeah it's just something I'm stubborn about. I don't understand this cattle urge to go on and on to new things. Like so many people knew Vista sucked but they still moved on from XP. Most people used to agree SS was the worse game and DC used to be better, but they all moved to it anyway. Like the dowpro team - they completed dowpro for DC and let it go unused. What the hell was the point of completing it if nobody will play it? You know what I mean? Well I'm a stubborn fellow and I don't like SS so I'm sticking with what I like. If modders do things for SS and not DC, well that's just too bad, isn't it. If I ever get sick of DC and/or completely run out of people to play with, I'll go back to playing Go and chess.

Edited by Markus Ramikin, 29 March 2010 - 06:17 PM.


#60 thudo

thudo

    Wacko AI Guy!

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

Posted 29 March 2010 - 06:19 PM

1) SS is the new standard since its been out. Thats progress. Many Mods meant for it than DC.
2) DC can still be supported no problem from SS but SS has new stuff that cannot go into DC.
3) SS is cheap -- no excuse to buy it OR go other method :xcahik_:
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users