Jump to content
Sign in to follow this  
  • entries
    11
  • comments
    24
  • views
    10890

Code optimising and AI

Sign in to follow this  
steg

934 views

Just been optimising the code today in the little time I've had. A lot of the code was sloppy so simple to make more efficient. Started to implement the AI for one of the enemies in the game, this is named SentryCop (see image), his job is to fly around and shoot at anything that moves which includes the player. This was quite easy to do due to polymorphism and my use of generic classes. Got the sentrycop flying on a simple sine wave, got it to target various creatures/player on ground and fire! Not fully implemented yet but not bad for an hours work.

My top level creature class does implement line of sight using ray casting, this makes the creatures seem a bit more intelligent when chasing you (only aggressive creatures do this) , if they can't see you they slow down :-)

When sentrycop AI completed, the next on the list in no particular order (a mixed up list!):

Teleportation - Add teleporter, this needs connecting to another teleporter to work
UFO's - drop aliens, aliens move possibly shoot creatures and player - if kill alien, alien drops random weapon
Add random treasure blocks
Random name generator for creatures
Random attribute generator for creatures
Lift shafts - move up and down tunnels
Bomb weapon - throw and blows up blocks around it
Decoration objects, plants that grow very very slowly
Mobs who cannot swim and fall in water there energy should go down...

I also got some pictures printed out today at my local Boots shop of the game, they look really nice, really want to do some canvas large ones very soon...

Off to do some coding...

Oh, the sentrycop:

sentrycop.png

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!