Reducing the number of paint objects in a drawing system?

Hello, DevForum members.
Recently, there has been a surge of new ‘drawing games’ on Roblox. (I may have created that surge)

Basically, I need help with reducing the number of paint objects (ink) in my drawing system.

It works by in steps of every 0.05 seconds, where it checks the startposition (where the player clicks) and the endposition (where the player moves their mouse), and then connects those 2 points with size (the distance), position (self explanatory), and rotation.

But I have noticed that it uses a lot of paint just to draw a simple line, and I was wondering if anyone has any idea on how I could reduce the number of paint.

The paint is a pretty simple circle image, and if the paint’s size is bigger than the brush size (a line) it uses a classic frame object.

A possible method I can think of:
Keep track of which dots are painted when.
Loop through the dots in order; replace straight lines (within a certain margin that you should define by trial-and-error) with a single, long frame.

These steps would be applied after the player has painted ‘too much’ dots.

So TLDR: replace straight lines that currently contain a ton of dots, with a single frame.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.