Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AbrahamR, AndrewAMD, ozgur), 763 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Companion_ai [Re: Erick_Castro] #275969
07/02/09 22:45
07/02/09 22:45
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
Apart from the code, wich you can look though of course, here the mechanics of that guy:

---

This AI is based on finding a movement path without
the need for creating a node-based pathfinding grid.

The nodes are created "on the fly" by the player when he moves.

The player continiusly "drops" nodes when walking.
As the nodes are in a linked list, they somehow form a
"chain", wich is the path for the AI to move.

The AI guy looks for the most recent node, that he can directly reach.
Once he is there, he will go to an even more recent node.
Similar to a Dog, sniffing his way.

This way the AI follows the player.

I dont remember exactly, but I think, when the AI gets stuck,
he walks back his way, until he can find a suitable node again
to follow.

---

The other part is the movement script, wich uses
several traces, that makes the AI avoid to get to close to walls.
So before colliding directly with something, the AI usually pushed itself away from the obstacle or turned a bit.

The same with jumping. The Players actually hover over the ground up to the hips.
Similar to humans, the legs are basically
fully flexible to adapt to narrow obstacles on the floor.

If the trace dow finds a distance lower than the leg-hight, the
AI pushes itself up. If it is higher than the hip-hight, it
stops pushing, and starts to fall.

Re: Companion_ai [Re: Damocles_] #276009
07/03/09 07:46
07/03/09 07:46
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Thank you Damocles! =) This is very usefull!!!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Companion_ai [Re: 3run] #278885
07/15/09 23:00
07/15/09 23:00
Joined: May 2006
Posts: 30
awstar Offline
Newbie
awstar  Offline
Newbie

Joined: May 2006
Posts: 30
when player jumps , companion moves under him keeping player on top......

Re: Companion_ai [Re: awstar] #279576
07/18/09 09:28
07/18/09 09:28
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I think thats becouse of player.x, "companion" is trying to get in to player.x position


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Companion_ai [Re: 3run] #279632
07/18/09 14:28
07/18/09 14:28
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
The companion tries to get to the player as close as possible,
and both player and bot automatically step onto obstacles to move over them.

Here the bot sees the player as objstacle and steps onto him, or
the other way around.

you can avoid that by letting the bot stop earlier or let the bot not step onto the player (ignoring him in the trace)

Re: Companion_ai [Re: Damocles_] #279662
07/18/09 16:37
07/18/09 16:37
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I'll make if comparison, with distanse to player, if closer then 400 quants, follow player, if closer 50 quants stop & attack... I think that way this AI is the best for my zombie shooter game! smile


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Companion_ai [Re: 3run] #286509
08/25/09 15:32
08/25/09 15:32
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline
Member
Muhsin  Offline
Member

Joined: Nov 2008
Posts: 196
the wrong place
Does the companion attack enemies, if they attack the player?


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!
Re: Companion_ai [Re: Muhsin] #286527
08/25/09 17:00
08/25/09 17:00
Joined: Feb 2009
Posts: 2,154
Damocles_ Offline
Expert
Damocles_  Offline
Expert

Joined: Feb 2009
Posts: 2,154
No thats not implemented in that code.

Its basically just a demonstration to get
an active entity to follow you.

To extend it to an attacking companion,
you need to let the companion switch from
following the player to chasing the enemy.

(using a statemachine or something similar)

Re: Companion_ai [Re: Damocles_] #286687
08/26/09 14:38
08/26/09 14:38
Joined: Nov 2008
Posts: 196
the wrong place
Muhsin Offline
Member
Muhsin  Offline
Member

Joined: Nov 2008
Posts: 196
the wrong place
OK, thanks for the help


Come and play my new browsergame - Valley Of Wolves:

http://www.mafiacreator.com/ValleyOfWolves

Hurry and be the first to take over the different business' in the Valley Of Wolves, before anybody else does it!
And be the most feared MafiaBoss in the World!!
Page 2 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1