1307 Commits

Author SHA1 Message Date
IntegratedQuantum
3abe7e4950 Fix deadlock in Entity chunk creation/destruction 2024-08-17 11:21:42 +02:00
IntegratedQuantum
ce17aee034 Rotate item drops around their center. 2024-08-17 11:10:44 +02:00
IntegratedQuantum
3a6f55b8e7 Implement block drop rendering and fix a couple synchronization issues. 2024-08-17 11:01:22 +02:00
Carrie
44bb49ee5b Add lava caves, obsidian, and dirt 2024-08-11 10:44:28 +02:00
IntegratedQuantum
d23ffc2919 Fix some of the server side physics for item drops.
fixes #637
2024-08-10 22:49:33 +02:00
IntegratedQuantum
d8a3df1aa4 Fix item drops for items with textures.
Fixes the first half of #635
2024-08-10 21:43:49 +02:00
IntegratedQuantum
85ce42d023 Output a question mark before the port when symmetric NAT is detected.
All the other logic for handling it is already in place.

Might fix connection issues for some people.
2024-08-10 17:17:05 +02:00
IntegratedQuantum
0f654ea5cd Send item drop data to the client.
fixes #622
2024-08-05 10:58:55 +02:00
IntegratedQuantum
0efb90a682 Use the new EntityChunks for item drop simulation, and ensure that saving and storing of item drops works.
progress towards #622
Still needs to send them back to the client and check if everything works correctly.
2024-08-04 21:48:03 +02:00
IntegratedQuantum
16852488b7 Ensure that chunks inside the simulation distance remain loaded on the server.
fixes #76
2024-08-04 13:57:06 +02:00
IntegratedQuantum
2d359ccb86 Turn chunk.Neighbors into an enum.
Syntactically this seems to be a pretty neutral change, some expression get longer, other get shorter.
But I guess it increases type safety and I could also replace some of the more magic operations, like `neighbor ^ 1` with a named function.

fixes #602
2024-08-03 17:21:20 +02:00
IntegratedQuantum
55a3957917 Structure chance is now a chance per spawn point instead of a chance per block.
This is more intuitive, but it requires multiplying all the chances in existing biomes by 16×.
2024-08-03 15:49:35 +02:00
IntegratedQuantum
b7a1371f0b Open the block gui when right clicking it.
Also removed the keybind for the crafting gui, since it can now be opened from the game.

fixes #237
2024-08-02 21:24:08 +02:00
IntegratedQuantum
307cf453f1 Fix crash when re-entering a world.
this should finally make the exit to menu button usable.
fixes #100
2024-08-02 21:06:50 +02:00
IntegratedQuantum
2870340ff5 Fix how music is played to avoid crashing when leaving the world.
fixes #408
2024-08-02 20:59:28 +02:00
IntegratedQuantum
135dcd2425 Exit to menu on disconnect.
fixes #632
2024-08-02 20:32:00 +02:00
IntegratedQuantum
35466ec140 Add a window to kick players and cancel open invitations.
fixes #371
2024-08-02 20:18:43 +02:00
IntegratedQuantum
783f342ad9 Allow player to reconnect when the server still thinks the old connection is active.
This makes it easier to reconnect to the server when the client crashed.

fixes #369
2024-08-02 11:07:05 +02:00
IntegratedQuantum
10a1322058 Use the default port where possible.
Also make sure that another port is used and communicated correctly when the default port is already in use.
This allows opening multiple singleplayer worlds on the same computer.

fixes #605
2024-08-01 22:05:20 +02:00
IntegratedQuantum
4fa08bec95 Add the ability to insert ranges of equal blocks into the palette compressed data structure.
The index is then only calculated once. Individual insertions are not optimized though.

fixes #600

Also it seems that in my previous performance commit I had made a mistake in my measurement, I must have measured a buggy version which turned out to be super fast. In actuality the performance difference was much smaller, so I decided to optimize that section as well.

Now it's at 1.7 ms per chunk. Still needs more improvements, I guess.
2024-08-01 17:30:44 +02:00
IntegratedQuantum
c3711868c5 Remove some outdated TODOs. 2024-07-31 21:11:39 +02:00
IntegratedQuantum
bc1c1d6d92 Rework the biome map to allow fetching entire biome columns at once.
To make this possible I switched from 3d noise offsets to a single 2d noise offset in z direction. This makes the biome structure more predictable vertically, and therefore suited for getting entire columns at once.
This introduced some artifacts at biome borders, but I could remove them by rotating the bioem map slightly, such that none of the biome borders are vertical.

In total this halfed the cost of the TerrainGenerator, which makes up most of chunk generation. Chunk generation speed is now around 1-1.2 ms per chunk.

This also opens up future optimizations, like bulk insertion into the chunk data structure.
2024-07-31 18:46:20 +02:00
IntegratedQuantum
cde841bc6a Improve performance of PaletteCompressedRegion.setValue.
That made it almost 2× faster. But it's only a ~4% improvement of the total terrain generation time.
2024-07-30 10:11:29 +02:00
IntegratedQuantum
920d2354b9 Prevent some windows from being closed and fix titlebar hitboxes.
fixes #593
2024-07-27 16:29:56 +02:00
IntegratedQuantum
ac4fc601b9 Fix block placing at the same height as the player.
fixes #589
2024-07-27 16:11:52 +02:00
IntegratedQuantum
b1a28474ad Fix lighting for block items. 2024-07-27 16:08:52 +02:00
IntegratedQuantum
76476faa84 Fix the sliders.
fixes #590
2024-07-27 16:01:47 +02:00
IntegratedQuantum
6dc106fb9f Store light data in a separate buffer and compress it.
Slightly slower, but halfs GPU memory usage and allows storing 3× more faces on the GPU.
Also makes meshing a bit slower, but transparency sorting should be a lot faster, since it's shuffling around less memory.
2024-07-27 14:27:53 +02:00
OneAvargeCoder193
5281b77e9e
Made the open folder button work on windows (#586)
* Changed the saveFolder function so that it does the correct command on windows

* Changed the saveFolder function so that it does the correct command on windows

* why
2024-07-24 09:42:56 +02:00
IntegratedQuantum
60b17ed6ef Only draw the outer layers for leaves. The number of layers is configurable.
Makes #579 less useful, but it would still be beneficial.
2024-07-23 21:27:47 +02:00
Carrie
67cce6f25a Fix some text, add default_background 2024-07-23 20:44:34 +02:00
careeoki
952d93c45e
UI changes (#584)
* UI colour balancing+ design changes

* New world icons

* Update titlebar icons to match other icons

* Tweak raw meat palette
2024-07-22 09:34:13 +02:00
IntegratedQuantum
fa73ca7c22 Allow the player to change block break/place speeds.
This will make building large structures in creative much easier.
2024-07-21 11:18:27 +02:00
IntegratedQuantum
412d5b93b8 Improve world selection and creation interfaces.
fixes #577
fixes #576
fixes #575
2024-07-20 16:32:09 +02:00
IntegratedQuantum
6ca18480cf
Switch to an internal spring system for stepping and collision, instead of using external springs. (#580)
* Use internal springs instead of external springs.

This is not only more efficient, but also would potentially fix a large portion of open physics issues.

* Allow stepping onto blocks if velicity is positive and define a minimum stepping height.

* Add jump cooldown and make jump-stepping onto a block smoother.

* Disable the jump cooldown when the jump button was released.

* Remove some leftover code and fix stepping too far.
2024-07-19 15:41:55 +02:00
IntegratedQuantum
daf2f0332e Remove some deprecated APIs to become compatible with the latest master zig. 2024-07-18 21:09:32 +02:00
Carrie
f309e31eb5 Update apple and raw meat texture 2024-07-17 09:00:14 +02:00
careeoki
2f49d3744b
Update reflectivity textures (#572)
* Update reflectivity

* Ice hasBackFace
2024-07-15 22:16:28 +02:00
careeoki
72b8c2ce41
New hearts (#567)
* Redesign heart icons

* Fix indentation

* Fix indentation again

* Change half heart

* Fix scaling, fix formatting

* Fix formatting?????

* Fix formatting

* Fix Formmamting
2024-07-14 21:18:16 +02:00
IntegratedQuantum
78e30c5bf6 Fix formatting. 2024-07-14 11:38:14 +02:00
IntegratedQuantum
289e3c61f1 Add VSCode section headers to make navigating large files easier. 2024-07-14 11:31:57 +02:00
IntegratedQuantum
45cc9a9419 Add angle dependent reflections and draw glass backfaces.
Follow-up on #402
2024-07-12 17:00:26 +02:00
IntegratedQuantum
de21faa1ad Allow overwriting the GenerationMode of simple structures. Also makes simple vegetation work on the ceiling.
fixes #564
2024-07-12 10:38:45 +02:00
IntegratedQuantum
5c5347357b Remove the old StalagmiteGenerator.
follow-up on #562
2024-07-12 10:11:58 +02:00
Carrie
033ff55c02 Convert stalagmites to simple structures 2024-07-12 10:05:47 +02:00
IntegratedQuantum
358c0f38a8 Implement Stalagmites as their own simple structure model, which allows configuring the parameters in detail, potentially even adding multiple stalagmites with different block types..
Could also help with #547 once the biomes in question are transitioned to the new stalagmite structures, instead of using the old, dedicated generator.
2024-07-11 21:12:32 +02:00
careeoki
a6693d4113
Make glass more reflective (and slightly textured) (#555)
* Make glass more reflective (and slightly textured)

* Update brown glass
2024-07-10 09:01:36 +02:00
careeoki
56acfd05f3
Update biome structure chance, Ice and Frost (#550)
* Fix biome structure chance, Ice and Frost

* Make grassland consistent with other changes

* Revert glacier stoneBlock

* Warm Ocean stoneBlock is now sandstone

* 1/3 forest trees are birch
2024-07-08 22:10:54 +02:00
IntegratedQuantum
409ad24b14 Introduce the StructureMap to make large structure generation easier in the future. 2024-07-08 22:07:59 +02:00
IntegratedQuantum
814774f247 Use the player's inner hitbox for the block placing collision check.
fixes #549
2024-07-07 21:26:22 +02:00