Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by hurik

i'm working on a steering behaviors plugin for impact. it is an early beta, but it would be very nice if there would be some people which are willing to help me.

first some information about steering behaviors:
- Craig Reynolds page: http://www.red3d.com/cwr/steer/
- Chapter 3 in "Programming Game AI by Example" by Mat Buckland: http://www.jblearning.com/Catalog/9781556220784/student/ (I'm using this nice book ...)

at the moment i have implemented:
- seek
- flee
- arrive (not working very well ...)
- wander
- wall avoidance
- flocking (separation, alignment and cohesion)

here a demo which uses wander, wall avoidance and flocking: http://www.andreasgiemza.de/javascript/impact-steering-behaviors/

edit: the example now also uses flee. the white triangles are sheeps and the red one is a wolf which isn't hunting, but when the sheeps get to near they flee.

the problem is that i have changed the entity update function, the calculation of the forces is a very sensible and i have to use very strange values to get a nice behavior. and there a lot of other problems to get this plugin in a nice shape so everyone can use it.

so if you want to help, contact me.

here is the github repo: https://github.com/hurik/impact-steering-behaviors

1 decade ago by vincentpiel

those tuts are fine also :
http://gamedev.tutsplus.com/series/understanding-steering-behaviors/

demo is looking nice !

1 decade ago by Philip

You should consider using a high performance vector library like https://github.com/toji/gl-matrix

Your vector lib is creating way to much objects per frame. Thats why your system lag is quite high and the garbage collector steels performance from you.

Unfortunately this is no simple file replacing task. Lots of code must be rewritten. And another unfortunately, cause I don't have time right now to help, but would like to. Would be great to have for impact.

1 decade ago by vincentpiel

For the garbage collector issue : another way is to use a pool of vectors.
Still needs some re-coding, i couldn't compare, but it's worth thinking about it...

1 decade ago by hurik

How do I track objects per frame!?!?

1 decade ago by Philip

You can't directly track objects per frame but you can look into the memory consumption in the dev tools under Timeline. Everytime the curve goes down the garbage collector did his thing.

1 decade ago by hurik

I have started to rewrite the code with a better vector library and with the focus not to create too much garbage.

At the moment only wander is implemented ...

Does someone want to take a look over the code? Am I on a better way? Feedback and help is appreciated.

Edit: Now it is pushed: https://github.com/hurik/impact-steering-behaviors

1 decade ago by hurik

i made a lot of updates:
* with the new vector library the runtime is reduced by a quarter
* improved getNeighbors also reduces runtime by a quarter
* added arrive, pursuit, evade, interpose and offset pursuit
* more debug menu options
* every steering behavior has now his own example
* the plugin is not injecting the entity class anymore, it is extending it

here are demos of the examples:
* Flee and Seek: http://www.hurik.de/steering-behaviors/seek-and-flee/
* Arrive: http://www.hurik.de/steering-behaviors/arrive/
* Pursuit and Evade: http://www.hurik.de/steering-behaviors/pursuit-and-evade/
* Wander: http://www.hurik.de/steering-behaviors/wander/
* Interpose: http://www.hurik.de/steering-behaviors/interpose/
* Offset Pursuit: http://www.hurik.de/steering-behaviors/offset-pursuit/
you also can adjust the important variables ...

but there is a lot todo:
* getNeighbor must be improved. now it is fast but when you spawn a lot of units or bullets it not that good anymore ...
* the steering behavior hide is not easy to implement ....
* i have a lot of vectors. some could be joined ...
* arrive must be improved ...
* a lot of improvement here an there ...

i'm happy when there a people which want to help!!!

the repo and the download:
* repo: https://github.com/hurik/impact-steering-behaviors
* download: https://github.com/hurik/impact-steering-behaviors/archive/master.zip

1 decade ago by alexandre

Very interesting work, Hurik. Doing a roguelike test and this could be very useful. Some uncertainty as to the ability to quantize the movement to suit the theme (as in all roguelikes, player moves one step, then NPCs move one step). Will send you feedback.

EDIT: this lib seems quite flexible and powerful; it is however overkill for the needs of a simple roguelike like the one I was test-building. Will keep it in mind for future though. Thanks for sharing.
Page 1 of 1
« first « previous next › last »