• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - IDE Hex Tile System

C

Chungsie

Guest
I have some hexagon tiles, Water1.gif and I want to know how to make a tileset in gm 2. I can't find any tutorials on it for hex tiles. And an attempt to google fixes for transparancy issues shows there is no solution for this type of tile. Also I'm not sure how to make it work for animated tiles. I had been making objects out of the tiles, but they don't align on the grid as well as tiles do.

Can someone help?
 

hippyman

Member
You won't be able to use the built-in tile system. You could theoretically chop all your hex tiles into six normal tiles and put them together with some sort of system that you put together yourself but it still doesn't change the fact that you'll have to DIY for this one. I know there is an extension on the marketplace that does this. There's also plenty of tutorials that talk about hex grids so that would be a great start. You may not get a Gamemaker tutorial but all you really need is something to explain the math for getting the coordinates of each tile.
 
C

Chungsie

Guest
thanks so much! I bought the asset to try out. I found a finangled way that leaves a large border between the tiles, like 4 px, but I'm hoping this asset will greatly help :)
 
Z

zendraw

Guest
in gms1 you can simply position them to overlap, not sure if gm2 can do that, but i think its supposed to be able to do that.
 
C

Chungsie

Guest
there is an issue with transparencies with GM2 and tiles
 
C

Chungsie

Guest
it won't treat transparencies in a tile as transparent in gm2. So if you have a corner of nothing it is a large black space
 
Z

zendraw

Guest
perhaps then handle them as sprites and draw them manually on a grid? how advanced are you in gml.

ps:this problem seems like a major fail for me, yoyo.
 
C

Chungsie

Guest
you used to be able to make a layer in rooms for sprites, but now you cannot.
 
Z

zendraw

Guest
well another idea wuld be to write a shader which simply removes transparency? if not then the easyest way wuld be like some1 above mentioned, cut the hexa in 6 pieces. the bad part about this is thatyou wuld have to make piece 4 more pieces for all variations, which is just stupid. like game maker forces you to do stupid stuff cus it cant handle transparency correctly...
 
C

Chungsie

Guest
if I make the layer assets I can place sprites, but then I would need a large DS_grid, roughly 500x300 worth of tiles
 
Z

zendraw

Guest
you wuld need 150000 cells? still a grid can do the job just fine.

i once tested a grid of 1024x1024 cells and the only diffrence betwean a grid of 50x50 cells is the creation time of the grid.
 
C

Claire

Guest
it won't treat transparencies in a tile as transparent in gm2. So if you have a corner of nothing it is a large black space
Can you elaborate on this? I've done a quick test and can't see any issues, is the problem in the IDE, runner or both? Does your source sprite appear correct in the image editor?

Are you having problems with the first tile in your set? The first tile is reserved since tile index 0 means no tile so and although the tile select window shows a checkerboard it will actually appear as full transparent in the room.

If you can create a small test project with a broken tileset please log a bug with the helpdesk: https://account.yoyogames.com/report-bug
 
G

Guest

Guest
I use tiles with transparency in GMS2. Specifically, I have an "items" layer with pictures of items that appear on top of the "environment" (ground) layer. It should work. It sounds like this needs debugging.
 
C

Chungsie

Guest
ok my pc is so slow right now. I can't find where to put anything ina bug report, here's a screen.
problem.PNG
 

rwkay

GameMaker Staff
GameMaker Dev.
I think you may want an asset layer rather than a tile layer (the asset layer is closer to the old tile layer) - it allows you to place sprites without having an instance associated with them.

Russell
 
C

Chungsie

Guest
the asset layer is great for making backgrounds that animate and what not, but they don't really help make information about the spaces. it doesn't care where I am on it.
 

rwkay

GameMaker Staff
GameMaker Dev.
Can you elaborate on what you mean by 'don't really help make information about the spaces. it doesn't care where I am on it.'????

Russell
 

GMWolf

aka fel666
Can you elaborate on what you mean by 'don't really help make information about the spaces. it doesn't care where I am on it.'????

Russell
I think its on a logical level, they will nt act like the maps do.

For that reason, I suggest you represent your grid logically using a ds_grid, and then display is using an asset layer.
Yes this does makes it hard to edit these grids in a room editor.

THe solution then would be to have a tile map to represent the map logically. and still display it using an asset layer.
This allows you to edit your grids in the room editor, but you loose the ability to preview you rooms.
 
C

Chungsie

Guest
I was told something about making a level editor. Im not sure how I could manage making the map in a ds_grid first. I tend to think poorly of things like visuals, believe it or not. and my ability to relate a visual to a number is lower still. I do own grids, but like I said, I have no idea how to use it. and can't seem to find a tutorial on it.
 
G

Guest

Guest
If this is your first game, hexagons might cause a lot if additional headaches beyond what you'll run into just making a first game. Perhaps consider just doing square grids for your first game, you need a good understanding of them to work with hex grids anyhow and there's soooo much other stuff to tackle.
 

GMWolf

aka fel666
If this is your first game, hexagons might cause a lot if additional headaches beyond what you'll run into just making a first game. Perhaps consider just doing square grids for your first game, you need a good understanding of them to work with hex grids anyhow and there's soooo much other stuff to tackle.
I am quite familiar with GML and how to do grids, etc.
But hex grids is still something i am 'afraid' to tackle.
 
C

Chungsie

Guest
so I looked over the documentation for layer_sprite functions. and I think I understand enough to have it place sprites based off a ds_grid. and if I recall from making inventories, I can maybe make a read system for the grid. now it's a matter of creating the grid with useful information?
 
C

Chungsie

Guest
wait, are layer_sprite functions outdated now that there is no sprite layer?
 
I am working on a hextile system as well and what helped me was this little workarround so that i can place two tiles on the same field:



Code:
global.back_layer = layer_create(-1);
global.back_tiles = layer_tilemap_create(global.back_layer, 0, 0, t_hex,t_width*grid_width, grid_height*t_height);
global.back_tiles2 = layer_tilemap_create(global.back_layer, 0, 0, t_hex,t_width*grid_width+1, grid_height*t_height);
 
Top