Cleanup repository
4
.luaurc
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"aliases": {
|
||||
"jecs": "src",
|
||||
"testkit": "testkit",
|
||||
"jecs": "jecs",
|
||||
"testkit": "test/testkit",
|
||||
"mirror": "mirror"
|
||||
},
|
||||
"languageMode": "strict"
|
||||
|
|
21
README.md
|
@ -1,19 +1,18 @@
|
|||
|
||||
<p align="center">
|
||||
<img src="image-5.png" width=35%/>
|
||||
<img src="assets/image-5.png" width=35%/>
|
||||
</p>
|
||||
|
||||
[](LICENSE) [](https://wally.run/package/ukendio/jecs)
|
||||
|
||||
Just a stupidly fast Entity Component System
|
||||
|
||||
* [Entity Relationships](https://ajmmertens.medium.com/building-games-in-ecs-with-entity-relationships-657275ba2c6c) as first class citizens
|
||||
* Iterate 800,000 entities at 60 frames per second
|
||||
* Type-safe [Luau](https://luau-lang.org/) API
|
||||
* Zero-dependency package
|
||||
* Optimized for column-major operations
|
||||
* Cache friendly [archetype/SoA](https://ajmmertens.medium.com/building-an-ecs-2-archetypes-and-vectorization-fe21690805f9) storage
|
||||
* Rigorously [unit tested](https://github.com/Ukendio/jecs/actions/workflows/ci.yaml) for stability
|
||||
- [Entity Relationships](https://ajmmertens.medium.com/building-games-in-ecs-with-entity-relationships-657275ba2c6c) as first class citizens
|
||||
- Iterate 800,000 entities at 60 frames per second
|
||||
- Type-safe [Luau](https://luau-lang.org/) API
|
||||
- Zero-dependency package
|
||||
- Optimized for column-major operations
|
||||
- Cache friendly [archetype/SoA](https://ajmmertens.medium.com/building-an-ecs-2-archetypes-and-vectorization-fe21690805f9) storage
|
||||
- Rigorously [unit tested](https://github.com/Ukendio/jecs/actions/workflows/ci.yaml) for stability
|
||||
|
||||
### Example
|
||||
|
||||
|
@ -57,9 +56,9 @@ end
|
|||
```
|
||||
|
||||
21,000 entities 125 archetypes 4 random components queried.
|
||||

|
||||

|
||||
Can be found under /benches/visual/query.luau
|
||||
|
||||
Inserting 8 components to an entity and updating them over 50 times.
|
||||

|
||||

|
||||
Can be found under /benches/visual/insertions.luau
|
||||
|
|
Before Width: | Height: | Size: 392 KiB After Width: | Height: | Size: 392 KiB |
Before Width: | Height: | Size: 391 KiB After Width: | Height: | Size: 391 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
|
@ -14,9 +14,6 @@
|
|||
"Lib": {
|
||||
"$path": "src"
|
||||
},
|
||||
"rgb": {
|
||||
"$path": "rgb.luau"
|
||||
},
|
||||
"benches": {
|
||||
"$path": "benches"
|
||||
},
|
||||
|
|
|
@ -5,7 +5,6 @@ local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
|||
local Matter = require(ReplicatedStorage.DevPackages.Matter)
|
||||
local ecr = require(ReplicatedStorage.DevPackages.ecr)
|
||||
local jecs = require(ReplicatedStorage.Lib)
|
||||
local rgb = require(ReplicatedStorage.rgb)
|
||||
local newWorld = Matter.World.new()
|
||||
local ecs = jecs.World.new()
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local Matter = require(ReplicatedStorage.DevPackages["_Index"]["matter-ecs_matter@0.8.1"].matter)
|
||||
local ecr = require(ReplicatedStorage.DevPackages["_Index"]["centau_ecr@0.8.0"].ecr)
|
||||
local rgb = require(ReplicatedStorage.rgb)
|
||||
local newWorld = Matter.World.new()
|
||||
|
||||
local jecs = require(ReplicatedStorage.Lib)
|
||||
|
@ -133,13 +132,6 @@ for i = 1, N do
|
|||
end
|
||||
print("TEST", hm)
|
||||
|
||||
local white = rgb.white
|
||||
local yellow = rgb.yellow
|
||||
local gray = rgb.gray
|
||||
local green = rgb.green
|
||||
|
||||
local WALL = gray(" │ ")
|
||||
|
||||
local count = 0
|
||||
|
||||
for _, archetype in ecs:query(D2, D4, D6, D8):archetypes() do
|
||||
|
|
|
@ -5,7 +5,6 @@ local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
|||
local Matter = require(ReplicatedStorage.DevPackages.Matter)
|
||||
local ecr = require(ReplicatedStorage.DevPackages.ecr)
|
||||
local jecs = require(ReplicatedStorage.Lib)
|
||||
local rgb = require(ReplicatedStorage.rgb)
|
||||
local newWorld = Matter.World.new()
|
||||
local ecs = jecs.World.new()
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "jecs",
|
||||
"tree": {
|
||||
"$path": "src"
|
||||
}
|
||||
"$path": "jecs.luau"
|
||||
}
|
||||
}
|
||||
|
|
0
src/index.d.ts → jecs.d.ts
vendored
10
package.json
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"name": "@rbxts/jecs",
|
||||
"version": "0.4.0-rc.0",
|
||||
"version": "0.4.0",
|
||||
"description": "Stupidly fast Entity Component System",
|
||||
"main": "src",
|
||||
"main": "jecs.luau",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ukendio/jecs.git"
|
||||
"url": "git+https://github.com/ukendio/jecs.git"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Ukendio",
|
||||
|
@ -15,9 +15,9 @@
|
|||
],
|
||||
"homepage": "https://github.com/ukendio/jecs",
|
||||
"license": "MIT",
|
||||
"types": "src/index.d.ts",
|
||||
"types": "jecs.d.ts",
|
||||
"files": [
|
||||
"src",
|
||||
"jecs.luau",
|
||||
"LICENSE.md",
|
||||
"README.md"
|
||||
],
|
||||
|
|
33
rgb.luau
|
@ -1,33 +0,0 @@
|
|||
return {
|
||||
white_underline = function(s: any)
|
||||
return `\27[1;4m{s}\27[0m`
|
||||
end,
|
||||
|
||||
white = function(s: any)
|
||||
return `\27[37;1m{s}\27[0m`
|
||||
end,
|
||||
|
||||
green = function(s: any)
|
||||
return `\27[32;1m{s}\27[0m`
|
||||
end,
|
||||
|
||||
red = function(s: any)
|
||||
return `\27[31;1m{s}\27[0m`
|
||||
end,
|
||||
|
||||
yellow = function(s: any)
|
||||
return `\27[33;1m{s}\27[0m`
|
||||
end,
|
||||
|
||||
red_highlight = function(s: any)
|
||||
return `\27[41;1;30m{s}\27[0m`
|
||||
end,
|
||||
|
||||
green_highlight = function(s: any)
|
||||
return `\27[42;1;30m{s}\27[0m`
|
||||
end,
|
||||
|
||||
gray = function(s: any)
|
||||
return `\27[30;1m{s}\27[0m`
|
||||
end,
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"name": "jecs-test",
|
||||
"tree": {
|
||||
"$className": "DataModel",
|
||||
"StarterPlayer": {
|
||||
"$className": "StarterPlayer",
|
||||
"StarterPlayerScripts": {
|
||||
"$className": "StarterPlayerScripts",
|
||||
"$path": "tests"
|
||||
}
|
||||
},
|
||||
"ReplicatedStorage": {
|
||||
"$className": "ReplicatedStorage",
|
||||
"Lib": {
|
||||
"$path": "lib"
|
||||
},
|
||||
"rgb": {
|
||||
"$path": "rgb.lua"
|
||||
},
|
||||
"benches": {
|
||||
"$path": "benches"
|
||||
},
|
||||
"mirror": {
|
||||
"$path": "mirror"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
roots = ["ServerStorage"]
|
||||
|
||||
[extraOptions]
|
|
@ -6,8 +6,7 @@ realm = "shared"
|
|||
license = "MIT"
|
||||
include = [
|
||||
"default.project.json",
|
||||
"src/**",
|
||||
"src",
|
||||
"jecs.luau",
|
||||
"wally.toml",
|
||||
"README.md",
|
||||
"CHANGELOG.md",
|
||||
|
|