issy123 / agario-protocol

Protocol for agar.io version 2.1.5
8 stars 2 forks source link

Protocol 19 - message 0x45 - minimap #22

Open Barbosik opened 5 years ago

Barbosik commented 5 years ago

Since 2018/20/12, a new protocol 19 is rolled out. The difference is just in cipher key. Also added a new message 0x45 - Minimap

sv_protocol 19 sv_secret 0x0000765D sv_versionClient "3.3.1" sv_versionProto "12.0.1"

Barbosik commented 5 years ago

45 = MINIMAP UPDATE

Offset Size Description
0 byte =0x45
1 uint16 record count
3 minimaprec record 1
x minimaprec record 2
... ... ...

Minimap record structure is the following:

Offset Size Description
0 int32 player X coordinate
4 int32 player Y coordinate
8 uint32 player total mass
11 byte player flags
... ... ...

player flags:

Bit Mask Description
0 01 highlight player on the minimap with red color
1 02
2 04
3 08
... ... ...

All player cells displayed with one minimap record, which has total mass owned by the player. Minimap records contains top 20 players, sorted by owned mass.

This is how minimap data looks like (look for minimap debug data on the screen, because graphical minimap on the bottom right corner is not related to this feature, this is just my old minimap):

Minimap Screenshot

There is need more investigation about minimap record fields. If you have any info, you're welcome.

Barbosik commented 5 years ago

added support of server minimap to my client, works great! Brown circles on the minimap are received from agario server :)

Screenshot

SuperOP535 commented 5 years ago

ooh nice 😮

ghost commented 5 years ago

👍

Barbosik commented 5 years ago

playerX and playerY coords are int32

yeah, exactly

Barbosik commented 5 years ago

it looks that minimap may have some small random coordinate shift and fake players. Probably in order to prevent use minimap for bots

BorysDev commented 5 years ago

perhaps the last byte on the minimap record is a terminator, to indicate when the record has ended

Barbosik commented 5 years ago

no, there is no need for terminator, because record length is known. This is some flag or player type. Needs to monitor for non zero value to understand what it means.

UPDATE: this is flags :)

00 - yellow 01 - red 02 - yellow 03 - red

So it looks, that bit0 is used for highlight player on the minimap with red color

Barbosik commented 5 years ago

Here is better visual design for minimap. It shows agario server minimap with squares and local minimap with circles.

Screenshot

BorysDev commented 5 years ago

Looks good :) :+1:

issy123 commented 5 years ago

Awesome work barbosik! Since I no longer maintain the protocol, i've invited you to be a Collaborator, this way you can organize each protocol in a seperate file and it's easier to navigate through for every agar.io clone dev

SuperOP535 commented 5 years ago

issy I think it's better to use Cigar2's protocol repo (it's not fully done but it has separate files and a little activity from the community)

BorysDev commented 5 years ago

But this is the original, i think we should keep it going @SuperOP535 Most of the protocol on there has been devised by Barbosik anyway. Right?

SuperOP535 commented 5 years ago

The issues of this are original, not the repo 😂 and /shrug, we have some stuff done so like why do it again ?

BorysDev commented 5 years ago

@SuperOP535 If you use that laughing face unironically again i will personally hunt you down

Mistik commented 2 years ago

Can I use your custom client barbosik?