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.

Code Snippets / AI demo- fight the computer

Author
Message
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 11th May 2004 15:23 Edited at: 11th May 2004 15:32
A few days ago i started working on this little AI demo. You're in a small cube world, and you must beat the computer in a small duel (with sword cubes!). I'll list what the AI player does:

-if you get within its hearing range, it will become aware of you.
-if you get within its seeing range, it will become aware of you.
-if you get out of its max-range, it will forget about you.
-if its aware it will try to attack you.
-if its hp is low it will run away, heal, then come back.
-if its hp is low and it dont have mp left, it will keep running until you kill it.
-theres some gravity, and sliding collision in it too.
-It is media free

Controls:
Mouse to move
Space to jump
Enter to attack (with cube sword)
Control to heal (using Mp)
Esc to exit.

Anyway, i hope you find it useful. Please tell me if there's something that should be worked on, this is my first AI attempt, so it might have a few glitches.



.........what's the point of reading this?
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 11th May 2004 20:14
that's pretty cool

if I = 1 then I = 1 else I = 0
comando 300
20
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 11th May 2004 22:53
it killed me , but it's cool

CURRENT PROJECT: RETRO PAC-MAN
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 12th May 2004 03:50
Yeah, the comp is pretty much unbeatable. If you want a fair go, try lowering its stats, or increaing yours. Thanks for the comments.

.........what's the point of reading this?
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 12th May 2004 05:28
Dark Sephiroth, this is very good AI. If nothing, this should be the standard/barebones for any FPS with AI.

I'm sure many people(like myself) will learn a few techniques from this.



A book? I hate book. Book is stupid.
(Formerly known as Yellow)
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 12th May 2004 06:13
Thanks MikeS. Im making all this new stuff to it right now, like FF style limit breaks, and maybe even a tournament mode. Ill try to add something today.

.........what's the point of reading this?
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 12th May 2004 09:58 Edited at: 12th May 2004 10:01
I got a cold and was home from school today, so i just sat here for the last 3 hours playing games, and making this one. Ive added a few things to it:
-3rd person view. Move with arrowkeys.
-Camera slide collides with wall.
-Player doesnt use block-sword, he now throws crates
-A crate limit break, it hits enemy with remaining mp.
-New heal effect. (press shift)
-5 randomly placed healers. 3 for hp and 2 for mp. they heal 25% of the stat.
-Still media free, and inbuilt texture for crates.
-Before i didnt mention that its made in DBC.



.........what's the point of reading this?
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 13th May 2004 04:03
If it's too easy or hard, just change the stats of the player/enemy. I used color object, and set a random color above 100, so it flashes. Glad you like it
Im now working on final update, with things like enemy patrol.

.........what's the point of reading this?
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 13th May 2004 16:54
This is very good! I especially like all those nice effects. very cool.

Infra-Dark
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 14th May 2004 05:36
Thanks for the compliments
The final update includes:
-everything from 1 and 2.
-the enemy no patrols when he is unaware about you.
-while patrolling, if his hp is low he uses his heal.
-if he doesnt have the mp to heal, he will track down the appropriate healer (withing 1000 dist) and use it to heal himself.

If there are any bugs or glitches let me know, and ill fix them. Anyway, i hope you like it



.........what's the point of reading this?
Kohaku
20
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 14th May 2004 08:11
Thats great!

Infra-Dark
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 14th May 2004 09:58
Thanks again Aura Im now going to make a good copy of this game, without the messyness of this one. Itll be a 6 player game with two teams. Ive already started on it, and ill post back as soon as I can.

.........what's the point of reading this?
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 27th May 2004 21:07
It's an incredibal game!


I beat the computer!

The happenings of tommorow are behind us now
sadsack
20
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 30th May 2004 00:29
Thank you I can use your code in my civil war game, I think renny
Mytho
20
Years of Service
User Offline
Joined: 30th May 2004
Location: USA
Posted: 2nd Jun 2004 00:29
nice, smooth system.

bug- if the enemy is running parallel to a wall, and you are chasing, he will hit the upcoming wall, you will run into his behind, and he'll be 'stuck'.

Dare to attempt the MMORPG.
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 2nd Jun 2004 15:26
Yeah i noticed that, it's probably the only way to win if you're out of mp at the end, he just keeps running otherwise.
I decided not to make the new one. It would kinda set me back on my real project, which I'll post the details on in about a month. Anyway, thanks for the positive feedback guys

.........what's the point of reading this?
DARKGuy
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 3rd Jun 2004 05:13
I've got an idea (from my old MS-DOS programming times), when it gets close to the wall (you can use math calculations for that if you want) select a number beetween 8 and multiply it by 45 (using wrapvalue if something strange happens), then the enemy will select a concrete angle and will move, instead of getting stuck...I can fix that if you want

BTW I really loved that game...I played it for almost half-hour and didn't killed that f***n cone hahaha nah just joking, it's well balanced, and really loved that limit break lol!

nice nice game

:: Pentium 300 Mhz, 8Mb video card, 64Mb RAM, 5 gb & 1.6 gb HD's, W98SE, Sound Blaster AWE 32 ::
CPU
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 20th Jun 2004 03:54
very very good, like darkGuy said it's easy when the enemy got stuck in a corner...

Sparring - Loved by many, Pefected by few.

I'm going to live forever, or DIE IN THE ATTEMPT!!!"
Black Hydra II
20
Years of Service
User Offline
Joined: 26th Nov 2003
Location:
Posted: 20th Jun 2004 04:02
Wow... Thats awesome.

The one problem is it is so damn hard to find him! Apparently if you get to far he disappears... so he's hard to track. He is definitely more skilled than me.

"Damn had to remake account!" direct quotation from previous account.
Murdock 743
20
Years of Service
User Offline
Joined: 16th Jun 2004
Location:
Posted: 20th Jun 2004 04:44
sweet game the AI is awsome and I too beat the game first try by cornering him.
Cheers,
Christian
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 8th Sep 2004 11:53
good impresive i love it youre really good.


www.dragonseige.gpox.com
vampyre
22
Years of Service
User Offline
Joined: 14th Nov 2002
Location:
Posted: 11th Sep 2004 08:11
I think you are A brilliant coder NathF
Dot Merix
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 11th Sep 2004 10:38
very impressive.. nice effects

- Merix

Athlon xp 2400+, 1.0GB Ram, Radeon 9800PRO 128mb
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 11th Sep 2004 11:12
forizil in my nizle youre good

www.dragonseige.150m.com
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 11th Sep 2004 11:39
Whoa, some replies, and I thought this thread had died out.
Thanks guys

I'm adding some similar AI to my compo entry, BattlefieldMT.

(Yes Gothboy, I got your email. I might not have the time to help you now as Im working like mad to finish my compo thing. Dunno, maybe sum other time... like in a month? )

-Formerly DarkSephiroth-
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 11th Sep 2004 12:07
thank you cause thats all i need the i can get the reall feal of theings and i can start coding the eye candy like the menu you really do have some talent.

www.dragonseige.150m.com

Login to post a reply

Server time is: 2024-11-23 19:58:06
Your offset time is: 2024-11-23 19:58:06