Page 1 of 1

Creatures bumping into each other

PostPosted: 03 Jun 2016, 21:20
by paul424
What do you think of creatures bumping onto each other ? It is bad IMHO. To solve that we could either a) add a physics to our game ( add a barrier for each ) or b) use spatial tree ( like mine quadtree https://en.wikipedia.org/wiki/Quadtree) c) use spatial subdivisions. f.e. divide map into size R grid squares. then for each square, compare the content of the square to its surrounding squares and do n^2 check on all elements in those buckets for collision

Re: Creatures bumping into each other

PostPosted: 07 Jun 2016, 16:07
by hwoarangmy
Dealing with creature collision is very hard and much more complex than what you seem to think. What would happen if creatures collide in a corridor one wanting to go up and the other wanting to go down ? What will the other creatures will want to do ?
You can divide the tiles as much as you want, there is no solution. At most, you can try to add something smarter than the random offset I added when creatures are walking but that's it. Going further is an enormous work for a, IMHO, not that usefull feature.