1056 Commits

Author SHA1 Message Date
IntegratedQuantum
b882e81c73 Always use explicit direction 2025-07-27 14:48:27 +02:00
IntegratedQuantum
be9069c8df push pop isEmpty 2025-07-26 15:18:30 +02:00
codemob
2fa5e0bae2
basic swim movement (#1665)
Adds basic water control. Starts #85.

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Co-authored-by: IntegratedQuantum <jahe788@gmail.com>
2025-07-26 14:03:41 +02:00
Krzysztof Wiśniewski
e4030386d6
Binary storage for inventories (#1662)
Related to: #1642
Resolves: #1290

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Co-authored-by: OneAvargeCoder193 <mgiakimenko@outlook.com>
2025-07-26 13:52:53 +02:00
codemob
55dc104c37
Use an approximation of the heightmap derivative to "erode" some layers of ground_structure (#1699)
Fixes #188
2025-07-25 22:04:45 +02:00
codemob
a47c8d14a1
Prevent settings from breaking when no previous file is present. (#1719)
Fix #1718
2025-07-25 18:09:51 +02:00
IntegratedQuantum
08c78ff48d Fix double free detection of the StackAllocator 2025-07-25 17:28:59 +02:00
IntegratedQuantum
ab691cec73 Use GarbageCollection for LightMapFragments 2025-07-23 22:29:50 +02:00
IntegratedQuantum
6089c58e55 Fix getBlockFromAnyLod to include the chunk at highestLod
fixes #1710
2025-07-23 21:32:42 +02:00
codemob
468f959c54
Allow searching by tag in the creative inventory (#1700)
fixes #1659

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-07-23 21:22:50 +02:00
IntegratedQuantum
6baf7fc067
Garbage Collection - The Great Return (#1680)
This is a first attempt to get rid of of reference counting #1413

Basically all threads execute a global sync point, this allows
determining a time when all temporary resources (such as meshes on the
client side used in lighting on other threads) have been freed with 100%
certainty.

Remaining work:
- [x] Implement the sync point
- [x] Implement free lists and free the resources
- [x] Determine if this is worth it performance wise
  - [x] Use this for chunk meshes
- [x] Remove reference counting and the locks on the chunk storage data
structure
- [x] Measure performance of gathering many light samples and compare it
with master → around 15% reduction in time
- [x] Cleanup some unused things (mesh free list)
2025-07-21 22:20:17 +02:00
IntegratedQuantum
1794515c92 Print modifiers, modifier restrictions and tags in item tooltips.
fixes #1587
2025-07-21 17:07:29 +02:00
codemob
df0af7afbc
Preserve unknown entries in settings (#1696)
Fixes #1675
2025-07-20 23:29:50 +02:00
IntegratedQuantum
7aa35798be Fix chisel behavior for blocks with resistance
Until we have a proper tool for it #760 it should break the corners in one hit independently of resistance
2025-07-20 22:46:37 +02:00
IntegratedQuantum
31d62f77ee Set the selected window to null in toggleGameMenu
This caused a bug when pressing escape instead of left-click to return to the game.

fixes #1691
fixes #1655
2025-07-20 22:41:51 +02:00
IntegratedQuantum
fe687be59f Rename player model to "snale"
fixes #1697
2025-07-20 22:32:53 +02:00
codemob
f2dc3faec2
Place certain blocks on water (#1672)
Fixes #1218

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-07-20 11:10:16 +02:00
IntegratedQuantum
bd5ea763cb Fix undefined behavior in text rendering (TextBuffer.width was initialized with undefined and never changed for draw.print)
(hopefully) finally fixes #595
2025-07-18 23:59:39 +02:00
IntegratedQuantum
c297fe0dfc Panic before the OpenGL buffer surpasses 2 GiB
fixes #1671
2025-07-18 23:58:29 +02:00
IntegratedQuantum
362f540825 Remove on-demand player inventory loading and fix a possible exploit 2025-07-16 17:22:36 +02:00
IntegratedQuantum
aae66ea77f
Update Zig to use the new Writergate version (#1664)
For reference: https://github.com/ziglang/zig/pull/24329

some commits have been extracted from #1583, but the x86_64 backend has
been disabled due to its horrible performance.

Remaining work:
- [x] Wait for official builds on ziglang.org and upload them to our
repository
- [x] Add workaround for https://github.com/ziglang/zig/pull/24466
- [x] Fix TODO comment about ANSI support in stdout
- [x] Check for compile-time performance changes → it went from 13.1 to
11.9 seconds 🎉
2025-07-15 23:00:29 +02:00
IntegratedQuantum
6811f21682 Don't fetch controller mappings in debug mode, decreasing compile-time by 5 seconds (25%)
see also: https://github.com/ziglang/zig/issues/24435
2025-07-13 21:47:55 +02:00
codemob
684d154a6d
Added invert mouse Y setting (#1666)
Fixes #1296.
2025-07-13 12:19:58 +02:00
Krzysztof Wiśniewski
76c0d885a5
QoL changes for creative inventory (#1635)
Although major UI changes are planned, they are expected in rather far
future. Unfortunately current state of creative inventory makes it
really frustrating to use when building and when testing newly added
blocks. Therefore I have implemented a dead simple search bar which
filters out all items with IDs that don't contain the searched phrase. I
also made a sin of (subjectively) improving the look of item list by
padding last row of item list with empty immutable slots if it was not
filled with items found.

![Screenshot 2025-06-20
025239](https://github.com/user-attachments/assets/17f6ca67-fc65-4588-b76e-c5cb0fb65ff1)

![Screenshot 2025-06-20
025312](https://github.com/user-attachments/assets/e7af7498-4415-45d8-a72c-ef155683e91e)

![Screenshot 2025-06-20
025245](https://github.com/user-attachments/assets/6dbf2b30-c075-491a-803f-b1dd92efa49c)
2025-07-07 22:23:33 +02:00
IntegratedQuantum
5a80a2d281
Speed boost when breaking a block based on leftover damage (#1658)
This makes the DPS statistic more accurate and reduces the impact from
off-by-one errors as described in #1643

fixes #1656 

@ikabod-kee please check this out
2025-07-06 21:49:45 +02:00
Krzysztof Wiśniewski
19fe9508d5
Binary Item storage (#1473)
## Description

This pull request implements binary storage for items to allow more
compact storage of inventories for ECS and block entities.

## Links

Depends on: #1494 
Depends on: #1478

---------

Co-authored-by: OneAvargeCoder193 <mgiakimenko@outlook.com>
Co-authored-by: OneAvargeCoder193 <85588535+OneAvargeCoder193@users.noreply.github.com>
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-07-06 12:44:42 +02:00
IntegratedQuantum
a8ffa97ebc Buoyancy, volume friction and volume mobility
fixes #83
fixes #84
first prototype of #85
2025-07-05 16:56:29 +02:00
IntegratedQuantum
4b856619b5
Trying out miniaudio (#1652)
It does seem to offer a higher level interface, including spatial audio.

However this proof of concept only uses the low level interface, which
is pretty similar to port audio so far, also performance-wise.
Only technical difference so far seems to be that we can actually deinit
it without crashing.

@ikabod-kee since you got better ears for this, could you check if you
notice anything that got better or worse with this transition?
Particularly, I'd like to know if you notice any improvements with
respect to #571.

Remaining work if accepted:
- [x] Include this in the libs and precompile it instead of adding it
here
- [x] remove portaudio from the libs
- [x] make a new libs release and use it here
- [x] Remove remaining references of portaudio from the source

fixes #415
fixes #571
2025-07-05 11:49:18 +02:00
IntegratedQuantum
dd506e197e Don't allow two players of the same name to join (except from testing worlds)
fixes #1636
2025-07-01 22:47:36 +02:00
Krzysztof Wiśniewski
54aab15a4e
Add SBB rotation parameter (#1530)
## Description

This pull request adds `rotation` parameter to `cubyz:sbb` simple
structure with default value `.random` which allows specifying fixed or
randomized rotation for structures generated. Rotation for structure is
only propagate through the strcuture children only for vertical child
blocks. Additionally, a `rotation` parameter was added to structure
building block children definition to allow overriding / re-enabling
random rotation for children of strcuture. Default value for that
parameter is `inherit` which takes the rotation of parent (only for
vertical child blocks until interrupted). Valid values for rotation are
`0`, `90`, `180`, `270`, `random`, `inherit`, all accepted as a string,
numeric values also accepted as floats and integers.

## Links

Resolves: #1529

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-06-28 16:38:36 +02:00
Krzysztof Wiśniewski
254546c789
Use enum instead of packed struct for *Index objects (#1640)
Resolves: #1600

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-06-28 15:45:34 +02:00
IntegratedQuantum
24a1fcdc69
Use world-space dithering as well as a better dither matrix to handle transparency in mipmapping/anisotropic filtering (#1641)
- [x] Prototype
- [x] Remove old code
- [x] ~~Apply this form of dithering to other shaders as well (item
drop)~~ → old dither looks better for items and display model
- [x] Can we finally remove the dither seed?
- [x] Check performance impact → it's slightly (insignificantly) faster
even
2025-06-26 20:14:54 +02:00
IntegratedQuantum
a8b36f3ca4 Don't use vector types in the GPU buffer.
I decided to pack the corner positions, everything else would have made it more ugly.

fixes the most relevant part of #1634
2025-06-19 22:04:26 +02:00
Krzysztof Wiśniewski
9c33f8184d
Fix amber ore (#1633)
Amber ore was not adjusted to #1509
2025-06-19 16:46:28 +02:00
Yiheng Wu
f75f3d40e4
Calculate font unit per pixel dynamically (#1629)
This PR turns font unit per pixel (a "magic number") into actually
computed value. Previously the "font unit per pixel" is hardcoded as
float `4.0`, because `units_per_EM` field of unscii is 64, and default
font size is 16. If another font is loaded, layout will be corrupted by
invalid scaling of `glyphPositions`. Note that only transformation from
font unit to pixel is affected, no visual change is made, and width of
glyph(character) is not changed.
2025-06-18 15:37:50 +02:00
OneAvargeCoder193
4898012311
Use comptime modding for rotation loading (#1509)
Related to: #1507
closes #1533 

I'm pretty sure that the rest of the moving into a comptime mod
interface can be done in a future pr

---------

Co-authored-by: Krzysztof Wiśniewski <argmaster.world@gmail.com>
2025-06-17 18:13:48 +02:00
IntegratedQuantum
e17e6e2067 Simplify obj parsing code 2025-06-14 11:00:24 +02:00
IntegratedQuantum
a8767938f0 Don't schedule draw calls when there are no chunks to draw.
should fix #1614
2025-06-08 11:54:14 +02:00
Krzysztof Wiśniewski
9f0289551d
Add ToolTypeIndex struct (#1478)
## Description

This pull request adds `ToolTypeIndex` struct that behaves similarly to
`ModelIndex` and `BaseItemIndex` structs.

## Links

Related to: #1290 
Related to: #1060

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-06-08 11:38:33 +02:00
IntegratedQuantum
cd4cd8e9b9
Add and allow for more optional slots (#1612)
This checks slots based on texture connectivity. It really is just a
gimmick at this point, but it has potential to be more than that with
the right modifier restrictions.
![Screenshot at 2025-06-07
10-03-05](https://github.com/user-attachments/assets/e2aa96d4-8add-47cf-abc4-97f383c5fe41)
![Screenshot at 2025-06-07
09-59-46](https://github.com/user-attachments/assets/6aa00d24-8a97-4200-8c77-86b9751d2e2d)
![Screenshot at 2025-06-07
09-54-42](https://github.com/user-attachments/assets/247a2fdd-29ce-4467-85ff-3183f0ec36f1)

The big questions I have for you are:
- Is it obvious why some tools don't work while others do or is this too
confusing?
- @careeoki can you improve the texture to look better for these crooked
tools? Many slots do just seem to produce a thin line of diagonally
connected pixels, and this really doesn't look good and the algorithm
doesn't accept those as valid connections.

fixes #1589
2025-06-08 11:32:56 +02:00
archbirdplus
a24729eb40
Orient blocks in inventory to face left (#1618)
Implements @careeoki's suggestion, aka resolves #1577. Also fixes a
comment I didn't like.

<img width="789" alt="Screenshot 2025-06-07 at 21 44 36"
src="https://github.com/user-attachments/assets/e4b7e1b0-a1ea-4968-869b-ece5bf69386c"
/>
2025-06-08 11:20:37 +02:00
archbirdplus
27ef22e21a
Allow send Add ## in chat (#1617)
Resolves #1615.
2025-06-08 11:19:16 +02:00
IntegratedQuantum
bf7d20f11e
Separate the face buffer based on LOD (#1609)
- reduces allocator overhead (less items in the free list of each
buffer)
- reduces the chance to run out of fake GPU memory (we can now
effectively store 50% more faces than before)
- reduces the chance to run out of actual GPU memory
- reduces height of lag spikes of buffer resizes (but increases their
frequency)
- makes it more clear in which LOD (LOD1) the main memory bottlenecks
are
- reduces the occlusion culling lag (#1161) after disocclusion of parts
of the screen (roughly halving the impact).

It however does decrease the granularity of timing information, since I
can no longer look at the passes separately, but I think that's a fair
price to pay

- [x] cleanup
2025-06-07 09:32:05 +02:00
IntegratedQuantum
b1af1be3d2
Cleanup and fix the deposit on close behavior of the workbench. (#1602)
In the process I had to improve how the player inventory is handled,
which required adding an interface to externally load an inventory for
the inventory system.

This new interface is also relevant for block inventories, which is why
I would like you to review this @Argmaster

fixes #978
2025-06-06 19:26:21 +02:00
IntegratedQuantum
e91f42225b Show the base stats of the result tool in the workbench gui
fixes #229
2025-06-05 19:46:03 +02:00
IntegratedQuantum
03a5e2cf38 The particle hashmap was never inited 2025-06-02 15:38:40 +02:00
OneAvargeCoder193
a59ac2b011
Change log rotation to be more similar to branches, and also remove log_top (#1496)
Fixes #357 

Stuff left to do

- [x] Make them more like branches
- [x] ~Make them rotate~ Fixed automatically by making them like
branches
- [x] ~Let them be chiseled like stairs?~ This will be a future pr
- [x] Automatic migration between old and new logs

---------

Co-authored-by: Carrie <carriecapp9@gmail.com>
2025-06-01 17:17:33 +02:00
IntegratedQuantum
0c1ee186b2 Silence some of the less important OpenGL messages
fixes #1532
2025-06-01 15:22:47 +02:00
IntegratedQuantum
39bea9a66e Fix lossy chunk compression for transparent blocks
fixes #1565
2025-06-01 15:05:18 +02:00
IntegratedQuantum
4dc994ae9d Remove the text listener while deiniting the component
Previously there was a rare race condition where this could crash.

should fix #1562
2025-06-01 14:48:44 +02:00