Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor patches(#44,#49,#50,#2, #4) #55

Merged
merged 8 commits into from
Nov 13, 2022
Merged

Conversation

ABCxFF
Copy link
Owner

@ABCxFF ABCxFF commented Nov 11, 2022

Why:

Closes #2, #44, #49, and #50.

Summarize what's being changed (include any screenshots, code, or other media if available):

  1. Constant OUTPUT_BUFFER capacity can cause crashes #2) Added 00 packet chunking (idea by Nulled) to split up larger packets into multiple smaller ones. Along with that, made the OUTPUT_BUFFER resize if running out of space.
  2. Spectator gets attacked by AIs #44) Makes AI check if the target's sides != 0, before continuing to use it as a target.
  3. Spectator Healthbar Shows #49) Set the spectator tank to actually use the invisibility meta data described earlier (someone forgot to do this previously)
  4. Dominator can be on fallen team #50) Set fallen bosses to have no team, and set non teamed dominators to default to the Arena
  5. Auto 5 and Auto 3 Aim inaccuracy #4) Calculates barrel pos correctly - algorithms were off

Confirm the following:

  • I have tested these changes (by compiling, running, and playing) and have seen no differences in gameplay

@ABCxFF ABCxFF added the inaccuracy Tested stat related inconsistencies between a real diep server this replica label Nov 11, 2022
@Nul-led
Copy link
Collaborator

Nul-led commented Nov 11, 2022

Possible Improvements for #2:

  • using Buffer.poolSize to make use of preallocated memory making the creation of new typed arrays faster (needs to be adjusted to current typesize i think)
  • (optional) adding a config option to adjust the poolSize

@ABCxFF
Copy link
Owner Author

ABCxFF commented Nov 11, 2022

Ah smart. Also thinking of generally switching to Buffers instead of Uint8Array and views

@Nul-led
Copy link
Collaborator

Nul-led commented Nov 11, 2022

Yup LGTM

@c86ec23b-fef1-4979-b2fa-b9adc351b8cc
Copy link
Contributor

seems good

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

@c86ec23b-fef1-4979-b2fa-b9adc351b8cc
Copy link
Contributor

it has bug: console is spammed with possible desync error

@Nul-led
Copy link
Collaborator

Nul-led commented Nov 12, 2022

I suppose we cant do much about that, apart from
a) collecting & merging 00 packets on the client
b) disabling console output

@c86ec23b-fef1-4979-b2fa-b9adc351b8cc
Copy link
Contributor

@Nul-led only the camera file causes that bug not the writer it seems

@supahero1
Copy link

As for #2, you can use:

socket.send(data, { fin: false })

to send a partial message without actually splitting it into a separate websocket message (all of them will be merged into one on the other side once fin: true is set, or if the second argument is not given, since then fin is set to true by default). There's no need to dynamically resize the buffer or anything, just check if we're about to write past the end of it, and send the frame.

@Altanis
Copy link
Contributor

Altanis commented Nov 13, 2022

LGTM

quick thing, invisible entities don't get sent to the client right

@ABCxFF
Copy link
Owner Author

ABCxFF commented Nov 13, 2022

As for #2, you can use:

socket.send(data, { fin: false })

to send a partial message without actually splitting it into a separate websocket message (all of them will be merged into one on the other side once fin: true is set, or if the second argument is not given, since then fin is set to true by default). There's no need to dynamically resize the buffer or anything, just check if we're about to write past the end of it, and send the frame.

That's awesome, thanks for letting me know. I'll add in later today / tomorrow

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good, but fix the entity desync console message problem

@ABCxFF ABCxFF changed the title Minor patches(#44,#49,#50,#2) Minor patches(#44,#49,#50,#2, #4) Nov 13, 2022
@ABCxFF ABCxFF linked an issue Nov 13, 2022 that may be closed by this pull request
@ABCxFF
Copy link
Owner Author

ABCxFF commented Nov 13, 2022

Should be fixed now @c86ec23b-fef1-4979-b2fa-b9adc351b8cc

@ABCxFF ABCxFF removed the request for review from Nul-led November 13, 2022 19:25
@Nul-led
Copy link
Collaborator

Nul-led commented Nov 13, 2022

LGTM

@ABCxFF ABCxFF merged commit 912badc into main Nov 13, 2022
@ABCxFF ABCxFF deleted the minor-patches(#44,#49,#50,#2) branch November 13, 2022 19:36
Camvanaa pushed a commit to Camvanaa/diepcustom that referenced this pull request Jan 12, 2025
…xFF#55)

* patch: ABCxFF#2

* patch ABCxFF#44

* patch ABCxFF#49 - make specs invisible

* patch ABCxFF#50 -

* use buffers for writing

* Revert 00 chunking

* also patch ABCxFF#4

* finish ABCxFF#2, using fin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inaccuracy Tested stat related inconsistencies between a real diep server this replica
Projects
None yet
5 participants