1168 Commits

Author SHA1 Message Date
Krzysztof Wiśniewski
86e0a9ae4b
Move /set to be method on Blueprint (#1352)
* Move Pattern into Blueprint

* Improve error message on capture failure

* Change memory management
2025-05-02 10:21:25 +02:00
Krzysztof Wiśniewski
64ce0ed991
Batch block updates (#1313)
* Batch block updates

* Apply review change requests

* Allow blockUpdate to carry multiple block updates in single message

* Read until there is nothing left

* Use mesh_storage.BlockUpdate

* Break instead of boolean

* Restore client side neighbor updates

* Move side check in blockUpdate out of the loop

* Update src/utils.zig

* Fix minor issues

* Reverse ownership logic + change contains into liesInChunk

* Update liesInChunk

* No name for upadeBlock param

* Apply review change requests

* Fix formatting

* Restore onBreakClient where it should be

* Update src/renderer/chunk_meshing.zig

* Update src/renderer/chunk_meshing.zig

* Converge formatting with master

* fix formatting (https://github.com/ziglang/zig-spec/issues/38 is so stupid)

---------

Co-authored-by: IntegratedQuantum <jahe788@gmail.com>
2025-05-01 10:10:03 +02:00
IntegratedQuantum
e2a65d21d1 Check the world in openCommand before opening it.
fixes #1372
2025-04-30 16:40:19 +02:00
IntegratedQuantum
af52b392f6 fix formatting (https://github.com/ziglang/zig-spec/issues/38 is so stupid) 2025-04-30 15:12:44 +02:00
IntegratedQuantum
3780814400 hotfix for #1366
fixes #1366
2025-04-29 18:14:00 +02:00
Krzysztof Wiśniewski
d49f61e7b5
Add zig test runner (#1361)
* Add test runner

* Add runner to build
2025-04-29 17:49:59 +02:00
OneAvargeCoder193
cd0cabbbb8
Add Block Inventories (#1198)
* Add chest block placeholder

* Update location of chest.zig.zon

* added chests

* fix some stuff

* dont create all inventories on the client

* make it better

* remove comment

* fix formatting

* fix more formatting issues

* use chests instead of iron block

* fix formatting

* make blocks with inventories that are broken drop the items

* fix compiler error

* fix formatting

* fix formatting

* Trigger GitHub Actions

* add inventory saving to bin

* fix formatting

* fix formatting again

* fix formatting again again

* small change

* current changes

* thing

* Chest patch w/o quantums suggestions

* small test pls no merge

* it works with a couple segfaults that may or may not be in the base game

* final thing i think

* block inventories

* haha

* another thing

* fix formatting

* fix formatting again

* remove saving for now

* remove a comment

* remove more comments

* dont store inventory on the client

* something

* hardcode stuff for the future

* remove getwindow

* fix formatting

* fixes

---------

Co-authored-by: Krzysztof Wiśniewski <argmaster.world@gmail.com>
2025-04-28 17:17:39 +02:00
IntegratedQuantum
c7522483b0 Replace (most) bufPrints with allocPrints, which cannot break for large input sizes 2025-04-27 22:12:34 +02:00
OneAvargeCoder193
9181b31a6d
Add stars and a simple skybox (#1043)
* really bad and inefficient star code i think

* add stars that dont work during the day but look cool

* remove galaxy shape and replace it with a simple sphere

* add broken background

* make stars affected by fog

* make the stars additive

* remove commented code in shaders

* remove unused variables in the shader

* make the stars spin

* make stars not have bloom

* fix formatting

* temp changes

* fix formatting (still temp changes)

* switch to cubyz random numbers

* multiply star matrix in cpu instead of gpu

* changed star to be twice as big, not affect by resolution as much, and also be loaded from a texture

* remove trailing whitespaces

* remove unused constants

* simplify the code by removing a log and power

* optimizing the stars

* remove debug code

* make stars triangles instead of points

* simplify the math more

* give star ssbo unique id

* fix formatting issues

* make array multiline

* fix formatting

* remove files i accidentally added

* remove random obj file

* fix some issues

* use square distance

* fix formatting

* small change

* fix some stuff

* fix other things

* comp error

* more stuff

* fix some stuff with the stars

* test

* fix formatting

* fix more formatting

* test 2

* fixes

* changes

* changes

* fix formatting

* fixes

* remove patch
2025-04-27 20:29:19 +02:00
Carrie
a2911710a6
Add ladder assets (#1310) 2025-04-27 17:31:48 +02:00
Krzysztof Wiśniewski
668f9d0a9a
Directional drops (#1251)
* Add some crazy complicated logic to unstuck items

* Add bouncinessFactor

* Fix formatting issues

* Use rayIntersection to determine direction of drop

* Simplify blockDrop() code

* Apply review change requests

* Send bounding box for block drops

* Rename BlockDrop to BlockDropLocation

* Apply review change requests

* Apply review change requests

* Update src/Inventory.zig

* Apply review change requests

* Remove code reversing direction for carpet

* Update src/Inventory.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Update src/Inventory.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Remove factors variable

* Strip types from randomOffset

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-04-27 17:29:02 +02:00
OneAvargeCoder193
735e99826e
Make the crosshair transparent (#1347)
* make crosshair transparent

* fix styling

* fixes
2025-04-27 15:14:07 +02:00
IntegratedQuantum
b70eb60afd Remove items that don't have a material from the tool grid.
fixes #1353
2025-04-27 12:30:04 +02:00
Carrie
db767b9c30
Update tool template textures (#1355) 2025-04-27 11:00:33 +02:00
Carrie
f8c26e751b
New selection wand texture (#1354) 2025-04-27 10:58:56 +02:00
Carrie
1c22c879f4
Ruby ore + diamond texture tweaks (#1349)
* Ruby blocks and item, tweaks to diamond textures

* Tweak ruby ore and add recipes

* Change ore height

* minHeight
2025-04-27 10:58:27 +02:00
OneAvargeCoder193
b554552b4d
Show tool durability in icon (#1350)
* durability kinda

* changes

* fix formatting

* fix formatting

* dont show durability when full

* fix formatting
2025-04-27 10:56:59 +02:00
IntegratedQuantum
29f06de52f Implement some basic lossy compression for entity and item network data
progress towards #1327
2025-04-26 15:59:59 +02:00
IntegratedQuantum
6fc7e604e7 Add a delay before after sending the disconnect signal on windows localhost.
fixes #1322
2025-04-26 15:12:24 +02:00
IntegratedQuantum
de3b862f1e Handle realpathAlloc failure in files.zig 2025-04-26 14:49:45 +02:00
Krzysztof Wiśniewski
62d4bf6700
Use isServerSide instead of conn.user != null (#1346) 2025-04-26 09:40:06 +02:00
IntegratedQuantum
05ab8a4a5b Make mushrooms degradable 2025-04-26 09:38:57 +02:00
Krzysztof Wiśniewski
c06e2c4673
Fix texture_pile (#1340)
* Fix texture pile

* Update src/rotation/texture_pile.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Apply review change requests

* Apply review change requests

* Update src/rotation/texture_pile.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Apply review change requests

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-04-25 20:50:48 +02:00
Krzysztof Wiśniewski
fde5a69cdc
Add selection wand (#1298)
* Add selection wand

* Update zon file extension

* Apply review change requests

* Simplify receive logic for worldEditPos

* Convert isServerSide to method
2025-04-25 20:49:37 +02:00
IntegratedQuantum
f41504f684
Tool reparammarametetrizatation (#1332)
* Change how to specify tool parameters

* Some mild reparammarametetrizatation and pickaxes now only have one relevant tip.

* Ignore properties that couldn't be found instead of assigning some default

* Remove grip and strength from materials

* Ensure that all woods can break all stones, but not copper, and ensure that all stones tipped woods can break copper.

Also increased weight damage slightly

* Reparammamaramamararara

* Update shover and axe (mostly copied from the pickaxe with less damage)

* Remove the unused FunctionType struct.

* Remove named slots from axe
2025-04-24 21:57:12 +02:00
Carrie
f0bfe30c0e
Allow ores on obsidian (#1305) 2025-04-23 22:43:58 +02:00
Krzysztof Wiśniewski
af65b7c7fb
Integrate void block with commands (#1333)
* Integrate void block with paste

* Update src/blueprint.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Add -v flag description to /paste command description

* Swap conditions in paste

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-04-23 22:18:45 +02:00
Krzysztof Wiśniewski
386ff63903
Unify 'Registered x' log message format (#1335)
* Unify 'Registered x' log message format

* Apply review change requests
2025-04-23 15:36:22 +02:00
Krzysztof Wiśniewski
05d39a81b8
Use readVec and writeVec where applicable (#1336)
* Use readVec and writeVec where applicable

* Use writeVec in chunkRequest.sendRequest
2025-04-22 23:02:22 +02:00
Krzysztof Wiśniewski
f193eb68bd
Migrate jungle(TODO) to jungle (#1334) 2025-04-22 22:44:49 +02:00
Krzysztof Wiśniewski
a4584d5e96
Add void block (#1324)
* Add void block

* Apply review change requests
2025-04-22 19:18:45 +02:00
IntegratedQuantum
eaa46fc065 Remove extra empty line 2025-04-20 18:32:28 +02:00
IntegratedQuantum
10ad990617 fix formatting 2025-04-20 18:24:41 +02:00
IntegratedQuantum
b0e067a458 I forgot to add the file 2025-04-20 18:12:20 +02:00
IntegratedQuantum
176c9d4c75 Introduce item tags and generalize the tag system
All tags now share the same index space, I don't see a reason why we should have separate spaces for these.

I also made diamond powerful if encased in gold/silver
2025-04-20 17:43:24 +02:00
IntegratedQuantum
4286455915 Implement basic modifier restrictions with an example for diamond.
Still needs tooltips and item tags to be more useful
2025-04-20 13:57:05 +02:00
IntegratedQuantum
5f54d48a73
The new network system (#1297)
* Create the foundations of the new network system.

* Fix memory leak

* Implement a simple additive-increase-multiplicative-decrease congestion control scheme.

Also fixed the locking with the send path

* Fix edge case for mismatch in read and available position

* fix formatting

* Reimplemtent network statistics of the F6 menu

* Fix problem the F6 window size

* Rename size to capacity

* Implement the advanced network debug menu

* Fix a few problems

* Actually call the handlePacketLoss function

* Reduce startup delay and fix possible problems with negative RTTs

* Fix crash in block of partially received packets.

* Use a PriorityQueue for unconfirmed packets.

Also fixed a display issue in the advanced network menu

* Always send confirmations and change how packet loss is handled to avoid killing the network connection by only resending packets outside the receive buffer.

* Use the length instead of the endIndex in the CircularBufferQueue

this just made everything more difficult to work with.

* Optimize CircularBufferQueue.enqueueSlice with memcpy

* Fix problem with zero-length packets, which is a valid use case

* Fix a small edge case

* fix formatting

* Add missing code to increase the capacity in enqueueSlice

* Don't send more data than the receive buffer can fit.

* Use a better data structures that handles the received ranges

* Use memcpy in more circular buffer functions

* Send a keepalive if the connection hasn't been established but the player was invited by the server

* Implement disconnecting for the new protocol

* Reimplement timeout

* Only add new connections when the other side actually sent an init packet.

otherwise the connections stay in the queue, and need keepalives.

also moved the code from the invite window to network.zig, where it belongs

* Don't allow queueing more than 2 GiB of data (i32 limit)

* Reimplement and simplify reconnection

* Use member functions for Socket

* React to packets using a scheme similar to TCP

TCP will send a fast retransmit on first loss discovered by DACKs, shortly after starting the RTO timer.
In essence this means that only second loss of the smallest packets is handled by congestion control.

* Increase scaling after congestion control halves bandwidth.

Now it increases it by at least 1%, isntead of only by the MTU

* Use start and len instead of start and end for the RangeBuffer

* Use ListUnmanaged in RangeBuffer

* Rename flawedReceive to tryReceive

* Add a `ms` constant to make it easier to see what units some of the constants use.

Also added a function alias for microTimestamp to make it potentially easier to change to other timestamps in the future.
2025-04-19 15:05:02 +02:00
IntegratedQuantum
a6ef0dc57e
Update CONTRIBUTING.md
as discussed in #1297
2025-04-19 13:13:09 +02:00
Carrie
332e9f57f0
Add silver ore (#1306)
* Add silver ore, ingot, block, lower gold ore

* Add recipes, make gold and silver ore values different
2025-04-16 12:36:26 +02:00
Carrie
d4e187e5af
Redistribute ores (#1304) 2025-04-14 09:27:54 +02:00
Carrie
da3ffce871
Big mushroom blocks (#1299)
* Add big mushroom blocks, tweak mushrooms to match

* Add mushroom branches, make glimmergill cap emissive, add recipes, material vals

* Tweak blockHealth
2025-04-13 16:50:23 +02:00
Carrie
871b635cae
Sulfur ore, block, and torches (#1287)
* Sulfur ore, block, and torches

* Tweak block health

* Add material values, brighten sulfur block
2025-04-13 16:45:05 +02:00
Krzysztof Wiśniewski
823faf64b7
Add tests for BinaryReader and BinaryWriter (#1273)
* Add tests for BinaryReader and BinaryWriter

* Add guards for integer values

* Add small integer edge cases

* Add mixed data test

* Apply review change requests

* Use std.math.divCeil

* Adapt to endian parameter removal

* Apply review change requests

* Change duplicate u8 into u0
2025-04-05 11:19:35 +02:00
Carrie
747a2dc957
Add copper ore and make iron generate deeper (#1268)
* Add copper ore and redistribute ores

* Add copper recipes

* Revert ore redistrib, nerf copper
2025-04-04 17:32:15 +02:00
Krzysztof Wiśniewski
00c6b29736
Always use big endian (#1274)
* Always use big endian

* Apply review change requests
2025-04-03 21:32:59 +02:00
IntegratedQuantum
db3d640c2a Add some testing for joining zon and fix #1231 2025-04-03 19:44:26 +02:00
IntegratedQuantum
0762e30955
Update CONTRIBUTING.md
I added a section on performance
2025-04-03 18:05:51 +02:00
Krzysztof Wiśniewski
f4e472c218
Add /set command (#1236)
* Add /set command with pattern support

* Fix formatting issues

* Remove pattern code from PR

* Fix imports

* Apply review change requests
2025-04-02 21:23:37 +02:00
Krzysztof Wiśniewski
b0af58b21b
Refactor sendKeepAlive and receiveKeepAlive (#1265) 2025-04-02 21:18:17 +02:00
Krzysztof Wiśniewski
92fcd10069
Modernize genericUpdate protocol (#1257)
* Modernize genericUpdate protocol

* Do not complicate sendGamemode

* Apply review change requests

* Yeet cure

* Rename to biomesByIndex

* Update src/network.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Use @typeInfo(T).vector

* Update src/network.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Undo blind remove of TODO

* Update src/server/terrain/biomes.zig

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>

* Remove defaultIndex argument from getByIndex

* Make biomesByIndex a ListUnmanaged

---------

Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
2025-04-02 18:05:36 +02:00