Author Topic: shift between 6 bots of teams 0..15  (Read 2352 times)

Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
shift between 6 bots of teams 0..15
« on: October 01, 2008, 03:27:58 PM »
You may have notice when you play EVENT that only the first 3 bots of each teams are candidate.

Below is a DOS shell that allows to shift between the 3 first bots and  the 3 last ones (bot0 becomes Bot3, Bot3 becomes bot 0 and so on).

Restriction :
-this SHELL only works with the 16 first teams under the AI directory
-this shell does not verify that the shifted bots are in good order : LW, MW,HW
-this shell verifies that the team contains 6 bots (otherwise  do nothing)
-before the first usage, make an archive (zip/tar) of your AI directory

Extension :
as notice in the comments of the Sheck, you can decide to shift only some (randomly) and not all of the 16 teams . just add the keyword 'REM' in front of the specific line

Usage : copy the source in a text file name "ShiftTeams.bat" under your AI directory. That's all.
Hope some of you enjoy this tool.

Here is the source  :

REM ===================================================
REM For Random team in team0 .. team15
REM bots 3,4 and 5 become bots 0 1 and 2
REM bots 0 1 and 2 become bots 3 4 and 5
REM Allow to fight bots that are normally not reachable  in EVENT
REM =======================================================
echo off
setlocal
set variable=0
: Boucle
rem == move to team XXX  
set Nom1=Team%variable%
cd %Nom1%
rem switch only if exists bot0..Bot5
if not exist Bot0.bot goto FinTraitement
if not exist Bot1.bot goto FinTraitement
if not exist Bot2.bot goto FinTraitement
if not exist Bot3.bot goto FinTraitement
if not exist Bot4.bot goto FinTraitement
if not exist Bot5.bot goto FinTraitement

set /a goOn=%RANDOM%
set /a goOn=%goOn%%%2
rem ======================================
rem if you want to randomly select the teams to shift
rem replace the line  below "set /a goOn=0" by "rem set /a goOn=0"
set /a goOn=0
rem ====================================================
if /i %goOn% equ 1 goto FinTraitement
rem ===== Switch this on
echo team%variable%
rem == Save 1st set
(copy Bot0.bot Bot0x.bot) >> trace.txt
(copy Bot1.bot Bot1x.bot) >> trace.txt
(copy Bot2.bot Bot2x.bot) >> trace.txt
rem == rename 2nd set :
(copy Bot3.bot Bot0.bot) >> trace.txt
(copy Bot4.bot Bot1.bot) >> trace.txt
(copy Bot5.bot Bot2.bot) >> trace.txt
rem == rename saved set
(copy Bot0x.bot Bot3.bot) >> trace.txt
(copy Bot1x.bot Bot4.bot) >> trace.txt
(copy Bot2x.bot Bot5.bot) >> trace.txt
rem == delete saved team
(del Bot*x.bot) >> trace.txt
del trace.txt
rem === move Up
: FinTraitement
cd ..
set /a variable+=1
if /i %variable% equ 16 goto FinBoucle
goto Boucle
: FinBoucle
pause

Offline Madiaba

shift between 6 bots of teams 0..15
« Reply #1 on: October 01, 2008, 04:17:37 PM »
I should send you mine, Phil. Maybe you can make it better...?
 
>Its AI has 90 Teams that are shifted in sets of 15 (for Events availability).
>Another Batch file for the AI bots, switches, one place at a time, each of the individual 6 bots in a Team. It does this for all 90 Teams.
>The User Batch switches all the 96 User Teams, in sets of 16.
 
All of 3 them 'pause', explain where things are at, what action is about to be taken, and then prompts the User to choose.
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline Gigafrost

  • *
  • Posts: 805
  • Rep: 0
  • You'll never know what I'll think of next.
    • View Profile
    • Awards
shift between 6 bots of teams 0..15
« Reply #2 on: October 01, 2008, 07:41:24 PM »
woah its been a while since you last posted phil. welcome back.

Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
shift between 6 bots of teams 0..15
« Reply #3 on: October 02, 2008, 02:50:41 AM »
Quote from: madiaba;16093
Its AI has 90 Teams that are shifted in sets of 15 (for Events availability).[/COLOR]

Madiaba, when you shift your team,
- does your scrip re-create the files bindings.py and team.txt according to the selected teams
- or do you have a bindings.py and a team.txt for each pack of 16 teams
- or even a Huge 'binding.py' and you always stay with the same 'team.txt' ?

Quote
woah its been a while since you last posted phil. welcome back
Thanks.
Well i've bin in BBeans 4 with BO but yet i'm out. I'v also send a pack of 16 AI teams  to share for DSL2.1 at ACAMS but no feed back yet. As time goes on, theses teams tend to be completed (all of them have not 6 bots ). I will submit them again in few weeks.
« Last Edit: October 02, 2008, 06:51:11 AM by philetbabe »

Offline Madiaba

shift between 6 bots of teams 0..15
« Reply #4 on: October 02, 2008, 07:11:58 AM »
Quote from: philetbabe;16130
Madiaba, when you shift your team,
- does your scrip re-create the files bindings.py and team.txt according to the selected teams
- or do you have a bindings.py and a team.txt for each pack of 16 teams
- or even a Huge 'binding.py' and you always stay with the same 'team.txt' ?
The single Batch operates from the Main RA2 directory and then 'cd' into the AI directory to 'ren' the Teams folders, along with correlated TXTs. The (large) Bindings.py holds all the AI's lines and stays 'as is' within the AI folder.
 
The Batch does the following:
Teams folders: I 'ren' the Team folders in sets of 15
ren Team0 Team0.store
ren Team1 Team1.store
ren Team2 Team2.store
ren Team3 Team3.store
ren Team4 Team4.store
ren Team5 Team5.store
ren Team6 Team6.store
ren Team7 Team7.store
ren Team8 Team8.store
ren Team9 Team9.store
ren Team10 Team10.store
ren Team11 Team11.store
ren Team12 Team12.store
ren Team13 Team13.store
ren Team14 Team14.store
 
ren Team15 Team0
ren Team16 Team1
ren Team17 Team2
ren Team18 Team3
ren Team19 Team4
ren Team20 Team5
ren Team21 Team6
ren Team22 Team7
ren Team23 Team8
ren Team24 Team9
ren Team25 Team10
ren Team26 Team11
ren Team27 Team12
ren Team28 Team13
ren Team29 Team14
etc..until last set:
ren Team0.store Team75
ren Team1.store Team76
ren Team2.store Team77
ren Team3.store Team78
ren Team4.store Team79
ren Team5.store Team80
ren Team6.store Team81
ren Team7.store Team82
ren Team8.store Team83
ren Team9.store Team84
ren Team10.store Team85
ren Team11.store Team86
ren Team12.store Team87
ren Team13.store Team88
ren Team14.store Team89
 
TXTs: I made 6 different txts "Teams" through "Teams6", all with a different 'index' order for the teams that is correlated to the 'ren' of the Team folders.
"Teams.txt" is scripted so that the 'index numbers' (1-90) are the same as the 'Team numbers' like this:
index 1
Team-1
"Brought to you by Clutch"
blah........
index 2
Team-2
"Brought to you by ACAMS"

blah........
index 3
Team-3
"Garage Addicts"
etc........through index 90.
 
 
"Teams2.txt" is scripted so that the 'index numbers' (1-90) are offset by 15 from the 'Team numbers' like this:
index 1
Team-16
"Mechanical Mayhem"
blah........
index 2
Team-17
"Syncopated Destructions"

blah........
index 3
Team-18
"Robot War Heros"
etc........through index 90.

Here Team 16 is in the initial position ('Index 1').
 
.
Note: The exe only reads the original 'Teams.txt'. The others are just rotated 'in line', so to speak waiting for their turn to be 'ren' Teams.txt.
----------------
.
.
.
Sum: So, when the Batch switches the Team folders (in 6 sets of 15), it also switches which TXT the exe reads (with the proper set of Teams in the right positions).
.
Hope this answers your questions...
.
« Last Edit: October 02, 2008, 07:56:59 AM by Madiaba »
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline Somebody

  • *
  • Posts: 7201
  • Rep: 13
  • CP: +2
    • View Profile
    • Awards
shift between 6 bots of teams 0..15
« Reply #5 on: October 02, 2008, 03:26:43 PM »
I do not understand a word of this thread...
I built that big robot on that TV show that time


Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
shift between 6 bots of teams 0..15
« Reply #6 on: October 03, 2008, 03:27:11 AM »
Quote from: Somebody;16166
I do not understand a word of this thread...

when you play events, you fight Ai Bots. They are selected from the ones under you directory RA2/AI/Teamxxx with xxx a number between 0 and 15. Moreover, only the first 3 bots of each teams are candidate in EVENT and that, even if your team contains 6 bots. the candidate are named Bot0.bot, Bot1.bot and Bot2.bot in your RA2/AI/Teamxxx.

The script given in the first post allows to fight in EVENT the 3 last bots of each team by shifting the first 3 bots with the 3 last ones.

An other problem is to fight EVENT with not only the  first initial 16 teams given in a AI pack but with the teams with range above 16.

The 2 problems with this point are

-tells RA2 which AI goes with which bots : this is defined in a file name bindings.py under your RA2/AI directory : 2 solution : you recreate this file once you have selected the teams you want to fight OR you have a file which contains all the description of all the AIed bots.

-describe RA2 which are the teams names team0...team15 (logo, number of bots for each team, etc) :  This is done in a file named team.txt under RA2/AI directory. If you can change the content of a teamXXX and describe it in the file team.txt -> you have a new candidate for you EVENT.  All the job is to have a mechanism to change (randomly or not)  the content of the files RA2/AI/teamXXX and re create the file team.txt associated.

If you know how to do that, with all the AI shared under the download part of this site and the one you can create, you have a RA2 program and the tools which allows you to play with hundreds bots and not only 16 (teams) * 3 (bots) = 48 bots. That's a great deal  !

Quote
Madiaba says ...

With such a configuration (unique Bindings.py)  a script which select randomly 16 teams from your 90 should
not be to hard to do if you don't care about  the real name and the logo of the team (always use the same).

However, this is one of the charm of RA2 to have a look of the various logo.
If each team contains in its own directory (RA2/AI/teamXXX) a bitmap with the name of the team (ie "riot.bmp")
it should be possible to generate dynamically the file team.txt according to the ones selected randomly.
 I will try to work on it but I don't expect a result before a month or two because my weekend are mostly full.

Offline Madiaba

shift between 6 bots of teams 0..15
« Reply #7 on: October 03, 2008, 06:19:17 AM »
Phil: The Team logos DO follow the Team, because ALL of the Team-info is shifted to the next '+15th' index slot, so as to not leave anything behind.
Let me get the files together and send it to you...
 
BTW:You already know that the exe in 'Events' randomly selects the order of the 15 Teams you will/may face. NP.
Are you saying that you want to randomly select 15 Teams from all 90 to make available for 'Events'? I like the thought and can see how the coding would/should be, but would it not also cause some collateral damage by randomly changing the Teams order in 'Exhibition'?...
 
Let me know what you think, Phil.
« Last Edit: October 03, 2008, 06:40:24 AM by Madiaba »
Input is appreciated. :)
-Arrogance is a quantity devoid of quality...
-As a client once told me "This is my story, and it's sticking to me!"
-Relationships these days are like the 'Arrival' section of the airport: a lot of baggage is being revealed in one place, and not a lot of it is being correlated to its real owners...

Offline philetbabe

  • *
  • Posts: 497
  • Rep: 2
  • Drop D
    • View Profile
    • Awards
shift between 6 bots of teams 0..15
« Reply #8 on: October 03, 2008, 07:19:31 AM »
Quote from: madiaba;16205
Are you saying that you want to randomly select 15 Teams from all 90 to make available for 'Events'? I like the thought and can see how the coding would/should be, but would it not also cause some collateral damage by randomly changing the Teams order in 'Exhibition'?...

Yes, this is the idea : randomly select 15 Teams from all 90 to make available for 'Events'.

I've done it in a Python script but the condition for such a thing is that each directory teamXXX contains the  part of team.txt and the part of bindings.py relative to it. I than re-create team.txt and bindings.py with those parts. So, the final team.txt and bindings.py is coherent, just as if i ve put a AI pack with 16 teams. under exhibition i see only 16 teams with their initial logo and so. Anyway  That's a strong constraint ! First because it's a python compiled script and, as a .exe, it cannot be shared under the download part of this site, second because of the need to create those parts of team.txt and bindings.py.
so i think about an other way to do it with less constraint and in dos command (.bat).
What is fine with such a principe is that you 16 teams came from differrent  AI pack that normally never confront together. You may also mix your own AI with standard ones.

Offline Somebody

  • *
  • Posts: 7201
  • Rep: 13
  • CP: +2
    • View Profile
    • Awards
shift between 6 bots of teams 0..15
« Reply #9 on: October 03, 2008, 04:31:56 PM »
I get it now, thank you for translating it into "random person who knows nothing about C++" talk.
I built that big robot on that TV show that time


Offline Somebody

  • *
  • Posts: 7201
  • Rep: 13
  • CP: +2
    • View Profile
    • Awards
shift between 6 bots of teams 0..15
« Reply #10 on: October 03, 2008, 04:31:56 PM »
I get it now, thank you for translating it into "random person who knows nothing about C++" talk.
I built that big robot on that TV show that time