Jump to content

tuskiomi

Forge Modder
  • Posts

    153
  • Joined

  • Last visited

Everything posted by tuskiomi

  1. Hello all. It's been a while since my last post, I need some assistance from those who are familiar with the internals of the forge modding API. I want to create a wrapper around the current forge API that will allow calls to the code via HTTP. This, in theory, would allow any and all mods to run as a standalone executable, with local networking being the interface between processes. I only want to do this a server-side modification, as there would be little benefit from a client perspective. What this would do is allow a deployment of forge (and mods) over a micro services manager (ex: Kubernetes), Not only would this increase performance of mod-heavy packs significantly, it would allow for dynamic and on-the-fly updates to mods and even server jars. In all, I think this would be a drastically beneficial addition, so I want to give it a shot. My question to the community is: What would be the downsides, and what features do you think would not be possible / would be a slog to implement?
  2. Pretty much what it says on the tin. I'm looking to play around with the minecraft source code, and MCP for 1.12 really doesn't have anything close to complete function mappings. What version of forge is the most complete in terms of function mappings?
  3. Even if hashing took 10x longer, it would still be 10x shorter than stitching.
  4. I like the sound of parallel loading, but I seriously doubt that textures can be stitched in parallel, but if that's been parallelized, good work, i'm impressed. One thing I'm not sure of is this statement "I don't feel like periodically cleaning my disk of cached texture atlases, especially since different packs with the same mods would cause a new atlas set to be cached, and a resource pack change would cause a re-cache, and pack devs would see their test installation bloat with every mod added to the pack." Let's think of set theory. We have set M. set M contains all mods in your mod pack. any mod 'm' is a set containing three items: 1: s, the space that the mod takes up. 2: a set C containing source files for the mod. 3: a set R, which contains all of the resources that a mod uses. Similarly, we have an Atlas set A, for which there is one A for every one M. Set A contains all R sets within M, as well as a D set, for Directory. The A set also contains a unique element s, which is the space that A takes up. Then it follows that so long as set C is lesser in space than set D, then Mc will take up less space than Ac. In short, The atlas will always take up less space than the mods, considering that most worlds are bigger than the mods, then space won't be an issue, especially if you cull old atlases automatically.
  5. See the benchmark below. I think you are very wrong. 1.) That Is really not something that a mod should have access to. 2.) Like in Minecraft, the easter eggs are still in the game and loaded even when it is not present. Same concept flies here. 3.) That's why you hash the textures as well, not just the mod versions and names If the textures change, the jar changes, and the hash will be different. Ok! Here's my script that can load, hash ,and unload mod files in 356ms(+/- 40ms) on my computer, using the mods for the Feed-The-Beast Continuum modpack, during which the texture stitching takes 34.5 seconds, with 500ms of human error. import java.io.IOException; public class ShaHasher { public static void main(String[] args) { String cmd = "7z h -scrcSHA1 mods"; String result = ""; long timeStart = System.currentTimeMillis(); try { result = execCmd(cmd); } catch (IOException e) { e.printStackTrace(); } System.out.println(result); System.out.println("^^^CMD OUTPUT^^^"); System.out.println("Extracted SHA1 for data only: "+ getSHAContents(result)); System.out.println("Extracted SHA1 for data and names: "+ getSHAContentsAndNames(result)); System.out.print("Time taken: "); long timeStop = System.currentTimeMillis(); System.out.print(timeStop-timeStart); System.out.println(" ms."); } public static String getSHAContents(String toExtractFrom) { int loc = toExtractFrom.indexOf("SHA1 for data:"); loc +=16; while(toExtractFrom.charAt(loc) == ' ') { loc++; } int end = loc; while(toExtractFrom.charAt(end) != '\n') { end++; } return toExtractFrom.substring(loc,end-1); } public static String getSHAContentsAndNames(String toExtractFrom) { int loc = toExtractFrom.indexOf("SHA1 for data and names:"); loc +=26; while(toExtractFrom.charAt(loc) == ' ') { loc++; } int end = loc; while(toExtractFrom.charAt(end) != '\n') { end++; } return toExtractFrom.substring(loc,end-1); } public static String execCmd(String cmd) throws java.io.IOException { Process proc = Runtime.getRuntime().exec(cmd); java.io.InputStream is = proc.getInputStream(); java.util.Scanner s = (new java.util.Scanner(is)).useDelimiter("\\A"); String val = ""; if (s.hasNext()) { val = s.next(); } else { val = ""; } s.close(); return val; } } here is the output of the program. https://pastebin.com/7mTLdmkq What else can I benchark for ya?
  6. It's not really a question at this point. It is ridiculous that forge does not save the workload and dynamically generates texture maps every time. Here is how this can be done easily: When loading for the first time: 1) save a SHA checksum of all mods UUIDs (name+version) . This will be used to validate that the current mod's textures are up to date. 2) save all pngs on the drive with the checksum, and a map of item/block to the drive. 3) save a SHA checksum of all images + maps to the drive as well, to prevent user tampering. When loading after the first time: 1) load all the mods + textures, and generate a SHA checksum (This is also done the first load, but it doesn't save the sum this time) 2) verify that the sum matches the current textureset. 3) load the textures +maps. take a checksum (this should be very fast) 4) if the sum does not match, make a new textureset as if it is the first time booting, Otherwise: 5) skip stitching, and load fast. It's something that's been an annoyance for many years now, and it really should be fixed.
  7. 1/2 your posts are this If you want to look for a file image height, see here: http://stackoverflow.com/questions/672916/how-to-get-image-height-and-width-using-java if you have a resource location, you can use that to find the file, non?
  8. He is talking about the animation when the hand receeds to grab the next item in the hotbar.
  9. I beleive there is no option to disable this in minecraft right now. it is a naitive part of the game, and is likely not to change.
  10. Yes, you need a class to represent the sword. To do this, you'd make a new class that extends Item.
  11. That is something to keep in mind. i am, just going to be using to be supporting the uno, and other, common devices. like I said, i want this to be in a normal dev enviroment.
  12. Thanks, i'm going to read up on this. Any clue how long it would take to unpack a 23Mb .dll file on a standard 7200 rpm hdd? My guess is 5 seconds max. The library itself is less than 23Mb, but i want an upper limit.
  13. I had trouble deciding the forum to post this to myself. is there a way that i may pack it in to the .jar file itself?
  14. Arduino doesn't have network capabilities, sadly. I'm expecting users to have the bootloaders installed, and connected via USB, the same way development was made to work.
  15. Hello, all. I want to make a mod that ties up a real arduino and minecraft redstone in a virtual world. I've been doing research and what most people reccomend is the RXTX library, the most useful page on that is found here. however this requires you install a .dll file, and this is viewed as very shady no matter where you are. Is there an alternative? Maybe a way to send raw serial data through the port? I've been studying assembly languages, so that option may not be bad. If possible, i'd like a library that is made for arduino. thanks in advance, it means a TON. -Tusk
  16. This is true. Maybe an email to mojang with statistical facts and evidence will help. also, forge needs hookers and blackjack. Ou should get on that, lex k thx bai
  17. It may not be true when people say you only use 10% of your brain. sadly, it is true that forge only uses 13.5% of my processor. Maybe i make my own modloader in that case.
  18. what if we just throw out code from the tick into threads when the tick begins, and a processor waits until all values are returned and moves to the next tick? Or we have onethread working backwards, and one thread worKing forwards, and when they meet, the tick completes
  19. Credit where it's due, you didn't give up. You have expiremented with the code successfull. and now have a better understanding. it doesnot matter what you do, so long as you learn to do it with wht you're given.
  20. Honestly, i'd start making bukkit plugins. It's 10x easier, and is the same server code. If that doesn't appeal, i'd start with reading the documentation. if neither of those appeal, go nuts. Literally, get a basic mod going and make it do something Like open a gui, or a new window. I did the third one, i made a mod that opens a seperate window that adjusts ore generation as you navigate the window. Edit; Elaboration. I learned to mod from wuppy29, and am thinking of making coherent tutorials. Will report back. anyway, after watching wuppy, i got ahold of java syntax very quickly, and started to use different api on different projects. The use of other's apis is what i think helped the most. It gets You into the mindset of what type of author the api maker is. In this case, lex manos tends to use registries, and interfaces more than anything else. Yes, there are hooks, and events, but you'll find those in most other codes. Another example is bukkit. Bukkit is written completely on events, with little to no registry handling, or interfacing. Google api uses trees and xpaths to operate, making for excellent modules. The most important things that you always have to keep in mind, is A) read the stacktrace from top to bottom. B) if you did something with one method, 10 other people coud each use 10 of their own methods to do the same thing. Dont be afraid to ask. Don't be afraid of rejection
  21. What if I use events, waits notifies, and updateS to keep things asynchronous? Eg:the main minecraft thread coult be put into suspension untill the next tick item completes? or the engine could process future ticks, while the main thread alters them to fit?
  22. maybe I could split things categorically EG: blocks get 1 thread. Tile Entities get another Items get another. Would that work?
×
×
  • Create New...

Important Information

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