A quick one today. I got TaleSpire up and running again with the latest backend changes. Next we want to store multiple versions of each of your boards (we may expose this in future so you can restore an earlier version). All the code required is pretty much there but I just need to work out the strategy we want to use for when we make a new checkpoint and then plumb what we have together to do that.
Then it’s back to refactoring the queries for handling retries etc.
Time for sleep. Ciao
Some serious yak shaving has been taking place today.
The goal was to add the ‘manager’ that would keep track of the connection to the backend and handle cases where we lose connection. One task was to be able to inform a request if it should retry, but hmm.. that means I should really refactor the queries a little.
With my new goal I dug into the queries a bit and saw that I should really take care of the changes to board I needed to make first. We want to be able to keep multiple versions of the board on the server so we have a backup history of sorts. This requires some work on the database.
With my new goal I started writing the board changes and saw that a bunch of this code will need revisiting anyway as we expose some guids we use as keys and that it’s a good plan. So I made the basic changes and then switched task.
With my new goal..well it’s a monster. The guids were used in a tonne of places and so about 70% of the queries in the backend needed to be refactored. This has taken me the rest of the day but, as it’s work we needed to do for the release anyway, I’m not worried.
I’m not at the point where I have pushed a new staging build and am testing TaleSpire (spoiler there are still bugs). There are a good few hours of work before this is working properly again and I’m not sure how much I will get done tomorrow as I need to visit the doctor. We shall see anyway.
Until next time,
Evening all! Today has seen a bunch of bug fixes which are rather specific but I’ll mention a few.
- Changing floor rapidly on board load could cause assets not to load
- Deleting the board you are in now takes you to the campaigns default board (currently a new empty board)
- Fix for case some requested data arrives for a board asset which has been deleted
- Grabbing a board asset whilst board loading caused error as creature landed in invalid area
- This is half the fix, the other half is a UI fix to make sure you can’t pick things up before the zone is fully loaded
- Add inspector button for checking for duplicate network ids in board assets
- Fix case which resulted in duplicate network ids after reloading board
- Add compression to network messages for building/deleting multiple tiles
- batch multi-tile messages to avoid making single message too large
- not as robust as I’d like but good enough for alpha
- Fix case where other player deleting assets we have selected caused our selected region to grow
- A bunch of code cleanups
I also hit an annoying aspect of mono. In c# you are able to set the validator used when a HttpWebRequest needs to check if a http request is valid. One of the things that is meant to be passed to that callback is the certificate chain. I use this to verify the intermediates on top of our certificate being checked. On MS c# this works perfectly, but in the mono version unity is using it isn’t. Super aggravating but not much we can do right now, hopefully it will improve as the .net version support in Unity gets better.
The standard certificate validation is fine of course so no worries on the security side. I just wanted the option to do a bit extra.
Anyhoo that’s all for today. Tomorrow I am looking at managing the connection to the backend and the handling/retrying/etc of failed requests.
Ah today has been fun again. A few things that were done were:
- A few more little fixes to serialization of unique characters,
- If you delete a character that is unique, remove it’s ‘uniqueness’ server side
- Added text to help debug fog of war (this was great, more below)
- fix two bugs in fog of war search when the search crossed zones
- make sure that when the octree node is larger than a tile that the fog of war search takes that into account in calculating distance walked (just fixed up some lazyness when coding the feature)
- Fix case where creatures you don’t control seem to load in an incorrect position when you join and existing play session on a board
- Fix dumb bug where non GMs weren’t loading unique creatures properly if they were the first player to reach a board
- Fix bug in quadtree deserialization
- Serialize fog of war for unique creatures. Sync it to players on join and store it in board so you can leave and rejoin board much later and it is remembered.
- Add code to recognise and upgrade boards stored in an old format
- other misc small fixes
Of these the most fun was the adding some additional info to the debug view of the fog of war so I’ll jsut rabbit on a bit about that. This really is one of the places where Unity shines, its so easy to add additional UI to the editor, not just in the inspectors but in the scene view too. I was struggling working out why the fog of war was behaving strangely so I decided to show a number at every ‘step’ of the search to show how far the character could still walk (how many steps remaining). It took a few tweaks as the fog of war search is done on a different thread and UI elements have to be drawn from the UI thread, also I wanted the text to remain visible for a number of seconds. Anyhoo the result was that every time you placed a creature the scene view looked like this:
the red circle is where the creature is
When I did this in the morning I could immediately see that the numbers were wrong when the search crossed a boundary. Turns out that was a simple case of not initializing an int in one of the constructors for the search. Also there was a case where the number went from 0 to over 4 billion, that’s an easy one, unsigned integer wrap around when subtracting 1 from 0. Each is a simple issue but it just became obvious as soon as I could see a tiny bit more info. Yay tools!
Out of curiosity I added a little slider to the creature’s inspector to control how far the search would walk, this was great to fine tune and find a default value that felt nice.
The other stuff doesnt make for nice pictures but is all obviously needed for the alpha.
Here’s to tomorrow, hopefully it’s as productive.
Hey again! today has been spent taking places where we would make multiple calls to the backend and merging them into single calls. Makes stuff a bit faster, simpler and more robust.
There’s really not all that much to say about that. It’s a bit fiddly as it is relatively easy to introduce subtle bugs and I’ve been chasing down a few of those (tomorrow morning will start with squashing one).
Other than finishing that work off I’ll be getting things in a place to merge into the master branch. I’m not as far along as I’d like but hopefully I’ll pick up pace again.
Work rolls onwards. Unique creatures seem to be working ok. I still want to persist who controls them across sessions so I’ve added the server-side code for that, now I just need to hook that up client-side.
A GM can now easily move all the players from one board to another, although we still need to add the UI for this.
This weekend I’m going to focus on getting the branch I’ve been working on merged into master. To do this I add some dev features back in. If I have time I need to add the code to handle cases where the connection gets flakey.
Hopefully we will have some news on the updated UI in a week or so.
Watch this space!
Hi all, sorry for the lack of daily yesterday. I got a bit burnt out so I took a short break to get my head back on straight. Today I wrapped up some refactoring of code handling losing network connection and similar cases. Tomorrow I’m doing some work on the server side of the unique creature code. I’m hoping that’s something I can get done in the morning and then looking code to move your party between board smoothly (that should be easy too).
Hopefully I’ll have more details tomorrow.
Thanks for stopping by!
Well, to balance out the successful days, there is today. Today I had a issue when some of the rush to get features written had resulted in some code that was harder to deal with that it needed to be. ‘No worries’ I think I’ll just refactor XYZ and this task should be easy… 12 hours later and I can barely remember what the issue was that motivated the refactor. I have essentially spent a whole day for a questionable gain when time is what I have least of right now.
So yeah, that’s not a great day. At this point its probably worth just pushing through and finishing up the cleanups. Hopefully the changes are worth it, but if I were to do it again I’d probably have just shut my face and kept hacking until the alpha was out.
Let’s see if I’ve learned a lesson.
Until next time
As promised the video of hammering the networked undo/redo. It’s pretty stable in the video but I do have one bug in that system that I’m going to fix tomorrow (looks like a simple mistake in when updating the history stack, nothing too worrying).
Today has been focused on asset deleting and making sure that all the subsystems that have to hold references to board assets (like tiles) release them if the asset is deleted. An couple of hours was spent on refactoring the multi-select tool in my ongoing (entirely wholesome) love affair with state machines, its a good deal more robust now and the code to release delete assets is much faster. That latter part is important as any time you have a selection someone else might delete some or all of the tiles you have selected.
There is still a lot more I can get out of this speed-wise but it’s not wise to spend more time there given that it’s not yet an issue and there is so much to get done for the alpha.
On that subject, work continues. I’m up to 128 tickets on github :p but having gone through the codebase I feel the number of engine related tickets are not going to grow violently more before we release. Lots for the UI though :)
Right. I’m off to chill and watch ‘an american werewolf in london’, such a classic!
Happily it’s all still going well. I started the day switching the board syncing from http to https, a small task but of course it’s very important. The only reason it hadn’t been done already what that things were being built quickly to test the mechanism. I’ll ramble on about my future plans regarding security another day.
Thanks to some recent changes to the board-asset code we now know the place the pieces will land the moment they are released by the player. This lets us start the fog of war update a few frames earlier which makes things feel snappier.
Also thanks to @jonnyree adding drag-select I added deletion of multiple tiles. It feels so good to crazily mash ctrl-z and ctrl-y on one client and see that the result is totally stable on the other. I know of a few places where things could go wrong though so I am fixed them up tomorrow.
I’ll post a video of the undo/redo tomorrow too, even though it’s doing what it has to do I’m still stoked to see it doing it so well :)
Alright, time to hit the hay.