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
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:
Possible solution
Create a 'blob buffer', by this I mean:
This solves a few things:
Stuff to note: