Tron AI
Hi
I don't know much about AI (genetic algorithms, neural networks, A*, ect..), but I'm responsible for writing an AI for a Tron-like game. I could probably create something that is usable, but it wouldn't be very adaptable nor flexible (different degrees of possible intelligence). What you you guys suggest I look into to create such a system?
Thanks!
Step 1) Never say "neural network" or "genetic algorithm" again.
Step 2) You don't design AI by selecting a method. You design AI by identifying one problem at a time and proposing a solution for that single problem.
For the most basic issues, you will likely start with a simple finite state machine. However, until you present a game behavior-specific problem, there is no solution that can be offered.
Step 2) You don't design AI by selecting a method. You design AI by identifying one problem at a time and proposing a solution for that single problem.
For the most basic issues, you will likely start with a simple finite state machine. However, until you present a game behavior-specific problem, there is no solution that can be offered.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
1.) Why? Just curious :)
2.) I'd like to arbitrarily switch between randomly going around as if the AI has no purpose (which should be easy I think) and the AI trying to cut off the path off the player. Sorry for being vague.
2.) I'd like to arbitrarily switch between randomly going around as if the AI has no purpose (which should be easy I think) and the AI trying to cut off the path off the player. Sorry for being vague.
So you just want the enemy to travel in a vector in the direction of the player? You can just subtract the locations of the player and enemy to get a vector pointing from the enemy to the player and then have the enemy move in that direction.
@SiCrane, Lightcycles
@mikesobczak, that works for getting a direction, but most likely it'll be obstructed by a trail of some sort so it needs to find the quickest way there and the lightcycle can't just turn at any arbitrary degree :-). I think I'll give this a go myself over the weekend, then I'll come back here if I'm having troubles.
Thanks guys.
@mikesobczak, that works for getting a direction, but most likely it'll be obstructed by a trail of some sort so it needs to find the quickest way there and the lightcycle can't just turn at any arbitrary degree :-). I think I'll give this a go myself over the weekend, then I'll come back here if I'm having troubles.
Thanks guys.
Sounds easy enough to me. The playing field is just a large square and divided as a grid. You just make sure your player isn't going around in a inner circle other wise it gets trapped. Of course, sometimes you can make it go around in circles so that it dies and the user gets a point.
That would be good enough for the beginner mode.
That would be good enough for the beginner mode.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Are you lightcycles going to move over a grid o freely?
I'm not talking about if the movement will be orthogonal or not. Only if there will be 'infinites' parallel lines like in gltron.
I'm not talking about if the movement will be orthogonal or not. Only if there will be 'infinites' parallel lines like in gltron.
Don't forget that there are probably many open source tron games out there. I know I've played at least 1 very decent one.
[edit] yeah... like gltron...
[edit] yeah... like gltron...
you can start with the simplest AI like:
1) go in direction X unless its blocked, if its block change direction using (3)
2) change direction X every random() number of steps using (3)
3) the direction choosing strategy will be: choose using random() and avoid crushing if possible.
---
I think this will be very easy to program and provide a fun enemy, though maybe not very challenging.
you can make a smarter algorithm with the direction choosing strategy,
for example score every direction based on if it leads to a if it crosses player path, if it turns into large area or small area, if it locks the player in a small area, etc... choose direction with highest score.
1) go in direction X unless its blocked, if its block change direction using (3)
2) change direction X every random() number of steps using (3)
3) the direction choosing strategy will be: choose using random() and avoid crushing if possible.
---
I think this will be very easy to program and provide a fun enemy, though maybe not very challenging.
you can make a smarter algorithm with the direction choosing strategy,
for example score every direction based on if it leads to a if it crosses player path, if it turns into large area or small area, if it locks the player in a small area, etc... choose direction with highest score.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement