GithubHelp home page GithubHelp logo

tomorrowdawn / gitcgsimulator Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 1.0 11.02 MB

Simulator for GeniusInvokation TCG, tailor-made for ai training.

License: GNU General Public License v3.0

Jupyter Notebook 57.72% Python 42.28%

gitcgsimulator's People

Contributors

tomorrowdawn avatar

Stargazers

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

Watchers

 avatar

Forkers

moshang152

gitcgsimulator's Issues

事件处理框架需要修改为事件队列形式而非递归

因回调函数中需要模拟运行回调后的游戏状态,所以需要能够保存当前所有未运行的事件,因此必须使用事件队列形式。目前考虑手动维护事件栈,并对回调函数接口进行调整,添加事件队列快照参数。预期修改文件范围为EventManage.py和GameInstance.py,示例搜索算法中也将作出相应调整。

增加对角色被动的支持

计划设计一个passive方法,游戏开始时或者角色复活时会调用该方法。该方法应当返回一个事件列表,事件列表会如同正常事件一样被执行。

另外可能需要设计一下若复活应当修改哪些部分。目前似乎只有Aura(需要将角色附着从died变成empty)受到影响。

Faster Implementation?

Now each action takes nearly 200us (0.2ms) to execute, which is extremely slow. Profiling the code with cprofiler reveals a high computational cost during event handling. Therefore, there are two potential approaches for future work:

Improve the Python code to enhance performance. While this approach requires less coding, it may not significantly improve performance since the event queue is necessary, and further complexity reduction may be limited.

Rewrite the code in another language, such as C++. This approach would require more time and effort for coding, but it would allow us to benefit from the efficient nature of C++. By doing so, we can achieve much better performance (on average, C++ is 20x faster than Python in terms of execution cycles). And this would enable us to train a more powerful AI.

It's good if we could implement an engine in C++, but it's too much for single developer, because a lot of coding(like reflection, double dispatch,......) should be made to simulate python function.

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.