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

Use less bits for wire_ports net #3164

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wrefgtzweve
Copy link
Contributor

Uses 13 bits instead of 16 for networking the entity in wire_ports.
Which is fine as gmod can't have that many entities in the first place, base gmod also uses 13 for net.WriteEntity() https://github.com/Facepunch/garrysmod/blob/master/garrysmod/lua/includes/extensions/net.lua#L5
image

@Denneisk
Copy link
Member

I'm guessing it's not possible to change to WriteEntity for this task?

@wrefgtzweve
Copy link
Contributor Author

Seemed like all the logic is using actual entity ids rather than entities

@thegrb93
Copy link
Contributor

thegrb93 commented Nov 1, 2024

The entity limit could increase again in the future so I'm not really a fan of this.

@storm37000
Copy link
Contributor

storm37000 commented Nov 1, 2024

using Write/ReadEntity should grow with the entity limit when and if it is increased.

@wrefgtzweve
Copy link
Contributor Author

wrefgtzweve commented Nov 2, 2024

I can make a local var for it but yeah i can see the issue, however currently networking useless bits isn't great either.
Would be really hacky but grabbing this upvalue could be a possibility but i doubt anyone would want that. Ideally it'd have just been globally available.

@Denneisk
Copy link
Member

Denneisk commented Nov 2, 2024

My suggestion, make a request to have that exposed globally and for now just have 13 in an equally named upvalue until it becomes global.

Entity limits don't just increase overnight. We'll have plenty of forewarning to change it as necessary until the value gets exposed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants