Jump to content


Photo

Increasing AI Resources on retreat/defence plan


5 replies to this topic

#1 quiet_man

quiet_man
  • Members
  • 33 posts

Posted 20 February 2005 - 12:02 PM

I can't get the "Player_SetResource" to work from .ai files
I tryed "Player_SetResource(player_id, RT_Requisition, 200)"

I also searched the DLLs for other commands, like from resource_manager, but found nothing

any ideas?

to bad I have only limited time to spend on this, but I think I understand now a few parts of the ai scripts. As you are much ahead on the building and general strategy stuff, I'm looking for specific tactics/improvements.

Currently I'm looking into the retreat and defence plan thing, on many maps it is easy to trap the AI, e.g. at an narrow passage or simply at an edge that makes the ai units drop into your defences one by one

What I'm thinking of is the check on retreat if the assault was fended of with few losses by "trapping",
if the ai was trapped then I want to give it an resources boost to rebuild it forces, the next step would then to try to avoid the trap

quiet_man

#2 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 21 February 2005 - 04:20 AM

Yea thats one of the things I once tried to investigate - looking at the LUA*.DLL files but found ziltch. That may be stuck somewhere in the raw API of the game somewhere. Relic's main LUA AI coder, BIGFOOT says there will be some documentation coming out for such things but dunno about how reliable that is? Grrrrr. Now that we found out early last week about the official expansion - Winter Assault, I'm sure they have their hands full.

Btw, we have to watch out "giving the AI stuff" like "infusing it with cash". I was thinking about doing that to promote the AI to build Large Generators but the way Larkin put it makes sense: let the AI build it based on its need. If the AI has 6 regular Generators then what more does the AI need? He's got huge energy coming in + with the AI researching both req/power upgrades its all good.

AI just needs to be smarter, think near human unpredictability, respond to threats with creative zest.. yep.. sounds impossible but we can get close. :p
Advanced Skirmish AI Team Lead for the coolest Warhammer40k PC RTS out there:

Dawn of War Advanced AI Headquarters

Latest DoW Advanced AI Download!

#3 giskard

giskard
  • Members
  • 155 posts

Posted 23 February 2005 - 08:40 AM

This sounds like the same problem I had when trying to get the AI to reading in a new var i added to its own AI info files.

I think all the vars are stored in each AI players stats array and initialised in the scripts. So when the AI does a check against the stats it knows exactly what vars should be present in the stats.

So adding a new one confuses it.

Thats a theory only, its the only logical explaination for commands that should work, not working at all that ive come up with so far.

Giskard

#4 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 23 February 2005 - 09:14 AM

Lets define the problem more clearly.

I added

BuildBaseStrategyInfo = 
{
common = {},
	
eldar_race =
{

  Turrets =
  {
 	 --limit of turrets
 	 limit = math.random( 10,15 ),
 	 
 	 req = 300,
 	 
 	 power = 150,
  },

to advanced\buildbasesstrategyinfo.ai and it works. I can access by self.info.Turrets.limit for example as expected. Whats your problem ?

Edited by LarkinVB, 23 February 2005 - 09:15 AM.


#5 giskard

giskard
  • Members
  • 155 posts

Posted 23 February 2005 - 07:18 PM

Ive been trying to do this basically.

For example.

Add to buildbasestrategyinfo.

myvar = AIName

Then call it back from buildbasestrategy.ai as this

self.info.myvar

The way I understand it is this.

Self refers to the current document name. Info refers to its info file of the same name with info at the end and the last var refers to something in the info file.

If you change the info part of the name to say JET it still loads but crashes out later when it hits code in other docs expecting to find the info file.

If you check ETA for example you will see it refered to as self.info.ETA.cost because it has ETA = (cost) or something like that in it.

Yet using this system to call new vars doesnt work.

All other attempts at doing something similar didnt work either.

So i went to the CPU manager and tried to add it directly to the player stats using the player.stats.myvar as its assigned name. Setting it up accordingly and hit exactly the same problem. I tried several varations on this and none of them worked.

I separated the functions and created my own to do the check then call the original function and pass on the myvar variable to it and it still didnt work.

Now i do my checks in the update function which may be the source of my problem. Perhaps the update function doesnt like checks in it.

giskard

#6 LarkinVB

LarkinVB

    title available

  • Members
  • 1,488 posts

Posted 23 February 2005 - 08:27 PM

I can only repeat that it works here and that I offer my code for you to check. I access turrets with self.info.Turrets.req (for example) in eldarbuildbasestrategy.ai.

Edited by LarkinVB, 23 February 2005 - 10:46 PM.




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users