SpockBotMC / SpockBot

High level Python framework for building Minecraft clients and bots.
MIT License
198 stars 47 forks source link

Update to 1.9? #222

Open ElPresidentePro opened 8 years ago

Gjum commented 8 years ago

We plan on supporting 1.9, but right now nobody is actively working on it.

Some things that need work:

IRC log for reference:

[22:21:38] <Domi> Hello, is it possible to run spockbot on 1.9?
[22:22:56] <gamingrobot> Gjum: does the world plugin support 1.9 now?
[22:23:23] <gamingrobot> If it's just the protocol bit missing I can fix that
[22:25:09] <gamingrobot> Domi: I don't think so yet, I have been a little out of the loop
[22:25:25] <Gjum> gamingrobot: without the protocol, I haven't had a chance to really test it. the calculations should be right though, tested them separately
[22:25:59] <Gjum> and no, it's not possible yet, we need the protocol, and some plugins are dependent on 1.8 behaviour
[22:26:42] <gamingrobot> Should I go ahead and do a taged release for the 1.8 version and start moving forward on 1.9 support
[22:27:23] <Gjum> please do :)
[22:27:27] <gamingrobot> Ok
[22:28:04] <Gjum> it's quite a lot to get feature parity. but with the protocol in place, most plugins should work again
[22:29:19] <Gjum> so Domi, if you are ok using nodejs and just need the protocol (no fancy wrapping into plugins like spock does), go with nore-minecraft-protocol
[22:37:21] <Gjum> gamingrobot: the chunk impl I PRd is very minimal, doesn't benefir from in-memory compression like vanilla by using a palette, and doesn't allow encoding changed data easily
[22:38:06] <Gjum> it's enough for a client though, and can be used in a very backwards compatible way
[22:38:54] <Gjum> so I was thinking if we want a vanilla-like implementation with bitarrays and palettes, which would also make it easy to write chunk encoding for a server
[22:42:11] <gamingrobot> OK I will merge after I do a release
[22:42:28] <Gjum> ok
[22:42:28] <gamingrobot> I will also up the version number after
[22:42:45] <gamingrobot> And protocol update is easy
[23:09:59] <rom1504> gamingrobot: main thing to care about for protocol update for 1.9 are : chunks (but Gjum did that), metadata (completely changed), and packets ids (completely changed)
[23:10:17] <rom1504> the rest is just about adding a few fields left and right
ElPresidentePro commented 8 years ago

interesting, It seems that you are very close to getting the first bot 1.9, The problem is the chunks.

gamingrobot commented 8 years ago

I have to do another release for 1.8 to fix a bug and then I will start merging in 1.9 changes tonight.

ElPresidentePro commented 8 years ago

@gamingrobot Fantastic notice!

gamingrobot commented 8 years ago

I have updated mcp inside spockbot to support 1.9 but its on a test branch due to being in a broken state. You can see the first pass of the update 4ba34bb. The bot joins the server then crashes due to failing to decode Chunk Data correctly. I think this is due to the new biome data that's included.

Gjum commented 8 years ago

Cool stuff. I'll take a look at that chunk issue this evening.

Gjum commented 8 years ago

@gamingrobot it looks like the problem is that I wrote the decoder for protodef's chunk packet, but spock has an extra field for biome data. do we still want it to be its own field, separate from block data, or should all the chunk data be a single field? nope, was already one binary blob before

ElPresidentePro commented 8 years ago

For what is this error?

[DEBUG]: NETCORE: Connected to host: 192.168.1.38 port: 25695
[INFO]: My position: PlayerPosition(0, 0, 0) pitch: 0.0 yaw: 0.0
[DEBUG]: EVENTCORE: Exception while emitting event_tick None
Traceback (most recent call last):
  File "C:\Users\osman\Desktop\spock\example.py", line 52, in <module>
    client.start(SERVER, 25695)
  File "C:\Users\osman\Desktop\spock\spockbot\plugins\helpers\start.py", line 34, in start
    self.event.event_loop()
  File "C:\Users\osman\Desktop\spock\spockbot\plugins\core\event.py", line 29, in event_loop
    self.run_continuous()
  File "C:\Users\osman\Desktop\spock\spockbot\plugins\core\event.py", line 36, in run_continuous
    self.emit('event_tick')
  File "C:\Users\osman\Desktop\spock\spockbot\plugins\core\event.py", line 62, in emit
    if handler(event, d) == EVENT_UNREGISTER:
  File "C:\Users\osman\Desktop\spock\spockbot\plugins\core\timers.py", line 132, in tick
    timer.update()
  File "C:\Users\osman\Desktop\spock\spockbot\plugins\core\timers.py", line 28, in update
    self.fire()
  File "C:\Users\osman\Desktop\spock\spockbot\plugins\core\timers.py", line 31, in fire
    self.callback()
  File "C:\Users\osman\Desktop\spock\example_plugin.py", line 97, in periodic_event_handler
    self.clientinfo.position + Vector3(-1, 0, -1))
  File "C:\Users\osman\Desktop\spock\spockbot\plugins\helpers\interact.py", line 167, in place_block
    self.click_block(pos, **kwargs)
  File "C:\Users\osman\Desktop\spock\spockbot\plugins\helpers\interact.py", line 155, in click_block
    self._send_click_block(pos, **kwargs)
  File "C:\Users\osman\Desktop\spock\spockbot\plugins\helpers\interact.py", line 138, in _send_click_block
    'cur_pos_z': int(cursor_pos.z),
  File "C:\Users\osman\Desktop\spock\spockbot\plugins\core\net.py", line 90, in push_packet
    self.push(mcpacket.Packet(ident, data))
  File "C:\Users\osman\Desktop\spock\spockbot\plugins\core\net.py", line 83, in push
    data = packet.encode(self.comp_state, self.comp_threshold)
  File "C:\Users\osman\Desktop\spock\spockbot\mcp\mcpacket.py", line 82, in encode
    o += datautils.pack(dtype, self.data[name])
KeyError: 'hand'
nickelpro commented 8 years ago

@gamingrobot updated the protocol but all the plugins built on top of the protocol haven't been updated yet. So plugins that have to deal with the protocol directly (such as the Interact plugin, in this case), make incorrect assumption about the protocol structure, try to encode improper packets, and then the framework crashes.

ElPresidentePro commented 8 years ago

this takes time without moving

ElPresidentePro commented 8 years ago

how's it going?

gamingrobot commented 8 years ago

Entity metadata needs to be updated still but chunk decoding is "working" (meaning decoding but not tested)

gamingrobot commented 8 years ago

Entity metadata is done now. Now to to fix various crashes and double check the chunk decoding it working as intended.

ElPresidentePro commented 8 years ago

How goes all the guys project?

gamingrobot commented 8 years ago

All that is left is inventory, and some testing. @Gjum wrote the inventory so he would be the best person to update it, but if I find a free weekend I might try and dig though it.

ElPresidentePro commented 8 years ago

sound good :+1:

louwers commented 8 years ago

http://wiki.vg/Protocol_History#1.10 :innocent: