Boss AI

I stole these graphics they will be changed later, but with the same idea.
Aside from that, the boss transfroms between three forms, Lion, Eagle, Gryphon. Each from has a different speed and the eagle and gryphon can fly. Each is a different size, so the first thing i want to fix is when a lion running on the ground turns into a gryphon, which is taller, and thus it becomes inbedded in the ground.

Aside from that stuff i need an idea of how the boss should act, and how to go about doing that.

The game is here : http://rapidshare.de/files/22566223/Hazard_Lizard.jar.zip.html

I made a developer cheat where you hit k to load the next level. Hit it 4 times to load the boss level, he starts near the top but once he turns into a lion he falls all the way down.
Any AI ideas and or room layout ideas would be much appriciated. Right now he just acts like a normal enemy that can transform.
Oh there are still frame “animations” of the hawk and gryphon attacking, i dont know i will use those.

My ideas so far:
Lion does what it does right now.
Gryphon flys around in the center chasing the player and avoiding the barrels.
Eagle will act like a lion but sync its x pos with yours, so it will fly back and fourth on the same level with you, i can place barrels so you cant hide behind them.

But i would prefer anything more creative.
Oh, look at the files, Sprite, Critter, Boss, GryphonBossOne those defines it.

EDIT:
OOO, best idea ever. Starts as gryphon, can take 10 hits. When you kill it it turns into the eagle and lion with said paths.
I can probably do that myself, ill post again if i have difficulty.

It is a nice game. I was actually considering implementing a similar game so thanks for the inspiration :wink:

I like your idea on how the boss should act, it is not so bad :slight_smile:

I believe that the concept should be as realistic as possible. In this case this mean to define the attaching skills of each of the enemies and creating the surrounding based on these skills.

The skills of the enemies:

  • The Gryphon is slow but strong and can attach the player directly. So I believe that the enemy should choose this form if the player is not on the ground and there is a lot of barriers right above you.
  • The Lion should dominate the ground and lower part of the environment. The Lion should be able to make small jumps to support this behavior.
  • The Eagle is not so strong unless it is flying in high speed. This means that the Eagles would benefit from attaching from ‘high’ altitude and in open areas.

Of course this AI will require some restriction on the environment so that the enemy can easily decide on the desired form. This should also make the AI easier to implement.

Looking forward to play the next version!

Well here is the basic idea, i havnt beaten him yet because its insanly hard. And there is a bug with the eagle that causes him to teleport to the top of the screen if something happens. And a bug with the sheild that makes it crash. I can usually kill the gryhon and the lion though.

http://rapidshare.de/files/22729690/Hazard_Lizard.jar.html

Here is the eagle code:

import java.util.LinkedList;
import java.awt.Point;

public class EagleBossOne extends Boss	{
	public EagleBossOne(ImageSequence left, ImageSequence right, LinkedList<Sprite> goodies)	{
		super(left, right, 5, goodies);
	}
	
	public void update(long elapsedTime, PlayerSprite player)	{
		super.update(elapsedTime);
		
		float vectorY = player.getY() - getY();
		
		double mag = Math.sqrt(vectorY * vectorY);
		
		float velocityY = (float)(vectorY / mag);
		
		if (velocityY > getMaxSpeed())	{
			velocityY = getMaxSpeed();
		}
		if (velocityY < -getMaxSpeed())	{
			velocityY = -getMaxSpeed();
		}
		
		//System.out.println(velocityY);
		
		setVelocityY(velocityY);
		
	}
	
	public boolean isFlying()	{
		return true;
	}
	
	public float getMaxSpeed()	{
		return .25f;
	}
}

I cant see why this would cause him to teleport to the top. The gryphon does the exact same thing but with both axes

import java.util.LinkedList;
import java.awt.Point;

public class GryphonBossOne extends Boss	{	
	
	public GryphonBossOne(ImageSequence left, ImageSequence right, LinkedList<Sprite> goodies)	{
		super(left, right, 10, goodies);
	}

	public void update(long elapsedTime, PlayerSprite player)	{
		super.update(elapsedTime);
		Point vector = new Point();
		vector.x = (int)player.getX() - (int)getX();
		vector.y = (int)player.getY() - (int)getY();
		
		double mag = Math.sqrt((vector.x * vector.x) + (vector.y * vector.y));
		
		float velocityX = (float)(vector.x / mag);
		float velocityY = (float)(vector.y / mag);
		
		if (velocityX > getMaxSpeed())	{
			velocityX = getMaxSpeed();
		}
		if (velocityY > getMaxSpeed())	{
			velocityY = getMaxSpeed();
		}
		if (velocityX < -getMaxSpeed())	{
			velocityX = -getMaxSpeed();
		}
		if (velocityY < -getMaxSpeed())	{
			velocityY = -getMaxSpeed();
		}
		
		setVelocityX(velocityX);
		setVelocityY(velocityY);	
	}
	
	public float getMaxSpeed()	{
		return .15f;
	}
	
	public boolean isFlying()	{
		return true;
	}
	
	public void collideVertical()	{
	}
	
	public void collideHorizontal()	{
	}
}

Haven’t had a chance to try it out ( at work ::slight_smile: ) but perhaps you could start with the lion and eagle together attacking the player. But don’t make them too strong since the player will have two oponents and you want him to feel like it’s an fairly easy victory. As soon as one or both of them are getting weak ( < 25% ) then they trigger a power which allows them to magically merge into the gryphon. This would be your “real” boss.

A lot of anime and other media use the technique of seperate-but-weaker individuals that can almost-but-not-quite do the job joining together to present a greater force. I call it the Voltron-effect and it can really take your player by surprise the first time it happens. ;D

Then, at a later level, you can have a lion and dragon merge into a Manticore and a nother lion, goat and snake that merge into a Chimera. 8)