How do I disable collision on many tiles?

0 favourites
  • 10 posts
From the Asset Store
Piano tiles
$9.99 USD
Template for a piano tiles game, fully documented in comments and video
  • Hi! I can't find how to disable collision on many selected tiles, like doing this by unchecking «Use collision» checkbox in «Tile properties»?

    I have 10 variations tilesets of 100x100 tiles per ground layer, one more 100x100 per trees and grass layer and so on.

    There is no option to disable «Show collision polygons» checkbox for specefic tileset only, so trees/grass/spikes draw their own collision grid. I can hide entire layer, but this is not an option, because I want to see ground collision greed relatively to all level assembled, not only the bald ground.

    Don't you want to say disabling 10 bundles of 3sets of 100x100 tiles using half of them = 150.000 tiles I need to do this manually?

    This cannot be true with such many years developed spicific software, so I think I'm just unnatentive. Point me, please in right direction. Thank you!

  • If you are doing it just to hide collision polygons in the layout editor, then of course, it not worth spending hours turning collisions for each tile in each tilemap. It's much easier to move grass and trees tilemaps to another layer and toggle its visibility.

    If you feel confident editing raw project files, you can modify objectTypes/tilemap.json - disable collisions for a couple of tiles, save the project, open that file in Notepad++ and you'll see what to do. However, if you really have 150K tiles, this change will probably add many MBytes to your project size.

  • If you are doing it just to hide collision polygons

    Yes. Editor works with 5-10 fps with collision grid turned on when looking on 4x viewport size area. While really need to see only one hundred of collision cells.

    If you feel confident editing raw project files, you can modify objectTypes/tilemap.json

    Oh, thought "disable multiple cells" already was implemented in C3 (was not in C2). Very sad.

    But your advice can be really helpfull! I will test it now! Thank you!

    P.S.I had some cases when I wrote few lines of code in Visual Basic.NET to search and replace a lot of different symbols in couple of huge files. It's not a big problem, but can be a fast solution!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • However, if you really have 150K tiles, this change will probably add many MBytes to your project size.

    1 Megabyte file right now, five layers with ground/grass/trees/secret areas and obstacles. 16x16 tiles on 5000x2000 small level with 800x450 viewport.

    This includes two big tileset textures, player with animations, buttons and other menu sprites, two parallax bundles, some enemies and so on...

  • { "name": "tm_MountainsPass", "plugin-id": "Tilemap", "sid": 424572617616130, "isGlobal": false, "instanceVariables": [], "behaviorTypes": [], "effectTypes": [], "image": { "width": 1024, "height": 1024, "originX": 0.5, "originY": 0.5, "originalSource": "", "exportFormat": "png", "exportQuality": 0.8, "imageSpriteId": 2977033, "useCollisionPoly": true }, "tile-collision-polys": {} }

    This code is contents of "objectTypes/tilemap.json"

    Changing "useCollisionPoly" does nothing.

    Tile options array must be elsewhere...

  • You'll have add this block for each tile:

    		"0": {
    			"collisionPoly": {
    				"points": [
    					0,
    					0,
    					1,
    					0,
    					1,
    					1,
    					0,
    					1
    				]
    			},
    			"useCollisionPoly": false
    		}
    

    So if there are 10000 tiles in the tilemap, you have to repeat it 10000 times. I don't think it's a good idea to be honest.

  • I don't think it's a good idea to be honest.

    In C2 I was using "polygon-sprites" to make collision outline. But I think it's not the best approach to not to use things that are created for their special purpose.

    There MUST be a button or checkbox to disable collisions on selected (in tilemap bar) rectangle of tiles. I can't imagine how can this be there is no such button. It's game develop software! Like using stone hammer in 21st century((( Its possibility but not the way.

    Thank you! I apreciate your help! I will dig onto deeper.

  • 1536x2048 with 16x16 tiles = 12288 tiles. Yes, I've added 12288 entries as mentioned above.

  • Did it actually work? Collision polygons from these tilemaps no longer visible in the layout editor? Did it improve the performance too?

  • Answer is yes on both questions!

    But later I decided to cut all trees as single images.

    I will keep in mind that I can add «disabled» entries as many as I need on any tilemap. ...until better solution will be done by construct developers))

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)