#Trying to optimize my Drawing Game, I need help.

1 messages · Page 1 of 1 (latest)

hoary narwhal
#

Im trying to make a roblox drawing game, all of the features are pretty much implemented, but the server gets overloaded so easily from all the parts that is generated to make up the strokes. Im not sure if it is due to my code in the server, the parts themselves taking up space on the server or what, but around 60k parts it becomes almost unplayable when Spray Paint can easily have over 300k with no problems. So I guess Im wondering how do I achieve performance like this with a part based system? Does spray paint use decals instead or something else? Any help is appreciated. I can't really post all my code in here because its thousands of lines at this point but if you want to see a snippet just ask.

brave idol
#

most likely decals

#

it depends if you have code looping through all of the parts

#

that would cause lag

hoary narwhal
# brave idol that would cause lag

yes I do use a lot of for loops. So you are saying the parts themselves are not the problem, but since the total amount of parts accumulates, the for loops running through them are taking longer and longer thus leading to poor performance?

#

and i will look into the microprofiler

brave idol
#

spatial query like raycast is better at the scale of 10k's+

hoary narwhal
#

the server kinda lags a lot, but I will look into it and see if a for loop is getting called where it shouldnt be

brave idol
#

how are you even hitting 100k

#

that's a lot of parts

#

for one person? wtf

ember gyro
#

very detailed drawing game

#

😏

brave idol
#

i'd expect 100k to be the total for like 30 people, not 1

hoary narwhal
#

every line takes a lotta parts

#

but spray paint handles 300k with no problem, but mine dies at like 100k

#

im definitely gonna put a part limit on players, but I want it to be able to handle 200-300k total in the server without slowing down too noticeably

cold waveBOT
#

studio** You are now Level 1! **studio

ember gyro
#

i swear i saw smhtn about editable decals in roblox studio

#

ima check it out and see if I am remembering correclty

#

ill come back

#
hoary narwhal
ember gyro
#

i was wrong

#

sadly

hoary narwhal
#

ah

ember gyro
#

my bad homie

hoary narwhal
#

youre good

#

im just tryna get this optimized without converting everything into mesh

#

currently tinkering with the microprofiler

#

im not seeing anything on the microprofiler. It seems like this is for frame rate issues. The issues im having are frame rate related, its more just reduced responsiveness. Like the server just takes longer to respond. Unless im wrong?

brave idol
#

dont forget to check it from server perspective in studio

#

but yea its more for cpu lag

ember gyro
brave idol
#

i think there's memory tools in it too

ember gyro
#

how would u go about doing this pyro

brave idol
brave idol
#

making the pixels a bit bigger

#

editablemesh/editableimage is probably best way tho

hoary narwhal
#

the microprofiler showed me that a streaming solver v2 was taking 80 ms to run, so I disabled it streaming enabled and now it runs perfect

#

theres no way that was it

hoary narwhal
brave idol
hoary narwhal
#

this whole thing is a canvas for players to draw on as they please

#

what you see rn is about 10k parts

#

the other tools are a lot more optimized

brave idol
#

i'd still suggest making those parts slightly larger

#

anyway i'd suggest reduce your min streaming radius

#

and again make sure nothing looping over all parts, make sure they're all anchored etc

#

and make sure you aren't spawning duplicates

hoary narwhal
#

yeah, every attribute that can affect performance is disabled and set to false, and the parts themselves are controlled with a slider, so they can make the parts bigger or smaller if they choose. And disabling streaming enabled seems to have completely fixed my server lag...

cold waveBOT
#

studio** You are now Level 2! **studio

hoary narwhal
#

even though its only a client side thing

brave idol
#

i would suggest you keep instance streaming on

brave idol
hoary narwhal
#

yes I have instance streaming still on

#

i just disabled shadows, made the material smooth plastic, made them anchored

brave idol
#

namely turning it off will make mobile phones pain when trying to run this

#

keeping it on shouldn't have much cpu cost on server

hoary narwhal
#

idk its being weird

#

as soon as I disabled it my game is now running perfectly

#

but its not really intended for phones in the first place, maybe ipads though

brave idol
#

tbh nothing stopping you making this entirely clientsided

#

bit of work to do it but, it's plausible

#

idk up to you

hoary narwhal
#

its supposed to be a community thing