-
Notifications
You must be signed in to change notification settings - Fork 26
Description
This repository has been in kind of a bad state, with poor (and sometimes wrong) documentation, a /dev and /experimental branch, each containing important features, and some questionable design choices.
This issue is to propose a set of changes and actions to take, to get Concord and it's repository back to a good state.
Logo
We have talked about a logo in the past, but never got around to doing it.
Perhaps a Concord plane?
Sumneko annotations
The Sumneko type system has become really good, and should be used in favor of the current LDoc annotations.
It would be absolutely fantastic if component data could be typed too, but we might need to wait for generics to be supported better.
Revamp syntax
In the Concord Discord I have often posted some proposals for alternative syntax, mainly for defining systems. The most recent proposal I feel is pretty good:
return ECS.defineSystem("My cool system", function(system, world, c)
local query = world:createQuery({
include = {c.position, c.velocity},
exclude = {c.sleeping},
}
system:disable()
system:on("update", function(dt)
for e in world:query(query) do
e.position.x = e.position.x + e.velocity.x * dt
e.position.y = e.position.y + e.velocity.y * dt
end
end)
system:onMatch(query, function(e)
print("Entity matched", e)
end)
system:onUnmatch(query, function(e)
print("Entity unmatched", e)
end)
end)In a nutshell:
- Queries replace filters, allowing for more complicated queries:
-
- We could replace 'include' with 'read' and 'write' fields, for even more control over how components are accessed and modified
-
- We could add 'any', for entities that match any of the listed components
-
- We could add nested queries
-
- Queries could be (more easily) created at runtime
- All components are passed in as
c, so no more "components as strings" stuff system:on(event, cb)is to respond to emits. This way system events and system private functions dont get all mixed up.system:onMatch(query, cb)andsystem:onUnmatch(query, cb)replacepool:onEntityAddedandpool:onEntityRemoved, pushing it to systems instead allows for queries to be shared more easily.
Serialization
I've always felt like serialization is kind of shoehorned in. I also didn't use it when I needed serialization. It felt like a better approach to handle it in a saving and loading system respectively instead. I'd like to take a closer look at it.
Documentation
All documentation needs to be rewritten, period. The README should have some basic getting started info, the Wiki should be for indepth API info, and there should be practical examples in the repository.
Issues and Pull Requests
There are a bunch of open issues and pull requests, these should be looked at.