[Behavior] Grid based sight

Post your completed addons to share with the community

Post » Wed Mar 21, 2012 2:43 pm

[QUOTE=00Rez] @seven
@Beurt

New version uploaded still alpha let me know what you think and if any problems occur...

Rez[/QUOTE]

Updated today see first post.
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Thu Mar 22, 2012 12:01 pm

Update!

Upcoming changes (r2.2):

- Radius is now set within actions.

- The action to draw sight cells now has the options to draw "seen", "not seen", etc.

To do:

- Need to remove various crap from the scripts.

- Better opacity rules when drawing cells.

- Choice of using custom opacity rules.

- Make smooth grid movement work.
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Mon Mar 26, 2012 4:00 am

I'm impressed at the performance of this, compared to event-based field of view. However, there are a number of bugs with pathfinding. I've modified your demo to demonstrate: here.

You can cause a crash a number of different ways:
-Place a second instance of the Enemy object.

-Require the Enemy to find a new path as often as it moves.

-Right-clicking excessively will eventually cause a crash. This usually happens when the Enemy is adjacent to a Blocker object (orthogonally or diagonally) even when the object is not in the way of the path. Oddly enough, this never becomes an issue if you control the player with the arrow keys.

There are also some unexpected behaviors which, although not exactly bugs, would still be considered unexpected:

-The behavior assumes all objects are equal to the grid size. This becomes an issue e.g. if using a tiled background for the walls.

-In some cases, the behavior thinks the object for which fov is being calculated is inside a wall. I haven't yet been able to reproduce this outside of one project, but one solution is to ignore the tile the object is currently occupying.seven2012-03-26 04:01:17
B
11
S
2
Posts: 35
Reputation: 868

Post » Wed Mar 28, 2012 12:14 pm

[QUOTE=seven] I'm impressed at the performance of this, compared to event-based field of view. However, there are a number of bugs with pathfinding. I've modified your demo to demonstrate: here.

You can cause a crash a number of different ways:
-Place a second instance of the Enemy object.

-Require the Enemy to find a new path as often as it moves.

-Right-clicking excessively will eventually cause a crash. This usually happens when the Enemy is adjacent to a Blocker object (orthogonally or diagonally) even when the object is not in the way of the path. Oddly enough, this never becomes an issue if you control the player with the arrow keys.

There are also some unexpected behaviors which, although not exactly bugs, would still be considered unexpected:

-The behavior assumes all objects are equal to the grid size. This becomes an issue e.g. if using a tiled background for the walls.

-In some cases, the behavior thinks the object for which fov is being calculated is inside a wall. I haven't yet been able to reproduce this outside of one project, but one solution is to ignore the tile the object is currently occupying.[/QUOTE]

Thanks for this seven.

I'll have a look. With regards to tile size are you saying to calculate the cells that are blocked based on the dimension of the object rather than position and tile size?

The wall thing occurs when you place the "player" on top of a cell that is blocked didn't think it blocked itself?

Working on the pathfinding
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Fri Mar 30, 2012 12:04 am

@blocking cells based on the dimension of the object: yes. I think it's still safe to assume that all objects for which sight is calculated will be a multiple of the tile size; but if the object is 2x2 (in grid cells) or is a Tiled Background that is extended outward, more than just the origin of the object should be recognized.

@walls: sorry for not being clear. the player can be to the left of a sight-blocking object (presumably to the left because that is the origin of the object) and have all sight cells disappear, as if the player actually went inside the wall. I haven't been able to isolate the problem, but it's enough to ignore the tile the player is currently occupying when calculating fov.seven2012-03-30 00:04:50
B
11
S
2
Posts: 35
Reputation: 868

Post » Fri Apr 20, 2012 9:49 am

Bug:

Using your example, if I scroll the layout at all based on the player position it completely screws up the pathfinding.
B
3
Posts: 4
Reputation: 283

Post » Fri Apr 20, 2012 9:54 am

[QUOTE=Rankith] Bug:

Using your example, if I scroll the layout at all based on the player position it completely screws up the pathfinding.[/QUOTE]

Sorry about this. Use my path finder here!

I'm currently in the process of re-doing this plugin. I would suggest using only the sight part of it and not the path finding.
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Sat Apr 21, 2012 8:54 am

Yar it was just convenient to use both haha. Originally was just gonna use for site but had that addon right there :P.
B
3
Posts: 4
Reputation: 283

Post » Tue May 01, 2012 9:13 pm

Hi there
Firstly, Id like to congrat Rez for your incredible work and thanks u for sharing it here.
Im using your awesome behaviour (Im really new with construc) but theres one thing I dont know how to make.
Id like to move to player only one grid-box (I dont know how to call each boxes of the grid, sorry). It doesnt mind if you click five boxes far from the player, the interesting thing would be to have the option to "pause" the path of to move only one step further.
Im using "goto next position" but cant make this happens like that.
Thanks for all your help people.

PD: sorry for my bad english
B
14
S
4
G
3
Posts: 106
Reputation: 4,792

Post » Sun Jul 29, 2012 12:18 am

It doesn't work (r99) I tested the example that comes with it and it also doesn't work, none of the cells appear
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: Sobieski74, Yahoo [Bot] and 1 guest