Giter Site home page Giter Site logo

compact-conflict's People

Contributors

jakubwasilewski avatar krajzeg avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

compact-conflict's Issues

null reference error if you interrupt an all-AI game

If you configure the game to have all AI players, then while they are playing, interrupt it by clicking the start new game button in the lower right, then you get:

Uncaught TypeError: Cannot set property 'innerHTML' of null

possible bug in "protected by fire" logic

I think I found another one.
I believe that
var invincibility = upgradeLevel(state, fromOwner, FIRE);
should be
var invincibility = upgradeLevel(state, toOwner, FIRE);

because the invincibility value is for the guy being attacked.
If invincibility >0 and they lose the roll, then it says "Protected by fire!".

probable bug in AI minmax code

@krajzeg, I noticed what is probably a bug on this line:

var better = (!node.b) || (maximizingNode && (child.v > node.v)) || ((!maximizingNode) && (child.v < node));

I think it should be

var better = (!node.b) || (maximizingNode && (child.v > node.v)) || ((!maximizingNode) && (child.v < node.v));

Income from troops parked at temples results in a positive feedback loop

Overall, this is an awesome game and I really enjoy playing it! That being said, there is a bug with income calculation that affects gameplay.

Toward the end of the game, the last AI parks its troops at a temple, meaning that its troop count is included in the income calculation. It never moves its troops, meaning that it gets stuck in a [use troops to generate income] --> [use income to buy troops] --> [use troops to generate income] --> [...] positive feedback loop. After a few iterations of this, the AI is able to generate a stupid amount of money each turn and grow its army to an unrealistic size.

This affects gameplay because the AI army quickly becomes too large to defeat. If the player figures out how the AI is generating so much money, the player can grow their army the same way and eventually defeat the AI. (I had to look at your code to figure out what was going on.) Otherwise, the AI could either overrun the player or just be unbeatable. Every time the player mobilizes their troops away from a temple to attack the AI, they are putting themselves at a disadvantage (the troops are not at the temple, and are therefore not included in income calculations). Here's what my gameplay looks like now:

image

I'm not quite sure how to fix it, but I'd start at line 1982. Keep up the good work!

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.