Skip to content

Improvement to materials & classes #335

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

Open
Vam-Jam opened this issue Mar 14, 2022 · 0 comments
Open

Improvement to materials & classes #335

Vam-Jam opened this issue Mar 14, 2022 · 0 comments
Labels
enhancement Improvements to already existing features help wanted Help wanted with a bug/feature, may require some degree of knowledge in order to finish it

Comments

@Vam-Jam
Copy link
Collaborator

Vam-Jam commented Mar 14, 2022

Come one, come all, here's a small idea that could help fix a few issues with stability and performance

Preface

Every time a blob is made, It get's given 1 unique id (which is never removed), server has to tell the client its been made, sync everything, clients need to check that it's built all scripts, calculate cshape shittery and much more.

Creating a new blob is expensive, and we should be limiting how often we do it

Issues we have are:

  • Materials are probably 1/2 of the unique blob id list, they are made in extreme quantities, and have an extremely short life spam
  • Fire, used by guns or blob, made in short session, game tends to lag as they get made in batches and live for 10 to 20 seconds
  • Class swaps, its so bad the player see's a ghost of themself. (and we know switch class spam can kill

Possible solution

Create a 'blob buffer', by this I mean:

  • Batch make blobs in-head of time, and put it in an array
    • Note: These blobs would be invisible, have no tick and would keep a list of their scripts that are there at start up for later
  • Before create_blob is call, check to see if said blob has a pre-made blob free
  • If so, we take use one of the pre-made blobs, re-activate it and re-use it until our heart is content
  • If not, might as well temp create one and maybe add it back to the buffer for re-use later

This solves a few things:

  • Less blob id spam
  • Much much much cheaper to re-use a blob then to create a new one
  • Could end up helping performance

Stuff to note:

  • Need to keep a list of scripts added at start up, so when we re-init the blob, we just clear the list of added scripts
  • I suggest doing this on materials first, as they are simple objects with almost 0 logic
@Vam-Jam Vam-Jam added enhancement Improvements to already existing features help wanted Help wanted with a bug/feature, may require some degree of knowledge in order to finish it labels Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to already existing features help wanted Help wanted with a bug/feature, may require some degree of knowledge in order to finish it
Projects
None yet
Development

No branches or pull requests

1 participant