Ok time to answer all of you
to count tiles:
little example of a vacuum mechanic, probably not really what you are trying to do though:
https://drive.google.com/file/d/1DFmATBH-gtIYrIbpnbeOIWqNO36mWEAA/view?usp=sharing
fedca
Thanks for the counting tiles!
As for your demo on google, this was actually my previous gameplay for obtaining dust.
I still have this style saved on my project, easily togglable, 100% functional and it does its job.
The motive I decided to try another way is because I wanted to have more freedom on the type of dirtiness coming from the dust. I was hoping I could do that, but if this tiling issue gets harder for me to produce, it's fine - I'll go back to that.
After all, from 72677 tiles to 82 pieces of dust, the difference is noticeable.
Plus, I don't have to make a dictionary for counting the pieces of dust in this way.
... Yeah, maybe this is the most convenient idea... I'll think about it for my project, but in any case, I want to see if there is some way to produce the effect I'm asking for in this topic.
In the meanwhile, thank you so much for reading and answering this topic!
You may get better performance with a canvas instead of tilemap.
Even with a tilemap with 1x1 tiles its slow even just erasing.
dropbox.com/s/0jkp71pl9nvyw08/roomba_tilemap.capx
An alternate idea is to grab a screenshot and use some JavaScript to scan the image for set pixels. It works, but it needs to flicker as I need to hide the other layers for a frame.
dropbox.com/s/il3xbkj19f8n78n/roomba_screenshot.capx
So here's the example using the C3 canvas. It works well for erasing but loops in events are slow, so here it does the scan of the pixels over multiple frames. Seems to work well, but if you resize the game window in any way the canvas will clear. May need some more logic to periodically save the canvas and reload it as needed.
dropbox.com/s/ki35vb1bx2xztuf/roomba_canvas.c3p
If you have the full version of c3 you could also handle the canvas pixel scanning in javaScript as that would be much faster.
R0J0hound
Thank you so much for your demos! I appreciate your help! I admit I have never used the drawing canvas and by judging the difference I believe it's the one working better.
Deleting 1x1 tiles in-game doesn't affect the performance unless you're always counting (just as proved in your first demo). In fact, the whole idea of using this feature would work if it wasn't for the progression bar.
Yeah I own the full version of C3 alright, I'm not the best at javascript but I bet it can do better.
As I mentioned before with fedca, I'll keep in consideration all the help to make a resolution for this feature.
Throwing some ideas out here - instead of counting tiles, generate the dust dynamically and simply keep track of how much was created in the first place.
Or set up a loading screen style transition when running the counting event, if it's only a one-time thing.
oosyrag
Thank you for your ideas! Yes, as I mentioned before, I do have a similar technique in my game, which is currently suspended to try a new, (possibly) better way to collect dust. This feature is similar to the demo provided by fedca.
In the game, I have also tried to add random dust across the map, in different sizes and shapes. Of course, the more you add, the worse it gets with the performance. After 5000 pieces of dust, you see a downgrade. Luckily you don't need to go for 3000 pieces, just the ones you need, which usually go from 80 to max 500 depending on how to use them.
As I said to fedca, I was trying to see if I could make the roomba more of a rubber erasing scratches. While this works in-game, it doesn't go well when it's about data and calculations. Since I'm a sort of a newbie, I'm open to all ideas but at the same time keep acknowledging that some of these can't be made at the moment. So yeah, it's highly probable that I'm going back to the previous technique for getting dust since overall it works well.