Nah idk, i wil think about it but i wont be needing buffers, my game is currently using under 1 mb of ram (It have at least 50 scripts)
@kekulusskek
Ай бұрын
@@Jackinbox19001 it's useful in datastores tho, if i'm not wrong
@Jackinbox19001
Ай бұрын
@@kekulusskek How?
@enpiesie
Ай бұрын
@Jackinbox19001, you can only store so much in a datastore key, so to conserve space you can compress it using buffers.
@Jackinbox19001
Ай бұрын
@@enpiesie give me an example code
@defenestratorr
Ай бұрын
This is a microoptimization that you probably won't need in like 99% of use cases. Unless you're working with big data or something
@ivymuncher
23 күн бұрын
i love using buffers for networking and datastores :-) even if it might be a micro optimization they make me feel good so i just use them anyways lmaoaoaoaoaooa
@swordlegend3256
7 күн бұрын
still very useful. and micro optimisations add up to something big so mine as well it takes like 10 minutes
@jodio8071
Ай бұрын
The video is very informative and good but the only problem is that sometimes you're saying "bits" instead of "bytes".
@bruhblox_
Ай бұрын
@GattoBINwhat's wrong with you, he just corrected him
@pyxelbuh
Ай бұрын
@GattoBIN respectfully they corrected vital information that if not corrected could cause major confusion in new programmers
@ana_s
Ай бұрын
@GattoBINwow angry much. The video got very important information wrong. What's wrong with correcting it for the sake of other people
@mason228x
Ай бұрын
Bits and bytes in 8 times difference,so it is very important,thanks for comment jodio8071,and Gatto dont be govnato@GattoBIN
@--Brick--
Ай бұрын
@@ana_s read the reply above you
@theosiris4179
Ай бұрын
5:08 Unsigned and signed should be swapped. Unsigned takes only positive inputs, and will handle overflows and negative inputs by taking the modulo of the input number with its maximum number + 1. On the other hand, signed numbers allows numbers to have a negative sign. Overflowing a signed integer is trickier, as it involves first taking the modulo with max + 1 then using two's complement with the number in binary. Roblox handles overflows automatically.
@stewiepfing539
Ай бұрын
thats what I said 😭😭
@theosiris4179
Ай бұрын
@@stewiepfing539 To clarify what I meant: Under the unsigned comments should be buffer.writeu and under the signed comments should be buffer.writei, not the other way around. It's a super small mistake.
@exolyne.
Ай бұрын
@@stewiepfing539 you wrote the opposite functions for what the code comments were saying
@Wyrmver
Ай бұрын
modulo? dude it doesn't use modulo it's just how binary works
@ozzy1987
Ай бұрын
I would *really* advise against using these because of how much of a micro-optimization they are unless it involves networking or serialization, and even then, only really consider it if your game or system is having problems in the first place.
@Runtem
12 күн бұрын
Very nice library, I would probably use this in the future when I'm developing more complex games. Also this library is very similar to the one I used in Unity clicker games called PlayerPrefs which function similarly, however there were some limitations for data types and as far as I know, they couldn't store more than 1 piece of data in each variable.
@tiltedblock
Ай бұрын
To be honest, on the other side using this make scripting/coding looks more complicated than usual
@lalaly2011
Ай бұрын
buffers should be used for compacting data that is sent over the network or you have big arrays using buffers for variables are unnecessary unless your going to send them to another script with a remote event (especially unreliableremoteEvents that have a 900 byte payload limit)
@rrb101567
Ай бұрын
im gonna assume buffers will be super useful in saving large inventories to the DataStores
@theoverlord3371
Ай бұрын
I like to gamble. how to gamble in studio
@4EVERACE
Ай бұрын
math.random 🗣🗣🗣🔥🔥🔥
@CheeseY420
Ай бұрын
print(Random.new():NextInteger(1, math.huge()))
@Mono_DevRBX
Ай бұрын
Random:NextInteger
@로좋
Ай бұрын
math.random Fr 🗣🗣🔥🔥🔥
@PixelOyuncuZ
Ай бұрын
Random.new():NextInteger() 🤓
@KashTheKingYT
Ай бұрын
W stewiepfing as always!
@Divine706
Ай бұрын
Maybe, you can create a module with a buffer library?
@Lobster305
Ай бұрын
just like coding with assembly
@rocketpadgamer
Ай бұрын
while I was watching this video I decided to go outside where the kittens were, I paused the video, but my headphones landed on the space bar, so the video was actually playing at 2x speed, I skipped most of the video because of this
@RyanEXElol
Ай бұрын
Watch it again💀💀
@noxinabox3506
Ай бұрын
Cool story bro.
@Dr_mafario
Ай бұрын
Very cool stuff, though the back and forth and the random pauses make it sound so confusing
@Hanselkek
Ай бұрын
Ty :)
@Kitsune_Dev
Ай бұрын
while this is great for Basics, can you make a more in depth video on how to use this for mass data compression and decompression? concept is to automate it completely by detecting the type of data, compress it and map the order somewhere for decompression
@RyanEXElol
Ай бұрын
Basics help you in complex stuff, you can also read roblox documentations about it.
@InfinityChances_
Ай бұрын
You could use for loops that take each ID of a table, adds it to the buffer, and continues. To get it back, take the length of the buffer, get a for loop, and pull each data out and put it in a table. I'm not fully sure but this should work
@로좋
Ай бұрын
Thank you for noticing me about buffers 😄❤️
@Wayne2.
Ай бұрын
How would I use this in a datastore though? using the read functions just returns the original string. Sorry if this is a dumb question, I just haven't fully understood bitbuffers yet.
@builderdolphin
17 күн бұрын
You can use buffer.tostring to save the data to a string, and buffer.fromstring to convert the saved string back to a buffer.
@Avysilvasan
Ай бұрын
guys i think buffer needs a nerf🥶🥶 shid so cold
@furroy
Ай бұрын
hardly the easiest way to save memory. i'd rather down sample one 1024 image to 512 and prob save more than this with a lot less work!
@RyanEXElol
Ай бұрын
Umm actually the vid was about numbers and strings🤓
@robocat168
Ай бұрын
@@RyanEXElol True. You should do everything in your power to save memory.
@finjer5018
Ай бұрын
Cool video!
@garytodak
Ай бұрын
i have tried to use this, but its hard. you need to think how big is the value, what type, and what index is the buffer, is it signed, unsigned, integer, negative? if it big value, is it 8,16? all these need to think. unless you have good understanding on how your game value is, dont use it. but the good thing is, we can have like the value cap to what the byte is. like if i use 16bit the number will be in 0-65536 and if i use this for my character coins, it wont go beyond that. so maybe its good for security? in case someone hack and want to set it to 9999999 which is not possible in 16bit.
@passarodeterno
4 күн бұрын
bro just check if the value passes 65k lmao why you would user buffer for that xd
@passarodeterno
4 күн бұрын
and it just will be possible to exploit your game if you let them to
@Kitsune_Dev
Ай бұрын
O M G yes thank you!! 🙏🏻
@viperdune
Ай бұрын
can buffers be used in datastores instead of tables?
@olicon1000
Ай бұрын
Yes
@TheProgammerGamer
7 күн бұрын
Why don’t people do this more often?
@gamingwithlilabe3711
Ай бұрын
11-12 Hours, lol!
@salmanizzadin
Ай бұрын
📝
@MarzFromMars
Ай бұрын
cool
@ablueslime
Ай бұрын
hi
@fayking
Ай бұрын
this is probably being used in a really specific usecase, nice video btw
@abodReal
Ай бұрын
Networking for sure
@fayking
Ай бұрын
@@epixerty yea, you can use it everywhere but its a bit overkill haha
@theosiris4179
Ай бұрын
@@epixerty Just because you can use it everywhere doesn't mean you should. Variables without buffers allocate memory efficiently automatically. Buffers need the fixed amount of memory, and a little more to manage the buffer itself. Additionally, the steps to read & write buffers adds complexity to your code. local variable = 16 -- 4 bytes are used print(variable) -- Outputs: 16 local mbuffer = buffer.create(4) -- Allocates 4 bytes + overhead memory for buffer management buffer.writei32(mbuffer, 0, 16) -- Writes an integer (4 bytes) local value = buffer.readi32(mbuffer, 0) print(value) -- Outputs: 16 A better use case for buffers would be in data storage (datastores, memorystore) or networking, where they can handle large volumes of data efficiently.
@lumalumii
Ай бұрын
it's good for networking
@lumalumii
Ай бұрын
@@epixerty don't use buffers on everything
@8tan200
Ай бұрын
im sorry to be thet guy but how tf do you find these secret stuff?
@noobzyx5700
Ай бұрын
Its just that no-one uses it and can be easily replaced by the more simpler option which is a variable.
@lumalumii
Ай бұрын
devforum and roblox's documentation
@kryptonnslaxx6378
Ай бұрын
We studied about these in high school lol
@nanni5230
Ай бұрын
@noobzyx5700 Unless you are making a truly large scale game.
@windy6191
Ай бұрын
@@noobzyx5700what do you mean replaced by variable
@lembarkii8669
Ай бұрын
this is cool but not really worth it or needed in this day and age
@marcoorozco9420
Ай бұрын
YOU SAID 3.1415927 INSTEAD OF 3.1415926
@stewiepfing539
Ай бұрын
Thats what I meant in the video, single floating point numbers dont have the precision like double precision floating point ones
@erd404
Ай бұрын
3.14159265… You’d round up to 7 if you’re only going up to that digit.
@tipic_faker4166
Ай бұрын
lol
@I_pvn
Ай бұрын
dont do this
@RyanEXElol
Ай бұрын
Why
@stewiepfing539
Ай бұрын
@@RyanEXElol Its rage bait
@Noon1263
Ай бұрын
so apart from buffer, there is no other way to optimise your code?
@tantank
Ай бұрын
Obv, no
@Noon1263
Ай бұрын
@@tantank im convinced there is, we just don't know it yet. we are in this together amigo!
@Juju-dz5qt
Ай бұрын
Actor's, parallela roblox, OOP etc
@Juju-dz5qt
Ай бұрын
@@Noon1263prob have other way's what i dont know
@Noon1263
Ай бұрын
@@Juju-dz5qt heard of Actor's before but haven't really looked into them. I'm not sure what you mean by "parallel roblox", do you mean connecting functions with the :ConnectParallel() function? Also not sire what you mean by OOP.
Пікірлер: 129