feat: (377) Instances v1 + general engine improvements#95
Open
mark-b5 wants to merge 18 commits into
Open
Conversation
This should help Bun-Windows users with their startup/cycle times. WASM allocations are performing terribly. I tried to keep this API-compatible so that later we can let users pick between Rust or TS based on their performance concerns. Soon the same treatment for rsbuf. Will need to do some tests to make sure nothing is off by a hair. Funny history here... Kotlin -> JS/TS -> Rust -> TS (cherry picked from commit 55eccdc)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
377 specific
General engine improvements (will be merged individually into 284)
zone,zoneexit,mapzone, andmapzoneexittriggers are now queued from player movement, rather than being handled during the network layerInstances (will be reviewed and backported into 300+)
There is now an
instanceControllersingleton child ofWorldwhich handles tracking, allocating, and destroying instancesThere is a child class of
zone,instanceZone, which is a zone that stores copy flags from another zone to send to clientEngine sends out
rebuild_regionpacket to clientThe following commands are implemented:
region_create(int $levels, int $zonesEast, int $zonesNorth);allocates a new instance of size $levels*$zonesEast*$zonesNorth and sets it as the active regionregion_set(int $destLevel, int $destEast, int $destNorth, coord $sourceCoord, int $rotation);copies the source zone into the active region at zone offset ($destEast, $destNorth) on floor $destLevel, rotated by $rotationregion_getcoord(int $levelOffset, int $xOffset, int $zOffset);returns a coord inside the active region at tile offset ($xOffset, $zOffset) on floor offset $levelOffsetregion_findbycoord(coord $coord);finds the instance containing $coord, sets it as the active region, and returns 1 if found or 0 if not foundregion_uid();returns the uid of the active regionregion_findbyuid(int $uid);finds the instance with uid $uid, sets it as the active region, and returns 1 if found or 0 if not foundregion_setexitcoord(coord $exitCoord);sets the exit coord used when leaving or recovering from the active regionNeeded compiler changes
region_uidtype. Right now they are ints