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 Joncom

Quote from ckcollab
I'm not sure, but it's definitely not visible at {x: 64, y: -8}
For the sake of debugging, have your screen follow the position of the troublesome entity, perhaps.

1 decade ago by ckcollab

Forgive me, I'm pretty new! How do I make the "screen follow" an entity/position?

BTW, I did kinda get it figured out!

http://ckcollab.com/pick/

Just made an entity "Waypoint" with a property "next", a linked list of positions basically :)

1 decade ago by Joncom

Glad you got that sorted out.

How do I make the "screen follow" an entity/position?

// Like this...
ig.game.screen.x = entity.pos.x + entity.size.x/2 - ig.system.width/2;
ig.game.screen.y = entity.pos.y + entity.size.y/2 - ig.system.height/2;

1 decade ago by creadicted

deleted

1 decade ago by mahgo

Hi Hurik,

Did you have an ETA on when you were going to make the paths more natural?

1 decade ago by Joncom

Quote from mahgo
Did you have an ETA on when you were going to make the paths more natural?
I could be wrong, but I don't believe hurik has any plans to make the paths more natural. I'm basing this assumption based on the fact that it's be 8 months since the last update.

1 decade ago by mahgo

Yeah seems like a fair assumption!

Any plugins out there that do more than 45 degree paths, and take entity size into account?

1 decade ago by Joncom

Quote from mahgo
Yeah seems like a fair assumption!

Any plugins out there that do more than 45 degree paths, and take entity size into account?
hurik's plugin already provides the groundwork. You can make some improvements yourself using techniques found here. I believe hurik's pathfinding plugin is the best one publicly available. Or maybe Impact++ has some extra features? I'm not sure...

1 decade ago by collinhover

Impact++ pathfinding can handle most paths and does account for entity sizes, walking around corners, jumping, climbing, avoiding other entities, fleeing, etc. It works best for entities that are within 3x size of the tiles, but recent changes should have made it better for bigger entities. I'm not sure what more than 45 degree paths means, but you can get a good idea of the pathfinding in Impact++ if you check out the creatures and pathfinding level in the SUPER COLLIDER! demo: http://collinhover.github.io/impactplusplus/demo/index.html

1 decade ago by hurik

hi,

i added the nicerPath option. it makes the paths nicer. I made it on a request and i doesn't tested it very much.

here an example image:
/><br />
- red is the normal path<br />
- green the new and nicer<br />
<br />
<blockquote><strong>nicerPath (since v1.3.0)</strong><br />
Activate it with nicerPath: true, in your entity. Check example-np!<br />
<br />
<strong>Attention</strong><br />
- directionChangeMalus45degree, directionChangeMalus90degree and _preferManyWaypoints will be set to default values. Don't alter them.</blockquote><br />
<br />
code and download: <a href=https://github.com/hurik/impact-astar-for-entities

1 decade ago by hurik

hi again,

added support for entities which are bigger than the tilesize. it was surprisingly easy ...

here an example image:
/><br />
<br />
<blockquote><strong>ownCollisionMap (since v1.4.0)</strong><br />
<br />
Activate it with ownCollisionMap: true, in your entity. Check example-oc!</blockquote><br />
<br />
code and download: <a href=https://github.com/hurik/impact-astar-for-entities

1 decade ago by BennyT

Hi Hurik,

This is my first attempt at using your plugin and working with the a* algorithm.

I have an enemy entity that needs to catch up to a player entity chasing him down the screen for a top down game.

I have implemented your plugin and everything looks fine, except the enemy's position is never updated.

when i log out the this.path value, I can see it trying to get closer to the player's position but somewhere between then and the follow path call it gets lost.

Here is the update function:
		update: function() {
			console.log("Enemy is: (" + this.pos.x + ", " + this.pos.y + ")");
			// Update it every 2 seconds
			if(this.pathTimer.delta() > 0) {
				// Get the path to the player
				this.getPath(ig.game.player.pos.x, ig.game.player.pos.y, true);
				this.pathTimer.reset();
			}
			
			// Walk the path
			this.followPath(this.speed, true);

			// Update the animation
			this.currentAnim.gotoFrame(this.headingDirection);

			// Heading direction values
			// 1 4 6
			// 2 0 7
			// 3 5 8
		},

1 decade ago by hurik

sorry for the late answer ...

can you send me the code? then i can check whats the problem ...

andreas@giemza.net
Page 3 of 3
« first ‹ previous next › last »