zeel01 / scene-tiler

2 stars 1 forks source link

Bulk creation and deletion of tiles. #5

Open zeel01 opened 3 years ago

zeel01 commented 3 years ago

The ability to create multiple tiles, populate multiple tiles, clear multiple tiles, and delete multiple tiles as bulk actions.

Issues

Creating and populating a tile requires that Ids be known. If done in bulk, differentiating those ids won't be possible.

Possible solution

Generate a randomID for each tile, store it in the flags of all the child objects. Use this id to link them back up after creation.

ggagnon76 commented 2 years ago

It's been a while since we discussed this in the League discord, but I have been thinking about it. My best solution at this time would be:

  1. Create all the tiles you need, in bulk. Leave them blank and place them at 0,0 (paddingX, paddingY).
  2. Once the tiles are created, they will have ID's. Then iterate through each one, and assign them their correct location, background image, and populate them, all using one bulk update.

You'll end up hitting the server twice, but that would still be an improvement I think.