Hiding objects that aren't on screen...surely not?

Chunk = some portion of map (or to be precise pre determined area/range)
Not a tiles themselves
Imagine i have 16x16 tiles
I could go with 100x100 chunks where it would not match tile grid
BUT why does it matter?
When what is loaded or unloaded you won’t even see?
I could load 5 tiles off screen or line of 100 pixels in which 5 tiles only fit and some empty space

So it would just check for EVERYTHING in that area
Meaning chunk would need to be bigger than biggest object that would be loaded

thaz what i thought…it doesn’t matter idd.
But u may need something to refer too for assigning ID…and the scene grid tile size is there.
Btw it was a stupid question.

As you see this draws grid out of few variables with shape painter
All i need from it now is to give each cell ID and so it will be converted to chunk system
Nothing more nothing less
And now i could check if x pos of platyer or camera or whatever
Against if pit is to the left right up down or diagonal from its position
And depending on that i would load chunk by its ID
Now that i think of it i don’t even need IDs i could kinda sorta set IDs of chunks to their X and Y pos


…yep…that is wath i was thinking above…
better to not assign an ID if possible…
next steps are allyours… :smile:

i guess this way developers are bonded to think which tile size to use before starting a project but as long as it works i think it worth it…

thanks @Keith_1357 …sound advice…i’ll try that out when I get a chance!

1 Like

@ZeroX4 …it looks like you’ve thought this through more than me and thanks for showing your great work. After a commented … i thought doh…yeah it doesnt need to be radius, just based on whether it’s on screen or not!. Chunks …i need to research this a bit more in order to be clear on it. My objects are all different shapes and sizes and i don’t know if a system of chunks would work…i’ll give this more headspace next week!

Yeah well lets say papu zero struggle with both auto tile and chunk/culling system for some time or more like 2 years almost
So i had some time to think it trough
That’s how i know you want to go with off screen rather than radius
Where chunks are another story

Things to consider

  • Like i said radius would generate more objects per area than you need I BET there is use case for it but i can’t find one
    MAYBE something like fake fog of war would make sense

  • Culling makes a lot of sense when your game is grid based like in my case it is each piece of map being it own separate object
    Where in your case chunks could make more sense

  • Chunks do not load one object of screen but A LOT objects in some area
    Which can be performance heavy
    I would need to actually have chunk and culling system working (culling i have) to compare performance of both
    So chunks MAY make more sense in your case where you have some objects and not whole map built from grind
    And as for chunks and your case only thing you would need to care about for single chunk size to be bigger than biggest object you have to load

Actually same logic could be applied with culling

In this very topic of yours in this message

I sent screenshot to whole culling system i have
You can simply recreate it just pay VERY close attention to variable names
So you don’t mess them up
That is all you need nothing more nothing less
YOu can test it and see how it affects your game
Only thing it does not have is padding
Like you will see objects will be loaded on edge of screen cause i let it be like this on purpose to actually see loading and deleting moment
Where if add padding you would be able to adjust how much OFF screen stuff gets deleted and loaded

And not to sound cryptic
Where you see i compare X Y of stones and temp vars
That is where padding goes so like if X of temp var is greater than Stone.X()
All you would need to do is like
Temp.X is greater than Stone.X() + 20
And that would not check if stone X pos is where it is but if stone pos + 20 pixels to the right
That is padding

So you can test system see how it works for you if it give you anything come back here
Talk to me i will dive into adding padding
But until that i will try to figure out chunk system
So let’s hope for the best in both cases

thanks for this …i can’t work on anything for a few days but…will try a few things out next week! …chunks and culling!

1 Like