hi im trying to learn how to make a paintball game
should i learn parallel luau? is it even useful?
i already know i should know raycasting and im getting pretty good at it if i do say so myself
what you want to learn?
hi im trying to learn how to make a paintball game
should i learn parallel luau? is it even useful?
i already know i should know raycasting and im getting pretty good at it if i do say so myself
what you want to learn?
No reason to learn parallel Luau for something like a paintball game. Can’t see the benefit in trying to hyperoptimize by running things that don’t need to be in parallel.
Raycasting is pretty vital. You’ll probably also want to learn data storage and client-server communication if you’re going to make a paintball game (projectile handling, sanity checks, etc.)
idk lmk if u find out pls
TehEpicBird#0220
can you help me make one plz? it would be super beneficial to have a professional on the team
i can pay in % when the game starts to make that muney
u can join the team too if u want! the more the merrier!
This is not the place to ask for that – plus, I am busy with personal matters. If you need recruiting, use the Talent tab at create.roblox.com or post here.
what if i want to render hundreds of projectiles at once? wouldn’t raycasting in parallel be superior?
raycasting inherently isn’t that expensive, but doing it hundreds of times every frame can be taxing on the machine.
anyway, i was thinking about ways to track player attacks? each attack should have an expiration time-- when it’s data representation should no longer be tracked on the server. do you think a minheap would be useful for this?
my thought process is that the attacks with the shortest lifespan will be bubbled up to the top of the heap, so as time passes their expiration, we will remove that node (the min node)
IDK THATS WHAT CHATGPT TOLKD ME XD
also i saw that people are using Touched for their paintball bullets. i think i might fo that one. do u agreee with taht implemenation?
Debris service is good with used-bullets deletions.
No, as .Touched isn’t reliable.
yeah but the server wouldnt keep track of instances, right? you should render those all on the client. i was more thinking that if you have a data representation on the server for verifying attacks, you could remove them after some threshold time (in this case, .2 seconds)
local SETTINGS = {
RemoveExpiredRequests = .2 -- remove every .2 sec
}
-- Data structures
local MinHeap = require(script.MinHeap)
-- Private variables
local attackLookup = {} -- O(1) lookup of nodes in the heap
local attacks = MinHeap.new()
-- Private functions
local function addAttackToHeap(player, info)
-- create an expiration time based on request
local expirationTime = info.requestTime + 2
if attackLookup[expirationTime] == nil then
attackLookup[expirationTime] = attacks:Insert(expirationTime)
end
-- create a linkedlist within each attack expiration node
local currEntry = {
next = attackLookup[expirationTime].head,
player = player,
value = info
}
if currEntry.next then
currEntry.next.prev = currEntry
end
attackLookup[expirationTime].head = currEntry
end
-- remove old attacks
local lastRemoval = 0
RunService.Stepped:Connect(function()
local t = timeSource()
if lastRemoval > t then return end
lastRemoval = t + SETTINGS.RemoveExpiredRequests
local min = attacks:PeekMin()
-- destroy attacks
while min and min < t do
attacks:RemoveMin()
attackLookup[min] = nil
min = attacks:PeekMin()
end
end)
LIKE I SAID CHAPTGT TOLD ME ALL THIS SO IDK
You could probably use Fastcast for raycasting, and PartCache for instance creating tool.
Partcache is much faster and optimized rather than using Instance.new
idk… i heard part cash is not that good with hundreds and potentially thousands of parts… i think the lookup for parts is slow ish? (correct me if i’m wrong plz)
PartCache is much more performant than using Intance.new everytime u fire a gun.