Code Monkey home page Code Monkey logo

omicron's People

Contributors

lhunath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

omicron's Issues

Basemodule listObservableTiles performance

The method listObservableTiles in basemodule, checks each tile if it is within the viewrange. The performance can be significantly increased simply listing the tiles within a fixed range as follows:

visible = [ ]
for each -N ≤ Δu ≤ N:
    for each max(-N, -Δu-N) ≤ Δy ≤ min(N, -Δu+N)
        Δv = -Δu-Δy
        visible.append(origin + (Δu, Δv) )

Where N is the view range.

Adapted from http://www.redblobgames.com/grids/hexagons/#range

GameObject.onModuleElse performance due to assertObservable

Calling the function GameObject.onModuleElse which is also called from GameObjectController.canObserve is very slow. This function checks 3x if the GameObject tile is observable (so the same check).

Since this an expensive assert could you rework the locations where this assert check is done, as to avoid duplicate work?

Movement always fails

Movement returned by MobilityModule#movement always fails because the returned path starts at a tile containing the unit that will move. This causes the path validation to always fail because this tile is not accessible.

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.