Legacy GM Q:Tiles

zendraw

Member
Is there a chanse yoyo will make a deactivating function for tiles? currently im tryin to tile up an overworld but i end up with 50k+ tiles that i have no controll over. now if it were instances, i culd just deactivate the lot of them and things wuld be fine and dandy.

how does one deal with tiles efficiently? or how does one work around this. is a grid the only solution?

tiles are very inefficient for a larger play field.
 

TheouAegis

Member
why am I the only one who has never had issues with tiles slowing down anything? I try and try and try but I can never get tiles outside of The View to cause any more slow down then tiles inside the view.
 

zendraw

Member
are you doing somthing to the outside view tiles? can you suggest somthing to deal more efficiently with tiles?

the only thing i culd think of is constantly destroyng and adding them but that culd cause lag and if there is randomness involved in the placement its simply inefficient.

for real yoyo, a tile_deactivate/activate functions culd be so beneficial im amazed its not there...
 

Neptune

Member
As I've been told:
In GameMaker 2, tiles that are outside of the view are automatically NOT drawn.

EDIT: As far as tile control -- you have a lot more of it in GM2. You got layers and blob tile data -- which is great for spawning things on certain tiles, having different walk animations for certain areas and pretty much anything one could think up.
 

TheouAegis

Member
outside of Studio 2, my only suggestion is to put tiles on multiple layers. So any one time you would have no more than four layers visible. You can hide all the other layers that you don't need. One layer would be the size of one screen.
 

TheouAegis

Member
alternatively, don't do anything to the tiles that are outside of the view. All your tile manipulation should be done in an external data structure anyway, most of the time.
 

zendraw

Member
the topic is about GMS1.4.

anyway, what do you mean the manipulation shuld be done in an external data structure? arent they alredy in some structure?

also im not sure what hiding the tiles does, but the tile count is the same wether theyr hidden or shown. so its purely graphical optimisation. and i want them to dissapear atall like how you deactivate instances.

my main issue is actually with generating the tiles. even with 50k tiles i drop the fps but the game is stable, so in game its not an issue, but the generation time is like 1.30 minutes. and i want to 'deactivate' the tiles becouse as theyr numbers grow larger, the loading/placing/generating process slows more and more.

if theres a way of storing the tiles the way game maker stores them in the rooms, thatd be great, cus if the tiles and objects are alredy placed in the room and i load the room, it loads instantly, but placing 50k tiles in this broken room editor is hell. dont know why they dont fix it like make it load only whats visible in the actual view.

PS: if i remember correctly there was a tool in which you can build your room and then load it in game maker or somthing like that, if any1 knows what im talking about?
 
What I noticed about working with tiles in Studio 1 was that tiles outside the view definitely did not affect performance. As a test, I piled a ridiculous number of tiles in a single location. While on screen, I had massive lag, but as soon as the stack left the screen everything turned to normal. The part where I did notice unusual lag was when dynamically adding tiles to a room, but the odd thing was that the lag happens shortly after the tiles are added, not directly when added. To explain what I mean better, I had created a script to fill a room with random tiles (again to test performance), with a 'show_message' pop up to let me know when it was done, but the lag would happen AFTER the box was removed, not before. As a further test, I removed the pop up and just held down a movement key to determine when it was done, and again, the lag happened after the script was completed, as my player moved a few pixels before the delayed lag kicked in. It has been a while since I did this test, so there might have been something fixed since then. Just my two cents!
 

zendraw

Member
i assume the fps drop is purely from graphical stuff.

also yes, there truly is lag after the tiles are layed out manually and the more the tiles are, the bigger the lag is. thus a reason why there shuld be a deactivating function for tiles.

deactivating generated instances for the generation to continue smoothly i assume is a common practice, atleast for me. another way that comes in mind is to generate only objects and set theyr sprites, but then how to tile up the floor?
 
Looking back at my post, in the second half when I mention the lag generated after populating a bunch of dynamically created tiles, lag is the wrong word, the program will freeze up for a sum of time, then return to running fine, without lag. The odd part is that it happens after all the tiles are placed, not during the placement of the tiles.
 

zendraw

Member
yes thats exactly the thing, and the more tiles you have the longer it stays frozen, now the question is how does one deal with it?
 

zendraw

Member
so how i deal with it for now is i doubled the size of the tiles. so now from 1.30 minutes generation time, it fell to 20 sec with 4 frames pause for every area, and 11 sec for 2 frames pause. this is on 30fps. altho i will try optimisin the gen code further, i doubt it will affect the gen time, the main reason it slows down is becus of the freezings that happen when you place alot of tiles.

maybe some1 from yoyo can hint why is this happening and a possible workaround?
 
Top