Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Quad), 755 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: the cart before the horse [Re: Kartoffel] #421640
04/21/13 21:29
04/21/13 21:29
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline OP
Serious User
txesmi  Offline OP
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
I got some ideas around particles and bones


Re: the cart before the horse [Re: txesmi] #421708
04/23/13 14:44
04/23/13 14:44
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline OP
Serious User
txesmi  Offline OP
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
First steps on enemies behavior. The dynamic obstacle avoidance is a 2d geometric computation with no c_... involved.



Re: the cart before the horse [Re: txesmi] #421761
04/24/13 20:42
04/24/13 20:42
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
Originally Posted By: txesmi
First steps on enemies behavior. The dynamic obstacle avoidance is a 2d geometric computation with no c_... involved.

can you tell me a bit more info about it? do you use something like potential fields?


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: the cart before the horse [Re: sivan] #421764
04/24/13 21:40
04/24/13 21:40
Joined: Mar 2006
Posts: 2,252
Hummel Offline
Expert
Hummel  Offline
Expert

Joined: Mar 2006
Posts: 2,252
Just as a tipp, you can actually embed YT videos here. All you need to do is to switch to "using HTML (and UBBCode)". You get the html-stuff from under the YT video (Share->Embedding). wink

Re: the cart before the horse [Re: Hummel] #421791
04/25/13 13:07
04/25/13 13:07
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline OP
Serious User
txesmi  Offline OP
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
@Hummel,
html code? it sounds pretty dangerous laugh
I have to be blind because I can't find the switch to "using HTML (and UBBCode)" option anywhere. I reviewed my account preferences, I tryed to edit the topic because i read that UBB forum html option is in each topic. I'm lost. The youtube tag does not work.

@sivan
I will try to explain it. I devised it from scratch with the premise that all the enemies look for the player. In other cases it will not work because the whole algoritm remains in this premise.

I allocate all the enemies in an array that I sort each frame by distance to the player from nearest to farthest.

The next thing I do is create some obtruction lines with the near neighbors in the array when the distance between them is not big enough to permit the access and I allocate the lines in the narest of both enemies involved in the description of the obstruction line.

That is all the data I used to compute the avoidance. I move the enemies in the array order. First I set the player as actual enemys' objetive. I check if the ray between the actual enemy and its objetive is cut by any of the lines allocated in the previous members in the array, from previous to the first. In the case a line intersects I set the actual enemys' nearest line contructor enemy as the objetive for the actual enemy and I save the turn sign to enforce further intersection turns to same side.

Next I check the distance from the same ray above to the previous members in the array, from first (or the previosly set objetive) to the previous of the actual enemy. If the distance from the ray to the enemy is lower than the summatory of both enemies bounding radius, I set it as the actual enemys' objetive.

The last action is to turn the vector from actual enemy to its objetive in order to to get out of the bounds of the actual enemies objetive in the case that an intersetion has been detected.

It works pretty good and fast for my needs.

Re: the cart before the horse [Re: txesmi] #421792
04/25/13 13:39
04/25/13 13:39
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Originally Posted By: txesmi
I have to be blind because I can't find the switch to "using HTML (and UBBCode)" option anywhere.
Hummel is right, but he forgot that the HTML-switch is only available for moderators wink

Originally Posted By: txesmi
First steps on enemies behavior. The dynamic obstacle avoidance is a 2d geometric computation with no c_... involved.


Looks good, but I notice "jumps" in the position and angle of the enemies; there is something wrong with that and I guess you already know wink For a prototype I had also a plane with lots of enemies (10-100) targetting one single player entity. I did it even simpler, the boundary condition was that the area is more or less obstacle free:
  • calculate distance to player and check if we want to follow him
  • if yes, calculate the angle to him and turn to him
  • run into that direction by using vec_add and the direct vector from me to the player
  • after moving, check the player and all other enemies if I am in the boundary radius of them; if yes, push away with vec_add from them

This simple approach worked fine for me, you watch it here (Razor for my Valentine Trailer).

Re: the cart before the horse [Re: HeelX] #421797
04/25/13 14:31
04/25/13 14:31
Joined: Mar 2011
Posts: 3,150
Budapest
sivan Offline
Expert
sivan  Offline
Expert

Joined: Mar 2011
Posts: 3,150
Budapest
thanks for the detailed answer, quite interesdting, seems to be a unique solution, but sound a bit complicated, but if works fast, it's okay laugh but how do you ensure avoidance of other level geometries?

I read yesterday a robotics based simple method what I want to try out, where a grid or node based database is needed, static obstacles and dynamic agents have a repulsive and the target an attractive field effect, they can be summed and weighted, and each agent examines 4 neighbouring grids in the cardinal direction, and sets a moving force, this way a natural acceleration, deceleration, and obstacle avoidance can be achieved, and agent turning also can be handled easily. to avoid stucking in balanced areas a base force can be applied to each agents. just an idea I thought to share, and maybe I was not totally exact.


Free world editor for 3D Gamestudio: MapBuilder Editor
Re: the cart before the horse [Re: sivan] #421823
04/25/13 19:27
04/25/13 19:27
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline OP
Serious User
txesmi  Offline OP
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
thanks for the fresh ideas wink

I first tryed something similar to HeelX approach but did not find a convincing behavior. While thinking for a solution for playground limits I thought on this line system that lets me use segments as playground limiters and compute the whole enemy collisions same way. The static obstacles are supposed to be points+radius into the enemies array but without moving code. Since all the obstacles will be sorted in the array, the player collisions are very easy to compute too

Page 2 of 2 1 2

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