OgarProject / Ogar

An open source Agar.io server implementation, written with Node.js.
Other
717 stars 822 forks source link

Virus #349

Closed BaumanDev closed 8 years ago

BaumanDev commented 8 years ago

@ItzLevvie Doesn't seem to be making a difference..

BaumanDev commented 8 years ago

@ItzLevvie There's no start.bat too.

ghost commented 8 years ago

u have to add it

BaumanDev commented 8 years ago

@Agarian Alright.

ghost commented 8 years ago

https://www.mediafire.com/?lkdm7373k931v00 download that^

BaumanDev commented 8 years ago

What is that?

ghost commented 8 years ago

the server with all elements including start.bat

BaumanDev commented 8 years ago

I added it by making a start.bat

ghost commented 8 years ago

https://www.mediafire.com/?lkdm7373k931v00 has all elements needed including start.bat its easier to get this

BaumanDev commented 8 years ago

there's no difference at all

ghost commented 8 years ago

did u run the server

BaumanDev commented 8 years ago

http://prntscr.com/9qv76k this still happens

ghost commented 8 years ago

is that what this is about? do cells look like theyre merging but are not?

BaumanDev commented 8 years ago

Well what do you mean, did I open the console and run it?

ghost commented 8 years ago

Yes

BaumanDev commented 8 years ago

Yes I did.

ghost commented 8 years ago

do cells look like theyre merging but are not?

BaumanDev commented 8 years ago

Can you send a ZIP of your files? Cause I still get the poor collision with small cells. They barely collide :(

ghost commented 8 years ago

https://www.mediafire.com/?lkdm7373k931v00

BaumanDev commented 8 years ago

Those are your files?

ghost commented 8 years ago

those are the files^

BaumanDev commented 8 years ago

It's collision is normal?

ghost commented 8 years ago

hold on a sec

BaumanDev commented 8 years ago

Alright

ghost commented 8 years ago

i have the same collision issues apparently but i don't mind it

BaumanDev commented 8 years ago

Aww man :(

ghost commented 8 years ago

want free minions?

BaumanDev commented 8 years ago

Lol I can get up to 1,000 xD But that's just too much..

BaumanDev commented 8 years ago

I don't use minions really.

ghost commented 8 years ago

but these work on regular servers

BaumanDev commented 8 years ago

All of them will be there?

ghost commented 8 years ago

yes the amount can be changed through browser

BaumanDev commented 8 years ago

So if I were to get 300, all 300 would be on agar.io?

ghost commented 8 years ago

no the max is 263

BaumanDev commented 8 years ago

So all 263 will be there? xD

ghost commented 8 years ago

you can make it 1000 but it goes to 263 and most of the time yes

ghost commented 8 years ago

https://www.mediafire.com/?uwnsr602rerr64c chrome is required

BaumanDev commented 8 years ago

Alright thanks, I have to go for a little bit.

retslac commented 8 years ago

Alright guys. Got back home and checked which changes of the new Ogar version had an effect on my code above. It turns out you have to make 2 more changes to make it work like it should also on the latest version of Ogar.

1. Replace function simpleCollide in PlayerCell.js back to the old version
PlayerCell.prototype.simpleCollide = function(x1,y1,check,d) {
    // Simple collision check
    var len = d >> 0; // Width of cell + width of the box (Int)

    return (this.abs(x1 - check.position.x) < len) &&
           (this.abs(y1 - check.position.y) < len);
};
2. Remove the sorting of player nodes from function updateMoveEngine in GameServer.js

It seems that the creator of Ogar has made an effort to make the cells appear less wobbly when they are moving together. As i already solved this problem in another way in the new collision engine, this sorting is no longer needed and in fact needs to be removed because it interferes with my method.

    // Sort cells to move the cells close to the mouse first
    var srt = [];
    for (var i = 0; i < len; i++)
    srt[i] = i;

    for (var i = 0; i < len; i++){
    for (var j = i + 1; j < len; j++){
        var clientI = this.nodesPlayer[srt[i]].owner;
        var clientJ = this.nodesPlayer[srt[j]].owner;
        if (this.getDist( this.nodesPlayer[srt[i]].position.x, this.nodesPlayer[srt[i]].position.y, clientI.mouse.x, clientI.mouse.y ) >
        this.getDist( this.nodesPlayer[srt[j]].position.x, this.nodesPlayer[srt[j]].position.y, clientJ.mouse.x, clientJ.mouse.y )){
        var aux = srt[i];
        srt[i] = srt[j];
        srt[j] = aux;
        }
    }
    }
        var cell = this.nodesPlayer[i];
retslac commented 8 years ago

Have to say, there's one more detail i couldn't get exactly the way i wanted it. And that is the cell touching. I do have another idea to improve this, but still have to test it. But hey, that's just a minor issue i guess.

BaumanDev commented 8 years ago

@retslac I wish you luck.

BaumanDev commented 8 years ago

@retslac where do we put the second part?

retslac commented 8 years ago

If you mean the section of cell sorting. That needs to be removed from function updateMoveEngine, not added. And just below the part you just removed in the same function there's a line that says:

var cell = this.nodesPlayer[srt[i]];

this needs to be changed into:

var cell = this.nodesPlayer[i];
BaumanDev commented 8 years ago

Hmm, The cells still seem to be colliding bad.

BaumanDev commented 8 years ago

http://prntscr.com/9qyurb this is still happening. Are the cells colliding better for you? Maybe it's some problem with my codes...

ghost commented 8 years ago

the collision is partially malformed, i do not mind it but it would be nice if a fix is implemented. in spectate mode on regular agar, there is free roam spectate mode by pressing Q. any way to do that? :+1:

retslac commented 8 years ago

That's also happening on my part and is exactly what i would still like to fix. I don't really mind it that much though. The reason why it happens is because the smaller cells get squashed in between the big cells. I did try to fix this before but without success. I tried adding some mass to the smaller cells from all the cells pushing against it, so it can't get squashed so much. This partially solved the problem, but also partially cancelled the part of big cells pushing harder against smaller cells. If anybody else has an idea how we can improve this...

BaumanDev commented 8 years ago

Why DO they get squished?

BaumanDev commented 8 years ago

When we get virused the little cells squish through the big ones and pile up there, need to prevent that, and when you're small and you split 16, they squish against each OTHER..

retslac commented 8 years ago

The reason why they get squished is because multiple cells are pushing against it on both sides. This is especially so for small cells in between big cells because the big ones are even pushing harder.