[Solved] Check for diagonal neighbor on grid possible? Auto Tile now possible in GDevelop

@ZeroX4, could you share the extension in a website which doesn’t need an account to download?
Edit: created a temp email, that website asks to pay because it “expired”

Click it then click on GDCraft.zip and on far right you have download icon
Same goes for AutoTile

I paste here both extension and my project so you can test it and see how did i set it up
Actual image how to prepare tile is in GDcraft\assets\texture\terrain\TileStone\Stone.png
Then you just use spritesheet slicer on it Sprite Sheet Slicer by isometric8

Now if you wanna use it for your game you will have very bad time
It is far from perfect and it have issues listed above
I left it in state where it uses ObjectIsOnScreen extesion to update tiles
So if you zoom out too much it will lagspike on moving since update happens every few steps i think 20 or 50 pixels in any direction

Next thing is if you go to extension you have 2 other methods of updating tiles but which result in much more performance usage (it starts to lag faster) they are disabled but they don’t use ObjectIsOnScreen extension

But whatever works for you
I lost hope in this extension i believe only proper way to use it is to make it via events in game which is a lot of work but that is only sensible way
Extension is like half baked solution rabbit hole dead end you name it

You can’t have whole map build from tiles (well you can depend on map size) but that is eating a lot of performance which you can see from my post above
And you still need some performance for game itself
That’s why doing it via events looks like only proper way to do it

If you don’t understand how something works in AutoTile i will be more than happy to explain so do not be afraid to ask but if you really want to use in your project you will need to use a lot of tricks to reduce performance usage

For example 1st trick is to NOT have grass as tile or any object but just as color background you set in gdevelop
Then if you would dig grass with shovel to get dirt or use hoe to change grass into farmland you would simply need to spawn that kind of object in that grid cell
This way you save A LOT of performance instead of having grass as separate tiles which you simply destroy and replace with other tiles

I wish you good luck you will need it trust me

I have two questions:
1)Why does the original extension checks bottom/upper/left/right by position? Wouldn’t it be more performant if it were by bounding?. Nevermind, just read the topic
2) Wouldn’t it be better performant to delete all objects and which are outside of screen but store their position and important information? Then when the screen is on their position again, recreate them? It could be an extension, however what is important information to a game varies, so I guess it should be made per game. At least saving position should suffice? The problem with this approach may be the constant creation/deletation of objects…

ZeroX4, btw, thank you very much! Btw, my game is more Terraria-like, so I guess your suggestion won’t work, because I need players to be able to dig, remove and store the objects.

Btw, GDevelop tells me animation frames begin at 1, not 0, so the extension gets kinda buggy because it is defined as beginning at 0.

This is very powerful tool to rename multiple files at once Ant Renamer Portable (file renaming utility) | PortableApps.com
And do many many other stuff including numbering

So you for example have now file named Tile00.png
You can now add different numbers order to all files starting at whatever digit you want for example 01
So you would end up with file Tile0001.png
Now Ant Renamer have option to remove part of name of file either by what you determine
Or you can simply choose starting position and how many characters to remove

For example T i l e 00 01.png would be start from 5th position and remove 2 characters
And you end up with Tile01.png
And if you did all that batch renaming to your files you can set numbers as you wish

Sorry idk what you mean by animation frame starts from 1 not 0 so this is one method to change numbers

Other thing well just add any frame to tile then simply add rest
First one can be like fake frame just to fill the spot
I hope you know you can ctrl A when selecting file to select all?

About your question of deleting objects of screen
You are right it should depend on game
You and me are making something like minecraft clones so it would work for us
But what if someone makes idk game with teleports?
Or somehow move camera to different part of map?
Or don’t have player to check does his position changed because he have level builder/editor?

That is kinda issue that could be solved with making separate methods for updating and allowing ppl to choose where most would be just confused WTF it even is because they would not understand it
Or it would need to be broken into 2 separate extensions
So i picked lesser evil
While creating deleting at smaller scale would not be a problem it would all narrow down to how much zoomed out camera player have
Trust me i did think about many scenarios and more i think worse it looks

Sorry idk what you mean by animation frame starts from 1 not 0 so this is one method to change numbers
.

1) It is set to change the animation frame to 0 when there isn’t any object around.
image

2) I supposed that but it is true according to your animation of StoneTile 0, supposing you thought animation frames were referenced by name and not by number:

3) It is a number, not a name.
image

4) But frames begin at 1, there is no such thing as animation frame 0, according to Piskel.
image

However your game actually works when a tile isn’t around others, so I believe 1) is false and I didn’t understand the code enough. However, I believe it shouldn’t anyever reference the animation frame 0, so at least it is confusing.

4) Could also be false, then it would be GDevelop’s fault

This is very powerful tool to rename multiple files at once Ant Renamer Portable (file renaming utility) | PortableApps.com

I believe Nautilus encompasses everything you said, so I don’t need it, but thanks : )

Other thing well just add any frame to tile then simply add rest?

You and me are making something like minecraft clones

I don’t think I’m really doing any Minecraft-like game, maybe I am, but I guess the resemblance is a Dig and Create.

But what if someone makes idk game with teleports?

Recreate tiles based on player’s position?

Or somehow move camera to different part of map?

If there isn’t teleport in the game, set it recreate based on camera, and if player/falling object is out of camera, stop their movement.

Or don’t have player to check does his position changed because he have level builder/editor?

What? If you ask about level editor, make it focus on the camera as above.

Or it would need to be broken into 2 separate extensions

Seems like a tempting idea

While creating deleting at smaller scale would not be a problem it would all narrow down to how much zoomed out camera player have

In games like Mario Maker, I don’t believe the camera ever need to zoom out too much, in games like Terraria idk, but I know their zoom is can be hugely out.

You are confusing file naming by 3rd party program with what gdevelop takes as frame number 1

You could go with file names StoneA.png StoneB.png StoneC.png and so go on
And names would not matter
Only thing that matters is in which order you add them

For all you should care that first file could be called Stone_blablabla.png
Or Stone_999.png or even abortME.png

File name does not matter
It matters in what order you add them as frames

You even could have fully reverse file names
My method of preparing sprite sheet splits it into 48 files (0 is first 47 is last)

First frame could be named Stone_47.png 2nd could be Stone_46.png 3rd Stone_45.png

As long as image fits what you need and you added it in correct order it does not matter i hope you get it now

Also look my method is meant to work like this
You prepare sprite sheet then you cut it with sprite sheet slicer
And now you have all your files and all you need to do is this
After i click on Stone_9.png (just random file i could click any) i hold CTRL and press A to select all files
Then i hold CTRL and click on Stone.png to un select it (which is whole sprite sheet)
And then i just click open and all files are added in perfect order
2023-07-03_19_32_EBe0g5UU81_GDevelop

You are confusing file naming by 3rd party program with what gdevelop takes as frame number 1

So 4) is false.

You could go with file names StoneA.png StoneB.png StoneC.png and so go on
And names would not matter
Only thing that matters is in which order you add them

Yeah, but supposing 4) is true, as the tile images guide you, I supposed you implied frame 0 exists. Well, it little matters now as the problem is explained.

Also look my method is meant to work like this
You prepare sprite sheet then you cut it with sprite sheet slicer
And now you have all your files and all you need to do is this
After i click on Stone_9.png (just random file i could click any) i hold CTRL and press A to select all files
Then i hold CTRL and click on Stone.png to un select it (which is whole sprite sheet)
And then i just click open and all files are added in perfect order

Oh, I knew about Control + A, but I didn’t know GDevelop could import more than a frame at a time.

BTW, thank you very much! : )

I mean minecraft like game if it comes down to how auto tilling works
I was assuming you get that
We are far from minecraft when it comes to actual game
I only meant method of animating tiles

As for teleport you need to trigger to update tiles when something happen
If my method works of camera moving by some pixels which needs actual movement
And instead of that someone just switch places then there is no trigger to be taken into account
Imagine having analog clock and seconds hand
What you do not get here is waiting for hand to move 15 secs (tick 15 times/change position)
VS
Moving that hand from 0 to 15
it will not register 15 moves then but only one and that is the issue

You see this is extension you can’t think of adjusting it to yourself (i mena you 100% can)
But as creator of extension you need to think of a way that will work for everyone
So you can’t make situation specific updates because it will either work for one group of users or another

Splitting extension into multiple ones is good but can be confusing for many users which you as extension creator want to avoid
Trust me i seen ppl make more stupid mistakes in gdevelop than choosing wrong extension

Again you are not to decide or guess how much zoom some player will want to use you can only warn users that too much zoom can cause lag
This is same as with update method
You will never know what some users need you can only try to hit perfect middle spot so it works for most ppl and warn them what to do and what to avoid

Trust me if it were that simple as you think this extension would now be public
And i would polish it as much as possible but i really need some bigger brain to help me optimize it maybe even someone who can throw javascrip into it
Cause with my current knowledge it is bare bones more of a proof on concept that it is possible and it works kinda

If you have any ideas which you can show that help improve this extension i am open for anything you can throw at me

1 thing thx that would solve lagspike on deleting tiles with other 2 methods than with is on screen extension

Praise Keith for that

This basically narrows down grid cell in which tile was deleted and allows you to do exact same routine as when tile is created for checking adjacent tiles to update them
Because right now other 2 methods updates all tiles on deletion
But since is on screen method turned out to be more efficient i can’t see any reason to even implement it if i can’t find a way to have less lag WITHOUT is on screen extension method