Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Minecraft Forge
  • General Discussion
  • Forge one-time injection
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 2
MGlolenstine

Forge one-time injection

By MGlolenstine, June 28, 2017 in General Discussion

  • Reply to this topic
  • Start new topic

Recommended Posts

MGlolenstine    1

MGlolenstine

MGlolenstine    1

  • Creeper Killer
  • MGlolenstine
  • Members
  • 1
  • 106 posts
Posted June 28, 2017

Why doesnt' FML inject mods once and then only re-injects if there are changes in mods?

It'd be easier and faster to play bigger modpacks.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7691

diesieben07

diesieben07    7691

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7691
  • 56337 posts
Posted June 28, 2017

Please clarify what you mean by "injection".

  • Quote

Share this post


Link to post
Share on other sites

MGlolenstine    1

MGlolenstine

MGlolenstine    1

  • Creeper Killer
  • MGlolenstine
  • Members
  • 1
  • 106 posts
Posted June 28, 2017
4 minutes ago, diesieben07 said:

Please clarify what you mean by "injection".

Well.. Isn't Forge injecting minecraft.jar at every start?

 

Screenshot from 2017-06-28 15-59-12.png

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7691

diesieben07

diesieben07    7691

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7691
  • 56337 posts
Posted June 28, 2017 (edited)

Forge is not "injecting minecraft.jar". The game code is transformed on the fly as it is loaded from disk. That is not the slow part of starting up Minecraft. The slow part is (among other things) the model creating, which just takes a long time with a lot of mods.

Edited June 28, 2017 by diesieben07
  • Quote

Share this post


Link to post
Share on other sites

MGlolenstine    1

MGlolenstine

MGlolenstine    1

  • Creeper Killer
  • MGlolenstine
  • Members
  • 1
  • 106 posts
Posted June 28, 2017 (edited)
1 minute ago, diesieben07 said:

Forge is not "injecting minecraft.jar". The game code is transformed on the fly as it is loaded from disk. That is not the slow part of starting up Minecraft. The slow part is (among other things) the model creating, which just takes a long time with a lot of mods.

Oh, ok so I misunderstood the whole concept of forge :P 

But why is it creating models at every launch?

Couldn't you just store them?

Edited June 28, 2017 by MGlolenstine
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7691

diesieben07

diesieben07    7691

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7691
  • 56337 posts
Posted June 28, 2017

Not necessarily. There is no easy way for Forge to know whether something in a mod has changed that would change the generated model to change. Has this config file you changed caused the Model to change? We don't know. Is this Model download from an URL which has a different model every time? We don't know.

All this prevents from Forge "just storing models". As very often in Computer Science the obvious "just do X" answer is sadly not correct.

  • Quote

Share this post


Link to post
Share on other sites

MGlolenstine    1

MGlolenstine

MGlolenstine    1

  • Creeper Killer
  • MGlolenstine
  • Members
  • 1
  • 106 posts
Posted June 28, 2017
4 minutes ago, diesieben07 said:

Not necessarily. There is no easy way for Forge to know whether something in a mod has changed that would change the generated model to change. Has this config file you changed caused the Model to change? We don't know. Is this Model download from an URL which has a different model every time? We don't know.

All this prevents from Forge "just storing models". As very often in Computer Science the obvious "just do X" answer is sadly not correct.

Ok, I was wrong and I'm sorry. :P 

  • Quote

Share this post


Link to post
Share on other sites

GameGlitz    0

GameGlitz

GameGlitz    0

  • Tree Puncher
  • GameGlitz
  • Members
  • 0
  • 8 posts
Posted January 22, 2019

Actually, you are not wrong. I know this is a necropost, but the reason this is not wrong, is because instead of loading all the mods into the RAM, using up CPU power (older machines don't have a lot, so it takes a long time to load mods sometimes), Forge can do a 1 time load onto the hard drive, and leave it like that, and keep an MD5 checksum of every mod, and recheck the MD5 checksum every launch, and if it remains the same, just allow the game to load as NORMAL. This is the only way I can really think of, (yes, I know you can also do an SHA256 and SHA1 checksum, but MD5 is faster to calculate) and if anyone has more idea's of ways, or a way to prove me wrong, please reply to this thread. Thank you, goodbye.

  • Quote

Share this post


Link to post
Share on other sites

MGlolenstine    1

MGlolenstine

MGlolenstine    1

  • Creeper Killer
  • MGlolenstine
  • Members
  • 1
  • 106 posts
Posted January 22, 2019
3 minutes ago, GameGlitz said:

Actually, you are not wrong. I know this is a necropost, but the reason this is not wrong, is because instead of loading all the mods into the RAM, using up CPU power (older machines don't have a lot, so it takes a long time to load mods sometimes), Forge can do a 1 time load onto the hard drive, and leave it like that, and keep an MD5 checksum of every mod, and recheck the MD5 checksum every launch, and if it remains the same, just allow the game to load as NORMAL. This is the only way I can really think of, (yes, I know you can also do an SHA256 and SHA1 checksum, but MD5 is faster to calculate) and if anyone has more idea's of ways, or a way to prove me wrong, please reply to this thread. Thank you, goodbye.

First of all, thank you for replying to this post ?. I was thinking of the same thing, with the hashing and storing everything on the HDD, but I think that the problem with mod updates isa great one, I know you could only rebuild it when mods updare, but still... Thing that I think would be the most trouble, would have to be the different mod distinction, as some mods inject directly into the code and it's hard for Forge to determine which mod the change is coming from.

 

Thanks again, and I hope that we get something along these lines in the future ?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7691

diesieben07

diesieben07    7691

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7691
  • 56337 posts
Posted January 22, 2019
1 hour ago, GameGlitz said:

Actually, you are not wrong. I know this is a necropost, but the reason this is not wrong, is because instead of loading all the mods into the RAM, using up CPU power (older machines don't have a lot, so it takes a long time to load mods sometimes), Forge can do a 1 time load onto the hard drive, and leave it like that, and keep an MD5 checksum of every mod, and recheck the MD5 checksum every launch, and if it remains the same, just allow the game to load as NORMAL. This is the only way I can really think of, (yes, I know you can also do an SHA256 and SHA1 checksum, but MD5 is faster to calculate) and if anyone has more idea's of ways, or a way to prove me wrong, please reply to this thread. Thank you, goodbye.

Have you looked at how mod loading works? Probably not, because this is not feasible.

  • Quote

Share this post


Link to post
Share on other sites

Busti    72

Busti

Busti    72

  • Dragon Slayer
  • Busti
  • Forge Modder
  • 72
  • 624 posts
Posted January 27, 2019 (edited)

I think your best shot at skipping the loading screen would be to load Minecraft in a Virtual Machine and saving it's state to disk without quitting Minecraft, instead of shutting it down.

Edited January 27, 2019 by Busti
  • Quote

PM's regarding modding questions should belong in the Modder Support sub-forum and won't be answered.

Share this post


Link to post
Share on other sites

loordgek    176

loordgek

loordgek    176

  • World Shaper
  • loordgek
  • Members
  • 176
  • 1823 posts
Posted January 27, 2019

1.13 will be loading faster, mods will load parallel

  • Quote

Share this post


Link to post
Share on other sites

GameGlitz    0

GameGlitz

GameGlitz    0

  • Tree Puncher
  • GameGlitz
  • Members
  • 0
  • 8 posts
Posted January 28, 2019
On 1/27/2019 at 3:08 PM, Busti said:

 

"I think your best shot at skipping the loading screen would be to load Minecraft in a Virtual Machine and saving it's state to disk without quitting Minecraft, instead of shutting it down." - Busti

 

This makes sense, as Java uses it's own Virtual Machine, called the JVM. Running another JVM inside the main JVM via the framework itself will allow us to run Minecraft once, and then save the state. Then we can launch that machine every time the game starts, but check the MD5 hash of mods and files before starting. This speeds up a LOT.

 

On 1/22/2019 at 7:10 PM, diesieben07 said:

Have you looked at how mod loading works? Probably not, because this is not feasible.

RUDE.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7691

diesieben07

diesieben07    7691

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7691
  • 56337 posts
Posted January 28, 2019
5 minutes ago, GameGlitz said:

RUDE.

Please clarify how I was rude?

  • Quote

Share this post


Link to post
Share on other sites

GameGlitz    0

GameGlitz

GameGlitz    0

  • Tree Puncher
  • GameGlitz
  • Members
  • 0
  • 8 posts
Posted January 28, 2019
  1. Forge one-time injection

    diesieben07 replied to MGlolenstine's topic in General Discussion

    Please clarify how I was rude?
    •  1 minute ago
    •  
    •  13 replies
  2. diesieben07

    Ore Variant Textures Not Working Properly

    diesieben07 replied to Viking 2481's topic in Modder Support

    That is literally how any programming language works...
    •  3 hours ago
    •  
    •  4 replies
  3. diesieben07

    Access transformers doesn't work with forge classes

    diesieben07 replied to hohserg's topic in Modder Support

    No! Don't do this. You must not be accessing the world in your model, since the model may be rendered on a different thread, so you will cause random and seemingly inexplicable crashes. Any information necessary for the model to render must be stored in the IBlockState.
    •  3 hours ago
    •  
    •  7 replies
  4. diesieben07

    Access transformers doesn't work with forge classes

    diesieben07 replied to hohserg's topic in Modder Support

    What are you trying to achieve? Why do you need access to this class?
    •  4 hours ago
    •  
    •  7 replies
  5. diesieben07

    The game crashed whilst exception in server tick loop Error: java.lang.IllegalArgumentException: Duplicate id value for 23!

    diesieben07 replied to betaninja's topic in Support & Bug Reports

    1.7.10 and older are no longer supported on this forum due to their age. Update to a modern version of Minecraft to receive support. You have been told this already, consider this a warning.

 

This is a paste of all the rude things you have said, PLEASE take it down. It is very selfish.

  • Confused 1
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7691

diesieben07

diesieben07    7691

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7691
  • 56337 posts
Posted January 28, 2019
3 minutes ago, GameGlitz said:

This is a paste of all the rude things you have said, PLEASE take it down. It is very selfish.

None of your quoted posts were rude or selfish.

  • Like 1
  • Quote

Share this post


Link to post
Share on other sites

GameGlitz    0

GameGlitz

GameGlitz    0

  • Tree Puncher
  • GameGlitz
  • Members
  • 0
  • 8 posts
Posted January 28, 2019 (edited)

You are joking. They are all very rude.

Edited January 28, 2019 by GameGlitz
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7691

diesieben07

diesieben07    7691

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7691
  • 56337 posts
Posted January 28, 2019
1 minute ago, GameGlitz said:

You are joking. They are all very rude.

This is getting very off topic. If you wish to continue this discussion either PM me or make a new thread in Off-Topic if you think it should be public.

  • Quote

Share this post


Link to post
Share on other sites

GameGlitz    0

GameGlitz

GameGlitz    0

  • Tree Puncher
  • GameGlitz
  • Members
  • 0
  • 8 posts
Posted January 28, 2019

Okay. Lets get back on topic. With a VM it is possible however.

  • Quote

Share this post


Link to post
Share on other sites

GameGlitz    0

GameGlitz

GameGlitz    0

  • Tree Puncher
  • GameGlitz
  • Members
  • 0
  • 8 posts
Posted January 28, 2019

When the creator of this thread comes back online, I'm going to start up Eclipse and try out my thoughts.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7691

diesieben07

diesieben07    7691

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7691
  • 56337 posts
Posted January 28, 2019
1 minute ago, GameGlitz said:

Okay. Lets get back on topic. With a VM it is possible however.

In theory, yes.

In practice this has several disadvantages:

  • VMs have a performance overhead, especially on hardware that does not natively support it.
  • Passing through a graphics card to the VM is a complicated process requiring expensive software and a specialized host OS. It also makes the card unavailable to the host.
  • You now have two OSs you need to keep up to date (your main OS and the one in the VM).

This is just what I can come up with off the top of my head. Feel free to do this for your own use, but this is not something in the scope of Forge, imho.

  • Quote

Share this post


Link to post
Share on other sites

GameGlitz    0

GameGlitz

GameGlitz    0

  • Tree Puncher
  • GameGlitz
  • Members
  • 0
  • 8 posts
Posted January 28, 2019

Updates are not required, as what I am talking about is different. If you intergrate a VM for forge to load mods, and then pass the session over to the JVM on the host computer, it is possible. I have started to experiment in Eclipse, and I have to say I am VERY close to getting this core-mod to work.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7691

diesieben07

diesieben07    7691

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7691
  • 56337 posts
Posted January 28, 2019

Considering the standard VM has no "take over this session" functionality that I am aware of I will be very keen on seeing your solution.

  • Quote

Share this post


Link to post
Share on other sites

GameGlitz    0

GameGlitz

GameGlitz    0

  • Tree Puncher
  • GameGlitz
  • Members
  • 0
  • 8 posts
Posted January 28, 2019

I have actually done it. This core-mod still isn't ready for production, but it works PERFECTLY for me. What I have done is created a Linux distro that contains a very simple architecture (just Java on Arch Linux) which will boot up at Minecraft's start, and then reload mods to the drive if the MD5 hash of any files have changed (apart from the Minecraft settings and Optifine settings). Then, it will hibernate the VM, and then put the session onto a container on the main PC, which will put you on a loading screen overlaying the title screen, which will then take the session out of the container, and close Minecraft, replacing it with the loaded modded version. Then it will close the container, and leave the VM hibernated. This is a very complicated method, and if you manually delete the VM files from the .minecraft\config\GameGlitzVM\ folder, it will have to load each mod again, resulting in no difference of load times. However, when you close the game, shutdown your computer, leave it for 2 mins, and boot it back up, then launch Minecraft, it will automatically restore the session into a container, then onto the host computer.

I am now working on a re-auth system to auth you to the official Minecraft servers again, so that you can play on servers (else what is the use). I have seen a mod called ReAuth that does what I need, but it requires you to enter your account details, so I will find a way to use the account that the launcher used to start the game. Please reply with any way to help me reauth.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7691

diesieben07

diesieben07    7691

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7691
  • 56337 posts
Posted January 28, 2019

Call me rude again, but until you actually show some code of this working, I am very skeptical.

  • Like 3
  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 2
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Eksity
      Another freaking "error in currently selected datapacks prevented world from loading"

      By Eksity · Posted 11 minutes ago

      Basically the title. I Try to get into my pre-existing world, and gave me an error that said "Error in currently selected data packs prevented the world from loading." along with safe mode and return to title. I mess around with my mod list a lot because I make modded MC content for YouTube and TikTok, But the mods I have removed in the past 3 days are quark, quark oddities, quark biomes o' plenty, armorplus, and thedragonlib along with a custom mcreator mod I never uploaded anywhere. I don't use a specific modpack, but rather a collection of mods i find interesting. latest.log: https://gist.github.com/Eksity/9e4b219018a1a519c9ab615c31c629f7   is there any advice, or anything you can do to help?
    • Zeher_Monkey
      [SOLVED] 1.16.3 How to get the World Name for saving files in the /saves folder

      By Zeher_Monkey · Posted 18 minutes ago

      Very true, but to be honest my code only needed a few lines updated. I want to move to something more native, but am struggling to find references to WorldSavedData. I am not worried about compact data, there is only 1 master file which contains each registered object, and each object is only ~3KB in size. It allows easy debugging, and on servers specifically, tweaks to the data that do not require things like NBTExplorer to use. It works for my purposes.
    • Differentiation
      Is it possible to change the color of Firework Spark particle?

      By Differentiation · Posted 25 minutes ago

      Hey,   Pretty simple question: is it possible to specify a color for the firework spark particle effect when spawning it?   Thanks
    • brok4d
      Modded 1.16 fluid has no physics

      By brok4d · Posted 33 minutes ago

      Well, you should have it, since that's why you get the error, the .png files and the .mcmeta files since the .mcmeta files are for animation if I'm not mistaken. This is what the .mcmeta have. { "animation": { "frametime": 4 } }
    • sc0rich
      how do I config mods in 1.16.4?

      By sc0rich · Posted 35 minutes ago

      Oh, okay.       wait, then how do I access the configurations? do you know where do I go? how I edit .cfg and .toml files? cause I just found it
  • Topics

    • Eksity
      0
      Another freaking "error in currently selected datapacks prevented world from loading"

      By Eksity
      Started 11 minutes ago

    • Zeher_Monkey
      8
      [SOLVED] 1.16.3 How to get the World Name for saving files in the /saves folder

      By Zeher_Monkey
      Started Wednesday at 12:20 AM

    • Differentiation
      0
      Is it possible to change the color of Firework Spark particle?

      By Differentiation
      Started 25 minutes ago

    • NullDev
      3
      Modded 1.16 fluid has no physics

      By NullDev
      Started 4 hours ago

    • sc0rich
      6
      how do I config mods in 1.16.4?

      By sc0rich
      Started Yesterday at 02:11 AM

  • Who's Online (See full list)

    • Hubmac
    • Eksity
    • Pera666
    • CookieLukas
    • abbepe
    • Deadlocked47
    • Kaiser Frederick
    • Seynox
    • Differentiation
    • Pickle_Face5
    • TeaWithBebeLoca
    • brok4d
    • Seika85
    • Zeher_Monkey
  • All Activity
  • Home
  • Minecraft Forge
  • General Discussion
  • Forge one-time injection
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community