Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Tank Killer

Author
Message
Kwiki Mart
20
Years of Service
User Offline
Joined: 9th Dec 2003
Location: PA
Posted: 18th Dec 2003 19:39
I am almost done the programing of my game but I still need to find a way to make some basic AI. Right now all i can do is shoot the enemy tank which just sits there. I am looking for it to shoot back and move around. I have no knowledge of programing AI. The only thing i can think of is having the ai check to see where i am then move towards me and when in range to shoot. Is this the best way or is there somthing that i am not thinking of? any help would be appreciated. The graphics are crude but i'll revamp them when the coding is done. Its a clone of the game combat. well the tank part of it.

pic 1

pic 2


On target, On time!
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 18th Dec 2003 19:44
thats lookin like a good game! the way you've suggested is quite a simple way of doing it, but you can build on that...
maybe the enemy could run away from you when its health is low?
maybe it could learn to use cover to protect itself?
the more complex the game, the more indepth ai you are able to use, just adding powerups or weapons that can be collected adds a whole new dimension

you'll also have to make sure it doesn't go through those barriers you've got there, as that wouldn't look right


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
outSync
20
Years of Service
User Offline
Joined: 23rd Aug 2003
Location:
Posted: 18th Dec 2003 21:46
I'm working on a similiar tank style game (though the graphics aren't near as good right now) and I've got everything pretty much set except for the AI.

My basic idea is to know when he hits an obstical, and move accordingly as basic movement. If the play comes within a certain range, he will target and fire.

I'll let you know the end result

2D Fan/Addict/Programmer
outSync
20
Years of Service
User Offline
Joined: 23rd Aug 2003
Location:
Posted: 18th Dec 2003 23:05
See the code for passive movement (basic). If the A.I. hits the corners, he randomly chooses to go left, right, up or down. Also, when the aitest variable reaches 100, he will change direction.

Very simple, and you can change this to a sprite really easily. To make it work with obsticles, just go:

IF SPRITE COLLISION (not sure if this is correct command)
ex = oldex
ey = oldey
ai = rnd(3)+1
endif

Hope it helps. I'm working on an attack mode, so stay tuned

2D Fan/Addict/Programmer
Kwiki Mart
20
Years of Service
User Offline
Joined: 9th Dec 2003
Location: PA
Posted: 19th Dec 2003 01:49
Hey thanks for the help. I'll try it as soon as i get home. Also I am having trouble with the score text. It flashes and i cant seem to get it to appear solid. any ideas? I just had a thought that if I make a bitmap that says score it should not flash at all, right? I am not at MY pc right now so I dont have my code handy.

On target, On time!
outSync
20
Years of Service
User Offline
Joined: 23rd Aug 2003
Location:
Posted: 20th Dec 2003 03:55
Well, besides that, you could simply use a STRING command. The text won't flash, and you can set the score quite easily using variables. Not to mention position it anywhere you want.

2D Fan/Addict/Programmer
Lewiji
20
Years of Service
User Offline
Joined: 25th Dec 2003
Location:
Posted: 30th Dec 2003 22:38
You also need 2 detecting 'sticks' in front of the tank on either side. Make the tank move towards you, and if the left stick overlaps something rotate it right, if the left overlaps rotate right and if they both overlap rotate it either way 180°. This will make it dodge obstacles.

<intelligent, witty comment here>
heartbone
21
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 31st Dec 2003 02:42
Hey Naval Gunz
this DarkBASIC game has kind of a naval gun theme.

And you might like to see this DarkBASIC Professional combo 2D/3D tank game.

The more you see, the more you know.
The more you know, the more you see.

Login to post a reply

Server time is: 2024-05-12 10:01:36
Your offset time is: 2024-05-12 10:01:36