The-Fireplace-Minecraft-Mods / TickDynamic

Public Issues repository for the Minecraft mod Tick Dynamic.
MIT License
15 stars 3 forks source link

1.11.2 Sponge Forge server fails to start. #17

Open cnibbler opened 7 years ago

cnibbler commented 7 years ago

Hi,

1.11.2 Sponge Forge server fails to start. Have tried forge build versions 2315 and 2393 with sponge build versions 2438 and 2484 respectively. The only mod in the mods folder, other than the sponge jar, is TickDynamic-1.11.2-1.0.0.jar.

Are you able to help?

I've attached my fml-server-latest.log files, one is when I used SpongeBootstrap v0.3.0 as a test. Let me know if you need any other info.

Thanks,

fml-server-latest_WithSpongeBootStrap.log.txt fml-server-latest.log.txt

TekuSP commented 7 years ago

Same issue with my Sponge.

The-Fireplace commented 7 years ago

I am aware that Sponge and Tick Dynamic do not currently work together. I am working to resolve the issue.

ryantheleach commented 6 years ago

@The-Fireplace Do you need any assistance from Sponges side? I can't speak for the rest of the team but this is exactly the sort of performance tweaks that we already have mixins for. I assume that the team would be open to improving the compatibility, if not integrating your changes into a mixin plugin.

The-Fireplace commented 6 years ago

@ryantheleach Honestly, I feel like integrating these changes into a mixin plugin would be ideal, since trying to make the Forge edition and Sponge play nice is not working out. My initial plan was to get a SpongeForge workspace set up and make a hybrid edition dependent on Sponge and Forge, simply because I am not nearly as familiar with Sponge as I am with Forge. Doing it like that would allow me to port the features that conflicted with Sponge to Sponge and leave the rest alone. However, as you saw, I could never get a SpongeForge workspace working on 1.11.2, and I recall re-attempting it on 1.12.2 and having even more issues. All of that said, I don't want to be the one to make this a Sponge plugin. If you or someone else wants to do so, I'll gladly grant whoever does it Author status on the CurseForge. Let me know what you think.

ryantheleach commented 6 years ago

@The-Fireplace see: https://github.com/SpongePowered/SpongeCommon/issues/1713#issuecomment-357768548

@Gabizou seems somewhat interested in having this in Sponge itself, co-operation withstanding, Of course you would be allowed to maintain the ForgeMod version yourself after we work out together how best to get this on the Mixin platform (It's my suspicion that it would be more maintainable then the asm patching you currently do)

Otherwise, if you would not like it to be in the Sponge codebase, once being a Forge coremod that uses mixins, it would be pretty trivial to add a class to wrap and port the core mod to Sponge Vanilla I suspect.

Anyway, first things first, we need to know what's being patched, and what path you would like to take. I really don't want to be stepping on your toes as an author.

The-Fireplace commented 6 years ago

@ryantheleach @gabizou Feel free to merge the changes into Sponge. As for what's being patched, I believe it is just Entity and TileEntity, both being made to extend com.wildex999.tickdynamic.listinject.EntityObject. I think the only other change to vanilla code is done with reflection, replacing the world's profiler with a custom one when the world loads. @wildex999 tell me if I forgot anything.

gabizou commented 6 years ago

Ah, see I've done a few changes of my own with regards to the profiler. For starters, Sponge overwrites the entire profiler, to reduce possibility of the profiler even being enabled on the server to gather stats for nothing, and then secondly, Sponge comments out the calls to the profiler in world tick methods.

More about what I'm asking about how your mod works in determining what entities and tile entities tick, that's more about the logic that I'm not seeing happen in the transformer. In Sponge, more than likely because we wouldn't superclass the Entity class, we'd more likely to implement as an interface of our own much like EntityObject performing it's function as a common "superclass" if you will.

The-Fireplace commented 6 years ago

The determination for how much time is given for things to tick is done by the TimeManager class. Details on how it works can be found here. The determination for which entities tick is done using EntityIteratorTimed, which remembers what index it stopped at in the entity list at the end of the last tick and continues based on it next tick it is used. When it reaches the end of the list, it loops around to the beginning.

I hope that answered your question.

wildex999 commented 6 years ago

As far as I can remember from writing this code:

gabizou commented 6 years ago

I see, so correct me if I'm wrong, but this is my understanding: TickDynamic does a sanity check where if there's (for example) 13k entities, and 80k tile entities, and by the time the entities are ticked, say we reach the first 8k entities, and 43k tile entities, the remainder will be ticked the next tick? And the entities/tileentities that were ticked this tick will not be ticked the next tick?

The-Fireplace commented 6 years ago

Not necessarily. Using your example, if 8000 entities can be ticked each tick, and the list contains 13000 entities, indexed from 0 to 12999: The first tick, entities 0-7999 are ticked. The second tick, entities 8000-12999 are ticked, then since it can tick 8000 per tick, and it has only ticked 4999, it then ticks entities 0-3000 in that same tick, because it loops back around. The third tick, it would tick entities 3001-11001. And so on... The same system goes for tile entities.

gabizou commented 6 years ago

I see. I can muscle getting that implemented in sponge pretty nicely then. I’ll provide credit where possible in the changes. Will have this pinned for things to do.

The-Fireplace commented 6 years ago

Sounds great. Let me know when it's done so I can let the users know.