Jump to content


Photo

Getting AI to build new units

ai build sparta athens twp peloponnesian wars

  • Please log in to reply
14 replies to this topic

#1 Lauri

Lauri

    Old man Lauri

  • Hosted
  • 10,436 posts
  • Location:Norway
  • Projects:The 4th Age
  •  The very worst T3A Team Chamber Member

Posted 31 May 2012 - 06:18 PM

Hey

So, we haven't really paid much attention to it, but now it's starting to get crucial. In The Peloponnesian Wars, we just can't get the damn AI to build units other than Hoplites.
But since we humans can, we get a pretty big advantage to say the least. We've tried a few different things, like altering buildcosts, or changing the order in the commandset for the Barracks, but no matter what we do, the AI only ever builds Hoplites. Hell, even setting Hoplites to 0.0 in skirmishaidata.ini does nothing!

Here's the code from that file;
ArmyMemberDefinition SpartanEkdromoiHorde_Member
        Unit            = SpartanEkdromoiHorde
        PercentageOfArmyPhase1    = 50.0
        PercentageOfArmyPhase2    = 30.0
        PercentageOfArmyPhase3    = 20.0
    End

    ArmyMemberDefinition SpartanPeltastHorde_Member
        Unit            = SpartanPeltastHorde
        PercentageOfArmyPhase1    = 15.0
        PercentageOfArmyPhase2    = 15.0
        PercentageOfArmyPhase3    = 15.0
    End
    
    ArmyMemberDefinition SpartanHopliteHorde_Member
        Unit            = SpartanHopliteHorde
        PercentageOfArmyPhase1    = 35.0
        PercentageOfArmyPhase2    = 50.0
        PercentageOfArmyPhase3    = 60.0
    End
    
    ArmyMemberDefinition SpartanSpartiateHorde_Member
        Unit            = SpartanSpartiateHorde
        PercentageOfArmyPhase1    = 35.0
        PercentageOfArmyPhase2    = 50.0
        PercentageOfArmyPhase3    = 60.0
    End

    ArmyMemberDefinition SpartaBallista_Member
        Unit            = SpartaBallista
        PercentageOfArmyPhase1    = 0.0
        PercentageOfArmyPhase2    = 5.0
        PercentageOfArmyPhase3    = 5.0
    End
Everything else in that file is unchanged. I've also looked around in the various hordes and Ballista to see if there's any indication of priority there, but to no avail...

So, anyone got anything for me?

T4A_Logo_-_article.png

The 4th Age version 0.8 has been released: Link


#2 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 31 May 2012 - 08:40 PM

Well.. I can only stab around in the dark with this information...
Is there any possibility for me to get the code and all to be able to test theories ingame? (and form new theories)
One is, are there any obvious module changes between these units?
How about maps, I don't suppose it is map specific?
Horde differences?
Some little pieces of code to check for, I have no idea if any of them might cause this, but its worth a shot...
ThreatBreakdown DwarvenGuardianHorde_DetailedThreat
  AIKindOf = INFANTRY
End
    Behavior = HordeAIUpdate ModuleTag_HordeAIUpdate
////....
        AILuaEventsList                = InfantryFunctions    ;
        AttackPriority                = AttackPriority_Infantry
    End
    Behavior = ProductionUpdate ProductionUpdateModuleTag
        GiveNoXP = Yes
    End
    Behavior = PickupStuffUpdate ModuleTag_PickupStuffUpdate
        SkirmishAIOnly = Yes
        StuffToPickUp = NONE +CRATE
        ScanRange = 200
        ScanIntervalSeconds = 0.5
    End

Sadly though, I am not aware of what changes you made to the game, and how exactly your mod works, so pinpointing the problem any further like this will be difficult. Though that does not mean I will stop trying to think of probable causes.
Ridder Geel

#3 Lauri

Lauri

    Old man Lauri

  • Hosted
  • 10,436 posts
  • Location:Norway
  • Projects:The 4th Age
  •  The very worst T3A Team Chamber Member

Posted 31 May 2012 - 09:58 PM

Well, best bet is simply downloading it (link, 83,7mb). It's unaltered from the beta really. Not sure you need to check it out though..
The various modules you point out are all in the codes, on them all. Hell, the ballista hasn't been touched from the Isengard one except from the regular stuff, like weapons, health, model and strings, and they never build that either.
Do your new units get built by the AI?

Sparta is also the Men faction, so it basically replace the faction throughout for simplicity. Which is why I find it so weird...

T4A_Logo_-_article.png

The 4th Age version 0.8 has been released: Link


#4 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 31 May 2012 - 11:00 PM

I will see what i can do tomorrow, or whever i exactly have time...
That is wierd indeed...
Ridder Geel

#5 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 09 June 2012 - 03:35 PM

Saw this late ..

What about the Old units ? can they build them ?
Test by having some old code in there and see if the older units come out ..They should
Then do a name swap and see if anything changes eg DwarvenGuardianHorde using SpartanEkdromoiHorde INI and vice versa

EDIT :

Did some testing .. spliced my mod with your art .. and added a SpartanEkdromoiHorde
Basis horde without any powers /upgrades/commandbuttons etc
They are built by AI ...

So you may have to do the unthinkable ....Start over
Start with a blank mod and add only the Hordes .. one by one .. check each one to see if the AI builds it
Then add the System powers etc ...
It may be the only way to discover the reason
The problem is not with the Horde / Unit coding

Posted Image

Edited by JUS_SAURON, 09 June 2012 - 06:10 PM.


#6 Lauri

Lauri

    Old man Lauri

  • Hosted
  • 10,436 posts
  • Location:Norway
  • Projects:The 4th Age
  •  The very worst T3A Team Chamber Member

Posted 10 June 2012 - 02:50 AM

Well, I too did get the AI to build one type of horde... :p

T4A_Logo_-_article.png

The 4th Age version 0.8 has been released: Link


#7 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 10 June 2012 - 09:48 AM

Ok, I guess I have some time to look at it now! I will let you know the results ;)
Ridder Geel

#8 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 10 June 2012 - 10:59 AM

K can you guys give me whatever .BIG file you use for the Worldbuilder? I want to check some theories... And manually creating the .big for it... is a pain.. :xd:
Ridder Geel

#9 Lauri

Lauri

    Old man Lauri

  • Hosted
  • 10,436 posts
  • Location:Norway
  • Projects:The 4th Age
  •  The very worst T3A Team Chamber Member

Posted 10 June 2012 - 06:51 PM

I haven't used WB for anything, and I've checked many of the libraries aswell, nothing to see there.

Btw, JUS, don't take it as I don't appretiate your work, I'm really thankful ;)
I'm pretty sure I'll have to redo it anyways to get it to work, since that is the way things go...

T4A_Logo_-_article.png

The 4th Age version 0.8 has been released: Link


#10 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 10 June 2012 - 07:01 PM

Then how did you make the Base file? :p
Don't tell me you hex edited that? :xd:
Ridder Geel

#11 Lauri

Lauri

    Old man Lauri

  • Hosted
  • 10,436 posts
  • Location:Norway
  • Projects:The 4th Age
  •  The very worst T3A Team Chamber Member

Posted 10 June 2012 - 08:50 PM

Anything related to units*

T4A_Logo_-_article.png

The 4th Age version 0.8 has been released: Link


#12 JUS_SAURON

JUS_SAURON

    El Shaddai

  • Members
  • 1,581 posts
  • Location:Trinidad
  • Projects: BFME2 MOD - Power Of The Ring
  •   INI Coder

Posted 10 June 2012 - 08:56 PM

I always liked this mod .. can't wait for another update
( It needs some archers :whathuh: and horsemen :smilehuh: ) .. and a lion
A few hours of copy pasting on the weekend should get it back functional I'm sure ..
All great mods had to be redone to perfect them

#13 Mathijs

Mathijs

    Post-modern Shaman

  • Network Leaders
  • 13,756 posts
  • Projects:Age of the Ring
  • Division:Revora
  • Job:Leader

Posted 10 June 2012 - 09:03 PM

There will be archers and horsemen!

No fuel left for the pilgrims


#14 Lauri

Lauri

    Old man Lauri

  • Hosted
  • 10,436 posts
  • Location:Norway
  • Projects:The 4th Age
  •  The very worst T3A Team Chamber Member

Posted 10 June 2012 - 09:50 PM

Progress; If I disable the Hoplites, the AI will build Ekdromoi and Peltast. So it might be something there...

Nevermind, figured it out. The AI follows the Commandset rules until it's changed. Since Ekdromoi and Peltast are built at rank 2, it never realize it can build them when the Barracks reaches rank 2.. So a simple commandset update with rank upgrade does the job. I tried by just using the same commandset over again, but it only seemed to build the Ekdromoi then, and not Peltast. So I'm going safe and have 3 identical commandsets, only with _Rank2 and _Rank3 at the back of the latters.

Pretty weird, but hey, it works!

Edited by Lauri, 10 June 2012 - 10:32 PM.

T4A_Logo_-_article.png

The 4th Age version 0.8 has been released: Link


#15 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 10 June 2012 - 10:49 PM

Aha... That was an odd one... Good you figured it out ;)
Ridder Geel




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users