Mentorship on a side-project

I’m looking for a mentor to assist me on a side-project. I’ve been experimenting with Rust on and off over the last year and have decided I really would like to take my development skills to the next level. My full-time paid gig is a Ruby developer working mostly with Rails apps, front-end web develoment and background processing via Sidekiq. Working on this project alone I’ve found myself getting stuck and not knowing where to look or what to do next. I’m hoping that maybe one or two more people will find this interesting and willing to help.

About the project, recently Blizzard and in partnership with Google’s DeepMind they have released protocol definitions and a C++ library for interacting with and building bots for the game StarCraft II. The goal of my project is not to necessarily implement 100% of the C++ library but use it as a reference for building a clone like project. I believe this type of project provides a variety of concepts that would help in building other Rust-like applications and libraries.

  • Code organization, interfaces and building a comprehensive api
  • Error handling with the use of error-chain
  • Client/Server connections through the use of websockets
  • Encoding/Decoding between client and server
  • Use of threads and channels (possibly Tokio and Futures)

Any feedback or guidance would greatly be appreciated.

https://github.com/ttdonovan/sc2-api-rs

3 Likes

Irrespective of whether you get someone to mentor you on the project (which sounds pretty cool by the way), you should feel free to ask for advice here on any of those bullet points you mentioned. People routinely ask for advice from project structure/layout to high level API design to low level impl details to single threaded code to multithreaded code to sync IO to async/futures IO and so on. I'm sure whatever you ask someone else will find useful to know as well.

3 Likes

@ttdonovan, this sounds like an interesting side project! Have you figured out some sort of high level goal for the project and how you'd break up the various sections?

The way I see it, you've got two or three fairly orthogonal problems/areas to deal with.

  • Communicating back and forth with the server
  • Use the information you get from the server to construct some representation of the game world
  • Expose that game world to bot programmers so they can inspect and manipulate it

Exactly how you'd implement that (async vs synchronous, websockets vs http requests, etc) are just implementation details and the end user, bot programmers in this case, shouldn't have to know/care about them.

I believe you are correct about the 3 areas and the rest is just implementation. I was hoping to utilize the C++ api as a reference on how to go about solving these problems and I have yet to figure out the best way to break these down into smaller objectives/goals. One of my challenges to build an expressive api that clearly communicates usage. At this time I'm still trying to figure out the implementation.

Current state:

  • Able to receive "responses" from WebSocket end-point (use of receiver thread and mpsc::channel)
  • Those responses are decoded into Rust structs with prost crate.

Uncertain about:

Ideas so far:

  • A "Controller/Coordinator" struct will accept a "Bot" and setup a "Connection" (not sure how the bot/connection will communicate yet see above "Uncertain about") calling a "event_loop" function will listen to the Connection's recv_response() and pass the decoded messages onto the Bot.
  • Exactly who is responsible for setting up the game world state - idk yet maybe this happens before communicating with the Bot.
  • Somehow the Bot will need to be able to issues commands/generate request based on the game world state to send back over the WebSocket - yet to be determined.

I'd be interested in helping out, this looks like a pretty interesting project and the thing which initially got me into programming was writing a bot for some online game in Python.

I'm not sure if I'd be a great mentor, but I'd be happy to join as a co-developer.