What to use instead of Tilemap for tile render

Hi, its me again with another question. I asked not-so-long-ago if using default unity tilemap to render tiles with entities would be good, the answer I got was “try it if it will work its ok”, but it didn´t, causing massive lag because I had to .Run() it on main thread, so here I am asking another question what to use instead of it?

I took look at that, it is interesting. However… “few” questions incoming…

What are all the things it can do? How exactly does it work if you know? If I were to “instal it” how am I to do, especially with the resource folder, when I have my own, wont it cause problems to have 2 resource folders? (Resources.load) or should I merge them? Will it be actively updated? Given DOTS are in very active development etc.

Just tell me as much as you can/want, I am the type of person who wants to know how it all works just in case:smile: (other suggestions, ideas etc. are still welcomed tho)

This uses drawmeshinstancedindirect, you can look it up in the unity manual, works well with dots but also without. We don’t know enough about your use case and tile map functionality requirements

Well I have one entity for 1x1 tile of world, it has component that updates with noises to create specific “type” of tile that then proceeds to update its tile in tilemap, or at least that was my approach, but yeah, lag.

Not sure how this lags? How many tiles are visible on screen at once?

2D? Tiles static or animated? Layered?

The problem isnt in the entities, but in the entities.foreach accesing every one of these entities and then based on its data placing tile and the tilemap tiles are:

animated, 50 000 and I lowered the number.

Yeah I think I can see now where the problem is…

But there is bigger problem, I want there to be multiplayer, so with enough players there can be such extreme numbers. That of course is just speculation that that will happen, but still I want to be sure. Also I will lower the number of loaded world even more as now its just for testing, so there will be less tiles needed, but that is just per-player. So I seriously dont know what to do.

Sorry for such a late response. I’m not the creator of this tool. For more info, you’ll need to read that thread of look into a git project. I’ve just tested it and I’m planning to use it in the future. It’s fairly simple to use and fills the need for animated tile sprites do I’ve linked it.

You can also check this thread - multiple solutions and discussion (basis for the other thread linked above). I have not been active in a year or so, but I recall that there were some API improvements providing a native ptr to compute buffer, which should allow eliminate the double buffer in memory and further speed up.

200k dynamic animated sprites at 80fps page-2#post-5024381

I still don’t get why you have 50k tiles rendered at once.

Just 256x256 map has 65536 tiles. So it’s easy.

:wink: I do not question the map size but how much is rendered on screen. OP can check if the links can be a solution…

Thanks so much for answers, I dont have time right now, but I will tests it ASAP and write the result here. :smile:

1 Like

So I added it to my folder, but I am having hard time, because I am using much newer Unity version and I get errors like IJobForEach is obsolete etc. just bunch of old stuff conflicting with the new stuff.

What to do? How do you fix these, do I have to try and fix every script?

I am afraid so. It’s worth checking if any of the different solutions were maintained.

If not, I used IJobChunk, which should not have changed much. You would have to update to system base…it’s somewhat involved.

So I tried fixing it and oh boy was that something. I ended up completely messing it up so I had to download it again and I dont think I have enough time and will-power to update it so for now I´ll try to make some sort of render distance where textures are rendered that is smaller than the actual loaded world.

Still massive thanks if nothing I at least learned a lot more about dots so thanks.

1 Like

:frowning:

Let’s see, another relevant thread was necroed by coincidence and if I get a good answer there, I might download unity again and update this.

@Klusimo It looks like there are forks of the main project that have been updated recently. Haven’t verified, but perhaps they’ve done much of the work already?

https://github.com/LordArugula/SpriteSheetRenderer

I downloaded it and I get this unusual error: Assets\SpriteSheetRenderer\Scripts\SpriteSheetManager.cs(114,13): error CS0656: Missing compiler required member ‘Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo.Create’

As well as this warning:
There are inconsistent line endings in the ‘Assets/SpriteSheetRenderer/Components/MatrixBuffer.cs’ script. Some are Mac OS X (UNIX) and some are Windows.
This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.

I´ll look at it and see what can I do, thanks for posting, didnt know there were forks of the original project.

So I fixed that error by setting Api Compatibility to .NET 4x then I found I had some errors in my code since my last editing so I´ll fix these and see if the SSR works :slight_smile:

So yeah that somehow didnt work, still a great lesson though… I guess…