Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello,
  I am looking at orevein generation performance in GT5U.  Currently I am seeing numbers around 100-300ms to fill an orevein. 

I have pulled the logic into a standalone test harness, and it seems to run fairly fast, about 600uS to fill a vein (without 
any minecraft-related function calls, just randomization and loop control). I have optimized that a little, shaving off about 
60uS, but that's clearly not where the major culprit is located.

 

I was wondering if anyone has done any performance comparisons on how to step through a chunk.  Based on my read of
https://minecraft.gamepedia.com/Chunk_format it seems like doing a full Y layer at a time is the most CPU cache-friendly 
since you wouldn't jump up and down between sections.  Also, it would be ideal to order XZ so that the memory accesses
are linear and won't cause cache collisions (TMI: http://www.aristeia.com/TalkNotes/ACCU2011_CPUCaches.pdf). The current code
does looping as

  • for X
    • for Z
      • for Y

so there might be some benefit to swapping Y to the outermost loop. And possibly a benefit to swapping order of X and Z.

 

It might all be re-arranging deck chairs on the Titanic though.  My suspicion is that the major time-sink is turning the victim block into a tile entity. I'm going to try adding some measurement code to see how much of the overall time is spent doing that.  If that's the case, there isn't much to really do except lower the number of blocks converted by making veins smaller, reducing their density, or optimizing World.setBlock().

 

Also, if anyone has a more fleshed-out command line test harness for worldgen, that would be great (a fake chunk would be awesome). The variance when
testing in-game is so high it's hard to tease out if improvements actually matter.  If not, can someone point me to the Chunk class file so I can make a better simulation?

Thanks for any help!

Edited by moronwmachinegun

6 hours ago, moronwmachinegun said:

 If not, can someone point me to the Chunk class file so I can make a better simulation?

 

You should have the Minecraft and Forge source code available in the forgeSrc-<version> referenced library, so you can either browse to the Chunk class inside of it or use your IDE's Navigate To Class (IDEA, Ctrl+N)/Open Type (Eclipse, Ctrl+Shift+T) feature to open the Chunk class directly.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • 2 weeks later...
  • Author

Well, I decided i didn't want to have to re-implement half of Minecraft just so I could set a XYZ value, so I just make my fake "chunk" be an array of ints.  I have placed my "fake" oregen command-line simulation code up on my Github at https://github.com/richardhendricks/GT-standalone-oregen if it is of interest to anyone.

 performancetest.java has the basic skeleton of what I needed.  There are a couple of sample tests in there, one using a non-chunkified worldgen to generate ores, one using a chunkified worldgen that remembers generated oreveins in a hashtable, and a chunkifed GT stone boulder generator that has random XYZ dimensions skewed towards making skinny pipes instead of bland round balls. The printout is very primitive, just a text printout of the chunks.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.