Very happy about my work today :)
Pretty much completing my work from friday, I rewrote an essential part of the engine (message passing between actors).
- The code became much simpler! (this was the goal)
- Some very mysterious parts of the engine are less mysterious, making it hopefully less and less scary-looking for any stray helpful programmers passing by
- Like I said on friday, multithreading will be easier thanks to this
- Simpler code makes it easier to find bugs hiding in every other part affected by it
- The code became more correct!
- The new implementation makes some guarantees about the order in which actors receive messages
- To illustrate the importance, imagine someone sending you a letter that says "Destroy all houses" and then a second letter that says "Build a new house". You tragically receive and implement them in the wrong order though - and to make things worse, this someone then wants to visit you at the new house. Also, both of you are incredibly dumb.
- ...this prevents a whole class of bugs!
- The code became faster!
- I hoped that the new implementation would be at least as fast as the old one, else this whole endeavor would be kind of useless, but it was hard to predict that so I had to try anyways
- But after some pretty obvious optimizations, the new implementation actually ended up being faster! (Planning & building roads ~1.3x faster, traffic simulation ~1.6x faster!)
- This makes me very happy :)
Didn't really complete anything today...
- I started to work on a radical simplification of some low-level engine code
- simpler code in itself is always better!
- game performance will hopefully be the same or better afterwards
- extending to multicore will be much easier
- all of that can be experimented with without touching the game code!
martinrliljagot a first sketch of simple mod-loading running - the first step towards Citybound moddability!
Yukineko-sanstarted working on his compiled Citybound history on the wiki!
As a practice of work-life balance, I will actually have weekends now! Happy weekend everyone!
Today felt a little like laundry-day:
- I reviewed and accepted a pull-request by
kingoflolzthat made a low-level thing more idiomatic for Rust.
- I separated some of the engine code into smaller pieces, which will make it easier to document, test and benchmark each of them
- I adopted
rustfmt, a style-linter for Rust (basically an automated grammar nazi) and applied it to the whole Citybound codebase
It destroyed my beautiful hand-crafted and definitely not sloppy formatting
- It applied consistent and nice formatting in most places
- It made the uglyness of some particularly ugly code shine much more brightly
- It forced me to fix lots of formatting by hand which it was smart enough to complain about but too stupid to fix itself
- This all might seem like a detail, but actually helps a lot to achieve consistent code style when a lot of people (or just one very inconsistent person) work together
- I hooked up continous integration (Travis)
- This allows me to automatically run tasks and checks when someone publishes code changes
- Right now I'm only using it to enforce the new code-style
- But: this will also be used to automatically compile and bundle the game for Windows/Mac/Linux, making publishing of new releases much easier!
- Once there are tests, those can also be run automatically when the code changes.
- I wrote a more thorough guide about how to get completely setup for contributing - I'm planning to flesh this out more and more to make it easy to get started
Today I felt a little all-over-the place, it's fascinating how busy the Citybound GitHub repo became with just a couple contributors. I will need to learn how to deal with the constant stream of notifications about different topics while still focusing productively on one thing at a time. Good problems to have!
- I realized that a lot of UI-related developments are blocked by the lack of a clear concept about UI code architecture (which code should talk to which other code to make, for example, reacting to keyboard/mouse input work, or to display some controls). This will be one of the bigger topics I'll focus on now.
- I started reviewing some of the submitted bug reports and found out that a lot of them are duplicates
- I bundled the most glaring bug into Issue #86 (Clicking on built road panics) and wrote a simple work-around for it. A true fix will be cleaning up the planning code more thoroughly.
- There needs to be better documentation teaching players how to find existing bug reports to reduce the work of reviewing them
- I started to pick up the technical debate regarding how modding will work having some very fruitful exchanges with
martinrlilja, finally coming up with a concrete plan that seems very promising to me!
Continuing the secod day with more awesome collaboration!
- I fixed Issue #49 (Citybound not running on older versions of Mac OS) and Issue #34 (Citybound only running once on Mac OS) by creating a proper app bundling workflow with XCode
- I reviewed and accepted
Herbstein's changes to the camera control code, which now allows pitching the camera (looking more up or more down) as well
- I reviewed and accepted
kingoflolzchanges to make Citybound compatible with the newest nightly version of Rust
- This enables us to use incremental compilation, which means that for small changes of the code, only a small part of the game needs to be recompiled, so instead of having to wait one minute, you only have to wait a couple seconds to try out changes in the game! I can't stress enough how much more pleasant development becomes due to this!
- I added a fairly robust workaround for Issue #35, so now you can create self-intersecting roads!
- I started cleaning up the probably messiest part of the code (the planning UI)
- This should make it easier to find the causes for some of the crashes when interacting with plans.
This was my first official working day on Citybound as my job!
- Added a Contributor License Agreement to force poor contributors to let me do with their contributions whatever I want (saving my legal ass)
- Reviewed and accepted
kingoflolzcamera control changes
- he implemented configurable keyboard + mouse controls for the camera, much nicer than I implemented!
- This will land in the next release which I'll publish once enough user-facing changes accumulated. (probably in a couple of days)
kingoflolzimpressively correct documentation comments on Kay, basically the most low-level part of the engine.
- Reviewed and accepted
martinrlilja's beautiful clean-up of the rendering and text-rendering code
- Potentially fixed Issue #49 (Citybound not running on older versions of Mac OS)
- Help me by reporting back if this newer file runs on older versions of Mac!
- Spent several hours trying to fix Issue #34 (Citybound only running once on Mac OS), going nearly insane
- This seems to be a deeply-rooted issue and will require more time
Summary & Thoughts
- Super happy about which big and meaningful changes the first contributors were already able to make, without any help from me, given only my messy, cryptic code.
- I'm trying to address the most show-stopping bugs first (the game not f_ing runnning)