• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
wulallala

how to stop enemies from moving to one point when lots of them are chasing one object

11 posts in this topic

i am making a top down game which lots of enemies are chasing one guy.

then,enemies would move to one point without any collision,they just overlay each other.

so ,is there any simple way to make them feel more real? make them not overlay with each other?

=================================

i have a bad solution.it doesn't work well.

my solution in simple:

foreach(around_enemy_arr in other)

{

vector a = normalize(self.positionvector - other.positionvector);

self.move_vector = self.move_vector + a;

}

this can work,but when plenty of enemies come very close to each other,they would shake!!!

i am sooooo confused.

please help.

0

Share this post


Link to post
Share on other sites

Well basically you can either live with it (lots of popular games ignore it for simplicity such as World of Warcraft) or first code a barebones collision system doing distance checks and find yourself tweaking it every once so often where it needs improvement :)

0

Share this post


Link to post
Share on other sites

You may look at this Boids page. It extends Craig Reynold's original Boid algorithm. Although it targets flock simulation, it shows a rule based system where one aspect is to avoid collision like you've described, besides avoiding obstacles, predator / prey behavior, and others.

 

However, w.r.t. the will to live also of soldiers ;) I want to hint that it is unlikely for a soldier in the 3rd row to try to push through the own lines towards the target. Perhaps you may try to drive the closest N soldiers purposeful towards the targets, while soldiers farther away just move up when a place gets available.

 

 i am reading the  <boids >, it really inspire  mebiggrin.png

thank you!happy.png

0

Share this post


Link to post
Share on other sites

Well basically you can either live with it (lots of popular games ignore it for simplicity such as World of Warcraft) or first code a barebones collision system doing distance checks and find yourself tweaking it every once so often where it needs improvement smile.png

i am trying to finish my simple collision system.

thank for your help.biggrin.png

0

Share this post


Link to post
Share on other sites

lots of popular games ignore it for simplicity such as World of Warcraft

Not for simplicity, or at least not only simplicity. Ignoring player or NPC collisions prevents you from doing some AI exploits and from harrassment in the form of area-denial. Both are important in a multiplayer game.

 

Imagine someone manages to get a boss creature and another NPC to walk into each other so they block each other, or imagine someone standing in the bank's door so nobody can enter. Such a design is hardly acceptable.

0

Share this post


Link to post
Share on other sites

 

Not for simplicity, or at least not only simplicity. Ignoring player or NPC collisions prevents you from doing some AI exploits and from harrassment in the form of area-denial. Both are important in a multiplayer game.

 

Imagine someone manages to get a boss creature and another NPC to walk into each other so they block each other, or imagine someone standing in the bank's door so nobody can enter. Such a design is hardly acceptable.

 

 

Thanks for expanding on it, samoth. I know all of that well but decided against more accurate wording to keep the idea brief.

 

Indeed what I mean by "simplicity" is that you as the coder/designer don't have to find and solve all the problems your game could get with colliding characters.

0

Share this post


Link to post
Share on other sites

Here is another nice page about steering behaviours: http://www.red3d.com/cwr/steer/

 

A nice thing with those, is that you can make your game avoid the need for proper collision detection, instead it makes sure the entities stay far enough away from eachother that collision doesn't happen.

 

One could argue that is some kind of collision handling too, and indeed it is similar, but it is a lot more simple to implement and get right.

You never need to detect actual collisions, all you need is a simple distance check

Edited by Olof Hedman
1

Share this post


Link to post
Share on other sites

Not for simplicity, or at least not only simplicity. Ignoring player or NPC collisions prevents you from doing some AI exploits and from harrassment in the form of area-denial. Both are important in a multiplayer game.

 

Ignoring Player and NPC collisions also prevents you from exploring a whole world of potential tactics in combat as well.

0

Share this post


Link to post
Share on other sites

I'd like to add to the growing throng suggesting you work on your enemy-to-enemy collision detection first. Even though it's likely you will need to add more behavioral rules to stop the mobs bouncing off each other, this first step will be necessary no matter what else you do.

 

Depending on how modular your player collision detection system is, you may be able to extend or reuse it for your AI.

0

Share this post


Link to post
Share on other sites

Here is another nice page about steering behaviours: http://www.red3d.com/cwr/steer/

 

A nice thing with those, is that you can make your game avoid the need for proper collision detection, instead it makes sure the entities stay far enough away from eachother that collision doesn't happen.

 

One could argue that is some kind of collision handling too, and indeed it is similar, but it is a lot more simple to implement and get right.

You never need to detect actual collisions, all you need is a simple distance check

This is so helpful.

Thank u :D

0

Share this post


Link to post
Share on other sites

Indeed collision makes the most sense.

Personally, I was faced with this issue no more than 2 weeks ago.

Instead of a strict collision system, I've created a similar behavior to collision, but instead, created what I would call "avoidance".

Whenever a collision would be imminent (distance between the active object and the collided object), the active object would change its course to "avoid" it (aka, pitch/pan its rotation/angle away from).

 

The upside is that I don't really handle collisions, which means that in some cases, two objects may be on top of one another, in such a way that movement, as a whole, is not impeded. But as a general rule, they'll try to create encirclement (find legal positions around their target).

 

Overall, it works well, and doesn't consume much process, which was the intent.

1

Share this post


Link to post
Share on other sites


Indeed collision makes the most sense.
Personally, I was faced with this issue no more than 2 weeks ago.
Instead of a strict collision system, I've created a similar behavior to collision, but instead, created what I would call "avoidance".
Whenever a collision would be imminent (distance between the active object and the collided object), the active object would change its course to "avoid" it (aka, pitch/pan its rotation/angle away from).

 

This is pretty much how the steering behaviours work, linked to by me and haegarr. (More accurately, the "avoidance" steering)

They are pretty easy to implement, and can be combined to create quite complex behaviours, apart from just avoidance (like queueing, flocking and path following).

I highly recommend checking through the java visualizations of them.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0