(solved)Using Tile Based Collision for base building

flyinian

Member
I was originally going to use objects for collision and I had a safe assumption that I could do base building with that. However, I decided to go with tile collision and now i am concerned that using the tile and tile collisions won't do well with base building and destructible environments(walls,doors). Another reason why I went with tile based collision was to try and have flawless movement with collision and objects weren't working for me but, I managed to get the tiles to work and they seems flawless or at least good enough to pass for me.

Am I still able to create a base building system using destructible walls, doors, etc with tiles or should go back to objects. I feel objects are much easier to code and work with than tiles but, I am not sure on how to go about using the tile based collision with objects that has collision with projectiles. The tiles used for the walls and so forth will have a large variation of variables(health, armor, resistances, and so forth. if that would make any difference). I rather stay with the tiles since they are easier on performance and I plan on having large worlds, large quantities of enemies and so forth.

My guess would be to stay with the tile based collision but, insert code into the specific objects that will utilize the tile collision codes.

I am still fairly early with my collision and assets so, changing some things shouldn't be a problem.

Its going to be a top down shooter and have a similar building system to Rimworld.

I am fairly new to this so, elaboration is appreciated. Thanks.
 

NeZvers

Member
For collision like Rimworld, you can use ds_grid collision too and it's easy to change cell if you destroyed something and there's no collision. Actually, you could use it to store how much HP that cell/ tile has.
 

NightFrost

Member
Tile based collision should be no problem, and certainly lighter than a large amount of objects sitting in the room. You'll just need to store the terrain properties in a DS grid or 2D array, and have any changes in terrain reflect to both the data structure and the tiles. Referring to Rimworld in regards to movement collisions is not the best idea, since Rimworld doesn't do that. When you click on destination grid cell, it does pathfinding (A* algorithm most likely) and constructs a path for the character to follow.
 

flyinian

Member
For collision like Rimworld, you can use ds_grid collision too and it's easy to change cell if you destroyed something and there's no collision. Actually, you could use it to store how much HP that cell/ tile has.
Tile based collision should be no problem, and certainly lighter than a large amount of objects sitting in the room. You'll just need to store the terrain properties in a DS grid or 2D array, and have any changes in terrain reflect to both the data structure and the tiles. Referring to Rimworld in regards to movement collisions is not the best idea, since Rimworld doesn't do that. When you click on destination grid cell, it does pathfinding (A* algorithm most likely) and constructs a path for the character to follow.
Thanks for replying. After some research, I think i'll be going with ds_grids.

For NightFrost, I wasn't referring to Rimworld for movement collision, but for base building.

Once again, Thanks for replying.
 
Top