004 - Aug 26, 2018

Hey!

This past week I was supposed to

  1. Have the backend serialize client state, send it down to the client and have the client deserialize those state updates.

  2. Render placeholder meshes at the locations of all of the entities in state.

  3. Add arrow key and touch controls for making the camera orbit your character.

Getting the state updates serializing/deserializing was pretty straightforwards. I used serde and bincode to send down the binary data over WebSocket.

Client World State The server and client crates both depend on a client-server-common crate with, among other things, this ClientWorldState struct.


Last week I was using the cgmath crate for my linear algebra but I wanted to move to nalgebra, mostly because it has really good documentation. (Side note I discovered nalgebra through GitHub's new recommendations on their homepage so thanks GitHub!)

Porting my math over to nalgebra took under an hour, the examples and documentation were top notch.

After that rendering my placeholder meshes was easy since, again, a lot of this is stuff that I already had working in my JavaScript client and I'm pretty much just re-doing in Rust now that I've fully committed to using the language / ecosystem for Akigi.


Luckily, getting the camera to orbit was also straightforwards since I've done it a bunch of times in other demos / apps, so that came together quickly as well.

Testing Mobile Touch Controls Making sure that the camera controls work on mobile when you touch and drag the screen.

Side Tasks

I knew that I'd be spending Saturday with a family friend and that I would be tired on Sunday from going out with some friends on Saturday night so I short loaded my work for the week. I ended up finishing what I set out to finish on Friday at 5:30am, giving me a couple extra hours to knock off some side tasks.

With that time I migrated from CircleCI 1 to CircleCI 2 and set up a weekly job to deploy the latest dev journal chapter so that I can stop dragging and dropping the files into s3.

It was fun setting up the IAM credentials. Gave my CircleCI just enough access to deploy to my s3 bucket and invalidate my cloudfront distribution. In the past I never really dove into fine grained permissions.

The AWS policy generator was really useful! A friend of mine named Will has engrained in me long ago that I should be careful to not give third party services access to stuff that they shouldn't have access to.

I also got a head start on planning out some of the things that I'll need to implement soon, namely some of the UI and knowing where the player's mouse / finger is clicking on in the 3D world.

Next Week

My sister's wedding is on Friday so I won't be getting much too done from Thursday - Saturday I don't think.

By next week I'll create three more placeholder models and make sure that we render the correct model for the correct entity based on the entity's model component.

I'll also add texture support to my renderer. I'll give each of the placeholder models a placeholder texture and make sure that the correct model is rendering the correct texture.

Doing all of this will "require" some enhancements to my automated asset build process, namely:

  1. Exporting all of my PSD texture files into PNGs using imagemagick

  2. Combining those PNGs into one texture atlas (in the future multiple, but one is fine for now)

  3. Serializing a HashMap of all of my meshes into a binary array (in the distant post-launch future multiple binary arrays at multiple levels of detail, but one is fine for now)

  4. Downloading these assets on the client side and using the right one at the right time

"Require" is a bit of an overstatement here. I can get definitely things working with less automation. But one important thing for me is that since I'm a complete noob to art I need it to be as easy as possible to make tiny improvements.

I can't spend many focused hours working on art like I can on code / technical problems, at least not yet. So low friction to rapid iteration is mission critical for me.

I've already built these exporting / preparing tools in isolation, so this week will come down to stitching them together and making sure that the front-end is rendering everything properly.

I'll spend the rest of today planning it all out and try to blaze through most of it before the wedding weekend and finish up the remainder late Saturday and on Sunday.

I'll also need to prepare the financial update for next week (every first dev journal of the month includes a financial update), so I'll need to figure out what I'm spending money on.

I originally thought that I'd just move everything to a seperate business card but that would be a hassle and I'll wait until I've done a few financial updates before worrying about making it easier.


See ya next time!

- CFN