by date
Plan for Bruno
Plan for Bruno
| Name: | Bruno | |
|---|---|---|
| Date Posted: | Jun 27, 2005 | |
| Rating: | Not Rated | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Bruno |
Blog post
AI- Artificial inteligence
Here it goes, my first plan :)
I have been working heavily on AI lately, a game can be very pretty, and have the most advanced graphics around, but if the ai looks bad, the entire game experience is waisted.
On Vatan, i want to have the best AI i can make, i want enemies to listen to the player actions, to react to them, and to behave in squads when possible.
To implement this, i made a huge FSM, with more than 50 states, which was a pain to debug.
Anyways, to start bots navigate with a A* algorithm, nothing fancy here.
Each bot in a area, when alerted to the player presence will search for near "bot friends"., When found they all will join in a Squad structure.
What will this squad structure be good for, you ask ?
Well, when combat starts, the squad will try to flank the player, each bot will be aware of which direction each one has, so if one is moving to the right, the other will move to the left. In practice the player will have bots moving to his left and to his right.
Bots also "comunicate" between them, if in a squad of 3 bots while the player is moving one of the bots looses the line of sight to the player ( and registers the material occluding the player ) , this bot will "ask" to the other "Where is he" (voice acting here), and if one of the other 2 can see the player they will reply (with voice acting) depending on the material occluding the player (behind the tree, behind the rock, etc).
We can also trow rocks, bots will listen and investigate, we can sneak behind them and kill them with knifes, bots can open doors, etc.
I uploaded a small video showing off a combat situation between the player over here (divx required):
http://fysoftware.com/t_video/
Enjoy :)
I have been working heavily on AI lately, a game can be very pretty, and have the most advanced graphics around, but if the ai looks bad, the entire game experience is waisted.
On Vatan, i want to have the best AI i can make, i want enemies to listen to the player actions, to react to them, and to behave in squads when possible.
To implement this, i made a huge FSM, with more than 50 states, which was a pain to debug.
Anyways, to start bots navigate with a A* algorithm, nothing fancy here.
Each bot in a area, when alerted to the player presence will search for near "bot friends"., When found they all will join in a Squad structure.
What will this squad structure be good for, you ask ?
Well, when combat starts, the squad will try to flank the player, each bot will be aware of which direction each one has, so if one is moving to the right, the other will move to the left. In practice the player will have bots moving to his left and to his right.
Bots also "comunicate" between them, if in a squad of 3 bots while the player is moving one of the bots looses the line of sight to the player ( and registers the material occluding the player ) , this bot will "ask" to the other "Where is he" (voice acting here), and if one of the other 2 can see the player they will reply (with voice acting) depending on the material occluding the player (behind the tree, behind the rock, etc).
We can also trow rocks, bots will listen and investigate, we can sneak behind them and kill them with knifes, bots can open doors, etc.
I uploaded a small video showing off a combat situation between the player over here (divx required):
http://fysoftware.com/t_video/
Enjoy :)
Recent Blog Posts
| List: | 09/03/06 - SliderGem 09/29/05 - Plan for Bruno 06/27/05 - Plan for Bruno |
|---|
Submit your own resources!| Zachary Zadell (Jun 27, 2005 at 16:50 GMT) |
| Firas (Jun 27, 2005 at 20:05 GMT) |
but what about navigation graph did you build one?
| Bruno (Jun 27, 2005 at 20:32 GMT) |
The nagivation map, is placed automatically in the map editor and nodes adjusted by hand in particular locations (bridges, etc)
| Andrew Nicholson (Jun 28, 2005 at 00:01 GMT) |
Keep up the good work.
| Leonard Davis (Jun 28, 2005 at 07:04 GMT) |
| Firas (Jun 28, 2005 at 08:48 GMT) |
colud you please tell me a bout the technique you use to implement the navigation graph?
| Bruno (Jun 28, 2005 at 10:01 GMT) |
The navigation graph is pretty simple, in the map editor you just select the minimum distance between each node, and the minimum heigh\maximum height at where they can be placed, and it just generates a grid of nodes.
The nodes are all placed in the heightmap automatically.
Then manually, for particular situations, the mapper moves the nodes around.
When all the nodes are in the desirable locations, we press a button, and it generates the connections between all nodes(taking the minimum distance connection into account).
The beauty of this, is that, we can drop bots anywhere, and they will move correctly.
| Firas (Jun 28, 2005 at 22:21 GMT) |
but what about the destribution method you use in placing the nodes (actually i'm stuking in how to destribute the nodes) I mean by destribute the nodes placing it in the world, so colud you explain more please?
and what about interiors how you generate the navigation graph for them?
| Bruno (Jun 29, 2005 at 11:31 GMT) |
for(x=0; x<heightmap_maxX;x++)
for(y=0; y<heightmap_maxY;y++)
place_node(x,y);
something like that, with (x++) and (y++) depending on the distance you want between nodes.
Indoor is a bit diferent, the nodes are not placed automatically, but placed in the editor manually by the mapper.
The connection between them is also made by distance, and a ray is casted between each node to make sure theres a path between them.
| Firas (Jun 30, 2005 at 06:21 GMT) |
ok my last question how did you draw a line between 2 nodes?
coz some guys use opengl to draw it, so if you use the same way, please tll me how did you do it?
did you make a new .cc file like for example navgraph.cc and call the opengl there? or what?
Edited on Jun 30, 2005 07:02 GMT
| Bruno (Jun 30, 2005 at 21:53 GMT) |
If you are asking how to render the line between 2 nodes, its just a opengl rendering call.,
glBegin(GL_TRIANGLES);
glVertex3f( origin[0], origin[1], origin[2]);
glVertex3f(destiny[0], destiny[1], destiny[2]);
glVertex3f( origin[0], origin[1], origin[2]);
glEnd();
You can also draw with lines if you want , with (GL_LINE)
You must be a member and be logged in to either append comments or rate this resource.


Not Rated


