Hello!
I'm looking for a way to combining collision tiles together to optimize my game and make collision detection a bit easier if I decided on using Hadron Collider (read about some weird problems when I looked through the forums).
here's a pic ( sorry if it is a bit sloppy )
I didn't find anything when I searched the forums and I found this when I searched the wiki.
Although it didn't work! Instead it gave weird locations for tiles that didn't make sense.
I uploaded the .love file. ( I used Kikto's inspect.lua to display the tables )
Any help is appreciated.
[Solved] Combining Collision Tiles In tile-based Game?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
[Solved] Combining Collision Tiles In tile-based Game?
- Attachments
-
- tilemerging.love
- (2.79 KiB) Downloaded 84 times
Last edited by I~=Spam on Thu Feb 14, 2013 5:23 pm, edited 1 time in total.
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
Re: Combining Collision Tiles In tile-based Game?
There's a couple of things you can do before what you are suggesting using HardonCollider, because that is a bit of a harder problem that it might seem.
I'd try all of those before you look into programmatically merging tiles.
- Make sure all of your tiles are set to passive, so they only respond to collision detection, and not actively search of it;
- Make sure all of your tiles are in the same group, so they don't collide with each other.
I'd try all of those before you look into programmatically merging tiles.
Re: Combining Collision Tiles In tile-based Game?
I would not recommend using HardonCollider for tile collision. There are plenty of examples in the forum that demonstrates how to handle tile collision. With that said, if you are willing to use HC for tile collision, you can do what MarekkPie suggested with the object layer in tiled.
Re: Combining Collision Tiles In tile-based Game?
I didn't even think about that. If your movements as restricted to within the tile grid, then as markgo said, there are much better ways to handle tile-based collisions. However, if you are making some game that uses a tileset to design a level (but needs more robust collision detection), then follow my advice.markgo wrote:I would not recommend using HardonCollider for tile collision. There are plenty of examples in the forum that demonstrates how to handle tile collision. With that said, if you are willing to use HC for tile collision, you can do what MarekkPie suggested with the object layer in tiled.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Combining Collision Tiles In tile-based Game?
This is something I made (for Simon, actually, if anyone remembers that) that solves this problem. (I use HC as well.)
Warning: this algorithm can get pretty slow for large levels with lots of tiles. It might make sense to pre-generate the large tiles instead of generating them every time you start the game.
Warning: this algorithm can get pretty slow for large levels with lots of tiles. It might make sense to pre-generate the large tiles instead of generating them every time you start the game.
- Attachments
-
- block-test-new-hc.love
- (111.29 KiB) Downloaded 162 times
Help us help you: attach a .love.
Re: Combining Collision Tiles In tile-based Game?
THANKS! I'll try it out. Sorry for the late response... I've had other important things for a while
EDIT: Finished testing and it works great! Thanks again!
EDIT: Finished testing and it works great! Thanks again!
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
Who is online
Users browsing this forum: No registered users and 2 guests