Skip to content

Commit

Permalink
v0.1.3 Release
Browse files Browse the repository at this point in the history
Auto-generation capability was added for Petra based bots.
Redundant petra based codes were removed.
  • Loading branch information
eserlxl committed Jul 22, 2020
1 parent aaccdb6 commit aea2e7e
Show file tree
Hide file tree
Showing 116 changed files with 78 additions and 54,377 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Arch based AI bots use Arch AI architecture.
Petra based AI bots use the original Petra AI architecture.
- Imperialist
- Patriot
- Single Base
- Single Based
- Unitary

## Arch AI Architecture
Expand Down Expand Up @@ -77,7 +77,7 @@ Arch AI changes its personality during the game according to the population from
### For Users
You can download the release versions from release directory. Extract the release version and copy the ArchAIPack directory to the mods directory ( ../0ad/data/mods/ ).
### For Developers
Arch install script generates 9 Arch based AI bots (Admiral, Capitalist, Communist, Imperialist, Mason, Mercantilist, Patriot, Theocrat and Unitary) and copies preconfigured 4 Petra based AI bots (Imperialist, Patriot, Single Base and Unitary).
Arch install script generates 9 Arch based AI bots (Admiral, Capitalist, Communist, Imperialist, Mason, Mercantilist, Patriot, Theocrat and Unitary) and 4 Petra based AI bots (Imperialist, Patriot, Single Based and Unitary).
~~~~
cd install
sh arch.sh
Expand Down
21 changes: 18 additions & 3 deletions install/arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ mkdir -p ../release
cp ../mod.json ArchAIPack

archDevDirectory="../simulation/ai/arch-dev"
petraDevDirectory="../simulation/ai/petra-dev"

declare -a bots=("Admiral" "Capitalist" "Communist" "Imperialist" "Mercantilist" "Patriot" "Mason" "Unitary" "Theocrat")
declare -a archBots=("Admiral" "Capitalist" "Communist" "Imperialist" "Mercantilist" "Patriot" "Mason" "Unitary" "Theocrat")
declare -a petraBots=("Imperialist" "Patriot" "SingleBased" "Unitary")

for ai in ${bots[@]}
for ai in ${archBots[@]}
do
targetDirectory="ArchAIPack/simulation/ai/arch-"$(echo ${ai}| tr '[:upper:][I]' '[:lower:][i]')
mkdir -p ${targetDirectory}
Expand All @@ -27,7 +29,20 @@ do
cp -f arch-${ai}.data.json ${targetDirectory}/data.json
done

cp -fR petraBased/* ArchAIPack/simulation/ai/
for ai in ${petraBots[@]}
do
targetDirectory="ArchAIPack/simulation/ai/petra-"$(echo ${ai}| tr '[:upper:][I]' '[:lower:][i]')
mkdir -p ${targetDirectory}

petraSourceFiles=$(ls -1 ${petraDevDirectory});

for file in ${petraSourceFiles}
do
cat ${petraDevDirectory}/${file}|awk -v target=${ai} 'BEGIN {c=1;}{if($2!=target){if($1=="///")c*=-1;else if(c==1)print $0;}}' > ${targetDirectory}/${file}
done

cp -f petra-${ai}.data.json ${targetDirectory}/data.json
done

version=$(cat ../mod.json|grep "\"version\":"|awk {'print $2'}|tr -d "\",")

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Petra ( Single Base )",
"name": "Petra ( Single Based )",
"description": "Petra is the default 0 A.D. AI bot. This type of Petra Bot does not expand by building multiple bases. Please report issues to Wildfire Games (see the link in the main menu).\n\nThe AI has a bonus/penalty on resource stockpiling (either gathering rate or trade gain) varying from -60% for Sandbox to +60% for Very Hard (Medium 0%) and the easiest levels have a slower production and building rate. In addition, the Sandbox level does not expand nor attack.",
"moduleName": "PETRA",
"constructor": "PetraBot",
Expand Down
File renamed without changes.
170 changes: 0 additions & 170 deletions install/petraBased/petra-imperialist/_petrabot.js

This file was deleted.

Loading

0 comments on commit aea2e7e

Please sign in to comment.