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.

Newcomers DBPro Corner / Zombie problems

Author
Message
sprite
18
Years of Service
User Offline
Joined: 22nd Apr 2006
Location:
Posted: 15th Apr 2008 01:02 Edited at: 15th Apr 2008 01:02
hi all

I ran in to another problem with my program an need a hand. I'm trying to make the zombies do the following.
1. Move each zombies around the world randomly and not follow the player.
2. Zombie collision with the world so they don't walk off the world
3. Create a circle around the zombie so they know when to follow the player

object 11 is the world map
object 12 is the player




Sorry to ask so much its the last part of my first game.
Thank you so very much for your help.

I'll add something later on.
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 15th Apr 2008 11:45
1. Not really sure how to go about this one, maybe a random pathfinding code? Otherwise have them walking in circles.

2. Have a look a sparkys collision dll. It's the best all in one collision dll!

3. You could use raycasting. And when the player hits the ray the zombie starts to follow the player!

Hope that helped!


StevetS
20
Years of Service
User Offline
Joined: 19th May 2004
Location:
Posted: 15th Apr 2008 15:19
I think what you're after is basic ai - do a search on it or better yet check out Zotoasters thread:

http://forum.thegamecreators.com/?m=forum_view&t=63411&b=7

This covers setting up and moving your zombies around using 'states'

With regards to keeping them within your map area (assume thats what you mean) set limits such as 'if zombie(nr).x > 500:zombie(nr).x=zombie(nr).oldx' for example

The link above covers having your zombies react when close to the player. You don't need to create a radius or circle around them, simply check the distance between the player and each zombie (use pythagoras theorum)

Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th Apr 2008 00:10
I wrote a couple of zombie AI code in the codebase.

Try http://www.thegamecreators.com/?m=codebase_view&i=9934fea4f3846d53c140cb0ead376fb2
And http://www.thegamecreators.com/?m=codebase_view&i=a587c3a9a641fafffc119b730bcea0d8

Hope this helped.

3700+ Athlon 64 - Geforce 7600 GS - 2GbDDR2 RAM - 40Gb Hdd (In this pc) - Windows Vista Ultimate (x86)
sprite
18
Years of Service
User Offline
Joined: 22nd Apr 2006
Location:
Posted: 19th Apr 2008 23:58
Thanks all got it working using the examples.

I'll add something later on.

Login to post a reply

Server time is: 2024-09-27 14:26:26
Your offset time is: 2024-09-27 14:26:26