PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

50M Downloads

Question: Entity Condition range/size limitations?

MuteTiefling opened this issue ยท 4 comments

commented

I'm just curious if there's some sort of inherent limitation to this drone condition. I can get it to work fine on smaller areas, but when I attempt a largish area (cylinder shape on y axis, ~38 block radius, 4 blocks tall) it is giving me inconsistent results. I feel like I might be bumping up against something similar to the path finding length limitation a while back.

For instance, in my actual game world. it pretty much always comes back false, but in my testing world I've set up a similar area and dropped in 10 chickens. The condition should be true at >= 10 and rename the drone to signal that. Upon first spawning in the 10 chickens, it did switch to the true name. Then I took one out and it went to the false name. Putting that chicken back, however, didn't cause the condition to become true again.

Watching it for a few minutes, I finally saw it pop to the true name and then immediately pop back to the false name. So it can see them... but I almost feel like it's got a fixed interval of time it can scan the area and if it can't complete it in that time, just too bad. Which I'd fully understand from a lag reduction point of view. Have I just gone too big? Do I need to scale this back somehow?

commented

No, that should work. Mind pastebinning your program so I can test it out?

commented

These are the programs for the actual drone in my play world: https://gist.github.com/MuteTiefling/9573c073e3c4d0818a9d15b77221b153

It's split into 2 APIs and a drone program to pass variables in.

And here is the simple test program I made while trying to figure out what I might be doing wrong:
https://gist.github.com/MuteTiefling/d2097cf8c5b18a440e6eb908dd943e67

I had thought maybe it was something to do with passed in variables/coordinate operators but even testing with the coordinates hard coded in the location widgets didn't fix it. The only times it seemed to work reliably were with smaller regions. With this last program, dropping the height down from 4 blocks to 2 and keeping the large radius significantly improved the responsiveness of the program, however.

Currently running this in 1.3.0-33. I have not yet done any significant testing in later dev releases, only confirmed that small regions work fine.

commented

Are you killing the chickens within the area, or leading them out somehow?

Because if you kill a chicken, it will drop a "Raw Chicken" item, and you're using an entity filter of *chicken*...

Other than that, I couldn't reproduce the problem. I set up a fenced area of 18x4x30 (pretty much the same size as yours) and the drone name updated absolutely fine (as long as I remembered to remove items...). The size of the area shouldn't have much of an effect on the responsiveness - it just affects the AABB size when the world.getEntitiesInArea call is made. Some IDE watchpointing indicates it's called every few ticks and the return entity count updates pretty much as soon as a chicken is added or removed (on a multiplayer server, I'd probably add a Wait widget of a few seconds in there for performance reasons, but whatever).

commented

The intention was to kill them in situ and immediately pick up the items to avoid that conflict, then checking the count again. But I could never even get it to go kill anything since the condition was never coming back true. I'll keep messing with it since I know it should work then. There could be some other conflicts too. As mentioned, this is in my play world, not my barebones testing world so there's still a possibility of mod conflicts that I haven't yet ruled out.

Anyway, thanks for the confirmation!