Coder Social home page Coder Social logo

planetis-m / breakout Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 1.0 238 KB

Breakout game implemented using strict ECS architecture. Used as a testbed.

License: Other

Nim 100.00%
breakout breakout-game ecs entity-component-system game gamedev nim

breakout's People

Contributors

planetis-m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

dseeni

breakout's Issues

Todo in the future

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.

Refactor 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)

Benchmark Storage internals

Modify the benchmark in experiments/ to use array/seqs in internal lists of Storage.
Can be done with when statements inside type section.

Switch every component store to 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)

Decomposed 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

Design of Deferred updates

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.

Switch to immediate updates / seperate scene graph to global / model

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.

Blueprint DSL: not all entities need Transform2d

Currently creating an entity through addBlueprint always attaches Transform2d and Hiearchy components to that entity. That's not always necessary.

Note: Low Priority

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.