Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Structure Changes (for accuracy and parity) #123

Open
break-core opened this issue May 3, 2024 · 11 comments
Open

File Structure Changes (for accuracy and parity) #123

break-core opened this issue May 3, 2024 · 11 comments

Comments

@break-core
Copy link
Contributor

break-core commented May 3, 2024

There are some files that need to be changed around, for more accuracy to the original Minecraft codebase. This should provide a more strong foundation for the ReMinecraftPE codebase all together.

Here are some changes that should be considered for a file structure change:

  • Move App, AppPlatform, and NinecraftApp to just source rather than being in /client/app. This lines up with MCPE, as asserts claim that NinecraftApp is in src (/src/NinecraftApp.cpp). It also makes sense for App and AppPlatform.
  • Move /client/app/Minecraft to source/client, as this is the path for it in Java Edition.
  • Move Font to /client/gui (matches Java Edition and PE)
  • Move Culler, Frustum, and FrustumCuller to a new folder in /client/renderer called culling, which contains culling stuff. (matches Java Edition)
  • Move DynamicTexture, FireTexture, LavaSideTexture, LavaTexture, WaterSideTexture, and WaterTexture to a new folder in /client/renderer called ptexture which has stuff related to textures.
  • Move client/options/Options into just the client folder. (matches Java Edition)
  • Move any "touch" or "touchscreen" related input code in /client/player/input to a new folder called touchscreen. (Matches PE)
  • Migrate all of source/common to a new util folder in source. (Possibly)
  • Possibly migrate all of source/renderer/GL to client/renderer?
  • Move Animal, Chicken, Cow, Pig, and WaterAnimal to a new folder in world/entity called animal which stores code related to animals.
  • Move Monster and Creeper to a new folder in world/entity called monster which holds all monster entities.
  • Move FallingTile, ItemEntity, and PrimedTnt to a new folder in world/entity called item which stores code related to item entities.
  • Move Player and Inventory to a new folder in world/entity called player which holds all player entity code. (Yes, Inventory is here too)
  • Move LocalPlayer into client/player.
  • Move the world/level/levelgen/chunk folder to world/level
  • Change the name of the path folder to pathfinder.
  • Move world/particle folder into source/client.
  • Move world/tile folder into world/level

Most of these decisions were based on reverse engineering and analysis of old Minecraft videos that show off the source tree structure. If there are any mistakes or incorrect changes I proposed, please let me know.

@iProgramMC
Copy link
Member

Well, when you say "matches JE", what version do you mean? We aren't trying to replicate any kind of modern version of the code base, otherwise tiles would be called blocks, and the Tesselator's name would be corrected to Tessellator :)

@iProgramMC
Copy link
Member

Also I was considering moving the GameMode (world/gamemode) to the client, because it uses the Minecraft class. IIRC it just allows us to specify different ways of breaking blocks.

@break-core
Copy link
Contributor Author

Well, when you say "matches JE", what version do you mean? We aren't trying to replicate any kind of modern version of the code base, otherwise tiles would be called blocks, and the Tesselator's name would be corrected to Tessellator :)

I am using a combination of both videos from older Minecraft that show the source tree, and also modern Minecraft code. Though, I only use modern MC code when I need to. This code version I'm using dates to 1.14 so it's as low as I can go. It should be as accurate as possible to older versions.

@iProgramMC
Copy link
Member

Yeah, I don't think the layout of 1.14 is representative of the beta versions of the game whose layout we're trying to figure out.

These changes aren't bad, but I do find some strange, like moving world/tile to world/level.

@break-core
Copy link
Contributor Author

break-core commented May 3, 2024

These changes aren't bad, but I do find some strange, like moving world/tile to world/level.

According to the "800+ days of Minecraft in 8 minutes" video, you can see a branch connecting to level which looks to be tile.
image

Edit: Found a clearer image of Jeb writing world/level/tile
image

@iProgramMC
Copy link
Member

So you mean to move all the tile sources to world/level/tile.

@break-core
Copy link
Contributor Author

So you mean to move all the tile sources to world/level/tile.

Yes, that is correct.

@break-core
Copy link
Contributor Author

I've edited some stuff in here that was wrong, but now that we have in fact discovered what the beta 1.0 filesystem looks like, we can technically build the filesystem how it was intended to be. I might start work on this.

@iProgramMC
Copy link
Member

iProgramMC commented May 12, 2024

BTW I suggest waiting for #120 should you want to take care of this. Otherwise there's going to be massive nasty merge conflicts. I am also thinking of starting work on this but after it's merged.

@break-core
Copy link
Contributor Author

Seems like your idea is the best. I won't make any changes just yet.

@iProgramMC
Copy link
Member

iProgramMC commented Jun 27, 2024

Update: Omniarchive published a prototype of Minecraft Beta 1.2_02, which is completely unobfuscated. This tells me a few more things:

  • world/particle should be moved to client/particle, not client
  • world/gamemode should be moved to client/gamemode
  • Options, KeyMapping and User should be moved to client (note: Timer is also in client, but since it's going to be used by a headless server in this repo soon we will keep it in a common namespace for both client and server)
  • In Java Edition, the title screen was called TitleScreen and was located in client/title. However, we will ignore this as our title screen is called StartMenuScreen
  • It seems input-related classes are located in client/player, and not client/player/input. I don't remember where the input directory came from but I do believe it was an official source too
  • Move Dimension to world/level/dimension
  • Move world/level/levelgen/chunk to world/level/chunk, ditto for biome
  • Move world/level/Material.cpp to world/level/material/Material.cpp and split out the material definitions
  • (After Bugfixes & Cleanup #120) Move Facing and Pos into source/common or whatever (they are in the net.minecraft namespace in that version

Some other notes:

  • Mth is implemented in util (not part of net.minecraft)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants