Giter Site home page Giter Site logo

cities's People

Contributors

bingbazaar avatar hoeencoder avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cities's Issues

First user to connect is not removed when they disconnect.

The first user to connect to the server after it starts will not be removed from the users array, and their tents (and most likely workers and soldiers when they are added) do not disappear from the canvas. I've looked into this and the code seems correct

Disconnection handler:

socket.on('disconnect', function() {
    if(searchUsers(currentPlayer.id)) {
        users.splice(searchUsers(currentPlayer.id), 1);
    }
    console.log('[INFO] User ' + currentPlayer.name + ' disconnected.');
});

searchUsers function

function searchUsers(id) {
    for(let i = 0; i < users.length; i++) {
        if(users[i].id === id) return i;
    }
    return false;
}

This should work, but for some reason its not. Can you take a look at it @Dubstepper?
Thanks in advance.

Tents stuck in a bunch

When the player has two or more tents, they will merge into a bunch.

Image of issue
This is not desired, I would prefer each tent not be inside any other, and if they do they should automatically correct themselves.

The current code for correcting this is:

        for(var j=0; j<player.tents.length; j++) {
            if(j != i && player.tents[i] !== undefined) {
                var distance = Math.sqrt(Math.pow(player.tents[j].y-player.tents[i].y,2) + Math.pow(player.tents[j].x-player.tents[i].x,2));
                var radiusTotal = (player.tents[i].radius + player.tents[j].radius);
                if(distance < radiusTotal) {
                    //if(player.lastSplit > new Date().getTime() - 1000 * c.mergeTimer) { //Not merging.
                        if(player.tents[i].x < player.tents[j].x) {
                            player.tents[i].x--;
                        } else if(player.tents[i].x > player.tents[j].x) {
                            player.tents[i].x++;
                        }
                        if(player.tents[i].y < player.tents[j].y) {
                            player.tents[i].y--;
                        } else if((player.tents[i].y > player.tents[j].y)) {
                            player.tents[i].y++;
                        }
                    //}
                    /*else if(distance < radiusTotal / 1.75) { //Merge into one.
                        player.tents[i].mass += player.tents[j].mass;
                        player.tents[i].radius = util.massToRadius(player.tents[i].mass);
                        player.tents.splice(j, 1);
                    }*/
                }
            }
        }

From my tests I believe they ARE correcting themselves, but this is being undone somehow.
Any help would be appreciated. Thanks!

Edit

The bug was invoked by this commit: Alter the laws of physics

Header sometimes dosen't appear

The header <header><h1>Cities.io</h1></header> sometimes disappears from view when playing. This happens to me whenever I hit the ready button. The header will be used to show the players stock of resources so it needs to be visible.

Suggestions

Summery of Convo. With Hoeen + More
Possible name for Clans/Classes/? being "Type" (I personally prefer Class the most though)
For the current Fourth class, Call it something talking about it being efficient (gonna look into this a bit more)
The second class name suggestion of Endemic. (quick reason why) Since They tend to be more confined by the less movement compared to others, they become more endemic to where they are.

Each Class should have something they are - in compared to normal (maybe half of what you would do for its + stat so it isn't a huge change, but still lacking a bit compared to others in that category)

Nomadic - Slower Respawn speed since they are move for moving around its harder to have children and take care of them.
Both of these below fit elsewhere as well, as placed there as well
Slower HP recovery (tent & unit) works as well... as they move its harder to repair things on the move.
The other option that I think would work is Lower Max Health (tents). as they are moving around, they won't be worrying about building tents to be standing to long as it would be hard to take down/move since they would be heavier & more parts to deal with.

Endemic(?) (maybe something dealing with tanks as they are a + health group)- Slow tent speed as they don't move as often so less experience first off, and they might (no different look or anything) have build things a bit stronger, due to it not being on the move as much (explaining the HP boost too, but this doesn't need to be told to people, but if there wanted to be different looks to different classes, make them look a bit stronger)

Superfluous(?)- Slower repair speeds. They have so many more repair to deal with that people are a bit overwhelmed (even if there isn't a higher rate, lets just pretend ok?!?!)

Efficient (name to change, this is trash tbh & I said it. Maybe a name relating to its glass cannon (saying below ends up happening)) - Slower HP recovery (unit health) as they are good at doing things quickly but at a cost to there bodies being abused and hard to get back to 100%
Lower health in general as they beat up their bodies, they can't have as much HP as other

for the efficient (ugh dis name I gotta think of a better one before I send this, but if you see this, I didn't) class, a + for them could be damage up as their solders are more efficient in fighting (which then the lower HP fits better for 'em, but both still work, just the low HP I like better)

These notes are looking at them as of 9/9/2016. These classes may change as time goes on Don't Expect them to be 100% matching as the game changes

Sorry for any Grammar errors & spelling. Yell at me at SG (Kraken Mare) or at [email protected]

Gl with everything!!!

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.