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.
Screen Shots (looks better ingame. Blur isnt good when its static!)
W A S and D keys
A left mouse click anywhere on the screen will create a light. use this to test the way the shadows work.
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.
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 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.
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 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 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.
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).
Jet sprite (place holder):
Prinz Eugn, aka Mark Simpson
Minimap based of:
The rest; (Programming, spriting, effects, etc etc etc)
Edited by tidus97, 03 October 2008 - 03:41 AM.