Complex Tile Collision Shapes

MyChairHasALooIn

  • Posts: 310
It's highly unlikely you're doing something truly unique within the single screen maze game theme, so don't worry so much about ip, although I do understand your concerns. Moveable camera and mini-map are both fairly easy to manage especially with the new image api (for the minimap) in 3.1. Obviously a maze spread over more than one 'screen' space with no minimap would be more awkward but even that isn't a definite don't do, as you'd be adding player memory as a useful skill to have when playing.

Using the new image api again, you could make the blocks that make up your screen space respond to per pixel physics, basically meaning they would have collision shapes that were pixel perfect to whatever your art was, however this would be a total redesign and a very complex solution to what seems to be a fairly simple problem. As well as potentially slowing down your game depending on how well it was managed.

Either way I wish you the very best of luck getting this problem beat, and remember, if you eventually figure out a solution yourself, not only do you win beating the problem, you'll also add in a fair dose of smug. Never underestimate smug :).

Happy stencyling!

Alan1

  • Posts: 88
Thanks MyChair, but I'm limited to 2.2. I'll figure something out.
"Oh man, this isn't happening, it only thinks it's happening." ~Flynn

SanjayPatel

  • Posts: 18
Well maybe this will still help - this is how i managed tile switching stuff in stencyl 2 (using some AS3 code)

http://community.stencyl.com/index.php/topic,1166.msg141425.html#msg141425

Alan1

  • Posts: 88
Thanks Sanjay. Nice work. Reminds me of Zelda. From what I understand, this would help me generate random maze patterns. It's not what I'm looking for but thanks again.
"Oh man, this isn't happening, it only thinks it's happening." ~Flynn

gamegirlxl

  • Posts: 713
A maze...  I wouldn't use collision shapes at all, although it's an unusual solution.  I picture a maze as an array (2D list) of squares.  There are two types of squares in a maze, walls and floors.  I picture the movement style of the mouse (I don't know what's going through the mazes, but I'll pretend it's a mouse) as being grid based, where it will be on one of the floor squares, and it can move in 4 directions if the direction also has a floor square.  It's like the movement in most Pok√©mon games.

If you decided to use collision shapes, there is a chance that the walls may not function properly.  If you were to use an array there is little gray area.  You would be able to find the value of the the space in the array when a key is pressed, and if it says it's floor, you can move there.  It would be easy to use binary, with 1=wall and 0=floor, so when you make the array the first item may look like: "1111111111011111111".  You would get the nth character of the item to see what the nth tile of the row is (remember that arrays and lists start at #0).  You can also use the array to generate the graphics, so it wouldn't be more work.

I know that you can do this in 2.2, because I've done similar things before in 2.2.  And I'll also say that the chance of you receiving legal action for IP is probably zero.  Since mazes existed way before computers did, they, as well as connect the dots, color by number, etc. are safe to use as long as you make your own puzzles.  It's good that you're combating legal disputes before they start, but most of the time, IP isn't worth suing small businesses or whatever.

Alan1

  • Posts: 88
Thanks GGXL, in fact, thanks to all for going above and beyond with this thread. Like I said, I do like keeping my ideas guarded. I haven't seen any maze game using what I have in mind and I'll need every edge I can get. But I'll just say that I do need to use collision shapes since some walls will be dynamic, and in effect changing the optimum path/solution(s). Also, the player risks getting crushed if they don't watch their step. I've said too much.
"Oh man, this isn't happening, it only thinks it's happening." ~Flynn

gamegirlxl

  • Posts: 713
Thanks GGXL, in fact, thanks to all for going above and beyond with this thread. Like I said, I do like keeping my ideas guarded. I haven't seen any maze game using what I have in mind and I'll need every edge I can get. But I'll just say that I do need to use collision shapes since some walls will be dynamic, and in effect changing the optimum path/solution(s). Also, the player risks getting crushed if they don't watch their step. I've said too much.

I was wondering if you were going to have dynamic walls.  I feel like I've seen "mazes" with dynamic walls, but they usually are simple puzzles requiring more in the way of coordination.  I don't think that you would use tiles with moving walls, because it would be better to use an actor.  Would the player die (instantly) if they are crushed by a wall?  You could probably use the method that I suggested with the array, and make the player an actor that can collide with walls that are moving.  You could also fake free movement if it's within the range of a floor tile.

The array would only keep the player off the walls, so you can do other stuff in conjunction with it.  You could even program nonfatal moving walls.

Hectate

  • *
  • Posts: 4643
I had a game idea (platformer) where whole sections of the game were constantly moving up or down like they were on a up/down conveyor belt or something. The challenge was that the only way I had to handle the collisions were as actors with a multitude of collision shapes - very rough to build. I still like the idea but I haven't revisited it in quite some time because of the difficulty of implementing all that.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.