.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   United Bot (http://forums.bots-united.com/forumdisplay.php?f=46)
-   -   PIA for United Bot? (http://forums.bots-united.com/showthread.php?t=1786)

Killaruna 26-05-2004 23:46

PIA for United Bot?
 
Hi all, people that attended the Amsterdam bot developer's meeting might remember that I passed around a sheet with a class design for an engine and mod independent bot. With all my diploma thesis and now PhD stuff going on I did not really have the time to implement the whole thing, but well, I started writing a couple of base classes and examples of the intended hierarchy, which should give some ideas of how I wanted to organize things. Due to lack of time, I won't be working on the project anymore (not much anyway), so before it stays completely useless on my HD, I decided to upload the whole Portable Intelligent Agent (PIA) framework to BotsUnited, and you can get it here: http://filebase.bots-united.com/pafi...on=file&id=138
I imagine that some parts of this framework could be used for the United Bot, and it has some features that might be worth discussing. The most prominent one is that I decided to code the entire upper AI level using an XML-based scripting language. Basically, all bot actions are toggled by perceipts (as descriped by Johannes in his docu on JoebotXP) and weighted to give a score. The action (or goal) with the highest score gets executed. With Parabot I noticed that it would be very nice to be able to configure these scores (and together with that the entire bot behaviour) by text files, so that interested users could toy around with it. That's what I tried to do with PIA, have a look at the example to see if it's feasable for your purpose.
I have no experience with plugins (though I like the concept) and how they could be integrated into PIA. One possibility would be to release the lower level actions in different libraries, so that people could write new shootAtEnemy or GoTo modules in C++ and replace the standard ones.
I don't know how understandable the whole framework is without proper documentation, but I encourage you to take a shot at the code, the config files and the example console project and post your questions, opinions and suggestions here.

Pierre-Marie Baty 26-05-2004 23:57

Re: PIA for United Bot?
 
the whole framework is VERY understandable Killaruna :)

Would it be too much asking to ask you to check if there's not one or two sample XML files lying on your harddisk that go with it to upload too ?

I'm having a look on the parser but I bet we'd all love to see what it looks like in XML :)

I'm on IRC for those who care (well, after I finish smoking this cigarette - brb :D)

Killaruna 27-05-2004 00:49

Re: PIA for United Bot?
 
Actually, there are sample XML files included: have a look in the console/data directory... ;) As you will notice, there are three different weapon configs, I haven't decided on a specific method yet (weapon.xml is the one currently used in the code, I think). One approach is to store all properties of a weapon (like cone angle, damage etc) and code a generic evaluator that translates these attributes into scores for different situations, while the other approach is to store the scores for each weapon directly (and let the user modify it as he wishes). Btw, I don't know if the dtd-specifications are up to date, didn't really make sense to me to work on those without knowing what I'd finally need...

Pierre-Marie Baty 27-05-2004 16:37

Re: PIA for United Bot?
 
In fact I was more interested by the goal planner in XML than the weapon specs, since these specs can eventually be made more readable and easily configurable through an ini file. Users don't need to understand the XML syntax to modify an ini file.

I am currently using a similar scheme in RACC for weapons. I define for them a number of "rails" (primary fire, secondary fire) and a set of properties that make the bots able to determine easily which weapon suits best for whatever job. An example:
Code:

# RACC - Bot weapons configuration file
#
# This file contains information needed by the knowledge system
# about the weapons used in the game. The syntax is explicit.
#
# Any weapon can have up to 2 rails (fire modes). For example,
# a MP5 automatic submachinegun in the primary rail, and a
# grenade launcher in the secondary one.
#
# weapon classes:
#  "primary": primary weapon
#  "secondary": side weapon, firable
#  "grenade": side weapon, tossable
#
# weapon rail properties (combinations are possible):
#  "disabler": disabling effect (e.g, blinds or freezes enemy)
#  "waterproof": can be used underwater
#  "lightdamage": light damage, almost never lethal
#  "mediumdamage": medium damage, may be lethal
#  "heavydamage": heavy damage, almost always lethal
#  "radiuseffect": damage radius effect (e.g, grenade blast)
#  "automatic": automatic firing capability
#  "buckshot": bucket firing capability (several impacts at once)
#  "scoped": scoping capability (medium range lens)
#  "sniper": zooming capability (long range lens)
#  "silenced": silent shot capability
#  "missile": missile (no instant hit)
#  "homing": homing capability (only relevant on missiles)
#  "toss": needs to be tossed at target
#  "place": needs to be placed (proximity bomb)
#
# weapon rail ranges:
#  "melee": melee only (close combat)
#  "close": most efficient at close range (0 - 6 meters)
#  "medium": most efficient at medium range (6 - 60 meters)
#  "far": most efficient at long range (60 meters - infinity)

# MP5 in HL deathmatch
[weapon_9mmar]
model="models/p_9mmar.mdl"
id=4
weight=
class="primary"
price=
buy_command=""
primary.properties="waterproof,mediumdamage,automatic"
primary.range="medium"
primary.type_of_ammo=10
primary.min_ammo=1
primary.max_ammo=120
primary.charge_delay=0.3
primary.sound1="weapons/mp5-1.wav"
primary.sound2="weapons/mp5-1.wav"
primary.min_delay="0.5 0.4 0.3 0.2 0.1"
primary.max_delay="0.6 0.5 0.4 0.3 0.2"
secondary.properties="waterproof,heavydamage,radiuseffect,missile,toss"
secondary.range="far"
secondary.type_of_ammo=5
secondary.min_ammo=1
secondary.max_ammo=10
secondary.charge_delay=0
secondary.sound1="weapons/glauncher.wav"
secondary.sound2="weapons/glauncher2.wav"
secondary.min_delay="0.5 0.4 0.3 0.2 0.1"
secondary.max_delay="0.6 0.5 0.4 0.3 0.2"

I think you see the point.

Having the top level AI in an XML script (or whatever scripting language) is nevertheless a great idea. I'm still wondering, however, if XML has enough flexibility to do that (test conditions, structures, etc.) Perhaps it would be more readable and easier to implement if it was made in another language than XML. Are there simple scripting language schemes that we could use ?

Killaruna 27-05-2004 17:01

Re: PIA for United Bot?
 
An example for an XML goal planner is pia\console\data\goals.xml
Have a look at the syntax and decide for yourself if it's flexible enough to fit your needs. Obviously you will have to make compromises, you can't get full generality and full flexibility together. A starting point would be to try to model your bot's behaviour using the suggested syntax... As for XML, I used it because it's a standardized data format with large support over all platforms. However, the key point is not using XML, but using a textfile-based scripting language in general.
The weapon specs you posted are indeed very similar to the ones I had in mind, the property-based system that is. I'm not yet sure though if it's discernibly better than a (far simpler) score system, which users might like to toy around with...

stefanhendriks 01-06-2004 17:33

Re: PIA for United Bot?
 
I have read the source, ouch i have to dig deep into my knowledge of C++ here, which is not much anyways.

Anyway, it looks very clear and neatly written, i have to read it more to understand it really, but it seems this bot has the possibility to work in more games (Worlds), so thats great!

Perhaps you can enlighten us how it works (function names, enheritance, etc) in a little doc? :)


All times are GMT +2. The time now is 22:04.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.