Skip to content

Add Render Distance option.#675

Merged
codeHusky merged 23 commits intosmartcmd:mainfrom
MijaeLio:main
Mar 7, 2026
Merged

Add Render Distance option.#675
codeHusky merged 23 commits intosmartcmd:mainfrom
MijaeLio:main

Conversation

@MijaeLio
Copy link
Contributor

@MijaeLio MijaeLio commented Mar 6, 2026

real.mp4

Description

  • Adds a Render Distance option for graphics menu. It can go from 2 to 64 at max.

Changes

SWF files for SettingsGraphicsMenu on every resolution, also fixing missing FOV option in those files.
GameRenderer.cpp
UIScene_SettingsGraphicsMenu.cpp
UIScene_SettingsGraphicsMenu.h
Consoles_app.cpp
App_enums.h
MediaWindows64.arc

Previous Behavior

There wasn't a way to change your render distance before. There is mentions for an option called "viewDistance" in GameRenderer.cpp. But it only uses 0 (16 Render Distance) with no way to change it normally.

Root Cause

No option for this was added on any menu before, and mc->options->viewDistance was unused for anything else than just setting up the game to use 16 chunks render distance only.

New Behavior

Make mc->options->viewDistance actually useful with adding a slider for it on Graphics Menu

Fix Implementation

I added two tables for UIScene_SettingsGraphicsMenu.cpp. LevelToDistance and DistanceToLevel to convert between slide values and chunks distances (I actually could do it without using those but it would look ugly for the slider to get 3 - 2 - 1.. values instead of 2 - 4 - 8.. values)

Updated renderDistance on GameRenderer.cpp so the game doesn't glitch when going more than 32 chunks (viewDistance 0)

As said before, updated SWF files to add this option and fix the missing FOV slider for 720 and 480

AI Use Disclosure

No AI was used. This took me the entire day and was a complete journey even if the changes are small 😭

Related Issues

@BlueishSapphire
Copy link

Looks good! But I think you accidentally left some temporary changes in Minecraft.Client/Common/UI/UIScene_LanguageSelector.cpp and Minecraft.Client/Common/UI/UIScene_LanguageSelector.h, and might've forgotten to include the updated swf files for SettingsGraphicsMenu in Minecraft.Client/Common/Media :)

@smartcmd
Copy link
Owner

smartcmd commented Mar 6, 2026

Good PR!

@codeHusky
Copy link
Collaborator

Make sure all assets are updated outside of the asset bundles (like in Common/Media and the platform folders) and then (assuming this tests well) we'll merge this in!

@codeHusky codeHusky added enhancement New feature or request performance Performance bottlenecks and bugs or maybe a room for optimizations graphics Graphical bugs or issues related to game resources priority: high QoL Quality of Life (QoL) proposals and related issues good PR Exceptionally good Pull Request labels Mar 6, 2026
@MijaeLio
Copy link
Contributor Author

MijaeLio commented Mar 6, 2026

just added the swf files on media folder

@codeHusky
Copy link
Collaborator

codeHusky commented Mar 6, 2026

I think you accidentally left some temporary changes in Minecraft.Client/Common/UI/UIScene_LanguageSelector.cpp and Minecraft.Client/Common/UI/UIScene_LanguageSelector.h

@MijaeLio Could you undo these changes? I don't see what relevance they have to this PR

Copy link
Collaborator

@codeHusky codeHusky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Temporary" changes should be rolled back before this can be merged

@codeHusky codeHusky marked this pull request as draft March 6, 2026 07:46
@void2012
Copy link
Collaborator

void2012 commented Mar 6, 2026

Awesome. What can we also improve at this point? Or I can merge already?

@EnderActually
Copy link
Contributor

Good PR, could we have an option to revert settings to their default?

@MijaeLio MijaeLio requested a review from codeHusky March 6, 2026 14:03
@MijaeLio
Copy link
Contributor Author

MijaeLio commented Mar 6, 2026

Awesome. What can we also improve at this point? Or I can merge already?

The only bug I found and that I would need help on fixing it is that when you change the render distance from the main menu before playing a world the game will still use the normal render distance, until you change the render distance again. I don't know why it happens and I need help on finding that out.

It's just a bug that happens when you first start playing. I didn't find any other bugs besides that.

@MijaeLio MijaeLio marked this pull request as ready for review March 6, 2026 14:04
@MijaeLio
Copy link
Contributor Author

MijaeLio commented Mar 6, 2026

Also sorry for taking long on reverting files lol. I was asleep

@codeHusky
Copy link
Collaborator

Id fix that main menu settings bug before we merge this. That’s a major consistency issue

@MijaeLio
Copy link
Contributor Author

MijaeLio commented Mar 6, 2026

fixed

}
}
#endif

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the purpose of this locale code change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now nothing really, I can remove that. But I had in mind to write support for a language option since languages only work on XBOX and the actual function doesn't work on windows 64, this makes the game actually get the languages for it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove that and do that in a dedicated pr

@codeHusky
Copy link
Collaborator

codeHusky commented Mar 6, 2026

image Loaded in the first time after merging this change and the render distance is visually 0?

@MijaeLio MijaeLio marked this pull request as draft March 6, 2026 19:19
@MijaeLio
Copy link
Contributor Author

MijaeLio commented Mar 6, 2026

image Loaded in the first time after merging this change and the render distance is visually 0?

This didn't really happened to me before but I'm gonna look up why is it set at 0 hold on

@MijaeLio
Copy link
Contributor Author

MijaeLio commented Mar 6, 2026

image Loaded in the first time after merging this change and the render distance is visually 0?

image Tested with clean builds for both debug and release with the latest commits and nothing seems off? Have you tried recompiling the build clean with my changes? I don't think is a swf or cpps problem

@codeHusky
Copy link
Collaborator

codeHusky commented Mar 6, 2026

  • delete x64 and restore it back to how it is in Git (discard changes)
  • build main from this repo
  • run the game
  • change a setting around, load into a world, save and exit
  • compile your pr
  • run the game
  • open world
  • open settings -> graphics
image

the issue is existing settings.dat i guess? settings.dat from before ur PR results in 0 perhaps

@CStone6
Copy link

CStone6 commented Mar 6, 2026

Nice job, looks like you got farther then me

MijaeLio added 2 commits March 6, 2026 20:07
Fixed visual bug and made the chunk updates depend to your view distance.
@MijaeLio
Copy link
Contributor Author

MijaeLio commented Mar 7, 2026

  • delete x64 and restore it back to how it is in Git (discard changes)
  • build main from this repo
  • run the game
  • change a setting around, load into a world, save and exit
  • compile your pr
  • run the game
  • open world
  • open settings -> graphics
image the issue is existing settings.dat i guess? settings.dat from before ur PR results in 0 perhaps

Just fixed this!

@MijaeLio MijaeLio marked this pull request as ready for review March 7, 2026 01:10
@MijaeLio
Copy link
Contributor Author

MijaeLio commented Mar 7, 2026

Also one more update and I hope y'all don't mind, but I made it so the chunk updates now depends to your view distance

Minecraft 6_03_2026 20_05_26 (1) Minecraft 6_03_2026 20_01_51

First image is now
Second is before

@codeHusky codeHusky merged commit 1644626 into smartcmd:main Mar 7, 2026
1 check passed
tm5k pushed a commit to tm5k/RickCraft that referenced this pull request Mar 7, 2026
* FOV option without debug menu

Now located in Graphics section.

Based on the FOV thing from discord idk

* language

* render distance option for graphics menu

* oop

* swf files on media

* revert changes on language selector

* nvm it was actually easy to fix

* forgot this

* Final probably

Fixed visual bug and made the chunk updates depend to your view distance.
tm5k pushed a commit to tm5k/RickCraft that referenced this pull request Mar 8, 2026
* FOV option without debug menu

Now located in Graphics section.

Based on the FOV thing from discord idk

* language

* render distance option for graphics menu

* oop

* swf files on media

* revert changes on language selector

* nvm it was actually easy to fix

* forgot this

* Final probably

Fixed visual bug and made the chunk updates depend to your view distance.
piebotc pushed a commit to piebotc/LegacyEvolved that referenced this pull request Mar 9, 2026
* FOV option without debug menu

Now located in Graphics section.

Based on the FOV thing from discord idk

* language

* render distance option for graphics menu

* oop

* swf files on media

* revert changes on language selector

* nvm it was actually easy to fix

* forgot this

* Final probably

Fixed visual bug and made the chunk updates depend to your view distance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request good PR Exceptionally good Pull Request graphics Graphical bugs or issues related to game resources performance Performance bottlenecks and bugs or maybe a room for optimizations priority: high QoL Quality of Life (QoL) proposals and related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants