Time Nick Message 00:50 MTDiscord I got a lot more into the nitty gritty of testing on this cache for entity in area and radius checks. My current solution has one key nuance that is different from current behavior, and I can make it exactly match current behavior, but wanted clarification: 00:51 MTDiscord Right now, when an entity is to be added during iteration, it is saved until the end of iteration. 00:52 MTDiscord In my version, that entity is added as soon as the current mapblock chunk is done being operated on. So: in my branch, you might find a newly added entity from that current get objects in radius/area call, in that calls iterator. But in master, you'll get it on next call, not the current. Thoughts? Should I keep my slightly faster updating one? 06:01 [MTMatrix] #14614 06:01 ShadowBot https://github.com/minetest/minetest/issues/14614 -- Entity spawned in `on_step` not visible to `get_objects_inside_radius` 19:02 MTDiscord Not easily fixable and ExeVirus fixes it accidentally. What a legend. 19:09 MTDiscord if i understand ExeVirus correctly, this "fix" only works sometimes, so it's not a reliable fix 19:11 MTDiscord i'm not quite sure why this wouldn't be easily fixable however. the modify safe map basically just consists of two maps: one to hold the current state (in which entries may be marked as deleted), and one to hold the newly added entries. 19:11 MTDiscord what if we just checked the second map if we got a miss in the first one? 19:21 MTDiscord oh, well my map uses an iterator, and that iterator would be invalidated if the entity was added to the current block. I could just search the pending entity list at the end of iteration before adding them, but then: what do you do about new ones added while iterating that vector.... well it is just a vector, could just use .size() as the check on a normal for loop and.... what about deletes.... 19:23 MTDiscord and modify safe map.... If I ask for an object while we are iterating, we shouldn't have any issues now that we are using other structures for entity iteration 19:26 MTDiscord well, my data structure is strictly a spatial index. it is not used (and should not be used) for iterating entities to run on_step callbacks. 19:27 MTDiscord ah, nevermind: mine won't be used that way either: mine does out of order IDs 19:28 MTDiscord i don't think the ID order matters 19:28 MTDiscord the only reason we have it is because it seems to somehow (?) fix an issue but it is not clear how this works in general 19:28 MTDiscord then I guess it can be used for that. Let's hold off on making this unmergable and keep it simple, and look into further fixes later please 🙂 19:28 MTDiscord the problem is, i couldn't reproduce the issue last time i tried, even though i would not expect it to work in general 19:29 MTDiscord ExeVirus: agreed 19:29 MTDiscord this would be in a separate PR 19:45 MTDiscord also: the reason ordered IDs matter I believe is for attached objects: we want the parent to be updated first, and attached object second. That's how I remember it at least 20:18 MTDiscord Ready for review: https://github.com/minetest/minetest/pull/14643 20:26 grorp merging #14743 in 10 min 20:26 ShadowBot https://github.com/minetest/minetest/issues/14743 -- Android: Fix back button sometimes not working as ESC by grorp 21:06 MTDiscord ExeVirus: yes, i know, but the thing is, in general there is no guarantee that the parent will have a smaller id than the child. 21:09 sfan5 the "order the map to fix attachment chains" thing is broken, I think we discussed it here 21:09 MTDiscord yes 21:10 MTDiscord i wonder how to reproduce the attachment issues however 21:10 MTDiscord recently i tried attaching a stack of boxes to a "racecar" in devtest and i didn't see anything (i also tried creating & attaching the entities in different orders, since the map is ordered) 21:38 MTDiscord Personally, without looking at the engine, I assume we attach entities to their parent, so a parent has a list of children. And those children have a list of children. And children know when they are attached... So just loop over everyone, skipping attached entities, and when a parent has children, update the children then. 21:39 MTDiscord yes, this should be simple to solve properly recursively 21:39 MTDiscord i wanted to do that, but as said, first i'd need a proper reproducer for the issue. and my rudimentary attempt at that failed. 21:48 MTDiscord If I create a DOM for minetest formspecs and add in new features that we've been asking for, will this pr immediately get shot down? 23:24 MTDiscord No, vrob has such a PR already 23:25 MTDiscord you could help him with it though; he doesn't have much time available for it.