planetis-m / breakout Goto Github PK
View Code? Open in Web Editor NEWBreakout game implemented using strict ECS architecture. Used as a testbed.
License: Other
Breakout game implemented using strict ECS architecture. Used as a testbed.
License: Other
Since I need to switch tasks, I will document here the directions/experiments
I want to follow in the future, so I'm not tempted to spend more time on it, right now.
Storage
[]
and []=
procs should raise KeyError
when the entity doesn't exist in the Storage
.
A distinct Storage
type must be created solely for Signatures
that keeps the old behaviour,
by adding overloads for []
and []=
.
hasEntity
proc needs to be created. Also proc sort[T](a: var Storage[T]; cmp: proc (x, y: T): int, start: Natural = 0)
Storage
internalsModify the benchmark in experiments/
to use array/seqs in internal lists of Storage
.
Can be done with when
statements inside type section.
Storage
/ Remove Signatures
If the benchmarks are favourable, change the design of the ecs to use only sparse sets instead
of the current combination of a sparse set and seqs. Then Signatures
can be ommitted completely.
Every system will iterate upon a chosen component. sysTransform
will work over (part of) Transform2d
(where dirty
components start), for sysFade
that would be Fade
, etc. Then use if checks to fetch the other required components, example:
if game.collide.hasEntity(entity):
let collide = game.collide[entity]
else: ...
See also: https://wickedengine.net/2019/09/29/entity-component-system/
(Don't really like this design but it may worth implementing it for benchmarking)
Trasform2d
Copy the design of cgmath
math library and refactor vmath
to use Decomposed
instead of Mat2d
. Every operation (concat
, transformPoint
, invert
, etc) may work directly on top of it, avoiding matrix baking and decomposing on every update. A more elegant/sophisticated design could also be more performant but needs benchmarking first.
Note: Start Here
Another route to discover before, giving in to immediate updates is to implement bfs graph
traversal on top of Hiearachy
. Wing Engine seems to do that, so it is entirely possible.
Note: Modify pathfinding gist.
Immediate updates (sysTransform
) is touted as simpler design. Implementation similar to the bitsquid blog.
See also: piesku/goodluck#51
Note: Benchmarking is necessary before this change.
Transform2d
Currently creating an entity through addBlueprint
always attaches Transform2d
and Hiearchy
components to that entity. That's not always necessary.
Note: Low Priority
use a a spatial data-structure
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.