Giter VIP home page Giter VIP logo

eskimo's People

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eskimo's Issues

Refactor Views to a horizontal architecture

Currently EventView and BufferView extend the basic View. This doesn't allow features to be stacked (What if you need event queues as well as buffers?)

Writing this down to remind myself.

unable to use private-class components in views

private class Something {
    public var xxx: Int;
}

class SomeSystem extends System {
    var someView = new View<Something>();

    ...
}

Results in Type not found : Something in the someView = new View<> line.

No unit tests

Hi,

Your repository is seriously lacking in unit tests. Please add some.

munit is a good choice, because it's cross-platform (builds and runs on multiple platforms, if you so choose).

removing components while iterating

What's the intended way of doing that?

var objs = new View<A, B>();
... initialize objs with something...

for (e in objs.entities) {
   objs.manager.components.remove(e, A);
}

This won't work for all entities, as entities without A will be overwritten immediately.

  • say we have these entities [0, 1, 2, 3]; Length 4 in objs, that all match
  • the first iteration will remove A from 0;
  • objs.entities will now contain [3, 1, 2, 3] / Length 3;
  • next iteration, remove A from 1
  • objs.entities will now container[3, 2, 2, 3] / Length 2;
  • iteration will stop now

A workaround i found is using View.entities.entities
This will properly remove A from every entity, but it seems hard to remember.

for (e in objs.entities.entities) {
   objs.manager.components.remove(e, A);
}

[next] type arguments for views at instantiation time

https://github.com/sh-dave/eskimo-issues/tree/master/view-arguments-instantiation

With haxe's maps i can do:

class S1 extends System {
      var v : View<C>;
      var m : Map<Int, C>;

      override public function onStart( sm : SystemManager ) {
            m = new Map(); // no <Int, C> neccessary
      }
}

This doesn't work for views. I have to type the type arguments again

      override public function onStart( sm : SystemManager ) {
           v = new View<C>(sm.entities); // <C> neccessary
      }

Support children class in view

If I have a interface represent the graphics of an entity.

interface RenderComponent {
    function getDrawable():IBitmapDrawable;
}

and this implement:

class SpriteRenderComponent implements RenderComponent
{   
    public var target:Sprite;

    public function new() {
        target = new Sprite();
    }

    public function getDrawable():IBitmapDrawable {
        return target;
    }
}

and I create a view:

var v:View = new View([RenderComponent],null,context);

add an entity:

var e:Entity = context.entities.create();
e.set(new SpriteRenderComponent ());

But I can't get the SpriteRenderComponent using context.entities.
Also, this doesn't work either:

var e:Entity = context.entities.create();
e.set(cast (a,RenderComponent));

I found that it is related to some methods in ComponentManager.hx.

Anyway, am I supposed to do this, does it volatile the concept of ECS?

Endless loop while resolving dependencies

I forget to add a system other systems depend on. This results in an endless loop in SystemManager.evaluateSystems(). Would be nice to somehow be notified about it.
An easy solution would maybe to add a loop counter and printing unresolved systems when that counter hit some threshold in debug builds.

Allow outside access of systems in SystemManager

So the topic of this issue is really more of just a potential solution to the problem I'm having. Basically, my systems have both a render method and an update method. This render method in each system needs to have access to Kha's graphics API. Obviously, baking this into a generic library like eskimo would be a bad idea.

SystemManager.update is not a complex function, and a rendering equivalent could be just as light. However, it of course needs to loop through the systems variable, which is private.

A simple solution might be just overriding SystemManager. This brings me to my second point, that the System class of course doesn't have a render method. How would you go about this?

[next] System.onStart called multiple times

https://github.com/sh-dave/eskimo-issues/tree/master/system-multiple-onStart

Using systems with other-system-dependencies, depending on the order systems are added to the SystemManager, System.onStart() is called multiple times.

In this case, S2 depends on S1 and does a get in onStart();

class S2 extends System {
    var s1 : S1;

    public function new() super([S1]);

    override public function onStart( sm : SystemManager ) s1 = sm.get(S1);
}
sm.add(new S1());
sm.add(new S2());

will result in:

trace S1.onStart
trace S2.onStart
sm.add(new S2());
sm.add(new S1());

will result in:

trace S2.onStart
trace S1.onStart
trace S2.onStart

Systems missing from usage example in README.md

Hi,

The example in README.md is a bit contrived (string/int components -- useful for testing though). In particular, it doesn't explain how to use systems.

ECS libraries can do things different ways, and I think Eskimo is missing a sort of "philosophical design" part that states things like (if I got this right):

  • Entities are just an ID and a bag of components
  • Components can be any class, and are usually just data
  • Views allow you to filter (and operate) on entities that have a particular set of components
  • Systems ... ???

In particular, I thought systems are supposed to be a "super-set" of views: they filter and select entities with the right set of components, and they have some "update" method or something that they operate across all components (eg. find all entities with position and velocity components, and move the position according to the velocity).

How is Eskimo supposed to work with regards to systems?

[next] type arguments for views not working as expected

https://github.com/sh-dave/eskimo-issues

I put up a small repo in case there are more issues, so you can easily reproduce. ๐Ÿ˜›
Just recursive clone and drop the issue folder into KS.

https://github.com/sh-dave/eskimo-issues/tree/master/view-arguments

../s/S.hx:6: characters 18-26 : Type not found : c.C1.

If you comment out the line, you see that this works for haxe's Map class.
It does also work when i put each component into it's own file and import them.

Edit: Also doesn't work when i try to import the actual class(es) by name:

import c.C.C1;

[java] build error (haxe 3.3.0 rc1)

Can't build for java

haxelib run hxjava hxjava_build.txt --haxe-version 3300 --feature-level 1
javac "-sourcepath" "src" "-d" "obj" "-g:none" "@cmd"
src/eskimo/IComponentType.java:9: error: getClass() in IComponentType cannot override getClass() in Object
    java.lang.Class getClass();
                    ^
  overridden method is final
src/eskimo/ComponentType.java:96: error: getClass() in ComponentType cannot override getClass() in Object
    public java.lang.Class getClass()
                           ^
  overridden method is final
Note: src/haxe/root/Date.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
Compilation error
Native compilation failed

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.