Jump to content


Photo

Topdown Dogfighting


  • Please log in to reply
11 replies to this topic

#1 tidus97

tidus97

    GMC Member

  • New Member
  • 580 posts

Posted 02 October 2008 - 07:29 PM

AI And basic engine Beta

This is still an early WIP.

I am releasing it to get peoples thoughts on the AI and the FPS at which people played at to test the speed of the engine.
After playing, even if you have nothing to say, at least reply back with your FPS information and preferably your system specs if you ran under 60 FPS.

Extra information can be found under 'The AI' and The Engine headings.


Download
Uploading.com Mirror.
WillHostForFood mirror

Screen Shots (looks better ingame. Blur isnt good when its static!)
Posted Image
Posted Image
Posted Image
Controls

Movement
W A S and D keys
Machine Gun
Space bar
Missile
Q key
Restart
R key

Extra Controls

Create Light
A left mouse click anywhere on the screen will create a light. use this to test the way the shadows work.
Folow AI
Left click on the AI to switch the view to him, and folow him around. This can only be undone once the game has reset.

Other

Counter Measures fire automatically to stop incoming missiles. they are not always available so be careful.

The enemy missiles detonate only when colliding with their targets. The counter measures confuse them into changing targets (to the counter measures themselves). This allows you to collide with missiles without getting hurt if your counter measures have taken their attention of off you.

Red dot on the minimap is your enemy. You are the Green dot.

You die when your hull goes below 0.

The red arrow near your ship points to the enemy. The more less transparent it is, the closer the enemy.

You can leave the room, but you shouldn't.



The AI

The AI player is bound to the same restrictions as you are (turning speed, max speed, acceleration etc), and you've been advantaged in areas where he would other wise be better than you (he doesn't rely on what he sees - he knows where you are when your off the screen for example. To counteract that advantage, you where where given a map and pointer which shows his location.).

He doesn't multitask any more than you can. He runs through a check list of conditions and if they are true, he does the corresponding action. Basic actions ignore this checklist (shooting, for example).

Main things he does:


  • Gives chase if his behind you. he will attempt to match your speed and keep you in front of him. this would be the aim in any dogfight.
  • Attempts to shakes you loose if your giving chase to him. No, he wont just go in circles and try to get behind you. He'll run away until you've lost your grip on him.
  • Moves out of the way of gunfire if he gets hit
  • Fires countermeasures and if countermeasures are unavailable, attempts to shake loose incoming missiles until they are.
  • Once actions are carried out, he reduces or increases his speed to around the 50% mark. too slow would leave him vulnerable. too fast makes it hard to shoot.
AI vs AI capability

Yes, AI vs AI does work. The AI that fights you works with a 'target' variable. This stores his targets ID, and so all of his actions are based on it. i can easily change the target variable to the ID of another AI player. The two (or more) AI players will fight each other. However, as they are running on the same code, they eventually end up looping through the same actions. The reason for this is probably the lack of randomness in the AI's script. The 'randomness' factor is inputted by the player and the way he moves (which, to the AI, is random. even though it makes sense to you). With the player removed from the game, the two AI's just run through the exact same values.

The Engine

Terrain Generation
The terrain is generated randomly. Right now there is only a tree object to generate. The generation works by spawning a tree object, which has 1 out of 2 chance of spawning another tree, and so on until the max tree limit is reach. At this stage a global variable is tripped which tells all of the trees to draw themselves onto a surface and then destroy themselves. This easily allows for thousands of trees with little or no lag at all.

Shadows
Shadows in the engine are only very basic. They only work with two light sources. The first light source is the one that's always 'on'. (From the north). And the 2nd light source is the nearest explosion/'light' object created in the game. If two light emitting objects are created near the shadow, the closest one will be used as the 2nd light source, and the other totally excluded. Its a fairly basic system but the shadows of the trees are only a minor detail so they probably wont be inspected close enough for anyone to care. To save some CPU, (Or alot in the case of 1500 shadow objects), shadows outside of view are de-activated.

Effects
There are no particle systems being used. i have created objects which behave very closely to particle systems but i feel objects provide me with some extra flexibility that particles cant (or i just dont know enough about them to do what i want). In future versions, i will be replacing the more simple effects with particle systems. (Smoke trail for example.).

Animations with png like transparency
By this i mean animations with pixels that have only 50% alpha etc. Not GIF style (visible and invisible pixels). Yes, I've figured it out. No, i wont share just yet. feel free to throw your ideas around as to how i may have done it. (the animation can be seen on the death of the fighter jet.Die, or kill the NPC to view it). FYI - i know the animation isnt smooth, but the detailed explosion's sprite was only 9 frames so i slowed it down a bit. (thats why it looks like someones flipping through pictures, rather than being a smooth animation).

Credits:

Jet sprite (place holder):
Prinz Eugn, aka Mark Simpson
prinz_eugn@hotmail.com

Blur script:
9_6
http://gmc.yoyogames...?showuser=21872

Minimap based of:
http://gmc.yoyogames...howtopic=214744
by Evilish

The rest; (Programming, spriting, effects, etc etc etc)
Me. Tidus97
tidus97@noobtopro.net



Edited by tidus97, 03 October 2008 - 03:41 AM.

  • 0
my jet fighting game.
my solar system generator. looking for someone to help work on it with me here
If i've helped you in any way you can repay me by downloading and rating the games.

#2 Lukearentz

Lukearentz

    My Two Cents

  • New Member
  • 2587 posts

Posted 03 October 2008 - 03:26 AM

Nice Engine.
I like the idea, however unoriginal. Your coding seems good as it wasn't glitchy and its pretty nice.
7/10 - For an Engine.
  • 0
I have left the GMC, and my domain is no longer registered to me.
All previous links will not work, for any information/links please PM me, and I may be able to help you

#3 tidus97

tidus97

    GMC Member

  • New Member
  • 580 posts

Posted 03 October 2008 - 03:38 AM

thanks. what FPS where you averaging, if you don't mind me asking? i'll make changes to the first post to say that im going to test the engine speed too.
  • 0
my jet fighting game.
my solar system generator. looking for someone to help work on it with me here
If i've helped you in any way you can repay me by downloading and rating the games.

#4 ParaBellum82

ParaBellum82

    GMC Member

  • New Member
  • 9 posts

Posted 03 October 2008 - 01:48 PM

very nice... I was averaging 50fps
  • 0

#5 Mgamerz

Mgamerz

    Lazy Developer

  • New Member
  • 1289 posts

Posted 03 October 2008 - 10:23 PM

I'll check it out cause I want to get some ideas for your AI on perhaps how I can improve mine.
Edit: Yeah when AI chases AI it starts to loop... I need to figure out a way to fix this.
Edit: It was decent. the shadows need to be drawn smaller or it makes the 3dism look kinda... weird. I had about 30-40 fps, but my pc is kinda sucky with a semptron @ 1.8 Ghz and a video shared memory 64 MB.

Edited by Mgamerz, 03 October 2008 - 10:30 PM.

  • 0

[StarBord: the First Front]III[Open Source 360° Topdown Shooter]IIIOpen Source Scrolling MenuIIIOpen Source Joystick Controls
Have something you want to figure out how it works? Try a test bed. They are fast to load, and great for experiments. And they are FTW.

#6 tidus97

tidus97

    GMC Member

  • New Member
  • 580 posts

Posted 04 October 2008 - 03:28 AM

yes i think the trees can use some downsizing. thanks for posting the FPS and commenting.

BTW, what do you mean by this:

Edit: Yeah when AI chases AI it starts to loop... I need to figure out a way to fix this.


? i didnt put 2 AI players into the game i released.
  • 0
my jet fighting game.
my solar system generator. looking for someone to help work on it with me here
If i've helped you in any way you can repay me by downloading and rating the games.

#7 Raptor320

Raptor320

    GMC Member

  • New Member
  • 449 posts

Posted 04 October 2008 - 08:11 AM

I only played one round, then restarted, then it got an error:
___________________________________________
ERROR in
action number 1
of Draw Event
for object minimap:

Trying to use non-existing surface.
___________________________________________

The graphics are really, really good. But the title screen, if I can call it that, was extremely annoying. Make a help button - the controls were here already and I didn't need to read them again. And I didn't need to see that annoying little loading message. There needs to be a decent menu there, and when it's generating the trees, it needs a loading screen. No bar, just something nice so you know what's going on.

Secondly, the weapons - with modern jet fighters, the main weapons are missiles. The guns are rarely used - the F22A Raptor only has enough rounds for a few SECONDS of sustained fire. So maybe limit that. Also, with the missiles, not sure if you've implemented this already, but if there's nothing in front of them, they should just fly away.

The counter-measures/chaff should be small, little white things. They're basically just small, really hot things that draw the missile from your plane.

The opponent was really, really hard. Maybe a bit easier?

As the game gets better, make more aircraft with stats - different speeds, armours, agility levels, etc. And more enemy - helicopters, ground targets, AA guns, etc. And maybe missions? Destroy targets, protecting targets, etc.

Good luck with your game! Hope all this helps!
-Raptor320
  • 0
NOW KNOWN AS ND4SPD

#8 Them

Them

    GMC Member

  • New Member
  • 65 posts

Posted 04 October 2008 - 08:18 PM

Great AI, I can barely hurt him before he kills me(but then again I kinda suck at the game). The only problem is that high-speed, 2-d dogfights are difficult to play. It runs well on my computer and the motion blur looks amazing. I agree with everything Raptor said and hope the game turns out well.

Edited by Them, 04 October 2008 - 08:18 PM.

  • 0


Wargames is a completely free and ad-free online game with an active user community.
Sign up for server 2, it's the best place to start learning the game.
The referral gives bonuses to you and me when you start playing.

#9 tidus97

tidus97

    GMC Member

  • New Member
  • 580 posts

Posted 05 October 2008 - 12:56 AM

___________________________________________
ERROR in
action number 1
of Draw Event
for object minimap:

Trying to use non-existing surface.
___________________________________________


thank you for reporting this. though ive never gotten that error. anyway, i think i know its cause. thanks

The graphics are really, really good. But the title screen, if I can call it that, was extremely annoying. Make a help button - the controls were here already and I didn't need to read them again. And I didn't need to see that annoying little loading message. There needs to be a decent menu there, and when it's generating the trees, it needs a loading screen. No bar, just something nice so you know what's going on.


The reason i got that pop up saying it'll load when you click ok is because i didnt know how to make one :p im working on a loading screen now though. as for the menu, its still a bit early to implement it. the engine has just been completed so it doesnt have a menu or anything yet.

Secondly, the weapons - with modern jet fighters, the main weapons are missiles. The guns are rarely used - the F22A Raptor only has enough rounds for a few SECONDS of sustained fire. So maybe limit that. Also, with the missiles, not sure if you've implemented this already, but if there's nothing in front of them, they should just fly away.

yea i know. but the fight is not much fun with missiles. ive purposely made the missiles alot worse in tracking and pretty much taken away the 'fire and forget' factor tracking missiles have in an effort to push the players to use the machine gun. i personally think its a matter of fun > realism here. but hey, what you said could be a great idea for a different game mode. (realism mode maybe). :)

oh and no, i havnt implemented that already. right now you have an abillity to lock onto an enemy at any angle. (Thats what the red circle is). i will, however, restrict it so u can only lock on from the front if i ever have a realism mode. thanks

The counter-measures/chaff should be small, little white things. They're basically just small, really hot things that draw the missile from your plane.


they are. infact their sprites are only 4 pixels wide, but the light/glow effect (representing the heat) is what makes it look bigger. i'll add a bit of transperancy onto the glow effect.

The opponent was really, really hard. Maybe a bit easier?


hehe, no :p

i may add difficulty levels thought but that level of hardness will remain the default one.

As the game gets better, make more aircraft with stats - different speeds, armours, agility levels, etc. And more enemy - helicopters, ground targets, AA guns, etc. And maybe missions? Destroy targets, protecting targets, etc.


all in good time. thanks for the ideas.


Great AI, I can barely hurt him before he kills me(but then again I kinda suck at the game). The only problem is that high-speed, 2-d dogfights are difficult to play. It runs well on my computer and the motion blur looks amazing. I agree with everything Raptor said and hope the game turns out well.



thanks mate. yes, top down 2d dogfights are hard to play due to the restriction in view space. ive tried to counter act this with the pointer and minimap. any more ideas on how i can improve?

Edited by tidus97, 05 October 2008 - 12:58 AM.

  • 0
my jet fighting game.
my solar system generator. looking for someone to help work on it with me here
If i've helped you in any way you can repay me by downloading and rating the games.

#10 Jakyl11

Jakyl11

    GMC Member

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 06 October 2008 - 04:22 AM

The enemies are pretty hard to kill but its been stated so I dont need to go into that.

It didnt take long to load the trees(bout 5 seconds)
FPS was at 60 the whole time
I also had a problem with keeping my aircraft in the rooms view maybe make it to where you cant go outside the boundries.

I got this error too



___________________________________________
ERROR in
action number 1
of Step Event
for object aimissles:

Error in code at line 3:
target.life-=10

at position 2: Unknown variable life

Edit: just wanted to add that this doesnt happen everytime i played it just one time it happened so dont think its that major I ignored it and it worked fine.

Edited by Jakyl11, 06 October 2008 - 04:23 AM.

  • 0

#11 tidus97

tidus97

    GMC Member

  • New Member
  • 580 posts

Posted 06 October 2008 - 04:45 AM

The enemies are pretty hard to kill but its been stated so I dont need to go into that.

It didnt take long to load the trees(bout 5 seconds)
FPS was at 60 the whole time
I also had a problem with keeping my aircraft in the rooms view maybe make it to where you cant go outside the boundries.

I got this error too



___________________________________________
ERROR in
action number 1
of Step Event
for object aimissles:

Error in code at line 3:
target.life-=10

at position 2: Unknown variable life

Edit: just wanted to add that this doesnt happen everytime i played it just one time it happened so dont think its that major I ignored it and it worked fine.


thank you for trying the game and giving feed back. i was aware of this bug and thought i fixed it. as youve said, its not major and hard to come by. i will look into it.

glad to know the game is running smoothly for most people.
  • 0
my jet fighting game.
my solar system generator. looking for someone to help work on it with me here
If i've helped you in any way you can repay me by downloading and rating the games.

#12 Gxiraudon

Gxiraudon

    GMC Member

  • GMC Member
  • 41 posts
  • Version:GM:Studio

Posted 08 April 2013 - 01:24 PM

Wow le me posting 5 yrs later. Download links are down. Is this project finished? Where can I download it then?
  • 0