Artificial Intelligence Depot
Visiting guest. Why not sign in?
News, knowledge and discussion for the AI enthusiast.
FEATURES COMMUNITY KNOWLEDGE SEARCH  
Understanding Artificial Intelligence
Comprised of critically acclaimed essays by the world's leading experts on each topic in the series, these collections will become definitive texts on crucial issues of our technological times.
More information at Amazon US UK

Reply to Message

Not registered yet?

The AI Depot has a focused community of friendly users. Rather than let anyone abuse the site at the brink of promiscuity, we prefer to let only those with an active interest participate... this simply requires registering.

Why not sign up!

Joining the site's community is completely free. You can then post messages freely, and customise your personal profile at will. Specific privileges will also be granted to you, like being able to access printer-friendly articles without restrictions. So, why not register?

Username:
Password:
Subject:
Email me when someone replies.
Body:

Parent Message

Shooter AI Ideas

Chris, sorry about the delay...

As you said, the game is tough! I played for quite a while, and still can't beat the end of level 1 boss ;)

I've got a fair number of tips for potential improvements, but since you're in beta, I'm not sure you're still 'open' to suggestions. So let me know!

Right, for the AI. It's a tough one, but I reckon a good old search is the way to go. In essence, you'd split the area into little zones, and evaluate how valuable they are. First you'll need to predict projectile positions using dynamics, and set those zones to 0 desirability. Then, you'll need to evaluate the potential for destruction of particular zones, by giving it a high reward if you're just below the enemy (and can shoot directly upwards). Then just do a mimimax search, and you're in business.

That probably sounds a bit simpler than it really is, but with a bit of experimenting, I'm convinced that would work. The key, of course, is the evaluation function... you can probably get the agent to learn how to evaluate positions, by learning weights or something. But a good place to start would be to hardcode some default values.

Hope that helps!

935 posts.
Wednesday 26 December, 19:46
Reply
Thanks

> I've got a fair number of tips for potential improvements, but since you're in beta, I'm not sure you're still 'open' to suggestions. So let me know!

Fire away, but just don't include "Make it easier" - it ain't gonna happen ;)

> you'd split the area into little zones, and evaluate how valuable they are.

How big do you think the zones should be? Just so you know, the actual hit rectangle of the player is a 2x2 block in the center of the ship. It can get away with alot :)

> First you'll need to predict projectile positions using dynamics, and set those zones to 0 desirability.

I'm confused by this. What do you mean by dynamics?

> you can probably get the agent to learn how to evaluate positions, by learning weights or something

You mean telling it to keep values that make it survive vs. values that make it die? :)

- Chris

3 posts.
Thursday 27 December, 02:21
Reply
Position Search

Right, suggestions...

- In full-screen, scale the playing area to fit... I had a little black area all around the view. There's so much going on that you need the game as visible as possible.
- A help menu, with the keys. I found ENTER nearly straight away, but it took me a while to find Z/X combo.
- Some bonus items are similar to small projectiles. Make them glow or something.
- How come some enemies can stop and rotate when the player can't?

Ideally, the zones would be 1x1 pixels. That would give the best results for the AI. The search should also be very deep, looking into about 10-20 positions ahead. This won't be possible, however: too expensive. So you'll probably end up having a 4x4 grid, and 4-8 position look ahead. If you're really interested, there are plenty of ways to improve this once you've got the basics working.

Dynamics is a branch of physics that deals with applying computing the position of a body given its velocity and acceleration. So it's stuff you're already doing! Just make sure it's really efficient, so you can do some good motion prediction. If the acceleration does not change, you can solve the equations of motions without having to simulate them.

> You mean telling it to keep values that make it survive vs. values that make it die? :)

Essentially, yes. The AI would learn how to evaluate properties of the position:

Characteristic / Desirability
Collision / 0
Position: Middle-Side / 70-20
Below Enemy / 90

And to combine them together, just add them up, and you get the total desirability. But as I said, you can set those coefficients manually pretty well, since you have a good knowledge of the game itself.

935 posts.
Thursday 27 December, 09:22
Reply
Moo

> - In full-screen, scale the playing area to fit... I had a little black area all around the view. There's so much going on that you need the game as visible as possible.

This will make the game run slow, and additionally make it look really ugly :) If you want the game to fill more of the screen, you can set the screen size to 512x384 in the options menu.

> A help menu, with the keys. I found ENTER nearly straight away, but it took me a while to find Z/X combo.

I didn't think the game was complex enough to include it.

> Some bonus items are similar to small projectiles. Make them glow or something.

Which ones? The only bonus items are the coins and reflect shields. They're both bigger than the bullets and animated :X

> How come some enemies can stop and rotate when the player can't?

Hey, the player can stop .. just not rotate :) I used the standard 8-directional movement for the player because it is much more precise. You need alot of precision movement to survive in XOP!

> you'll probably end up having a 4x4 grid, and 4-8 position look ahead.

The screen width/height is 400x300 .. I made an array : int zoneMap[100][75][6];

Is that right?

I'll try to get some code going.

- Chris

3 posts.
Thursday 27 December, 18:58
Reply

Back to the Artificial Intelligence Depot.