Jump to content

[1.18] Saving a network


1HA

Recommended Posts

I almost finished dealing with my mod cable networking.

I made machine BEs as a TreeNode, for hierarchical management.
but I don't think it's a good idea to search for its parent node in every moment a player joins the game. ( tech mod has a lot of BEs, as you know )
Thus, I want them to save their child nodes somehow when the player quit the game.

I thought I can save each child node by putting it into a tag, but I think this is inefficient.

Is there any other way?

Link to comment
Share on other sites

Players have nothing to do with it, except in how they decide which chunks are loaded (render distance) and which are ticking (simulation distance).

What you need to think about is what happens when your "parent" is not loaded into the world or not ticking while the other block is. Or vice versa.

And how that will change as players move around loading and unloading (or pausing and restart ticking) chunks.

 

Usually people side step some of these complications and just

* store all the networks in Level SavedData, https://forge.gemwire.uk/wiki/Saved_Data

* load all of the networks when the level is loaded

but this can have scalability issues.

 

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

19 hours ago, warjort said:

Players have nothing to do with it, except in how they decide which chunks are loaded (render distance) and which are ticking (simulation distance).

What you need to think about is what happens when your "parent" is not loaded into the world or not ticking while the other block is. Or vice versa.

And how that will change as players move around loading and unloading (or pausing and restart ticking) chunks.

 

Usually people side step some of these complications and just

* store all the networks in Level SavedData, https://forge.gemwire.uk/wiki/Saved_Data

* load all of the networks when the level is loaded

but this can have scalability issues.

 

So, you mean the basic problem of this is that the network has to be loaded partially when the chunk has loaded, right?

I have googled it... and watched this. (https://www.youtube.com/watch?v=prqMxqUtj-0)

Then how can I load the network when the chunk has loaded?

I have an idea which is about checking whether a new chunk has been loaded inside clientSetup(). Is it ok?

Thx for answering

Link to comment
Share on other sites

Why would client setup have anything to do with this? I doubt you want to do anything on the client for this and you can't reference the world from setup anyway.

 

This part isn't difficult to understand is it?

When the chunks are loaded the blocks in that chunk are loaded. When the chunks are ticking the blocks are ticking.

 

What is difficult to handle is when parts of your network are in different states, "loaded and ticking", "loaded but not ticking", "not loaded" and transitioning between these states.

You should research the different implementations of this, e.g. beyond the obvious ae2 and refined storage: https://www.curseforge.com/minecraft/mc-mods/search?search=network

Each has different trade offs.

 

If you are trying to code this from a "tutorial" (I didn't look at the video) then good luck. 🙂

You need a much deeper understanding of how minecraft actually works to do this properly. 

 

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.