Information

Author:
    Kilin
Rating:
    9.2 (10 votes)
Type:
    Example
Language:
    GM 6
Reviews:
    None
Submited:
    April 25, 2007
Dev - DB/form (refering to updated - check code)
Download:
    DOWNLOAD (686)
Dev - make AJAX
Screenshots (3)
Dev - Also, on form submission, use GD to resize the image as a new thumbnail file
Dev - In the submission form, you can now upload a banner image
Aircraft AI Example
This example was put together for those making aircraft games. I kind of decided to use the basic AI concept used in StarFox64. I found this kind of fun, and people are asking on how to do AI, so I decided to do an example on it.

This is a pretty simple way of making enemy AI when using a top-down shooter, or an aircraft game. This example is specifically made for using aircraft, but with a bit of changing, can be used for many top-down shooters. So, here's how it works.

The enemy is capable of dodging attacks and asteroids which are placed around. He can get behind you and shoot at you, and leave when he senses danger. He'll slow down when you are too close so he can stay behind you.

Also included, is a very, VERY simple way to do a radar. It can draw the character and enemy on it, and you'll want it. Basically, you base a rectangular radar on the room dimensions. It does not draw directions very well, nor does it draw the asteroids.

So, the controls are as follows:
Left/Right Arrow Keys: move your ship left/right
Up/Down Arrow Keys: speed up/slow down
Spacebar: shoot
Control: barrel roll (used to deflect projectiles)
Z: Loop (used to escape pursuit)

They're pretty simple, and the enemy is capable of most of those. Now, if you are having too much trouble, I threw in some bullet types.

1: normal bullet (you're good if you can win with this)
2: twin bullet (this is if your accuracy is off)
3: big bullet (you have to be a loser to need this, but it can help you finish quickly)
4: homing bullet (you suck to use this)
5: homing big bullet (you are a real loser to need this)

So, it's kind of a minigame within itself. These are the number keys, and may only work when they aren't on the number pad. The ones above the letters. =P

As a final word, do NOT simply put in more enemies. The seperate object for the enemy's health will not draw over all enemies. If you want to make multiple enemies, duplicate both the enemy object and the controller for each extra enemy you make. The reason this is done is because I used image_angle.

One more thing, do NOT rate on whether or not bullet types work, because they were thrown in in case you're having problems.

Remember that this uses GML, but a little D&D. The D&D was mostly used because GM was coming up with dumb ways to do things. Also, using random chances just is easier in D&D. There isn't much, but if you have suggestions for that, they're pretty welcome.

So, all graphics were done by me, I believe, except for the starry background. The programming was mine, and I decided to throw in some music just for fun from SF64.

Enjoy the example! I will not require credit, but it is appreciated. DO NOT simply copy everything and put it in your game. It's usually best to change things up to fit your game.


Target platforms:



Dev - Warning
Dev - After editing rating, make rating display change
Dev - When editing, update "edited" column
Dev - Restore deleted comments
Dev - Display deleted comments if mod (hidden, then with dropdown)
Dev - After deletion or during edit, make rating dropdown appear again
Dev - Stricter rating rules. Prevent user from rating again
Dev - Pages
Dev - Reporting
Oh, right. I need to upload a new version that eliminates most of the D&D and changes the AI stuff to scripts.
Posted by Kilin April 25, 2007 14:31 - 6.1 years ago
| [#01]

This is relly cool!
+ nice music addicted!
Posted by sparkythecat101 April 25, 2007 14:47 - 6.1 years ago
| [#02]

Nice i like it Great engine
Posted by GMWIZ April 25, 2007 15:46 - 6.1 years ago
| [#03]

the AI is a bit jumpy, somtimes it has direction changes over 45 degrees, very unfair and unrealistic. plz fix this?
Posted by noshenim April 25, 2007 19:00 - 6.1 years ago
| [#04]

This was pretty nice. The AI was rather difficult, but that may be because my aiming sucked and he was rather small...but it was good overall...good job!

Well...9/10 for you!
Posted by Crane-ium April 25, 2007 19:09 - 6.1 years ago
| [#05]

10/10, because you can barrel-roll XD

Good example, I might tinker with it a little when I have the chance.
Posted by Obelisk April 25, 2007 21:30 - 6.1 years ago
| [#06]

Hey, thanks, guys.
@_Player_: Yeah, I'm trying to work on that realism there. I'll update probably tomorrow or something.
Posted by Kilin April 26, 2007 10:14 - 6.1 years ago
| [#07]

Very good, just work on the graphics
Posted by Black Parchment April 26, 2007 22:59 - 6.1 years ago
| [#08]

...
The reason I had those simple graphics was because it didn't matter. Is everyone realizing that this isn't a game? I only made the minigame to show you how it works...because...you're supposed to, and it was fun doing it.
=)
Posted by Kilin April 28, 2007 8:59 - 6.1 years ago
| [#09]

It's awsomely fun to play, add a main menu and the other weanpons be powerups and it would go as a completed game
Posted by ipod13dude April 30, 2007 16:43 - 6.1 years ago
| [#10]

pretty god actully.8/10
Posted by Ice of sweden May 01, 2007 9:05 - 6.1 years ago
| [#11]

@ipod13dude: Yeah....it's a minigame showing how to use it. I suppose I may make a simple game out of it, though. The traditional arcade game...heh heh...but remember it IS an example!
Posted by Kilin May 01, 2007 10:13 - 6.1 years ago
| [#12]

Wouldn't it be better if the loop made you go the other direction, other then facing the other direction and back?
Posted by blah May 02, 2007 0:38 - 6.1 years ago
| [#13]

That would be a U-turn, which is from SF64 only. I didn't want to use it right then, but it's not hard to animate. Remember that this is an AI example, and not an aircraft example. People still think this is a game.
Posted by Kilin May 03, 2007 9:42 - 6.1 years ago
| [#14]

COOL! The jets are almost paper-ish! Either that, or thier paper airplanes. Anyway, Pretty good! I could use this!
Posted by Mari007 May 13, 2007 10:17 - 6 years ago
| [#15]

Well, I saved time by decapitating graphics. And I will throttle the next person who downrates my example for graphics...not that you DID.
Thanks, though.
Posted by Kilin May 16, 2007 11:01 - 6 years ago
| [#16]

It's nice but work on the graphics.
Just kidding.
Good example of starwing AI. Good and sophisticated. May use this some time
Posted by Afromonkey0 June 02, 2007 13:48 - 6 years ago
| [#17]

Dang, I really like this. Graphics aren't good but examples don't need good graphics so I won't cut my rate any lower because of graphics. Plus I could see this example becoming a very nice game. 10/10
Posted by Adalas June 12, 2007 3:13 - 6 years ago
| [#18]

Pretty nice 9/10
Posted by Cpsgames March 10, 2008 8:40 - 5.2 years ago
| [#19]

Recent Activity
 
Active Users (0)