how does the bot code work?

Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: how does the bot code work?
PostPosted: Thu Aug 24, 2006 5:14 am 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked








Joined: Fri Nov 12, 2004 3:54 pm
Posts: 3291
Location: Apoc City USA - outnumbered, but still fighting.
can someone give me a detailed explanation of how the weapon sets and weapon levels work. Specifically, how do the weapon sets affect the choice of the weapons the ai chooses, and in what order and what round, what they buy, etc....

I'm trying to put together decent ai bot that can shoot something useful now and then.
Chopper:
I really enjoy talking with folks in other countries, drinking stoli/tonic... pulling off shots that seem impossible, drinking..

Fact: CO2 = less than .04% (.00038) of the atmosphere - only a small fraction of that is man made.


Last edited by BOY on Sat Aug 26, 2006 12:11 am, edited 3 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 24, 2006 11:38 am 
User avatar
Reduced to ashes
Not Signed Up For Stats

Joined: Fri Jan 06, 2006 12:11 am
Posts: 639
Location: The Dark Side of the Earth
every "block" of weapons is included between
Code:
<weaponset>
....
</weaponset>

the bot will try to buy all the weapons simultaneously in the list

if there is more than one list will pick 1 at random at the start of the game and keep until the end

weapons are random bought from the list

type "explosionsmall", the weapon will be shoot regular by the bot
type "explosionlarge", the bot will not use the weapon until it will be sure that it has the perfect aim on the target (this include shield, it means that it will keep shooting big weapons on force shields wasting them :evil:)
type "sniper" the weapon will be shoot like a laser, regardles of the dirt, always at 1000 power

aimsniper tells you the maximum distance at the bot can do "direct shots"
sniperwobble is how much is accurate with sniper shots
aimtype tells how much "smart" is the bot:
random - no aiming skills
guess - tries to shoot at the target but doesn't "look" where the shots lands
refined - tries to shoot at the target and remembers where the shoot lands & applies corrections
newrefined - more accurate version of the previous type
targettype tells you how the bot chooses it's target:
none - the bot won't shoot
nearest - the bot will choose closest target
aggressor - the bot will also take note who shoots him and shoots back

noresign tells if the bot is able to resign when it has low health and no batts (health < 10 hp)
nodefences tells you if the bot knows or not, how to use batts, shields and parachutes

ailwableforrandom tells you if the bot is included in the list of random picked ais

checknearcollision enables the directsshots with aimsniper parameter

in the case you're wondering that the bot ai code is a bit restrictive/dumb i was thinking myself few improvements (200 or 300 :twisted:) i may post a list
Proudly without signature :P

Last edited by Brain Damage on Sun Aug 27, 2006 2:32 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 24, 2006 5:29 pm 
User avatar
Obliterated

Current Scorched3D Rank: Unranked



Joined: Sat Apr 24, 2004 6:52 am
Posts: 1393
Location: Florida, USA
Nice writeup there BD, I need to add that to the wiki at some point. :)
Undead.

Scorched 3D Documentation & Help


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 24, 2006 6:49 pm 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked








Joined: Fri Nov 12, 2004 3:54 pm
Posts: 3291
Location: Apoc City USA - outnumbered, but still fighting.
yes, that is quite helpful. :D once i get a good index list, i'll include it in the mod help index and or wiki. unless someone else does it first. there are too many stickys :P

Now, i have more questions. :oops:
if you don't know the answer to all of them, np. :wink:

These questions will help me make a few challenging bots to fit in with some single player campain modes i plan to make. Currtently not many of the mods have a very good single player mode (that I am aware of)

BD wrote:
the bot will try to buy all the weapons simultaneously in the list
'
'
'
weapons are random bought from the list


so when he buys one by random, he does not buy it again by random? is there a way to make the bot buy it more than once? does the weapon type or the weapon level affect what he buys at all?

even defense items are bought by random?

so there is no way to make a large weapons set that does not drain all the ai's money? It always tries to buy them all?

what numbers can the levels be? any number?


are the weapons the ai shoots affected like weighted randomchoice?

ie: if the ai has one level 10 weapon, and three level 30 weapons, does adding more level 30 weapons increase the chances that the ai will shoot a level 30 weapon? (assume he buys them all)

or does he choose a type, then a level, then choose the weapon within the level to shoot

if a bot has the two different weapons of the same type and same level, which one is chosen?

will the bot always shoot a sniper shot if it has the weapon and the target is in sniper range? if there is no checknearcollision the aimsiper is uselss?
Chopper:
I really enjoy talking with folks in other countries, drinking stoli/tonic... pulling off shots that seem impossible, drinking..

Fact: CO2 = less than .04% (.00038) of the atmosphere - only a small fraction of that is man made.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 24, 2006 7:13 pm 
User avatar
Reduced to ashes
Not Signed Up For Stats

Joined: Fri Jan 06, 2006 12:11 am
Posts: 639
Location: The Dark Side of the Earth
BOY wrote:
when he buys one by random, he does not buy it again by random?

no
BOY wrote:
is there a way to make the bot buy it more than once?

if the bot has the weapon in number greater than 0 it will not buy it again
BOY wrote:
does the weapon type or the weapon level affect what he buys at all?

no

BOY wrote:
even defense items are bought by random?

yes

BOY wrote:
so there is no way to make a large weapons set that does not drain all the ai's money? It always tries to buy them all?

yes

BOY wrote:
what numbers can the levels be? any number?

yes

BOY wrote:
are the weapons the ai shoots affected like weighted randomchoice?
ie: if the ai has one level 10 weapon, and three level 30 weapons, does adding more level 30 weapons increase the chances that the ai will shoot a level 30 weapon? (assume he buys them all)
or does he choose a type, then a level, then choose the weapon within the level to shoot

first chooses type, then it makes a random weighted choice

BOY wrote:
if a bot has the two different weapons of the same type and same level, which one is chosen?

random

BOY wrote:
will the bot always shoot a sniper shot if it has the weapon and the target is in sniper range?

no
BOY wrote:
if there is no checknearcollision the aimsiper is uselss?

i assume yes, never tryed personally :P
Proudly without signature :P

Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 24, 2006 7:58 pm 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked








Joined: Fri Nov 12, 2004 3:54 pm
Posts: 3291
Location: Apoc City USA - outnumbered, but still fighting.
Quote:
first chooses type, then it makes a random weighted choice


so adding more level 30 weapons increases the chances a level 30 weapon is chosen.


one last question, hopefully :oops:

Quote:
if the bot has the weapon in number greater than 0 it will not buy it again


greater than 0 from the weapons set, or from the accessory itself?

ie: even if i add the weapon one or more times at different levels, It wont try to buy it again?

TYIA
Chopper:
I really enjoy talking with folks in other countries, drinking stoli/tonic... pulling off shots that seem impossible, drinking..

Fact: CO2 = less than .04% (.00038) of the atmosphere - only a small fraction of that is man made.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 24, 2006 8:19 pm 
User avatar
Reduced to ashes
Not Signed Up For Stats

Joined: Fri Jan 06, 2006 12:11 am
Posts: 639
Location: The Dark Side of the Earth
BOY wrote:
greater than 0 from the weapons set, or from the accessory itself?

ie: even if i add the weapon one or more times at different levels, It wont try to buy it again?

err i don't get get what you mean weapon set & accessory i will try to use my words

the bot first checks if it already has the weapon in it's invectory (no matter how many 1 is enought to prevent it from buying it) then it adds to the list for weapons that needs to be bought.
even if you add 30 times the weapon, it will be checked out 30 times that the bot already have at least 1, so, it won't buy more
Proudly without signature :P

Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 24, 2006 8:51 pm 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked








Joined: Fri Nov 12, 2004 3:54 pm
Posts: 3291
Location: Apoc City USA - outnumbered, but still fighting.
got it. THANKS! 8)
Chopper:
I really enjoy talking with folks in other countries, drinking stoli/tonic... pulling off shots that seem impossible, drinking..

Fact: CO2 = less than .04% (.00038) of the atmosphere - only a small fraction of that is man made.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 25, 2006 9:47 am 
User avatar
Reduced to ashes
Not Signed Up For Stats

Joined: Fri Jan 06, 2006 12:11 am
Posts: 639
Location: The Dark Side of the Earth
whoops boy, while checking the bot's actual code i noticed i did a mistake:

actually the bot's choosing weapon system is:
first weapontype, then TOTALLY random (the level won't affect the weapon choice)

now the level value becomes, a bit a mystery for me, is it useful??? i never seen it's use yet in the code
Proudly without signature :P

Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 25, 2006 10:54 pm 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked








Joined: Fri Nov 12, 2004 3:54 pm
Posts: 3291
Location: Apoc City USA - outnumbered, but still fighting.
silly bots!! :twisted:

about the only evidence i see of the level is that I have notied the bot uses the shield at the lower level most of the time. I think.
Chopper:
I really enjoy talking with folks in other countries, drinking stoli/tonic... pulling off shots that seem impossible, drinking..

Fact: CO2 = less than .04% (.00038) of the atmosphere - only a small fraction of that is man made.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 12:42 am 
User avatar
Site Admin
Not Signed Up For Stats

Joined: Mon Aug 04, 2003 4:09 pm
Posts: 4771
Location: Scotland
This was the first/easiest scheme I could come up with, if anyone has a better idea just let me know :)


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 02, 2006 12:43 am 
User avatar
Reduced to ashes
Not Signed Up For Stats

Joined: Fri Jan 06, 2006 12:11 am
Posts: 639
Location: The Dark Side of the Earth
check out my suggestions, just few ;) :lol:
Proudly without signature :P

Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 23, 2007 2:08 pm 
Singed

Current Scorched3D Rank: Unranked





Joined: Tue Mar 22, 2005 1:23 pm
Posts: 15
Should not the bot's buying behavior be governed by the cost of items in it's weaponset compared to the money it has? The bots often find themselves in serious trouble after the first buy.
Items of its weaponset could be purchased when deemed affordable by levels or tiers. If bot spending could be better configured, this would extend the possibilities for custom AI play and give the offline player a more realistic opponent.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 23, 2007 3:28 pm 
User avatar
Obliterated

Current Scorched3D Rank: 118





Joined: Sat Nov 05, 2005 9:29 am
Posts: 1968
Location: In a Rental.
CaraVan wrote:
Should not the bot's buying behavior be governed by
the cost of items in it's weaponset compared to the money it has? The bots
often find themselves in serious trouble after the first buy.

Items of its weaponset could be purchased when deemed affordable by
levels or tiers. If bot spending could be better configured, this would
extend the possibilities for custom AI play and give the offline player a
more realistic opponent.


Tank-ai code has just been completely rewritten to include many more
variables in target selection and ammunition buy/usage.

All the options mentioned above have been looked into. And if i may say,
it's damn good now. makes them much more intelligent.
Scorched3D Mod-Servers
Forum
Stats
Mods-Page


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 23, 2007 8:50 pm 
User avatar
Desintigrated

Current Scorched3D Rank: Unranked



Joined: Sat Dec 18, 2004 7:20 pm
Posts: 2015
Location: USA
BEWARE THE EVIL BOTS!!!

They will destory you!

BEWARE... BEWARE...

.................................

Bots are many times more configable then they use to be and making the AIs for them will be some what more harder then before, but make the bots more fun then before.
Beware the VOID

When in doubt on why your mod broke...
it's all Bobirov's fault.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group