[Plugins/Behaviors] Rez Repo

Post your completed addons to share with the community

Post » Sat Apr 14, 2012 9:22 am

[QUOTE=Joannesalfa] Nice plugin! Is designed to make RTS game using your pathfinder plugin?[/QUOTE]

Yes you could with a bit of messing and lerp.
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Sat Apr 14, 2012 2:26 pm

http://dl.dropbox.com/u/41931267/Pathfinder.capx

The pathfinding seems to have severe problems... Not sure what's going on here. It seems to go through walls at a whimsy.
Example Uses the MoveTo behavior.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sat Apr 14, 2012 6:16 pm

@squiddster i've encountered the same problem with going through walls and some more (sometimes no path is found even tho there clearly is one)

http://dl.dropbox.com/u/45711709/testPath.capx

Btw. i stole your points for the visualisation of the path ;D
B
33
S
6
G
7
Posts: 338
Reputation: 7,424

Post » Sat Apr 14, 2012 6:20 pm

[QUOTE=sqiddster] http://dl.dropbox.com/u/41931267/Pathfinder.capx

The pathfinding seems to have severe problems... Not sure what's going on here. It seems to go through walls at a whimsy.
Example Uses the MoveTo behavior.[/QUOTE]

Thanks for this sqiddster.

This is due to bounding box which I will have to look into further. The way it checks objects is through the bounding box which doesn't seem to work when rotating objects and re-sizing to size not a multiple of the cell size e.g. 32 pixels.

For each cell on the grid the center coordinate x, y is checked to see if it lies within the bounding box of the object then sets blocking as necessary. For now I will create an action event to set cells by x and y position then you can block the map using construct events e.g. by testing overlap with a red blip or whatever. If you want to use objects as blockers don't rotate and use objects that are sized in multiples of whatever the grid size is e.g. 32 would equate to blockers sized 32, 64, 128 ... I'll have a look into a better method for blocking using objects. Sorry for the problems and I hope what I've said above makes sense.

B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Sat Apr 14, 2012 6:31 pm

[QUOTE=Ize] @squiddster i've encountered the same problem with going through walls and some more (sometimes no path is found even tho there clearly is one)

http://dl.dropbox.com/u/45711709/testPath.capx

Btw. i stole your points for the visualisation of the path ;D[/QUOTE]

I've noticed a bug occurring which might explain the not finding a path I'll have a look into it.
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Sat Apr 14, 2012 6:55 pm

[QUOTE=00Rez] [QUOTE=Ize] @squiddster i've encountered the same problem with going through walls and some more (sometimes no path is found even tho there clearly is one)

http://dl.dropbox.com/u/45711709/testPath.capx

Btw. i stole your points for the visualisation of the path ;D[/QUOTE]

I've noticed a bug occurring which might explain the not finding a path I'll have a look into it.[/QUOTE]

@Ize

I've figured out the problem whilst also fixing another problem which is always a good thing.

When first clicking you try to find a path to line_of_sight.x and line_of_sight.y this is the same position as the Player object so that's why it isn't finding a path. I changed this to ClickX and ClickY and it works now.

P.s. If you use another object that follows the Player object using lerp between the two positions of say 0.2 it would look really good.
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Sat Apr 14, 2012 7:12 pm

@Ize

Here is the amended capx!

Made all blockers cell aligned at 32 x 32 pixels and made all angles 0 for now. Will fix the Astar plugin and upload a new version soon.
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Sat Apr 14, 2012 7:53 pm

@sqiddster

Figured out the reason for the badness in your capx. You were setting moveTo every tick when it should only be set every time it reaches a cell position. Due to an issue with bounding boxes just re-size instead of rotating for now. Will upload a new version soon with a way to set the blockers with positions instead of objects for more control.

Here is the changed capx.
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Sat Apr 14, 2012 8:01 pm

All righty... so my objects were slightly resized/angled, which stuffed it up I see.

No problem. This isn't for me, it's for a friend. I'll check back every now and then to await the new version!
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sat Apr 14, 2012 8:10 pm

[QUOTE=sqiddster] All righty... so my objects were slightly resized/angled, which stuffed it up I see.

No problem. This isn't for me, it's for a friend. I'll check back every now and then to await the new version![/QUOTE]

Ok thanks for showing me anyways. New version up soon.
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests