Author Topic: RA2 1,4 - Importing Custom AI Files  (Read 2893 times)

Offline Hi5er

  • GTM Member Since 2010
  • Middleweight
  • Posts: 297
  • Rep: 0
  • Where creativity meets low expectations.
    • View Profile
    • Awards
RA2 1,4 - Importing Custom AI Files
« on: October 29, 2016, 09:45:21 AM »
This is becoming real tiresome hosting this tournament now lol!

I've run into another snag. Three of the entrants use a custom AI File. I have the standard pack if you like containing popup, flipper2 etc. But the AI lines im using crash the game, well at least I assume that they are the cause of the crashes.

Here are the facts:

- All three bots load fine into the bot lab and I can drive all 3 without any issues.
- All three bots can be selected in the team preview as AI opponents
- All three bots can load into the map.
- The countdown starts. 3. 2. 1. Crash.

With the following error message:



Here is my AI folder with all corresponding files:



Here are the lines of AI code that don't seem to work.

Code: [Select]
list.append(("You Wish I Was A Girl!","Flipper2",{'nose':math.pi,'UseSrimech':1,'invertible':False,'range':50,'radius':1,'topspeed':100,'throttle':100,'turn':100,'turnspeed':4,'UseSrimech':0,'EnemyMoveRadius':1,'EnemyMoveTime':3,'PrioritizeFlipper':0,'NoChassisTime':3,'SrimechInterval':1,'weapons':(0,)}))
Code: [Select]
list.append(("Big Hammer","Popup",{'nose':math.pi*2,'invertible':False,'radius':1,'topspeed':130,'throttle':120,'turn':65,'turnspeed':1.1,'NoChassisTime':2,'RunUpsideDown':0,'weapons':(0,)}))   
It should be noted that I can reference Omni and EternalSnowy fine. But popup and Flipper2 don't work. Could it be the smart zones? I am honestly clueless now.

I was told by Redace that yugitom had a similar problem a few months ago if anyone had helped him resolve that?
Tournament History:


Offline Badger

  • Permanent Artifact
  • Giga Heavyweight
  • Posts: 6318
  • Rep: 3
  • I wish to be with my people
  • Awards BOTM Winner Donated money for site hosting 2019
    • View Profile
    • Awards
Re: RA2 1,4 - Importing Custom AI Files
« Reply #1 on: October 29, 2016, 09:56:17 AM »
First off, in the first AI line you should delete "'UseSrimech':1," as it is overwritten later. I don't think that's causing the crashes though. As always, make sure that the line is preceded by 4 spaces, not a tab.

Try copying an AI line from a bot that works and just changing the bot name and .py name to make it work with the bot that's crashing. If it works you can transfer the original line's arguments one by one to see which one is causing the crash.
also lol at most toxic guy around calling others out on this sh**
Google Drive with my newer bots

Offline Avalanche

  • Retired.
  • Ultra Heavyweight
  • Posts: 3109
  • Rep: -34
  • Yeah, I don't know why I'm still here either.
    • View Profile
    • Awards
  • Discord: ThePootisPower#8377
Re: RA2 1,4 - Importing Custom AI Files
« Reply #2 on: October 29, 2016, 10:02:23 AM »
Big Hammer is actually called Big Time Hammer in the splash. That may be your issue. I'll leave the rest to others.
Former DSL HW champion.
Runner-Up in The Cybernetic Colosseum HW division.
Semi-finalist in RNP: Sword of Glory.
Robogames 1 BW Runner-up.
Professional cunt.
Man of a thousand alt accounts.

Offline JoeBlo

Re: RA2 1,4 - Importing Custom AI Files
« Reply #3 on: October 29, 2016, 10:45:56 AM »
Id try setting your weapon numbers correctly or at least to a value other than zero.. I could be wrong but id imagine the game wouldnt like a nil value for that section.

Plus the weapons line is tracked while in battle which may explain why the robots get as far the countdown before giving you trouble

Offline R01

  • Heavyweight
  • Posts: 769
  • Rep: 1
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: RA2 1,4 - Importing Custom AI Files
« Reply #4 on: October 29, 2016, 10:52:29 AM »
Id try setting your weapon numbers correctly or at least to a value other than zero.. I could be wrong but id imagine the game wouldnt like a nil value for that section.

Plus the weapons line is tracked while in battle which may explain why the robots get as far the countdown before giving you trouble
Having them set to "0, " works, I've done that before. I guess there's a tab somewhere where spaces should be? I've had crashes like that as well which happened because of exactly that.
Tournament History:
Showcases:
https://gametechmods.com/forums/index.php?topic=18882.0
https://gametechmods.com/forums/index.php?topic=19197.0

Offline Probably Rob

  • The Forgotten Obscure Orgasmic Mime
  • *
  • Posts: 1941
  • Rep: 10
  • You might want your lips around my silent chorus
    • RobotMPire
    • View Profile
    • Awards
Re: RA2 1,4 - Importing Custom AI Files
« Reply #5 on: October 29, 2016, 11:00:44 AM »
Much like Hammer, I've noticed you've listed "You Wish I Was A Girl!" as the AI name, while the end-part of the name is "was a girl", no caps. Check their names in their bot files, just in case

Offline cephalopod

Re: RA2 1,4 - Importing Custom AI Files
« Reply #6 on: October 29, 2016, 11:41:56 AM »
@JB, using 0 references the Chassis, so basically the AI will always try and use the weapon. Not as good a solution as using the actual IDs but a whole world quicker :)
bristol bot builders / two headed death flamingo / snappy robots
//
kindest and friendliest '13, '15, '16, '17 / favourite staff member '14, '15

Offline Hi5er

  • GTM Member Since 2010
  • Middleweight
  • Posts: 297
  • Rep: 0
  • Where creativity meets low expectations.
    • View Profile
    • Awards
Re: RA2 1,4 - Importing Custom AI Files
« Reply #7 on: October 29, 2016, 12:26:04 PM »
Thanks for the suggestions guys.

I should point out that "Big Hammers" name has been shortened for ease of reference as the name is fecking huge and it's copied exactly from the bot files in both cases, even if it doesn't exactly match the splash, i'm confident this isn't the issue.

I'll try the space suggestion first off.
Tournament History:


Offline 090901

  • alcoholic in denial
  • *
  • Posts: 7006
  • Rep: 22
  • :mrgreen:
  • Awards Donated money for site hosting 2019 GTMCS2 Divison Winner GTMCS Division Winner
    • View Profile
    • Awards
Re: RA2 1,4 - Importing Custom AI Files
« Reply #8 on: October 29, 2016, 12:52:22 PM »
BTW guys, I wrote this AI line myself, tested it in my game, ot worked, and then I sent it to him. I also had sent him one woth Popup.py and it didn't work, so I believe it doesn't have anything to do with the binding line itself as they were working 100% in my game.

Offline Hi5er

  • GTM Member Since 2010
  • Middleweight
  • Posts: 297
  • Rep: 0
  • Where creativity meets low expectations.
    • View Profile
    • Awards
Re: RA2 1,4 - Importing Custom AI Files
« Reply #9 on: October 29, 2016, 01:07:31 PM »
BTW guys, I wrote this AI line myself, tested it in my game, ot worked, and then I sent it to him. I also had sent him one woth Popup.py and it didn't work, so I believe it doesn't have anything to do with the binding line itself as they were working 100% in my game.

This is true. As had Redace.

I can get both bots to work using Omni. Which leads me to think that it must be something in the Flipper2/Popup files that is causing the error.

Both files are up to date and in the correct folder.
Tournament History:


Offline R01

  • Heavyweight
  • Posts: 769
  • Rep: 1
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: RA2 1,4 - Importing Custom AI Files
« Reply #10 on: October 29, 2016, 04:13:27 PM »
BTW guys, I wrote this AI line myself, tested it in my game, ot worked, and then I sent it to him. I also had sent him one woth Popup.py and it didn't work, so I believe it doesn't have anything to do with the binding line itself as they were working 100% in my game.

This is true. As had Redace.

I can get both bots to work using Omni. Which leads me to think that it must be something in the Flipper2/Popup files that is causing the error.

Both files are up to date and in the correct folder.
Check what other files those are referencing, might need another .py added or a updated version of pusher, rammer or something. Also I guess you've got the Ai.py files from the hosts as well?

Edit: another thing that came to my mind, you are referencing popup and flipper2 by the right name(the one used in the .py file and not the filename)?
Tournament History:
Showcases:
https://gametechmods.com/forums/index.php?topic=18882.0
https://gametechmods.com/forums/index.php?topic=19197.0

Online apanx

Re: RA2 1,4 - Importing Custom AI Files
« Reply #11 on: October 29, 2016, 05:17:55 PM »
This is what happens when modders edit __init__.py. Keep edits to separate files.
Download updated versions from AI repo.
https://github.com/apanx/RA2_AI

Offline Hi5er

  • GTM Member Since 2010
  • Middleweight
  • Posts: 297
  • Rep: 0
  • Where creativity meets low expectations.
    • View Profile
    • Awards
Re: RA2 1,4 - Importing Custom AI Files
« Reply #12 on: October 30, 2016, 04:57:01 PM »
This is what happens when modders edit __init__.py. Keep edits to separate files.
Download updated versions from AI repo.
https://github.com/apanx/RA2_AI

Amazing.

Apanx has done it again haha, downloading these source files has corrected whatever the issue was and both bots are now working fine.

Many thanks everyone, time for me to get some videos going!
Tournament History:


Offline JoeBlo

Re: RA2 1,4 - Importing Custom AI Files
« Reply #13 on: October 31, 2016, 01:22:24 AM »
@JB, using 0 references the Chassis, so basically the AI will always try and use the weapon. Not as good a solution as using the actual IDs but a whole world quicker :)

Ive always used "1" to shortcut as the first component is always a baseplate mounted one (thus indestructible)

"0" in a bindings line usually calls the default AI coding.. I was under the impression the weapon's ID had no default (since all robots are different) which is why I figured it was crashing.. but after looking through the ironforge defaults it looks like it __init__.py was updated at some point from the earlier one I have and the default call is a weapons ID "1"

So yes "0" should work but it actually defaults and references component "1" not the chassis..

That is of course if my memory serves me right with all this.. its been years since ive played with python and now my brain hurts..  :dead:

Online apanx

Re: RA2 1,4 - Importing Custom AI Files
« Reply #14 on: October 31, 2016, 02:49:03 AM »
Stock has the weapon list empty, anything else is modded.
Specifications in bindings should overwrite the values set during init.

Offline JoeBlo

Re: RA2 1,4 - Importing Custom AI Files
« Reply #15 on: October 31, 2016, 08:31:20 PM »
Yep thats were I was tripping up.. I was looking in a bare stock game, Ive never noticed the later update :)