I would like to know how culling works. Do you just hide things when they leave the bounds of the screen (with isVisible) or do you not move them when they’re out of the screen or what?
C [import]uid: 147322 topic_id: 35666 reply_id: 335666[/import]
I would like to know how culling works. Do you just hide things when they leave the bounds of the screen (with isVisible) or do you not move them when they’re out of the screen or what?
C [import]uid: 147322 topic_id: 35666 reply_id: 335666[/import]
I was under the impression that Corona performs culling automatically? Maybe a Corona staff member can weigh in. [import]uid: 135394 topic_id: 35666 reply_id: 142096[/import]
I was thinking more of things like Lime and the issues it’s having with large tilemaps - any idea how to fix that? I saw an interesting method where someone was just moving the map one tile over and then resetting it to it’s original position with a different image… [import]uid: 147322 topic_id: 35666 reply_id: 142106[/import]
Looks like you’re already at the forefront of Tiled import/implementation for Corona, which means you are much smarter than I. I’m going to leave this to a Corona staffmember to answer
[import]uid: 135394 topic_id: 35666 reply_id: 142107[/import]
Hi guys,
Off-screen culling is handled for you by the graphics engine (off-screen material won’t be rendered by OpenGL). See here, under the Examples section:
http://docs.coronalabs.com/api/type/DisplayObject/removeSelf.html
That being said, you don’t want to conduct “actions” on off-screen objects. For example, you should stop animations on them, since that will be chewing up efforts by the sprite processing. Likewise, I would suggest you remove event listeners on them, and (if possible in your design) remove or deactivate any physics bodies on them.
Brent [import]uid: 200026 topic_id: 35666 reply_id: 142127[/import]
So Lime’s problem (I don’t have it, so I can’t tell) is it’s doing something or other to tiles when they move off screen?
I’m trying to find out what the problem is so I don’t do the same thing 
C [import]uid: 147322 topic_id: 35666 reply_id: 142182[/import]
The problem with all other solutions tends to be that the tiles exist. Changing the parameters of a display object, like it’s position, is very slow. Whether OpenGL renders them or not, displayObjects suck up resources, even if they’re just sitting there, invisible. Culling in the context of tile maps refers to removing objects not in use so they do not even factor into the equation. The map is held in arrays and the displayObjects are created only as necessary as tiles move onto the screen, and reused or removed when the tiles move off the screen. [import]uid: 99903 topic_id: 35666 reply_id: 142206[/import]
@Ajaxzon:
Ask Dyson122 about being the leader in tile implementation 
@Dyson122:
You’re saying that it’s better to delete objects and recreate them instead of moving them when they go offscreen?
If you don’t mind, is there any way you can tell the basic layout of how you handle culling with your tile engine? It’s completely okay if you don’t want to, though.
Caleb [import]uid: 147322 topic_id: 35666 reply_id: 142262[/import]
There seem to be two different ways of achieving the same thing. I remove objects and recreate them with the new tile image at the other side of the screen. Another method is using animated sprites and loading the tiles as frames of the animation, then repositioning the displayObjects from one side of the screen to another and changing the animation frame to the appropriate tile image. The goal here is that, if 20 x 15 tiles fit on the screen, you only want to have 20 x 15 displayObjects or as close to it as possible. The other 382984 tiles or whatever can float around in tables as nice, cheap, numbers. The result is a system in which the total map size is irrelevant to the performance of the app.
I’m not in a hurry to describe the details of my tile engine. Sharing with the community is a noble thing, but nobility doesn’t win out over the ability to, you know, buy food. [import]uid: 99903 topic_id: 35666 reply_id: 142266[/import]
“I remove objects and recreate them with the new tile image at the other side of the screen”
That’s what I meant - I didn’t need code or deep explanations. I just wanted an idea of how you do it.
So let me get this straight:
Caleb [import]uid: 147322 topic_id: 35666 reply_id: 142353[/import]
Yes, that’s the gist of it. [import]uid: 99903 topic_id: 35666 reply_id: 142362[/import]
Thanks!
C [import]uid: 147322 topic_id: 35666 reply_id: 142375[/import]
I was under the impression that Corona performs culling automatically? Maybe a Corona staff member can weigh in. [import]uid: 135394 topic_id: 35666 reply_id: 142096[/import]
I was thinking more of things like Lime and the issues it’s having with large tilemaps - any idea how to fix that? I saw an interesting method where someone was just moving the map one tile over and then resetting it to it’s original position with a different image… [import]uid: 147322 topic_id: 35666 reply_id: 142106[/import]
Looks like you’re already at the forefront of Tiled import/implementation for Corona, which means you are much smarter than I. I’m going to leave this to a Corona staffmember to answer
[import]uid: 135394 topic_id: 35666 reply_id: 142107[/import]
Hi guys,
Off-screen culling is handled for you by the graphics engine (off-screen material won’t be rendered by OpenGL). See here, under the Examples section:
http://docs.coronalabs.com/api/type/DisplayObject/removeSelf.html
That being said, you don’t want to conduct “actions” on off-screen objects. For example, you should stop animations on them, since that will be chewing up efforts by the sprite processing. Likewise, I would suggest you remove event listeners on them, and (if possible in your design) remove or deactivate any physics bodies on them.
Brent [import]uid: 200026 topic_id: 35666 reply_id: 142127[/import]
So Lime’s problem (I don’t have it, so I can’t tell) is it’s doing something or other to tiles when they move off screen?
I’m trying to find out what the problem is so I don’t do the same thing 
C [import]uid: 147322 topic_id: 35666 reply_id: 142182[/import]
The problem with all other solutions tends to be that the tiles exist. Changing the parameters of a display object, like it’s position, is very slow. Whether OpenGL renders them or not, displayObjects suck up resources, even if they’re just sitting there, invisible. Culling in the context of tile maps refers to removing objects not in use so they do not even factor into the equation. The map is held in arrays and the displayObjects are created only as necessary as tiles move onto the screen, and reused or removed when the tiles move off the screen. [import]uid: 99903 topic_id: 35666 reply_id: 142206[/import]
@Ajaxzon:
Ask Dyson122 about being the leader in tile implementation 
@Dyson122:
You’re saying that it’s better to delete objects and recreate them instead of moving them when they go offscreen?
If you don’t mind, is there any way you can tell the basic layout of how you handle culling with your tile engine? It’s completely okay if you don’t want to, though.
Caleb [import]uid: 147322 topic_id: 35666 reply_id: 142262[/import]
There seem to be two different ways of achieving the same thing. I remove objects and recreate them with the new tile image at the other side of the screen. Another method is using animated sprites and loading the tiles as frames of the animation, then repositioning the displayObjects from one side of the screen to another and changing the animation frame to the appropriate tile image. The goal here is that, if 20 x 15 tiles fit on the screen, you only want to have 20 x 15 displayObjects or as close to it as possible. The other 382984 tiles or whatever can float around in tables as nice, cheap, numbers. The result is a system in which the total map size is irrelevant to the performance of the app.
I’m not in a hurry to describe the details of my tile engine. Sharing with the community is a noble thing, but nobility doesn’t win out over the ability to, you know, buy food. [import]uid: 99903 topic_id: 35666 reply_id: 142266[/import]