• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.


This topic is now archived and is closed to further replies.


AI for Galaxian Game

6 posts in this topic

Hi, Please, If someone has some stuff about ai for a kind of game like Galaxian or Phoenix Arcades, I will appreciate so much I have some questions like: When the enemies must attack? When the enemies must fire? What kind of techniques can I use? Please, I you have some examples o you can tell me where can I find some stuff, I will apreciatte so much Thanks a lot Cheers, Arcangel arcangelg@yahoo.com

Share this post

Link to post
Share on other sites
I don''t know the answer. All I can tell you is that Galaxian always kicked my butt. Man, I sucked at that game.

Share this post

Link to post
Share on other sites
While I''m far from an AI expert here''s a couple of points:

* An enemy can attack at a regular interval or randomly, your choice. Neither is particularly hard to implement.

* An enemy would probably fire similarly, again your choice.

* To implement this you could do something like:

An enemy could the following variables to handle this:

An action variable that would be an enumerated value - ACTION_IDLE, ACTION_ATTACKING, ACTION_REGROUP, etc.
A variable to determine when to attack, again possibly an enumerate value - ATTACK_RANDOM, ATTACK_INTERVAL
A variable to tell when it last attacked
A variable to tell when to fire, similar to the attack variable

Each time through your update loop you would check the attack and last attack variables, make a decision whether it''s time to attack again based on their values and set the attack variable appropriately. The next time through the update loop if an enemy is now set to attack it would begin it''s attack. It would then begin to evaluate the time it should fire.

This is a VERY simple explanation and it''s probably missing a lot of stuff, but it''s off the top of my head and might help you in starting to build this.

Breakaway Games

Share this post

Link to post
Share on other sites
in the games like galaxian, and galaga, all of the AI was pattern based.

Share this post

Link to post
Share on other sites
How about this:
if distance (playerX,playerY,enemyX,enemyY)>400 chase
if distance (playerX,playerY,enemyX,enemyY)<40 evade
if hit by bullet evade
calculate where player would be after a bullet reached the distance(playerX,playerY,enemyX,enemyY) and turn in that direction , direction reached OPEN FIRE !!!
I use this in my RTS game but it would also work in arcade

Programming is an art

Share this post

Link to post
Share on other sites
AI is not such complicated as it sounds. However, it is essential that you can seperate your thoughts in pieces.

First you need to know what you would do.
Ie. It is you and 5 other players. Player 3 is the stronger, and you have assigned him a score of 1000
Others are not much strong.
1 (you) score 600
2 score 100
4 score 500
5 score 300

What would you do?
1. You would try to get the stronger one (3) to attack the others but you, so that he weakens. So, the AI character (1), will try to make some aliance with the player 1, and he will try to forge a war between the aliance and the others.

This is a very basic thing. All this can be extended greatly, and finally end up with Personalities. But above all, you must try to analize your thoughts. Remember that the best AI is always hidden within your brain

Use scores that are generated based on some stuff.
Multiple scores for a character is the best choice.
To generate a score, take in account the user''s army, facilities, technology, resources production rate (if avaliable), player''s personality, etc...

Hope these will give you a start-up boost.


Share this post

Link to post
Share on other sites
Dunno if this is of any use for you anymore, but
i''ll tell you how i did the ''AI'' in my (little)
vertical scrolling 2d-shooter, where the enemies
just keep on coming on the screen in random

As stated before, the ''AI'' in this kind of game
is (usually) pattern-based. As my game is actually
a very simple example game for my soon-to-be game-
engine, i ended up with a simple control-point

The control-point structure:

typedef struct{
int iXPos;
int iYPos;

The 2 variables (iXPos and iYPos) tell where on the
screen the particular control-point is. This structure
can be extended, so that the enemies would stop on
certain control-points etc. So for making
the patterns i just made a 2 dimensional array of
control-points, like this:


All control-points are loaded from a file, which
contains all of their x and y values.

So now i had NUM_PATTERNS of different patterns which
all consist of NUM_POINTS control-points. The first
and the last control-point in a pattern are reserved
for starting and ending points, which must be outside
of the screen. Why? Well it would look pretty silly
if the enemies would pop on the screen from nowhere
or disappear in the middle of the screen.

So how did i use this then?

In my game every enemy has a variable which shows
which pattern it is following and another variable
which tells which control-point is the enemys next

In every AI-cycle i would just check if the enemy has
reached a control-point, and if it has, increment the
the target-variable by one. If the target-variable
is NUM_POINTS, then the enemy must be destroyed, as
it has reached the last control-point. If the enemy
hasn''t reached the target control-point, i just moved
the enemy towards it until the enemy is on top of it.

Some pseudocode to show how i did it (the enemies
are stored in an array of Enemy[NUMBER_OF_ENEMIES] ):

for( int i = 0; i < NUMBER_OF_ENEMIES; i++ ){

//Move the enemy:

if( ctrlPoint[ Enemy.Pattern ][ Enemy[i].Target ].iXPos < Enemy[i].X )
Enemy[i].X -= Enemy[i].Speed;

if( ctrlPoint[ Enemy[i].Pattern ][ Enemy[i].Target ].iXPos > Enemy[i].X )
Enemy[i].X += Enemy[i].Speed;

//the exact same for y-points

if( Enemy is on top of the controlpoint ){
if( Enemy[i].Target == NUM_POINTS ) //The last controlpoint was reached
Enemy[i].Alive = FALSE; //Destroy the enemy
}//End if

}//End for

When i created an enemy, i would randomly give it a pattern,
then put its x and y position as ctrlPoint[Enemy.pattern][0].x
and CtrlPoint[Enemy.pattern][0].y and finally set the enemys
target control-point as 1 (0 is the starting-point).

Very basic, and extremely easy.

What about shooting? Well i used a random variable on
that. When ever a random variable hit a certain value,
the enemy would shoot.

This isn''t probably the best and the fastest way of doing
all this, but it works just fine as an example. Hope that
atleast someone understands what i''m trying to say here,
and that this post would be helpful.


Share this post

Link to post
Share on other sites