#help-development

1 messages ¡ Page 1336 of 1

covert stump
#

lol were u talking about my scoreboard that i sent..

#

I was a bit busy

thorn isle
#

myes

covert stump
#

thanks for opinion

#

I'll make some small fixes they are easy..

#

and in my opinion.. LOL there is nothing much to event in scoreboard therefore every server has the same

thorn isle
#

i kind of don't like it as a concept honestly, it just gets in your face with things you already know or could easily check with a command

#

i'd rather throw balance and such on the tab footer

#

and use the sidebar for something like a quest tracker

covert stump
#

interesting

#

But me personally checking everything by command is kinda annoying

#

as a player

thorn isle
#

however this has some practical difficulties because it seems every server on the earth has a sidebar that shows the exact same things, so players are ad-conditioned to not look at it

#

i had this case where a player was asking "why is my balance not going up when i sell things"

thorn isle
#

it turned out they were looking at the $200 quest reward in the "rewards" section of the sidebar

#

which, mind you, had a big bold all caps QUEST title

thorn isle
#

much faster than a command and isn't bolted to your face all the time

covert stump
#

u can remove scoreboard tbh if u dont like

#

many client has those options

#

and even i hav that option too

#

using /scoreboard

thorn isle
#

i suppose, it just seems like a waste of effort and space

thorn isle
#

but it's the way everyone does it so i guess most people are going to end up doing it like that

covert stump
#

it only takes 1 hour

thorn isle
#

in other news

#

is modrinth down again

quaint basin
thorn isle
#

i mean the issue was that the number they were looking at ($200) wasn't their balance, but the quest reward

quaint basin
#

oh

thorn isle
#

they were so conditioned to "sidebar shows my money" that they completely disregarded the parts that read QUEST and "do this and that" and "rewards" and only saw the $200

covert stump
thorn isle
#

so i have this slight and ambient animosity towards servers and people using sidebars for this decorative useless stuff, because it's trained my new players to not look at the best quest-tracking hud in the game that i did spent a decent bit of effort on

#

just like ads

#

therefore i give your screenshots -10000 points

quaint basin
thorn isle
#

myeah, you'll want to create your own monospaced font with the glyphs of your choice in it

#

or do padding, but that's a bit unreliable if the player's resourcepack overrides the default font

quaint basin
#

I don't think anyone cares about that

orchid gazelle
#

yes

#

well they need to be processed individually though

thorn isle
#

basically what emily said

#

tons of things are clientside and bound to packets and events that aren't strictly for sounds

#

e.g. the block break effect which fires the breaking particles will also fire a sound, you can't cancel just the sound part without cancelling also the particles part

covert stump
#

not delete them

#

in sounds.json

#

Not ideal but its the only way to affect client-side sounds

thorn isle
#

that could maybe work; then add your own matching sounds in the pack and have them play manually

orchid gazelle
covert stump
orchid gazelle
#

well but I need to modify the sounds dependant on server-side information

#

so static modifications don't fit for me

covert stump
#

Minecraft has 3 different packets for playing sounds...

covert stump
thorn isle
#

basically blanket disable all sounds and then manually play only the sounds you want

orchid gazelle
#

like half of the effects weren't affected

orchid gazelle
covert stump
orchid gazelle
#

but all of the sounds may be affected

covert stump
#

The resource pack trick is really your only option for those remaining ones... ig

orchid gazelle
#

hjm ok

#

thanks anyways

quaint basin
#

https://imgur.com/a/QboaPqG Isn't the logic backwards? From what I understand, if the sender has permission and sends a message with a click_action, then anyone who reads the message and clicks will execute that command. But if the admin has permission, shouldn't it be the other way around?

tender shard
#

oh now I see it. Yeah it's indeed inversed

#

The inside of the if/else blocks should be other way around, yes

quaint basin
tender shard
#

as a quick you could "reverse" the permission, e.g. give it to default group, and deny it for admin group

quaint basin
#

yea i see

#

I changed to carbon chat

#

the huskchat is no longer updated

tender shard
#

yeah all husk plugins are kinda dead, they're only held together by community PRs

quaint basin
#

they are good right?

tender shard
# quaint basin they are good right?

Not really. HuskSync used to crash our farmworlds once in a time until I submitted a PR. map sync is also still broken, I'll make a PR for that soon

quaint basin
#

shit

tender shard
#

Oh and attributes like max health are also not properly synced, I got an open PR about that

#

HuskHomes idk, never used it

quaint basin
#

Do you think that synchronizing them isn't the best approach?

#

Or they just made a mistake

tender shard
#

They should definitely be synced, it's just that the implementation was bad

quaint basin
#

But I mean, the way they synchronize data between servers, do you think that's a good approach?

tender shard
tender shard
#

That one got us random server crashes once in a while

quaint basin
#

dupes 😯

tender shard
quaint basin
#

alr thanks

tender shard
quaint basin
#

But the approach they use to synchronize data between servers, do you think they do it well?

tender shard
tender shard
#

the only issue is that important issues kinda stay ignored for months until somebody else fixes them

quaint basin
#

i see

smoky oak
#

qq if i store data in a shulkerbox pdc, does it get transmitted to any player opening it/picking it up?

mortal hare
#

is this a bug

young knoll
#

I don't think it'll automatically transfer to the block when placed

mortal hare
#

Type parameter is being used within permitted classes

#

so why its being flagged as not used

smoky oak
mortal hare
#

its used for switch pattern matching

ivory sleet
# mortal hare is this a bug

na just means it isnt used in said class anywhere (and u could hypothetically be able to omit it and just define type constructors on the subtypes)

#

been a thing for a very long time

mortal hare
#

and u could hypothetically be able to omit it and just define type constructors on the subtypes
wdym? if you omit it, then you cant pattern match against generic type parameters

#
      final var result = Password.fromString("dovidas");
      if (result instanceof ValidationSuccessResult<Password, CharSequence> success) {
        success.value()
      }
#

this wont work if you omit generic params from the result class

#

and if you add them it allows even if they're different classes (i guess sealed classes infer that information, very neat)

#

its kinda misleading that those parameters are greyed out even if they're kinda used by classes

#

i love this feature

thorn isle
#

your example would be much better if you didn't use var here

#

since it completely depends on result being of a type with type parameters A and B, and your switch case pattern having a type that extends that type with matching type parameters

thorn isle
#

e.g. it's safe to cast Collection<String> to List<String>

mortal hare
#

actually i can omit generic type parameters if i use destructuring of record

      final var result = Password.fromString("dovidas");
      if (result instanceof ValidationSuccessResult(Password password)) {
        System.out.println(password.asString());
      } else {
        System.out.println(result);
      }
thorn isle
#

because List<T> extends Collection<T>

#

meaning the type parameter can already be inferred from the type you're casting

mortal hare
#

arent generic type parameters erased at runtime?

thorn isle
#

yes, but this is a compile time check

#

the compiler sees you have a Collection<T>

mortal hare
#

sometimes this might not work though, especially with upcasting

thorn isle
#

and it sees that List<T> extends Collection<T>

#

and it sees that the T's are the same

#

and therefore it decides that since T is already known at compile time and the bounds are the same, it boils down to just a regular runtime cast where the type parameter can be ignored

#

it's still "unsafe" and "unchecked" in the sense that if you use evil hacks to put an Integer in your Collection<String>, it won't throw a classcast exception when you try casting the collection to List<String>

#

but that's just how all typed shit works

mortal hare
#

i think i changed my mind about lombok tbh

#

maybe its kinda ok to use it, since then you dont have to worry of breaking something later on with getters or object equality

#

less code = stable code

#

iguess

ivory sleet
#

there are certain annot libs that u ideally wna use to annotate said type params to communicate its a phantom type
(that will also make that warning go away)

ivory sleet
# mortal hare

but also you may be able to at runtime verify and/or perform casts on type constructions before that instanceof branch depending on how fromString is type parameterized

#

<Password,CharSequence>fromString(...) for example

mortal hare
#

pov i just realized you can have format on save on intellij

#

i missed that from vscode

#

nice to see that intellij has it

#

it would be nice if it would arrange annotations too

lilac dagger
#

maybe the format code options are in a separate place

chrome beacon
#

IJ does have a lot of format options

mortal hare
#

is it just me or intellij doesnt seem to work properly with github organizations

#

i get push errors

#

but when i use CLI it works flawlessly

thorn isle
#

works fine for me

#

do you have your auth token and whatever set up

mortal hare
#

i just use https

#

i hate setting up ssh keys or api tokens

thorn isle
#

repository not found
means either it doesn't exist or you don't have access to it

mortal hare
#

yea but why does cli work

thorn isle
#

you've set up auth for it

#

you need to configure a token into intellj itself in the "github users" section

mortal hare
#

shouldnt it it just default git credential manager

#

for this

thorn isle
#

dunno, i don't think it does

#

it's always asked for either login credentials or a token for me

tender shard
#
ubuntu@sigma:~/ansible$ cat ssh_keys.yml 
---
- name: Manage SSH authorized_keys
  hosts: all
  become: true
  gather_facts: false

  vars_files:
    - group_vars/all/ssh_access.yml

  tasks:

    - name: system -> ubuntu @ all
      ansible.builtin.authorized_key:
        user: ubuntu
        key: "{{ item }}"
        state: present
        manage_dir: true
      loop: "{{ ssh_access.system | default([]) }}"

    - name: system -> mc @ mc
      ansible.builtin.authorized_key:
        user: mc
        key: "{{ item }}"
        state: present
        manage_dir: true
      loop: "{{ ssh_access.system | default([]) }}"
      when: "'mc' in group_names"

    - name: admin -> ubuntu @ all
      ansible.builtin.authorized_key:
        user: ubuntu
        key: "{{ item }}"
        state: present
        manage_dir: true
      loop: "{{ ssh_access.admin | default([]) }}"

    - name: admin -> mc @ mc
      ansible.builtin.authorized_key:
        user: mc
        key: "{{ item }}"
        state: present
        manage_dir: true
      loop: "{{ ssh_access.admin | default([]) }}"
      when: "'mc' in group_names"

    - name: operator -> mc @ mc
      ansible.builtin.authorized_key:
        user: mc
        key: "{{ item }}"
        state: present
        manage_dir: true
      loop: "{{ ssh_access.operator | default([]) }}"
      when: "'mc' in group_names"

    - name: dev -> mc @ dev
      ansible.builtin.authorized_key:
        user: mc
        key: "{{ item }}"
        state: present
        manage_dir: true
      loop: "{{ ssh_access.dev | default([]) }}"
      when: "'dev' in group_names"
ubuntu@sigma:~/ansible$ 

not the most perfekt playbook, but better than nothing

lilac dagger
#

looks like github's workflow config

sullen marlin
#

Looks painful is what it looks like

mortal hare
#

ah yes

#

java' ahhh gui

#

we're speedrunning epilepsy seizures with this one

#

this is why we need native wayland support on Java

dreamy glade
#

Hi, what event do I need to hook to track arrow entity movement (shot by player)? There is EntityMoveEvent but I think it only track LivingEntity which arrow is not. Thanks

mortal vortex
#

I think u would need a runnable

#

in conjuncture with ProjectileLaunchEvent

violet wave
#

Will spigot be ditching it's custom names/mappings in favor of mojang names for 26.1?
I really hope so. It'll make developing for Paper & Spigot much easier if they are both using the same NMS names.

quaint basin
#

When I type /rtp, I'm teleported to a pre-generated chunk, but the processor usage jumps to 30%. Aren't those values ​​high? My CPU is an i5-13500

chrome beacon
#

Also how are you measuring that

#

Like you really should take a look at timings instead

wet breach
#

you do realize your cpu has 14 cores right?

young knoll
#

14? That’s an odd amount

wet breach
#

6 performant cores and 8 efficient cores

remote swallow
#

i was about to say, im guessing its P and E cores

young knoll
#

Too futuristic for me

#

Mine just has 4 cores

#

(And 8 threads)

wet breach
#

I have 8 cores and 16 threads

young knoll
#

I’m pretty sure a modern cpu with a single core would beat mine

#

But shh

vagrant stratus
#

wassup nerrrds

thorn isle
#

if you want more details, profile it with spark

#

"cpu goes up" is not a very good benchmark of anything

wet breach
young knoll
#

Plus, is the entire area pregenerated or only the single chunk you teleport into?

#

Otherwise the game still needs to generate chunks around it up to the view distance

thorn isle
#

from what we talked last time, the idea is to pregenerate the whole area up to like 8 chunks away or so

young knoll
#

Well, is the view distance > 8 :p

thorn isle
#

could be, iirc he has some kind of per-player viewdistance thing where it could be arbitrarily far for some players, and we ended up at 8 chunks being a good compromise between overpreparation and being prepared enough

young knoll
#

Clearly we need chunky but it slowly pre-generates the world as people play

quaint basin
#

and the server is on my dedicated server

lilac dagger
quaint basin
quaint basin
#

the single core performance is better than i9-9900k for example

lilac dagger
quaint basin
#

and its the same price

covert stump
covert stump
covert stump
#

what is max attempt set

#

u can see in config

quaint basin
#

wdym attempts

#

The locations are in a buffer

young knoll
#

13000 series cpus? Pfft

quaint basin
covert stump
covert stump
young knoll
#

They made their own rtp with pre cached locations

#

So it doesn’t need multiple attempts

covert stump
#

didnt saw propely then

quaint basin
# covert stump

The RTP plugin is mine. The plugin checks at each tick if the buffer size has space for a location (by default the buffer stores 100 valid locations) - in this case, since the buffer is full, the overhead of the /rtp I'm talking about is only to load chunks and perhaps generate chunks to fill the buffer since it was emptied (generate partially because the generation is not done completely)

#

MSPT also went up to 41.9

covert stump
#

uhmm..

young knoll
#

I mean it’ll still have to generate extra chunks up to the view distance of 10

covert stump
#

If you load chunks on the main thread it will always spike your CPU... Push it to the background threads...

young knoll
#

Plus it has to load all the chunks

young knoll
#

You could pregen the extra 2 chunk radius and see if it makes much difference

quaint basin
#

What you can do is load chunks async, but the loading is still done on the main thread

young knoll
#

Though seeing as the mspt stays below 50 it seems to be doing fine

quaint basin
covert stump
#

not?

#

If you are using Paper..

thorn isle
#

Do you have a spark profile

#

Anything else is useless guesswork

covert stump
#

you use world.getChunkAtAsync() to handle the chunk loading and generation for your buffer on the worker threads....

quaint basin
quaint basin
thorn isle
#

Start it (on all threads) rtp, stop it, link the report here

young knoll
#

I think moonrise can load chunks fully async

#

Don’t quote me on that though

#

(Moonrise is the chunk system paper uses)

covert stump
#

In modern PaperMC...the heavy computing for chunk generation (terrain math) and chunk loading (reading from disk) happens on background worker threads...

quaint basin
thorn isle
#

--thread *

#

And set the sample interval to like 0.1

quaint basin
thorn isle
#

The default 5ms interval is useless

young knoll
#

I mean, it’s below 50 so it really doesn’t matter

thorn isle
#

Things add up

#

The whole point of pregen is to have fewer things add up at runtime

young knoll
#

You load the single chunk you are teleporting to async, and the scheduler likely handles loading the rest while trying to keep the mspt under 50

thorn isle
#

You don't want your baseline at 0 players be 40mspt

young knoll
#

I mean, the game suddenly has to load what, 400 chunks

covert stump
thorn isle
#

Let's see a spark profile, anything without a profiler report is useless guesswork

#

If there is a sync load or if the scheduler is working as intended, the report will reveal all

young knoll
#

If you see the mspt spike over 50 then I’d be concerned, but it getting close to 50 likely means the chunk system is using as much extra time as it can each tick without dropping the tps

quaint basin
#

i'll do the spark profile

young knoll
#

It’s a shame vanilla can’t do fully async generation and loading

#

It shouldn’t be too hard to do all the work on separate threads and then just push the final chunk into the chunk map

covert stump
#

lol.. If two background threads try to update the exact same chunk border at the exact same millisecon.. the server crashes

#

true multithreading projects like folia took years....

young knoll
#

That’s for ticking though

#

Just loading should be simpler

quaint basin
#

I did it this way. The MSPT is high because it was during server initialization

#

I typed that command after server had finished initialization, but for some reason the startup mspt appears

thorn isle
#

Wait for a while forthe jit and other shit to warm up

quaint basin
#

I had waited for the MSPT to went down and the CPU usage to drop to 0%, but yes, I'll do it again

#

It still hasn't gone down xd

#

MSPT went up to 100 this time

covert stump
#

use.. /spark profiler start --clear then /rtp then immediately /spark profiler stop

quaint basin
#

can I do that? /spark profiler start --thread * --interval 0.1 --clear

covert stump
lilac dagger
#

can't wait to test this out 😄

covert stump
#

Int Spark link, open up the Server thread drop down and just follow the highest percentagas

quaint basin
#

and CPU usage went up to 20% (it was previously at 0%)

#

Sometimes CPU usage goes up to 30%, and MSPT once went up to 105, as I showed in the other Spark profile

covert stump
#

A spike to 105 MSPT means the main thread totally froze for over 2 ticks lol...

#

expand the Server thread at the top, and just follow the highest percentage numbers down the tree...

#

Its almost hasto be a method like getChunkAt() or similar loops or a block checking loop that is forcing the main thread to do the work..

slender elbow
#

could also use the --ticks-over flag to only record the lagging ticks

chrome beacon
#

^^

quaint basin
quaint basin
thorn isle
#

this only shows the main thread

thorn isle
#

it's --only-ticks-over iirc

quaint basin
thorn isle
#

the chunk task scheduler is taking 2.6ms per tick

#

that is acceptable

quaint basin
thorn isle
#

it didn't, not on average at least, that was a spike; there's no way to know whether it was related

#

if you're trying to profile mspt spikes, use the --only-ticks-over parameter

quaint basin
thorn isle
#

with the other ones

lilac dagger
#

am i impl this right?

quaint basin
#

only increased to 26 MSPT and 23% cpu usage

#

from what I have seen on /spark tps

#

but profile is sayying max MSPT is 86

thorn isle
#

god only knows what it's doing

#

i think the numbers are just fucked

#

spark says the highest tick time was 80ms

#

and has recorded one tick exceeding the 25ms threshold

#

but for that one tick, it only has 9ms worth of samples for the main thread

#

either way, it doesn't seem to be directly caused by anything your plugin is doing; at worst it's the scheduler

#

let's see your rtp code again and see what you actually do when a player teleports; do you just player.teleportAsync?

chrome beacon
#

I don't really think you're lagging

#

The server is probably running perfectly fine

#

The high tick can happen right after startup

thorn isle
#

if he's doing what we're telling him to do, the profiler is only on for when he does /rtp specifically

#

so it wouldn't include startup ticks

orchid gazelle
#

Guys

thorn isle
#

and the server is of course running fine since from what i see it's a test server with like one player on

orchid gazelle
#

What should I code?

thorn isle
#

the question is whether this will make that 80mspt spike go up to 200mspt on a production server

buoyant viper
#

alternative suggestion: look at the packet class in a Fabric or Forge decompiled project workspace

#

or Spigot even if ur working on the server

#

altho most if not all of those packets are shared code between platforms (client/server) iirc

lilac dagger
#

i'll see if anything breaks

#

i'll try to get a player on the server

thorn isle
thorn isle
#

looks fine, it's pretty much just teleportAsync

#

what might be happening is the mspt spiking because there's a vacancy in the buffer and your rtp finding logic kicks in

#

to benchmark that you'll want to profile the buffer being populated over the course of a longer period of time than just a few ticks

quaint basin
#

I thought that would be cheap work for the i5-13500

thorn isle
#

impossible to say

#

but if it really is the rtp finder logic, that will involve lots of world generation

#

which is very expensive

#

lots of very expensive things = higher cpu usage

quaint basin
#

Even so, I have 12 cores. 30% of 12 cores is 3,6 cores

#

I don't know how I can benchmark buffer filling

#

Because what's probably causing the high mspt is getChunkAtAsync, etc., and it's not possible to know how long it takes to load the chunk

thorn isle
#

you let it run without any stops and you spark profile it with --thread *

thorn isle
quaint basin
#

What I find strange is that if I walk through a map that has never been generated before, the CPU usage stays at 20% and the MSPT at 25

thorn isle
#

remember my pyramid example

quaint basin
thorn isle
#

generating a bunch of locations faraway from already generated stuff is much more expensive than incrementally expanding an already generated area

quaint basin
#

oh yea

quaint basin
#

is this?

thorn isle
#

maybe, i don't remember

quaint basin
#

chunk-system: #
io-threads: -1#
Sets the number of threads to be used for read and write operations with chunks. If any value below zero is set, only one thread will be used.
worker-threads: -1#
Sets the number of threads to be used for parallel chunk generation. If a value below zero is set, the server will automatically determine the optimal number of threads based on the available physical CPU cores (not logical cores). For systems with 3 or fewer physical cores, only 1 thread will be used. In all other cases, the number of threads is capped at half of the physical cores.

#

This doesn't say what happens if I set it to -1. Maybe it's based on the physical cores

thorn isle
#

-1 is the default

#

the number of threads is capped at half of the physical cores

quaint basin
#

oh below zero

quaint basin
#

I think half is too much

thorn isle
#

doesn't really matter if you have enough compute on your machine

quaint basin
high vessel
#

Is someone really good at coding I need help with a plugin i've made

chrome beacon
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

buoyant viper
#

for legal reasons- dont quote me on that

high vessel
# chrome beacon ?ask

I can't just tell the exact problemo, because it's an private plugin i've been working on since days and I just need help with an bug I can't get away

random grove
#

If I have a registered event handler for BlockBreakEvent, and call player.breakBlock(block), will the event handler finish executing before player.breakBlock(block); finishes?

Also, can multiple BlockBreakEvents be fired when I call player.breakBlock(block) in the case of a player breaking a cactus or scaffolding, where there is a cascading effect?

thorn isle
#

yes and yes

random grove
#

thank you

thorn isle
#

however i'm not certain if that happens with cactus specifically

#

some plants break a tick later

#

others break instantly

#

or cactus, i'd tryitandsee

random grove
#

I see

#

Okay, thanks

random grove
thorn isle
#

they won't fire to begin with if you cancel the initial blockbreakevent, as the "side effects" are calculated after the event completes

chrome beacon
high vessel
chrome beacon
#

I mean it would be the same amount of info to explain here and in dm

thorn isle
#

i don't know if anybody here is particularly interested in doing stuff in dm's

chrome beacon
#

You're likely going to get better help from multiple people by just asking here

rough ibex
#

I don't think anyone is going to try and steal this genius award-winning private plugin idea if it's so coveted

chrome beacon
#

^

vagrant stratus
#

We're devs. We can just join the server for like a few minutes and go off that

#

your code is useless to us lol

sullen marlin
#

Us stealing their genius award-winning private plugin idea

vagrant stratus
#

^ Can almost guarantee their idea was already done too lol

lilac dagger
#

question, how do you check the content length of a packet?

#

i use this approach

#

i put it into a temp bytebuffer and read the bytes, send that and then append buffer to out

thorn isle
#

unless you have a way to calculate it ahead of time, this is an alright way of doing it

lilac dagger
#

true

thorn isle
#

a hack i like to do is write 5 zero bytes to the buffer where the length varint is going to be, then write the contents, and then go back and write the varint over those 5 bytes

brittle star
#

hello, i need a free minecraft config developer for my minecraft server. i am searching since 2 months now and i really need help. if anyone can help me please contact me

thorn isle
#

lol

quaint basin
#

ARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.google.common.util.concurrent.Abs
tractFuture$UnsafeAtomicHelper (file:/root/minecraft/proxy/velocity.jar)
WARNING: Please consider reporting this to the maintainers of class com.google.common.util.concurren
t.AbstractFuture$UnsafeAtomicHelper
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

#

how can I fix this?

#

I'm using java 25

buoyant viper
#

velocity

#

?whereami

buoyant viper
lilac dagger
#

this graph confuses me

young knoll
#

What makes it terminally deprecated

lilac dagger
#

i'm gonna assume:
length of compressed
length of decompressed
packet id
packet data

thorn isle
#

the first varint is the length of the packet on the wire

#

the second varint is the length of the uncompressed packet data

lilac dagger
#

so like i said

#

and apply compress/decompress if size of the compressed is bigger than the threshold i have from a previous packet sent by the server

thorn isle
#

apply decompression if the second number != 0

lilac dagger
#

hm?

thorn isle
#

see the last column of the 5th row

#

0 to indicate uncompressed

#

second number is 0 iff the data is not compressed

lilac dagger
#

yeah so instead of decompressed length no?

thorn isle
#

if it's compressed, then the second number is the uncompressed length

lilac dagger
#

oh so it's that way

#

hmm i see

thorn isle
#

the first number is used to determine how much to read from the wire

lilac dagger
#

yeah that i got

thorn isle
#

the second number is used to determine how large of a buffer needs to get allocated for the uncompressed data; if it's zero, the first number is used instead

#

well, minus 1 byte since the 0 data length varint isn't part of it

lilac dagger
#

is the uncompressed length varint compressed too?

#

it doesn't feel like it at least

#

i think i get it

#

they drew the line wrong

#

these 2 always are uncompressed and trigger for both sizes

#

okay, i'm done

#

time to test

#

nope

#

something is wrong

#

i think the first varint can become 0

#

no it's correct

thorn isle
#

all bytes following the second number are going to be compressed iff the second number != 0

#

otherwise, they're all uncompressed

lilac dagger
#

yeah makes sense

#

okay got compression going 😄

wet breach
# lilac dagger question, how do you check the content length of a packet?
import java.io.*;
import java.net.Socket;
import java.nio.ByteBuffer;
import java.util.Arrays;

public class TcpReceiver {
    public static byte[] receiveData(Socket socket) throws IOException {
        InputStream is = socket.getInputStream();

        // 1. Read the 4-byte length header
        byte[] lengthBytes = new byte[4];
        int bytesRead = is.read(lengthBytes);
        if (bytesRead != 4) {
            // Handle error: unexpected stream termination
            throw new IOException("Failed to read complete length header");
        }

        // 2. Convert the byte array to an integer to get the expected payload size
        int expectedLength = ByteBuffer.wrap(lengthBytes).getInt();

        // 3. Read the rest of the data into a buffer
        byte[] data = new byte[expectedLength];
        int totalBytesRead = 0;
        while (totalBytesRead < expectedLength) {
            bytesRead = is.read(data, totalBytesRead, expectedLength - totalBytesRead);
            if (bytesRead == -1) {
                // Handle error: stream ended prematurely
                throw new IOException("Stream ended before all data was received");
            }
            totalBytesRead += bytesRead;
        }

        return data;
    }
}

this assumes the packet follows the typical standard of putting the length of data in the beginning of the packet

buoyant viper
molten hearth
wet breach
#

one of the things I like about Java is handling packets is quite easy

buoyant viper
#

convinced me that i should, in fact, probably append my packets data length to its header spec

wet breach
# buoyant viper convinced me that i should, in fact, probably append my packets data length to i...
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.io.IOException;

public class UdpReceiver {
    public static void main(String[] args) {
        try {
            DatagramSocket ds = new DatagramSocket(12345); // Listen on port 12345
            byte[] buffer = new byte[1024]; // Pre-allocate a buffer
            DatagramPacket packet = new DatagramPacket(buffer, buffer.length);

            ds.receive(packet); // This method blocks until a packet is received

            // Get the actual length of the received data
            int actualLength = packet.getLength();
            System.out.println("Received packet length: " + actualLength + " bytes");

            // Access the actual data using the offset and length
            byte[] actualData = new byte[actualLength];
            System.arraycopy(packet.getData(), packet.getOffset(), actualData, 0, actualLength);
            
            // Note: A simpler way to get the data as a new array is:
            // byte[] actualData = Arrays.copyOf(packet.getData(), packet.getLength());


            ds.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Here is for UDP to compliment the TCP version

buoyant viper
#

now howd you know i was working with UDP 🤨

#

im still at the spec-ing stage really so and dealing with the potential for adding packet fragmentation to allow for larger transfers of data

#

and peer management

#

kinda just recreating ENet i guess but worse

wet breach
#

don't worry about packet fragmentation. Just worry about the size of what a packet could be and try to fit your data in that. network stuff will handle fragmenting packets automatically

#

1500 bytes is typically the standard on most networking equipment before it will start chopping packets automatically

buoyant viper
#

yes, for now im making sure that i dont cross like a 1024 byte threshold on the arbitrary data length, and the header is only a few more bytes rn

#

so staying well under 1500mtu

wet breach
#

this is where compression comes in handy, because if you are at 1600 bytes you could use compression to bring it below 1500 so it stays as a single packet. Network stuff will pad out packets to their max length hence compression is not handy for anything below that

buoyant viper
#

ill look into it this evening potentially

wet breach
#

here in the next decade we probably won't need compression anymore

#

and will start to become a thing of the past lol

wet breach
#

just so you don't accidentally start blocking your main thread lol

buoyant viper
#

i think id have to do a separate thread regardless of udp or tcp no?

#

accept() just blocks for both iirc

#

there is something with NIO DatagramChannel that i believe lets u accept() non-blocking though

#

but processing networking on separate thread was my plan anyway

wet breach
#

TCP doesn't always block

#

it will block, on sending or if connection has not been established

#

the sending only blocks if the queue or buffer is full

#

tcp is a stream if that helps because a connection has to be established. UDP no connection is established and packets are just sent to the destination.

buoyant viper
#

ye

lilac dagger
#

Right now i'm trying to emulate the minecraft protocol

chrome beacon
lilac dagger
#

I kinda got it

#

I just need to fix the packet decompression

#

The rest is just looking into protocol wiki api

#

The decompression logic is wrong and it's stuck at registry data

chrome beacon
#

I see

lilac dagger
#

I'll fix it when i get to pc

lilac dagger
#

fixed 😄

#

so now i should be able to speed it up

lilac dagger
#

i'm in

#

😄

chrome beacon
#

🥳

lilac dagger
#

took way too many classes to do it

#

keep alive, teleport and send message/execute command packets left

#

teleport done

#

this is amazing

#

it's not even that hard to do 😄

buoyant viper
#

waow :3

lilac dagger
#

this is out of date

wet breach
#

the id?

lilac dagger
#

yeah

wet breach
lilac dagger
#

in hex?

wet breach
#

no that is the int

#

hex for 21 is 0x15

lilac dagger
#

nope

#

doesn't pick it up

#

i see a bunch of 111 in chat

#

let me try that

wet breach
#

just fyi, an id of 21 would mask bits 0,2,4

#

and ignores 1,3,4,6,7

#

got to love bitmasking

lilac dagger
#

i don't need for this 😄

#

just the id of keep alive

#

i'll figure it out

wet breach
#

its probably 3

#

either 3 or 20 one of those

lilac dagger
#

i'll check the source of the server for the id

wet breach
buoyant viper
lilac dagger
#

2B

#

😄

#

thx

#

i'll check this one out

lilac dagger
#

nvm

#

that's player loaded

#

which is correct in the wiki

#

wait

#

maybe i have to send the keep alive

#

nope, the sv

wet breach
#

both client and server send keep alives

lilac dagger
#

yeah, but the server initiates it

#

i'll look for an id that's sent just once

wet breach
lilac dagger
#

oh i think i got it

#

keep alive is part of configuration

#

the id is correct

#

but i have to set to configuration protocols

lilac dagger
#

okay, i found the packet to switch strategy back to configuration

#

jeez, this is gonna end me

#

good thing i had the protocols stage implemented

slender elbow
#

doesn't the data generator include packet IDs?

#

or, it used to and it no longer does? i can't remember which one it was

lilac dagger
#

no it doesn't

#

i'm confused on one thing

#

both configuration and play have keep alive packets added

slender elbow
#

it does generate them

worldly ingot
slender elbow
#

./generated/reports/packets.json

worldly ingot
#

aPES3_AngeryNod That's relatively new

#

Maps from resource id to internal protocol id

slender elbow
#

yeah

lilac dagger
#

hmm

slender elbow
#

p neat

lilac dagger
slender elbow
#

the data generator

#

you need the --reports flag

lilac dagger
#

oh sick

#

hmm

#

i managed to get these actually

#

but they aren't called not sure why

#

43 and 27

#

i substracted start from end

lilac dagger
#

neither 0x04 nor 0x1B is called

#

and nor a start configuration packet is sent that switches to configuration

#

i might've missed something else

#

wait nvm

mortal hare
#

i should really try to utilize records more

lilac dagger
#

my bad

#

it's 2B for clientbound

mortal hare
lilac dagger
#

and 1B for serverbound

mortal hare
#

this is such yandere dev vibes

lilac dagger
#

this is how the id is obtained 😄

mortal hare
#

😄

lilac dagger
#

i didn't know that you can generate the ids

#

yay

#

inversed packet id it was

#

because clientboundkeepalive and serverboundkeepalive have different id

#

so 2B for clientbound and 1B for serverbound 😄

wet breach
#

indeed, which is why I said both client and server have them

#

I assumed you wanted the one the server sent

#

since the one coming from the client is easy to figure out?

lilac dagger
#

i make a client

#

so clientbound is the easiest

wet breach
#

you made a client?

lilac dagger
#

it's for my bot creator

#

i didn't render or do much

wet breach
#

anyways, both I suppose were easy to figure out if you just tossed up wireshark on 127.0.0.1 and bounded the client and server to the loopback as well

lilac dagger
#

i just join a player to a server and make him say stuff or execute commands

#

wouldn't it all be a byte mess?

wet breach
#

disable compression and security as well would remove a bunch more stuff as well

wet breach
lilac dagger
#

i just have this nice hook

wet breach
#

more so if there is no encryption which you can disable

lilac dagger
#

it does the uncompression and everything

wet breach
#

you can just disable compression on the server

lilac dagger
#

well, i just have it already with the sys out 😄

#

i don't need wire shark if i have it built in and picking packet id specifically

wet breach
#

guess you know for future reference that you can just remove a bunch of clutter in terms of debugging packets

wet breach
#

since both client and server can be ran on the same system and bounded to the loopback, it removes any outside interference. More so if we are disabling online mode and compression

lilac dagger
#

i see

#

i'll keep it in mind 😄

mortal hare
#

i hate this

worldly ingot
#

We love type erasure

mortal hare
#

We also love runtime exceptions with immutable collections instead of separate interface contract without add() methods

#

i wonder is there any lib which provides java's collection but with immutability in mind at compile time?

worldly ingot
#

Not really. Only library I've used that does immutability well was JOML

#

They have read-only parent types

#

Jetbrains annotations do have @Unmodifiable and @UnmodifiableView though which help a little

thorn isle
#

it gets a bit hairy

#

e.g. for linked hashmaps, get() can a mutating operation

slender elbow
#

Java's collections with immutability at compile time
that is called kotlin

worldly ingot
#

Touche

mortal hare
#

kotlin feels like c++ to me. language crammed full of syntax sugar features which can be used to easily shoot yourself to the foot

#

all i want is bug prone type safety with java's explicit syntax

mortal hare
thorn isle
#

sure you can, it just doesn't work very well

ivory sleet
#

non-nullability and immutability proofs

#

basically at compile time

mortal hare
ivory sleet
#

but i dont know a single person who likes checkers, people only use it if they are forced to lol

ivory sleet
#

but it can be slow at times since it deals with its own generation

#

either way, there are decent tools for this; that is prove correctness in different aspects, just that nobody likes to use them because they often become a distraction to most people who just wanna write and create things

ivory sleet
#

if u want to reason about types in higher order, use kotlin, or even better, move to a functional language

thorn isle
#

there are only a few cases where i'd want more robust statical analysis, and that's mostly for very complicated threading stuff, which doesn't seem to exist for java

mortal hare
#

still praying for native non null type support

ivory sleet
thorn isle
#

i don't like any of the proposed approaches

#

generics are already a mess, adding a second dimension of nullability to it is going to make it even worse

#

value types come with weird nonsensical limitations that bleed out into reference types

slender elbow
#

every day you complain about java yet refuse to use anything else beyond judging the book by its cover

#

I wonder

#

is java really the best solution to your problems out there and yet falls so short?

mortal hare
ivory sleet
#

there is

#

skript my friend

slender elbow
#

long live yaml

ivory sleet
#

but either way, you don't seem to be looking for perfection though dovidas, rather total correctness in ur programs, and there are very good languages that allow you to elegantly reason about/prove correctness if that's what you're after, java is not one of them

slender elbow
#

I must say your criticisms about java are very valid

#

but that is kind of the problem, java is not the solution you are actually looking for, those exist elsewhere and are quite elegant

young knoll
#

It’s called assembly

mortal hare
#

?paste

undone axleBOT
lilac dagger
#

okay, i managed to read the text directly from nbt for my bot

#

😄

#

i don't need adventure api

#

almost done

#

bot creator for 1.21.11 works perfectly

#

just nbt and netty as dependencies

lilac dagger
#

does anyone know if i have to do anything else to support batching?

#

i miss a chat packet for some reason

#

i think i got it 😄

lilac dagger
#

yeah perfect

#

it was an issue with the the compression

#

not a bundling thing

#

this took way too long 😄

#

but it works perfectly

orchid gazelle
lilac dagger
#

yeah

#

it'll come here

#

right now it's using mcprotocollib

#

but i can only support a version at a time with it

#

hence why i wanted to go full custom

thorn isle
#

nice

#

for whatever reason all the projects doing this are in javascript or god forbid python

#

it'll be good to have one written in java for better integration with plugins

buoyant viper
#

lol

lilac dagger
#

it's really cool, i use it to test minigames 😄

thorn isle
#

i wouldn't mind shading it into my ai moderator plugin to fuck with players some more

#

i've been planning on something such as this for a while, but creating a headless client has always been too much effort for me

lilac dagger
#

it's still very basic

#

i hope you don't mind 😄

#

I'll make a bot-creator-api package and a bot-creator-gui

#

i'll make sure to upload it to jitpack

dreamy glade
#

Hi, is there any ready-to-use spigot api that get an equivalent spawn egg from EntityType or I have to map it manually? Thanks.

hushed spindle
#

did anything change with nms? cant seem to get the mojang mappings from the repo

#

or is this the wrong version

sullen marlin
hushed spindle
#

would it now just be mojang instead of remapped-mojang?

sullen marlin
#

It would be nothing

hushed spindle
#

wait, no, im being silly

#

you're right

#

thank you!

vagrant stratus
hushed spindle
#

wait does this mean nms users dont necessarily need to update every release any more??

#

my lord about time

vagrant stratus
#

Not 100% of the time but yea, mostly the case

hushed spindle
#

that's so convenient, i didnt realize the deobfuscation would impact me

vagrant stratus
#

It is convenient enough i've bumped my lowest supported version to 26.1 kekw

hushed spindle
#

100% fair

#

supporting multiple versions with nms has been a pain in the ass

onyx fjord
#

So for the most part you will ideally maintain NMS for all versions

#

... that you wanna support

vagrant stratus
#

No need to multi-module or anything of the sort for 26.1+

hushed spindle
#

now im running into a different issue that i didn't before

Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.15.0:compile failed: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.15.0 or one of its dependencies could not be resolved

Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.codehaus.plexus:plexus-java:jar:1.5.2 has not been downloaded from it before.

i don't use plexus and i'm not in offline mode
search results didn't explain the issue very far, anyone know what could be going on?

sullen marlin
#

not a spigot issue, but share your pom

hushed spindle
#

sorry, i thought we could come here with development issues of any kind

any specific pom? i have a lot of modules

#

?paste

undone axleBOT
hushed spindle
sullen marlin
#

try running maven again with -U ?

hushed spindle
#

same result

wet breach
hushed spindle
#

yes

wet breach
#

-go to File -settings -on search box top left type 'maven'. -click on maven option -see if work offline box is checked. if yes then uncheck it

hushed spindle
#

i did check that, its not checked

wet breach
#

ok then try this

#

go to C:\Users\(windows user here)\.m2

delete
maven-metadata*.xml and _*.repositories

hushed spindle
#

i should delete the repositories folder?

#

there's no maven-metadata though

#

uh rather this is what i got

wet breach
#

they are probably hidden

#

on the top go to view and there should be somewhere where you can have it show hidden files

hushed spindle
#

i have that checked

wet breach
#

interesting it must be in intelliJ directory somewhere then

hushed spindle
#

i believe maven is packaged in with intellij right? i dont think i ever really directly installed it

wet breach
#

It should be yes

wet breach
#

if you don't want to delete you can just move it to somewhere else

hushed spindle
#

i can rename the folder rq see if that works

wet breach
#

that should work too

hushed spindle
#

still complaining about offline mode

#

very strange

wet breach
#

I guess try clearing caches in intelliJ and restart

#

this is why I don't use IntelliJ

hushed spindle
#

what do you use? eclipse?

wet breach
#

Netbeans

hushed spindle
#

ok so manually inserting the dependencies it complained about fixed the problem
love it when intellij is being quirky

wet breach
#

lol

hushed spindle
#

right so now im wondering if you guys think this is a bukkit bug or not

i'm iterating through a server's recipes with Server#recipeIterator() and at some point during an iterator.next() call an error is thrown saying that a method DyeRecipe#toBukkitRecipe() was called and is abstract

i look at DyeRecipe and see no implementation of toBukkitRecipe() in it or its super classes (DyeRecipe extends NormalCraftingRecipe which implements CraftingRecipe which extends Recipe<CraftingInput>). Recipe<CraftingInput> defines a method toBukkitRecipe() but this is not implemented in any of those classes resulting in the following error

#

basically im asking if this is anything i can fix because i dont see this being an issue of my plugin

#

DyeRecipe i believe is new in 26.1?

young knoll
#

Probably a bug

#

?jira

undone axleBOT
hushed spindle
#

cool cool

pure dagger
#

why is it not allowed to cast List<Integer> -> List<String> or whatever BUT List<Integer> -> List<?> -> List<String> works

thorn isle
#

it works but it's unsafe and will cause things to explode at runtime

#

this is basically the generics version of casting Integer to Object and then to String

#

it works, but you have to tell the compiler "trust me bro" in the Object -> String step

#

runtime however will not only trust but also verify, and it will blow up with a ClassCastException

worldly ingot
#

One of the most C-like things you can do in Java. Forcing a cast that makes no sense LaughingKirby

thorn isle
#

but because of type erasure, this (runtime exception) won't happen when you cast the collection; only once you try taking a String out of it and it gives you an Integer

pure dagger
#

then why is the first way not allowed?

wet breach
pure dagger
#

i know about that

#

but why is one allowed and the other not

thorn isle
#

the second way also won't work

wet breach
thorn isle
#

but you are bypassing the type system to trick the compiler into letting you do it

wet breach
#

therefore anything checked at runtime will allow you to compile even if it will not work

pure dagger
#

ah okay

#
List<Integer> intList = new ArrayList<>();
List<String> stringList = (casting to List<? then to List<String>)```

but wont it work if the list is empty and we will lose the first refference so no one will do intList.add(1) and then try to stringList.get()
thorn isle
#

yes

pure dagger
#

you are saying it will work

#

?

thorn isle
#

it's the same object and the runtime won't know the difference

pure dagger
#

yeah okay thankss

thorn isle
#

because of type erasure, the runtime will only do the cast when you get() from it

#

Integer i = coll.get(0) will blow up if the 0th item in coll is actually a String and not an Integer

pure dagger
#

yeah

thorn isle
#

so it will "work" but only if you don't use generics for what they're supposed to be used for

#

an interesting case in theory but not something you should end up doing in practice

pure dagger
#

yeah, i mean for making serialization library its kinda tricky and i think ill need to trust other methods (which are written by me) that they return the right type , and cant really verify it

thorn isle
#

honestly just look at how gson does it

#

or jackson or whatever

pure dagger
#

yeah i will

fallow saffron
#

Should I add an API to my plugin? it backports Sulfur Cubes, which aren't even out yet to 1.8, I see it creates many possibilities for endless mini-games, but because I coded in such a way for high performance, a custom Bukkit event for example may cause performance issues

worldly ingot
#

You'll be fine. But really...? lol

thorn isle
#

what's a sulfur cube

vagrant stratus
#

to be released entity

worldly ingot
#

1.8 players will go to such great lengths to use a vanilla feature that was added 10 years in the future

vagrant stratus
#

or that

thorn isle
#

is that one of the 100 useless dumb baby mobs added in 28.135 or whatever the current version scheme is

vagrant stratus
#

Nah, it's actually useful

worldly ingot
#

26.1, but no, this will be a 26.2 feature

vagrant stratus
#
A sulfur cube is a passive mob that spawns only in sulfur caves and has the ability to absorb full blocks. When a sulfur cube has a block absorbed, it does not take damage from player attacks and can be launched like the block it absorbed based on its unique properties. 
fallow saffron
#

That's why I made a plugin for it in 1.8

vagrant stratus
#
Depending on the absorbed block, the sulfur cube will have different properties when hit. Properties that are known so far include:
Material     Effect
Ice     Slippery
(Low friction)
Logs     Bouncy
(Low gravity)
Wool     Light
(Low gravity, low fall speed)
Iron Block     Heavy
(High gravity, high fall speed)
Stone     Stays Low
(Little to no bounce) 
thorn isle
#

it's a football?

vagrant stratus
fallow saffron
#

But the thing is I used SoA ECS (contiguous memory to increase cpu cache hits and auto-vectorization from JIT) so an OOP event will slow it down

vagrant stratus
#

This fuckin thing

thorn isle
#

you put a block in it and kick it around?

vagrant stratus
fallow saffron
#

And Bukkit just creates new objects every tick, thus increasing stuttering and slowdowns

vagrant stratus
#

Skill issue

thorn isle
#

iunno man

vagrant stratus
#

you'll have to figure it out yourself, or wait for the entity to release & backport it then

#

we're not gonna help you regardless lol

thorn isle
#

i don't know if you need to reimplement the football mob in assembly with 512 bit wide vectorized collision physics

fallow saffron
#

The thing is, a server may spawn tons of these

#

and that adds up

thorn isle
#

either way, if you're worried about performance, you know what they say

#

benchmark it or go home

vagrant stratus
#

^

thorn isle
#

in regards to your event question, tryitandsee and benchmark it

fallow saffron
#

my other plugin which backports bubble columns, can create millions of them and still only use 3.5ms of a tick

vagrant stratus
#

We're not gonna bother helping. You're on your own.
We can't even tell you if your backport is as efficient as the modern code lol

fallow saffron
#

It definitely is

#

the ECS I use, I ported from my game engine

vagrant stratus
#

And you know this how? The mob ain't even released yet

#

Damn we got a time traveler fr fr

thorn isle
#

bubble columns are literally water, no? same physics as with flowing water; entities check if they're in water, if it has an impulse, and then applies that impulse to the mob

#

you can have a world entirely made of bubble columns and it won't make a difference

vagrant stratus
thorn isle
#

those are clientside

#

i.e. not my problem

fallow saffron
#

Because Minecraft's codebase is OOP, they don't use arrays but create super classes that also increase indirection

vagrant stratus
#

okay and?

fallow saffron
#

It's slow

vagrant stratus
#

skill issue on your part

fallow saffron
#

That's why it is so stuttery

vagrant stratus
#

remake minecraft from scratch then

thorn isle
#

lol

fallow saffron
#

I did

thorn isle
#

no, not at all

fallow saffron
#

my game engine

#

not minecraft

vagrant stratus
#

meh

fallow saffron
#

but

thorn isle
#

the server performing poorly is definitely not caused by "oop indirection"

vagrant stratus
#

^

#

It's decades of jank code

thorn isle
#

that might be like 0.1% of it (moreso in the renderer perhaps) but not at all measurably significant

#

you're getting a bit lost in the weeds here

fallow saffron
#

If you keep creating objects per tick, the GC has to clean hundreds of thousands to millions of objects scattered in the heap

#

thus it uses up cpu time to do so

thorn isle
#

yes, and that's exactly what it was built to do

fallow saffron
#

and slows the game/server

thorn isle
#

we have things like gzgc nowadays

#

where95% of the work happens off the business threads

#

and generational garbage collectors explicitly target the problem of short lived, frequent allocations

vagrant stratus
#

You're stuck on 1.8 & backporting. It's gonna be worse for you as you're missing many optimizations and rewrites lol

fallow saffron
#

Yes they did improve the code but the Entity class is still one giant class

thorn isle
#

doesn't really mean anything performance wise

fallow saffron
#

It's hard for them to rewrite

vagrant stratus
#

Not really?

#

The way they're doing it isn't incorrect lol

echo basalt
#

inheritance vs composition

fallow saffron
#

It isn't but it's not the most optimal

vagrant stratus
#

They don't need most optimal lol

thorn isle
#

not to mention that you're invariably going to have a massive amount of indirection in the engine regardless of paradigm, especially in a sandbox game where the terrain is liable to change

vagrant stratus
#

You want it, but they don't need it

fallow saffron
#

they do when its the largest game and continuous complaining of performance

#

Vulkan is not going to magically fix it

vagrant stratus
#

And i doubt rewriting the entity system to be ECS will either

#

they're working with decades of poorly written code lol

fallow saffron
#

And if they're not already doing so, using MultiDrawIndirect in OpenGL that's already 99% of Vulkan

thorn isle
#

myeah i don't really see the idea behind the vulkan switch

vagrant stratus
#

macos

fallow saffron
#

Yes but ECS means easier and faster updates

thorn isle
#

and yes the renderer is terrible and there are many many things that could be done to improve it

vagrant stratus
#

OpenGL's getting deprecated or something iirc

fallow saffron
#

Yes stupid apple

vagrant stratus
thorn isle
#

mactoids can go pound sand

fallow saffron
#

they just refuse to let opengl 4.3 which has mdi run on their devices

vagrant stratus
#

Pretty sure a multi-billion $ company with decades of experience knows what they're doing lol

thorn isle
#

well

fallow saffron
#

Walled-garden

thorn isle
#

they certainly do

#

but the suits up top are telling them to make 1000 useless baby mobs per version

vagrant stratus
#

If they thought ECS was worth doing, they'd be working towards that

fallow saffron
#

they did

#

with bedrock partially

vagrant stratus
#

Irrelevant

#

bedrock != java

thorn isle
#

probably not worth the rewriting effort

fallow saffron
#

yes yes I know

vagrant stratus
#

exactly, so it's not worth bringing up lol

fallow saffron
#

but obviously they know the performance gains

thorn isle
#

from ecs? there are none

vagrant stratus
#

Irrelevant as well, as it's also a completely different programming language too lol

#

It's not worth comparing unless it was more 1:1

thorn isle
#

they don't care about performance anyhow, just look at the new Brain vs the old ai goals system

fallow saffron
thorn isle
#

what they're optimizing for is ease of maintenance and the ability to shit out 1000 baby mobs per version

thorn isle
vagrant stratus
#

I'm like 99% sure Enium heard something and never bothered actually doing massive benchmarks with different implementations

fallow saffron
#

It's not nonsense, I use it in my game engine, it uses like 1% of the cpu

thorn isle
#

have you ever even looked at a spark report

#

"ruh roh memory locality" is not the issue here

fallow saffron
#

Explain the frequent stuttering then

thorn isle
#

define stuttering

fallow saffron
#

frequent pauses in frames

thorn isle
#

are we talking about the client or the server; the tick loop or the rendering pipeline?

fallow saffron
#

im talking about the client right now

thorn isle
#

if you're talking about the rendering pipeline, it stutters because it's fucking shit

vagrant stratus
#

ECS & How minecraft are doing it both have their pros & cons.
It's not worth switching unless the difference of switching to ECS is worth it, which so far it does not seem that way.

Hell, I wouldn't even have issues updating Minecraft with new things

thorn isle
#

there are a million and one things you could do to improve the rendering pipeline

#

many of them aren't even major changes

#

just look at shit like sodium

fallow saffron
#

It's not the rendering pipeline, as minecraft grew, more and more objects are created

thorn isle
#

throwing ecs at it is like the least relevant proposition possible

fallow saffron
#

on 1.8 it runs smooth, not much stuttering, on the latest version it runs like shit

thorn isle
#

"muh objects" no, that's not relevant

vagrant stratus
vagrant stratus
thorn isle
#

have you profiled the garbage collector, my guy?

#

have you even tried anything other than g1gc?

fallow saffron
#

This is the same mindset as "let's just slap on DLSS" and pray it runs well

buoyant viper
#

gasp, a game gets more computationally expensive as it adds more features!

vagrant stratus
#

No, sounds like vcs2 just has more experience than you lol

thorn isle
#

although since you're on 1.8 i bet you're still running the psgc 🤡

fallow saffron
#

Minecraft's allocation rate is 150 MiB/s, my engine is 0.0MiB/s, no stuttering, volumetric clouds, physically-based sky, pbr materials, vsm shadows

vagrant stratus
fallow saffron
#

written in Java 8

thorn isle
#

allocation-caused stuttering on the cpu end is easily profilable and noticeable, and we have very mature tools and architecture to detect, profile, debug, and resolve them

#

and no, it's not caused by just spawning a million objects

#

more objects does not necessarily mean things stutter or even consume much in terms of compute

#

modern garbage collectors are exceptionally efficient at doing allocations and disposing short-lived objects

fallow saffron
#

Then tell me, why are there no AAA game engines written in Java if memory pressure is not an issue

vagrant stratus
#

The only real way to tell if it would make a difference is gasp modifying the client to use ECS and doing benchmarking. Who wants to waste time decompiling & rewriting the client just to do a proper bench mark

fallow saffron
#

So we agree that object allocation IS an issue

vagrant stratus
#

The language doesn't mean much, there are multiple games written in Java

fallow saffron
#

none of them are AAA in visual fidelity

vagrant stratus
#

Because they don't need to be AAA in visual fidelity

vagrant stratus
fallow saffron
#

Ugh I give up, keep doing what you're doing

thorn isle
#

did you know most of netflix's backend is written in java

vagrant stratus
#

elasticsearch is java too

#

A good chunk of Jenkins is in java as well

thorn isle
#

now what memory pressure does have an impact on is worst-case latency, as older gc's have been stop-the-world, but modern gc's like gzgc are specifically designed to have low pause times

vagrant stratus
#

Like.. if Java was the problem, we wouldn't have such major projects using it lol

thorn isle
#

so it's not from nowhere that things like renderers which are sensitive to worst-case latency might avoid java, but it's also a solved problem

#

it will work if you design for it and make it work

#

and no, you don't need ecs or native memory vectorization nonsense for it

fallow saffron
#

I literally created a world firstly with my SoA ECS plugin, placed 1m bubble columns, TPS sat at ~19.98TPS, the plugin consumed 0.35ms of a tick, did the same with real bubble columns (not even 30,000 placed) and MSPT went through the roof at 150MS! the tick took 150% longer

#

tell me where SoA ECS is not useful

thorn isle
#

it isn't

#

mojang is just bad

fallow saffron
#

lol

thorn isle
#

you're comparing apples and oranges here

fallow saffron
#

Now you're saying they're bad

thorn isle
#

like we've said several times, mojang doesn't optimize for performance

fallow saffron
#

Jesus I am talking to a 10 year old

thorn isle
#

you optimize for performance