-
-
Notifications
You must be signed in to change notification settings - Fork 30
Implement BOTI portal rendering with server-client chunk streaming #1986
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
Draft
Copilot
wants to merge
16
commits into
finally-real-boti
Choose a base branch
from
copilot/fix-boti-lighting-issue
base: finally-real-boti
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add proper lighting to WorldGeometryRenderer block entity rendering - Import LightmapTextureManager and use pack() for light values - Add WorldGeometryRenderer instance to TardisExteriorBOTI - Replace EndGateway placeholder with real interior world rendering - Implement coordinate transformations for exterior-to-interior view Co-authored-by: Loqor <65447472+Loqor@users.noreply.github.com>
- Apply inverse bobbing transformations in TardisDoorBOTI before camera transforms - Add cleanup on disconnect to free BOTI renderer resources - Clear render queues on world unload to prevent stale data - Add TardisExteriorBOTI.cleanup() for proper resource management Co-authored-by: Loqor <65447472+Loqor@users.noreply.github.com>
- Replace static renderers with per-TARDIS renderer maps in BOTI class - Add MAX_RENDERERS limit with simple LRU eviction to prevent memory issues - Update TardisDoorBOTI to use getInteriorRenderer(tardisId) - Update TardisExteriorBOTI to use getExteriorRenderer(tardisId) - Add cleanupAllRenderers() method for proper cleanup on disconnect - Add updateAllRendererProjections() for window resize handling Co-authored-by: Loqor <65447472+Loqor@users.noreply.github.com>
- Create BOTIPortalTracker singleton class in portal.server package - Track which players are viewing which portals - Track which chunks are being viewed through portals - Add methods for player start/stop watching portals - Add chunk load/unload notification handlers - Add player disconnect cleanup - Include PortalView class to represent portal viewing state - Placeholder TODOs for actual packet sending (needs network integration) Co-authored-by: Loqor <65447472+Loqor@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix lighting for the rendered world inside BOTI
Implement BOTI portal rendering with lighting, multi-instance support, and resource management
Feb 2, 2026
Signed-off-by: loqor <loqor@amblelabs.dev>
- Implement all TODO methods in BOTIPortalTracker - Add sendChunkToPlayer() to send ChunkDataS2CPacket to players - Track sent chunks per player to avoid redundant sends - Send chunk data in tick(), onChunkLoad(), and handle unload in onChunkUnload() - Create BOTIServerEvents to hook tracker into server tick and player disconnect - Add ServerChunkManagerMixin to notify tracker on chunk load - Register BOTI packet handlers on server and client - Initialize BOTIServerEvents in AITMod.onInitialize() - Add mixin entry to ait.mixins.json Co-authored-by: Loqor <65447472+Loqor@users.noreply.github.com>
- Create StartWatchingPortalC2SPacket and StopWatchingPortalC2SPacket - Create BOTIClientTracker to manage client-side portal viewing state - Register new packets in BOTIServerEvents - Integrate tracker calls in doorBOTI and exteriorBOTI rendering methods - Send start watching when doors are open and being rendered - Clear tracker on disconnect - Now fully functional: client notifies server when viewing portals, server sends chunks Co-authored-by: Loqor <65447472+Loqor@users.noreply.github.com>
Copilot
AI
changed the title
Implement BOTI portal rendering with lighting, multi-instance support, and resource management
Implement BOTIPortalTracker chunk streaming for portal rendering
Feb 3, 2026
Member
|
@copilot |
Member
|
this is so funny all it needs to do is add a |
Copilot stopped work on behalf of
duzos due to an error
February 3, 2026 00:23
Member
|
yeah copilot is ass |
- Add cleanup() method to TardisDoorBOTI that delegates to BOTI.cleanupAllRenderers()
- Fix ExampleClientMod to use BOTI.updateAllRendererProjections() instead of non-existent getInteriorRenderer()
- Fix DirectedGlobalPos.getWorld() to getDimension() in AITModClient
- Construct TARDIS interior dimension key as ait-tardis:{tardis-uuid}
- Fix BOTIDataS2CPacket handler to call packet.handle() directly
- Build now succeeds with Java 21
Co-authored-by: Loqor <65447472+Loqor@users.noreply.github.com>
Copilot
AI
changed the title
Implement BOTIPortalTracker chunk streaming for portal rendering
Fix BOTI cleanup and ExampleClientMod after per-TARDIS renderer refactoring
Feb 3, 2026
Copilot
AI
changed the title
Fix ServerChunkManagerMixin targeting non-existent loadChunk method
Fix ServerChunkManagerMixin transformation failure
Feb 3, 2026
- Remove chunk sending from onChunkLoad() to prevent infinite recursion - Add ThreadLocal re-entry guard in ServerChunkManagerMixin - onChunkLoad() now only logs, tick() handles all chunk sending - Fixes crash when exiting TARDIS to exterior world Co-authored-by: Loqor <65447472+Loqor@users.noreply.github.com>
Copilot
AI
changed the title
Fix ServerChunkManagerMixin transformation failure
Fix infinite recursion in BOTI chunk loading hook
Feb 3, 2026
- Create InteriorPortalDataManager for viewing TARDIS interior from exterior - Create ExteriorPortalDataManager for viewing exterior world from interior - Remove hardcoded 0,0 chunk center, use actual door positions - Update TardisExteriorBOTI to use InteriorPortalDataManager with interior world - Update TardisDoorBOTI to use ExteriorPortalDataManager with exterior world - Modify WorldGeometryRenderer to accept PortalDataManager parameter - Add updateCenter() methods to position fake players at door locations - Update cleanup code to reset all portal data managers - Fixes: exterior view now shows interior world, not overworld Co-authored-by: Loqor <65447472+Loqor@users.noreply.github.com>
Copilot
AI
changed the title
Fix infinite recursion in BOTI chunk loading hook
Fix BOTI portal rendering to use correct world dimensions and dynamic positioning
Feb 3, 2026
…al worlds - Create BOTIChunkDataS2CPacket to wrap ChunkDataS2CPacket with routing info - Packet includes TARDIS ID and view direction (interior/exterior) - Server sends wrapped packets instead of raw ChunkDataS2CPacket - Client routes packets to InteriorPortalDataManager or ExteriorPortalDataManager - Prevents vanilla client from loading portal chunks into actual world - Register packet handler on client side - Fixes issue where entire view distance showed interior instead of just portal view Co-authored-by: Loqor <65447472+Loqor@users.noreply.github.com>
Copilot
AI
changed the title
Fix BOTI portal rendering to use correct world dimensions and dynamic positioning
Implement functional BOTI portal rendering with proper world isolation
Feb 3, 2026
- Add onChunkLoadedCallback to PortalDataManager - Callback invoked in scheduleRenderChunk() when chunks load - InteriorPortalDataManager marks all exterior renderers dirty on chunk load - ExteriorPortalDataManager marks all interior renderers dirty on chunk load - Add markAllInteriorRenderersDirty() and markAllExteriorRenderersDirty() to BOTI - Fixes issue where nothing rendered because geometry never rebuilt after chunks arrived Co-authored-by: Loqor <65447472+Loqor@users.noreply.github.com>
Copilot
AI
changed the title
Implement functional BOTI portal rendering with proper world isolation
Implement BOTI portal chunk streaming and rendering
Feb 3, 2026
Copilot stopped work on behalf of
Loqor due to an error
February 3, 2026 04:17
Copilot
AI
changed the title
Implement BOTI portal chunk streaming and rendering
Implement BOTIPortalTracker chunk streaming for portal rendering
Feb 3, 2026
Copilot
AI
changed the title
Implement BOTIPortalTracker chunk streaming for portal rendering
Implement BOTI portal rendering with server-client chunk streaming
Feb 3, 2026
e716632 to
d6d6c74
Compare
Member
|
this code is so ass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A: Tardis Components
Area: Tardis components & manager.
S: Needs Review
Status: Requires additional reviews before being fully accepted.
S: Untriaged
Status: Indicates an item has not been triaged and doesn't have appropriate labels.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
BOTI (Bigger On The Inside) allows viewing TARDIS interior from exterior and vice versa. Initial implementation had skeleton code with TODOs and critical bugs preventing any rendering.
Core Implementation
Separate portal worlds per view direction
InteriorPortalDataManager- maintains fake ClientWorld for TARDIS interior chunksExteriorPortalDataManager- maintains fake ClientWorld for exterior chunksServer-side chunk streaming
BOTIPortalTracker- tracks which players view which portals, sends chunks to viewersServerChunkManagerMixin- hooks chunk loading to notify trackerBOTIChunkDataS2CPacket- wraps ChunkDataS2CPacket with routing metadata (TARDIS ID, view direction)Per-TARDIS renderer management
Map<UUID, WorldGeometryRenderer>for interior/exteriorCritical Fixes
Stack overflow on chunk load
onChunkLoad()callingsendChunkToPlayer()→world.getChunk()→ infinite recursionRenderer-world mismatch
Lag on relog with open doors
markAllRenderersDirty()individually (hundreds per frame)flushPendingCallbacks()Lighting
LightmapTextureManager.pack(blockLight, skyLight)to block entity renderingView bobbing
Packet Flow
Technical Details
ait-tardis:{uuid}calculateInverseBobbing()applied to matricesOriginal prompt
BOTI (Bigger On The Inside) Implementation Improvements
Overview
The BOTI effect allows players to see the TARDIS interior/exterior through the doors, creating the "bigger on the inside" illusion from Doctor Who. The current implementation on
finally-real-botihas a working interior-to-exterior view (TardisDoorBOTI), but needs several critical improvements.Priority Tasks (marked with [!!])
1. [!!] Fix Lighting for the Rendered World Inside BOTI
The
WorldGeometryRenderercurrently renders chunks but lighting appears broken/dark. The lighting data needs to be properly applied when rendering.Current Code Location:
src/main/java/dev/loqor/portal/client/WorldGeometryRenderer.javaThe
PortalDataManageralready handlesLightDatainreadLightData()method, but theWorldGeometryRenderer.renderTerrain()method doesn't properly use light values when rendering blocks. The block rendering usesblockRenderManager.renderBlock()which should receive proper light levels.Required Changes:
PortalDataManageris properly propagated to the fakeClientWorldWorldGeometryRenderer.buildSectionToMap(), get proper light values usingworld.getLightLevel(LightType.BLOCK, pos)andworld.getLightLevel(LightType.SKY, pos)LightmapTextureManager.pack()and ensure they're used in block renderingrenderBlockEntities()method should also use proper light levels for each block entity2. [!!] Make TardisExteriorBOTI Work with Real BOTI Rendering (Remove EndGateway Shader)
Currently
TardisExteriorBOTIusesRenderLayer.getEndGateway()as a placeholder instead of actual interior world rendering.Current Code Location:
src/main/java/dev/amble/ait/client/boti/TardisExteriorBOTI.javaRequired Changes:
WorldGeometryRendererinstance for exterior-to-interior viewing (similar toTardisDoorBOTI.interiorRenderer)TardisDoorBOTI.renderInteriorDoorBoti()but in reverse:3. Implement Bidirectional Portal Rendering for Multiple TARDIS Instances
The system needs to support multiple TARDISes being viewed simultaneously.
Required Changes:
interiorRendererinTardisDoorBOTI, create a per-TARDIS renderer map:Map<UUID, WorldGeometryRenderer>TardisExteriorBOTI- each TARDIS exterior needs its own renderer for the interior4. Player Chunk Tracking System
Players watching chunks through BOTI portals need proper chunk data sent to them.
Current partial implementation:
PortalDataManagerhandles packets but there's no server-side tracking.Required Changes:
Create a new
BOTIPortalTrackersystem:Server-side packet handling:
ServerPlayerEntityin the target dimensionGaslighter3000pattern fromsrc/main/java/dev/drtheo/gaslighter/for packet interception5. Fix View Bobbing Issues
The rendered world wobbles when view bobbing is enabled.
Current Code Location:
TardisDoorBOTI.javahascalculateInverseBobbing()methods but they're not being applied.// Lines 93-120 define the inverse bobbing calculations but they're not used in render()Required Changes:
interiorMatricesbefore ren...This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.