SEServerExtender / EssentialsPlugin

Dedicated Essentials Plugin
GNU Lesser General Public License v3.0
18 stars 18 forks source link

Entity Management - Conceal/Reveal Loop for grids with production #98

Closed Demolish50 closed 8 years ago

Demolish50 commented 8 years ago

Grids that are revealed due to "Reason: Grid has production facility that has a queue" are in a loop of revealing and concealing. Brand new essential config with no options set other than Entity Management for grids.

log: http://pastebin.com/raw/wtb0V4Bq

see "dwickers station" as an example

foogs commented 8 years ago

Same problem

StellarwhimsRepo commented 8 years ago

mayhaps give us an option to force production off regardless of queue status. players will just log in to keep these rolling which is just another thing to keep grids from concealing and staying active.

Demolish50 commented 8 years ago

Why are we using IMyProductionBlock.IsProducing in CheckConcealBlockRule but MyProductionBlock.Queue.Any in CheckRevealBlockRules? Is there a reason I don't follow? Doesn't matter really but it looks like IMyProductionBlock.IsProducing is not returning true on some of those blocks for some reason but MyProductionBlock.Queue.Any does. Seems to be working on my test build anyway. Not seeing that reveal/conceal loop anymore. Hope this helps figure it out. Maybe IsProducing is for something actually being produced but Queue could have something in the Queue that does not components to actually produce it.

An unrelated issue, and curse me for putting it here, is I am seeing some grids that are always concealing but never revealing. It's like they are not being concealed for some reason when it attempts to conceal them. It's the exact same 10 or so grids.

rexxar-tc commented 8 years ago

Because I changed the first one and forgot to change the second ¯_(ツ)_/¯ I'm rewriting some really old code, so these things slip through the cracks from time to time.

I noticed that as soon as I started investigating this and changed it to just check the queue. IsProducing checks if the queue is empty, so in theory it shouldn't have caused a problem. But theory and practice are very, very different in this game...

I'll check the reveal logic to see why those grids wouldn't be revealing.

Demolish50 commented 8 years ago

That's cool.

To clarifiy about the other issue. The grids are concealing every cycle. There is no reveal attempt on them. So it's like they are never actually concealing. I was a little vague there I guess.

rexxar-tc commented 8 years ago

That shouldn't be possible. It tracks which grids have been concealed precisely so it won't try to conceal the same grid multiple times.

Demolish50 commented 8 years ago

I see that but check this out.

https://pastee.org/rhhqx

Search for "dwicker multi ship" for example or "Static Grid 3962". It's a pretty short log. I'll poke around too.

Update, it looks like all of these grids are connected to something else via landing gear or connector. At least the four I looked at all where connected to another grid via connector. Upon removing the connecting block they concealed normally and no longer appear in the loop of always concealing grids.

rexxar-tc commented 8 years ago

That's interesting. I think I know what the problem is, then.

Demolish50 commented 8 years ago

It appears all the grids are doing it now after the essentials update today.

rexxar-tc commented 8 years ago

Would you mind sending me your world so I can check it out?

Demolish50 commented 8 years ago

The "all grids concealing over and over" issue is due to the change you made here:

"foreach (GridGroup group in GridGroup.GetAllGroups(GridLinkTypeEnum.Logical))"

At first I thought it was the change from physical to logical but that was not it. Looks like it should work to me but if you separate them back out the way you had it you can still change to logical and it functions. As in not all grids are forever concealing. Now even with the change to logical there is still a group of 10 grids or so (less then what it was when physical) that are always concealing.

works ok:
"var groups = GridGroup.GetGroups( entitiesFiltered, GridLinkTypeEnum.Logical ); foreach ( GridGroup group in groups )"

I'd love to know why your refactor to one line didn't work though, It might be because your not passing your hashset of entities filtered anymore. I'm not sure how GetAllGroups works.

foogs commented 8 years ago

My server big world GNR_StarSystem_world.zip P.S. I still stay on v1.134.06.179-alpha version Last version still crashes in my world(

rexxar-tc commented 8 years ago

This should be fixed in the latest update. Please let me know if you still have trouble.

Demolish50 commented 8 years ago

I think you got both issues sorted.

rexxar-tc commented 8 years ago

Awesome. I'm gonna close this then, feel free to reopen it if you have trouble again.