Walkable areas.
by Gary Preston · in Torque Game Builder · 04/29/2005 (8:49 am) · 6 replies
I'm currently making a test 2D adventure game, by test I mean its more of a proof of concept than anything else.
Using the following quick image as an example "room", lets say I want to restrict the players movement to the pavement only (highlighted in a pleasing blue :P) ignoring the Z-Ordering issues of when the player moves up the path and should be obscured by the building.

One method I've considered would be to place a fake transparent object (may need several) the same size as the background. Then setup a custom poly collision area to prevent the player straying from the path.
Another idea would be to create an editor that allows me to draw a border around the walkable area. Then store this border to compare the players current position against. I guess rather than storing the values, I could instead construct the CustomPoly for the fake object using this same method (allowing for the limitations concave polygons).
I just have this feeling that I'm missing a much more sensible or flexible way of doing this, so I'd like to throw this open for suggestions/ideas :)
Using the following quick image as an example "room", lets say I want to restrict the players movement to the pavement only (highlighted in a pleasing blue :P) ignoring the Z-Ordering issues of when the player moves up the path and should be obscured by the building.

One method I've considered would be to place a fake transparent object (may need several) the same size as the background. Then setup a custom poly collision area to prevent the player straying from the path.
Another idea would be to create an editor that allows me to draw a border around the walkable area. Then store this border to compare the players current position against. I guess rather than storing the values, I could instead construct the CustomPoly for the fake object using this same method (allowing for the limitations concave polygons).
I just have this feeling that I'm missing a much more sensible or flexible way of doing this, so I'd like to throw this open for suggestions/ideas :)
#2
I think something like this will be easier when the scene editor makes it's way about. But I guess we will have to wait and see.
04/29/2005 (9:48 am)
I know a lot of the "other" 2d engines do it by creating a very thin, transparent object like you suggested Gary.With the static nature and generally low overhead of most adventure games, I don't really see this being too much of an issue.I think something like this will be easier when the scene editor makes it's way about. But I guess we will have to wait and see.
#3
04/29/2005 (9:52 am)
Maybe I've been looking into dRacer (a very cool Torque 3D project with a track builder) too much... but it would be very cool to create a system where you place 'nodes'? or something of the sorts and it would generate road along the path, on the other hand you can do the reverse and generate sidewalk with those transaparent collision objects like you and Charlie are mentioning to each side of it
#4
04/29/2005 (10:03 am)
My master plan is to eventually create a decent adventure game. But like I said above, I'm waiting out the scene editor.
#5
I'm currently picturing an editor where you draw a line strip to enclose the walkable area. I can then take each individual line segment and turn that into a transparent collision object. Then I could use the same editor to draw room-exit collision areas as well.
04/29/2005 (10:19 am)
I'll probably end up building my own temporary solution that lets me place boundary objects. As you say, a thin transparent object would be suitable for this. It also gives me an excuse to look at the editor/gui side of things.I'm currently picturing an editor where you draw a line strip to enclose the walkable area. I can then take each individual line segment and turn that into a transparent collision object. Then I could use the same editor to draw room-exit collision areas as well.
#6
could even place together your own GUI game editor like your thinking (for internal use) :)
04/29/2005 (10:22 am)
Very true... similar to what I was imagining... though with nodes, but then agian a line really is a bunch of nodes, start and end point, can use that command Alex made to draw a visual line to represent the connecting of te nodes, store them in an array, then when your ready loop through them and place "line" collision objects in that spot..could even place together your own GUI game editor like your thinking (for internal use) :)
Torque 3D Owner Matthew Langley
Torque
another way for the road collision would be a cleverly peiced tilemap