It is currently Sun May 19, 2013 1:09 am

All times are UTC - 8 hours




Post new topic Reply to topic  Page 1 of 4
 [ 59 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: AI
PostPosted: Wed Sep 20, 2006 12:54 am 
Offline
Programmer
Programmer
User avatar

Joined: Tue Nov 08, 2005 3:53 am
Posts: 2374
Location: St. Petersburg, Russia
Firebrand, I wish to ask two questions about botAI you were making.

First is, are they able to seek route to some random point of map, not only to enemy.
Second is, how do you use Nodes to define bot's route? Is there Node Graph build?

_________________
- Our necromancers' team have already prepared everything for the Rebirth Ritual. Soon Holy Lenin will be back with us!
- Perfect. I shall report to Magistre Stalin immediately.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 20, 2006 5:46 am 
Offline
2D Artist
2D Artist
User avatar

Joined: Thu Apr 25, 2002 12:01 am
Posts: 3105
Location: Mexico
Bots have two basic actions that they do for tracking enemies, items, obstacles, etc.

The first thing a bot will do for tracking things is to look around himself in 180 degrees and locate any objects, then he'll determine the route to follow (a vector traced from it's current Origin to the thing's Origin it has located), then he determines if there are solid lines or objects in that route, if there are any solid obstacles, he'll discard the object and follow something else he can see and it's not blocked from it's current position, if he moves and tracks the same object again, but it's not blocked he'll surely go to get it (whatever it is).

To determine which kind of object the bot is tracking (items, path nodes, etc.) he'll just evaluate some flags I've added for different objects, if there's any more questions, just ask, I would like to improve the bots AI in any possible way :).

_________________
I'm the ruler of the Fire Power.....


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 20, 2006 5:52 am 
Offline
Programmer
Programmer
User avatar

Joined: Tue Nov 08, 2005 3:53 am
Posts: 2374
Location: St. Petersburg, Russia
Gee, does this means that if bot does not see anything of importance he will not move at all??

Actually I would suggest making Node Graph.

_________________
- Our necromancers' team have already prepared everything for the Rebirth Ritual. Soon Holy Lenin will be back with us!
- Perfect. I shall report to Magistre Stalin immediately.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 20, 2006 5:54 am 
Offline
2D Artist
2D Artist
User avatar

Joined: Thu Apr 25, 2002 12:01 am
Posts: 3105
Location: Mexico
He'll continue moving in circles until he spots something again, that's why bots get stuck so easily in maps without path nodes, how you suggest to implement the node graph? A sequential series of path nodes ordered by number or something?

_________________
I'm the ruler of the Fire Power.....


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 20, 2006 5:59 am 
Offline
Programmer
Programmer
User avatar

Joined: Tue Nov 08, 2005 3:53 am
Posts: 2374
Location: St. Petersburg, Russia
Node graph is a system of connections between nodes. I never did this on my own, but may guess how it should be made. I suppose that each Node may have up to X connections with other nodes (4 maybe). When bot decides what he should do, he builds a path using that connections.
To make this more effective nodes should be placed so that there's passable space between connected ones.

_________________
- Our necromancers' team have already prepared everything for the Rebirth Ritual. Soon Holy Lenin will be back with us!
- Perfect. I shall report to Magistre Stalin immediately.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 20, 2006 11:29 am 
Offline
2D Artist
2D Artist
User avatar

Joined: Thu Apr 25, 2002 12:01 am
Posts: 3105
Location: Mexico
Sounds interesting, the bots already build a "previous" and "next" nodes system, I think this system could be adapted to they feel 2 or 3 different "next" nodes from their current "next" node (think of it like a list of possible movements), we could determine other nodes using the same algorithm bots use for looking nodes, but applying it to the node marked by the bot as "next", I hope my explanation is clear.

_________________
I'm the ruler of the Fire Power.....


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 23, 2006 1:17 am 
Offline
Programmer
Programmer
User avatar

Joined: Tue Nov 08, 2005 3:53 am
Posts: 2374
Location: St. Petersburg, Russia
Well, I was thinking about how to make those paths, I have some ideas, but I want to test them by writing small path-building program on pure C first.

Then, I still wish to know two things:
1. Actually, you haven't answered clearly enouph, Firebrand, - how those bots use Nodes? Do they treat them as a sort of useful object and go for them in case they cannot see anything else of importance?
2. Secondly, imagine there's a path of nodes build somehow, for example an array of node references. May you make bot follow these nodes one by one? - and same task but with continious situation checking?

_________________
- Our necromancers' team have already prepared everything for the Rebirth Ritual. Soon Holy Lenin will be back with us!
- Perfect. I shall report to Magistre Stalin immediately.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 23, 2006 3:46 am 
Offline
2D Artist
2D Artist
User avatar

Joined: Thu Apr 25, 2002 12:01 am
Posts: 3105
Location: Mexico
Bots detect nodes as any other object they would go for, think of it like a pickup (item, powerup, etc.), the bot sees the node and he detects the path to it, if that node is blocked, he'll look for a different node he can see and it's path is free, then he'll just walk to it's origin, mar the node as it's "next" node, but also mark the previous node he visited as "last", from there the bot will check for another node, bots "save" a reference to the next node they will go to and to the last node they have visited, we could add a reference to the "second next" node they'll get to (making the check as I explained in my last post), hope this clears up this stuff, if there's anything else, keep asking :).

_________________
I'm the ruler of the Fire Power.....


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 23, 2006 3:52 am 
Offline
Programmer
Programmer
User avatar

Joined: Tue Nov 08, 2005 3:53 am
Posts: 2374
Location: St. Petersburg, Russia
Well, it's rather clear now, except for the reason why remember previous node, how this reference is used then?
As for path, I think it should be prepared already, bot should call some CalculatePath function which will setup a path for him, then he should simply go node by node; when he reach one node, he takes next reference from path array and continues his way.

To increase the speed of calculationm it is good to have Node Graph build in the beginning of the game, or even saved as special lump, if it can be possible. But still, Node Graph is nearly senseless without dynamic memory allocation. I hope Janis will implement this eventually.

_________________
- Our necromancers' team have already prepared everything for the Rebirth Ritual. Soon Holy Lenin will be back with us!
- Perfect. I shall report to Magistre Stalin immediately.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 23, 2006 3:57 am 
Offline
2D Artist
2D Artist
User avatar

Joined: Thu Apr 25, 2002 12:01 am
Posts: 3105
Location: Mexico
The bot saves his previous node reference in case he has to turn 180? for some reason (maybe a dead end or a heavy enemy chasing him :lol: ).

Why do we need dynamic memory allocation for this?

Yes, I think the path graphs could be done when beginning the level, to avoid more slow downs on the game (which already has a lot of them),

I wanted to discuss with you the matter of development messages scattered all around the source, they cause the debug file to increase miserably when testing for much time, is there a chance that they could be turned off somehow Crimson Wizard? I think they are a nice addition from you, since they'll help to find problems when they occur, but they don't make much sense for a release, they still are printed when the game is runned without the "debug" parameter. And some of them are in places where they come strange (like those messages from "starting map list dm_") or something like that :).

_________________
I'm the ruler of the Fire Power.....


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 23, 2006 4:05 am 
Offline
Programmer
Programmer
User avatar

Joined: Tue Nov 08, 2005 3:53 am
Posts: 2374
Location: St. Petersburg, Russia
Dynamic memory is needed for Node Graph storage. We do not know how much objects it may store for each map, so it is rather inconvenient to use static arrays.

About debug messages - it is strange they are shown even when debug is disabled; anyway, I will remove most of them, but I wish to leave some even in release - those that describe some weird errors (just in case).

_________________
- Our necromancers' team have already prepared everything for the Rebirth Ritual. Soon Holy Lenin will be back with us!
- Perfect. I shall report to Magistre Stalin immediately.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 23, 2006 4:10 am 
Offline
2D Artist
2D Artist
User avatar

Joined: Thu Apr 25, 2002 12:01 am
Posts: 3105
Location: Mexico
It's ok, I'm just telling you that they show up without debug, I thought there could be some problem with those :).

_________________
I'm the ruler of the Fire Power.....


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 23, 2006 7:24 am 
Offline
Lead Programmer
Lead Programmer
User avatar

Joined: Sat Oct 06, 2001 12:01 am
Posts: 564
Location: Limassol, Cyprus
It was a bug in the engine which printed all of the messages. It's fixed now.

_________________
You may think you can fly, but you better not try...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 26, 2006 12:00 pm 
Offline
Programmer
Programmer
User avatar

Joined: Tue Nov 08, 2005 3:53 am
Posts: 2374
Location: St. Petersburg, Russia
Firebrand, can you please check whether bots test bShootable flag when they seek for enemy? I was experimenting, trying to create spectator mode, set bShootable = false for player, but bots still were shooting at me.

_________________
- Our necromancers' team have already prepared everything for the Rebirth Ritual. Soon Holy Lenin will be back with us!
- Perfect. I shall report to Magistre Stalin immediately.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 26, 2006 12:35 pm 
Offline
2D Artist
2D Artist
User avatar

Joined: Thu Apr 25, 2002 12:01 am
Posts: 3105
Location: Mexico
Yes, if bots select one of the possible actors as enemy they recheck the bShootable flag, if it's not activated, then they discard the enemy, you can check it yourself in CheckStuff function in BotPlayer.vc. I don't think there's need for anymore checks for this flag, so the problem is somewhere, if you want, you can check the FindEnemy function to determine how bots select an actor as their enemy and how they look for it in SetEnemy, I don't know how you are doing this, maybe if you elaborate a bit on it we can find the problem :).

_________________
I'm the ruler of the Fire Power.....


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  Page 1 of 4
 [ 59 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group pozycjonowanie
Chronicles phpBB2 theme by Jakob Persson. Stone textures by Patty Herford.
With special thanks to RuneVillage