Igor released a snippet of the Engine API. What do you think about it?

According to Igor, this is his multiplayer stress testing code:

local timer = 0
local parts = {}
local MAX_PARTS = 500
local SPAWN_INTERVAL = 0.05

function Update(dt)
    timer = timer + dt
    if timer < SPAWN_INTERVAL then return end
    timer = 0

    if #parts < MAX_PARTS then
        local p = Instance.new("Part")
        p.Position = Vector3.new(
            math.random(-200, 200),
            math.random(80, 120),
            math.random(-200, 200))
        p.Size = Vector3.new(
            math.random(2, 6),
            math.random(2, 6),
            math.random(2, 6))
        p.Color = Vector3.new(
            math.random() * 0.8 + 0.2,
            math.random() * 0.8 + 0.2,
            math.random() * 0.8 + 0.2)
        p.Orientation = Vector3.new(
            math.random(-180, 180),
            math.random(-180, 180),
            math.random(-180, 180))
        p.Anchored = false
        table.insert(parts, p)
    end

    local n = #parts
    local i = 1
    while i <= n do
        if parts[i].Position.Y < -50 then
            parts[i]:Destroy()
            parts[i] = parts[n]
            parts[n] = nil
            n = n - 1
        else
            i = i + 1
        end
    end
end

Thoughts? The part creation is a lot more OOP than I thought it would be. Though I already said that in the other Engine API post (because apparently I’m the only one who posts here :sob:). Not necessarily bad, but not good either. Seeing this alongside the knowledge that humanoids exist, is this basically going to be an (mostly) OOP dev-facing API? Hard to know that just based on what we see in this tiny snippet, but it’s looking like that will be the case

Yes, the internal implementation is object-oriented

timer = timer + dt

n = n - 1

i = i + 1

Huh, I thought Luduvo was Luau? Whatever happened to addition assignment +=?

Old habits die hard. += is neither in C++ nor Lua, so muscle memory probably had him doing that

Addition assignment exists in cpp

1 Like

Well crap, I thought they only had ++ and --. It could also be because this is Lua code, but it’s running in Luau now. The transition to Luau and Entt happened somewhat recently, so that code might have predated the transition

Also why is the name of Nintendo’s newest family of consoles banned in the filter? What bad things could I possibly say with that word

i like it, but i wish the events were named something more verbose because i personally have functions that are already named like that and i’m gonna have to update all of them :sob:

i dont understand this, i just build

I think it’s important that this is an early version of the API and could possibly change.

But yeah, I thought in terms of the programming, one of the big things we were gonna be looking forward to was the fact we are going to be using ECS.

I’m hoping this is only being done because the API is still early days, but it could also be that if many developers want to migrate, they probably want to do their OOP instead of learning proper ECS. Which would honestly be a necessary evil.

It’s kind of shocking how similar this is to Roblox though, lol.

In luau, as in cpp, there are both operators; there are no other reasons other than a simple choice between two options.

I think the paradigm in Roblox (and most likely in Luduvo) is well suited for simple games. That is, like a construction set.

Well-suited for simple games, terrible for bigger games. To the point that they use 1000 user-created libraries, so they don’t have to deal with Roblox’s API (Roact, Maid, Rojo, etc.)

Glad I’m not alone in this sentiment, as I was looking forward to having an ECS workflow as well. It’s not the end of the world to have Roblox-esq API (not every part of it is bad), but it’s still a bit disappointing if the code snippet turns out to reflect on the rest of the API like I think it could. We’ll see how everything’ll turn out soon™

1 Like