| 09-03-2007, 09:20 PM | #2 |
What does "Nhoek" mean? |
| 09-03-2007, 09:42 PM | #4 |
Googled Nhoek and came up with this =P: http://www.youtube.com/watch?v=TUYT3Ni9pvo But, it's a neat system. It probably wouldn't be useful all that often, but in some situations it would be very nice to have. |
| 09-03-2007, 10:20 PM | #5 | |
The title is not clear, please indicate what does mean Nhoek. Meanwhile I'll rename it into "Outside/Inside Polygon Detection System". EDIT: I've checked it and the code arrangement can be improved greatly.
I took the freedom to make those modifications for you.
I'd love that Pipedream would check this system, in my opinion is very interesting and useful. |
| 09-04-2007, 08:48 AM | #6 |
Moyack: thanks for making the improvements. The rename sounds fine! Keep it that way. I'm dutch. Nhoek is dutch. It translates to Polygon. A friend of mine is making a spell with this system. He allows the hero to draw a polygon by walking around. While running around to create the polygon the hero places pathing blockers behind him. Enemies will be blocked from going forward, and if they're not fast enough will get trapped inside the polygon. Once the polygon is created all enemies within it are damaged depending on the surface size of the polygon. The smaller it is, the more damage the enemies within it get. Ps: didn't know you could use a variable when you declare array size inside a struct. I guess you can only use a constant. The map documentation might be a little flawed now but that's okay. |
| 09-05-2007, 05:59 AM | #7 |
I think I've mentioned this earlier... but do you have an anti-inversion system? Because when I tested it, I somehow inverted the shame, and the system went all screwy uppy. |
| 09-06-2007, 02:42 PM | #8 |
What is inversion? I have no idea what you mean by 'inverted shape' How do you 'invert' a polygon? That doesn't make sense. |
| 09-06-2007, 02:47 PM | #9 |
I think Tide-Arc Ephemera is referring to crossing the shape's lines. |
| 09-08-2007, 09:40 PM | #10 |
If someone is says that the system does not support crossing lines, then he is right. Support for this would be stupid though: a polygon with crossing lines does not have a properly defined area. You could define the area of the polygon as it's outer rim, but then there is no reason to create crossing lines within that outer rim. |
| 09-09-2007, 05:55 AM | #11 |
It becomes multiple polygons then, doesn't it? Can you not find the areas of those? |
| 09-12-2007, 05:00 PM | #12 |
I suppose you could divide the 1 polygon that has lines crossing into multiple polygons with no crossing lines but that wouldn't be useful for anything so I'm not adding support. |
| 09-12-2007, 05:48 PM | #13 |
It's not stupid, you can certainly define a sensible area for such an arrangement. It's also useful, for example if you have a group of four units and you don't just want to draw a convex hull around them. The problem is closely related to convex hulls except that instead of allowing every edge from a set of nodes you only allow 2 or 4 edges from a node depending on the existence of an intersection. The intersection problem is separate and tricky though. I think that in general though the convex hull is going to generate more intuitive and useful spells. It's far more likely that someone playing the game will drop a set of points as opposed to drawing a polygon. Then, the map writer takes the convex hull and passes it to this system, which could do well to have a case optimized for convex polys. |
| 09-13-2007, 03:22 PM | #14 |
I don't follow your description of how you would define the sensible area for a polygon with crossing lines. Tell me :D "you only allow 2 or 4 edges from a node depending on the existence of an intersection". What are the edges of a node? |
| 09-13-2007, 04:33 PM | #15 |
You start out with an undirected graph of nodes. For a polygon each node has two edges, one to each neighbor. Then you search for intersections between all (non adjacent) segments. You split the graph at an intersection and add a node in between with links to each pair of nodes whose line segments cross. When you're done you'll see a set of simple polygons tiling a region on the plane rather than one big mess. |
