2016 Has Died of Severe Traumatic Brain Injury

2016 Has Died of Severe Traumatic Brain Injury...


...and good riddance.

Happy 2017 everybody! If you're reading this, you've made it across the line. Congrats! Now, if you can survive another three weeks, you'll also escape the Chinese year of the monkey. You know, animals that like to throw poop everywhere. With it's departure, we welcome the fire rooster which, according to sources, rewards hard work justly.

I dunno about you, but I'll be bunkering down in an abandoned IT office, tracks hidden, no campfire, and noise traps everywhere. And maybe a pit snare with a banana over it somewhere I can watch through a rifle scope :)

Anyway, here we are. I managed to get almost caught up on a load of business admin stuff that piled-up during the break. Things like paying Josh for his latest (and awesome) in-flight track, filing and paying business taxes, year-end accounting, etc. I still have several emails to catch-up on, and of course, getting back up-to-speed with Tiago on the tablet build. Those memory leaks await...

But, it feels good to be back at the helm. I sense a good year ahead. Health and prosperity for us all!

Starting in three weeks ;)

Last-Minute Memleak Work, and Happy Holidays!

Hey Folks! Last day at the office before taking a week off, so what better way to spend it than working on memory leaks?

Actually, I did also finally pay myself for 2016 this morning. So that's kind of exciting :)

The memory leak situation has regressed. Tiago reports that the memory usage is actually worse after my changes than before. Oof!

This isn't necessarily unheard of. Often, sweeping changes like this miss something that can cause things to be worse, and fixing it pushes it forward to a net gain. So we're both going to look into it a bit to see if that might be the case. Briefly, we also considered that it might be a front-loaded memory cost. I.e. it might use a lot of memory up front, but less as time goes on. (Which would still be better than linearly using more memory each turn.)

Alas, memory crossed the critical high-water point during a fairly brief test, so I think we still have work to do.

So I started looking into why. I managed to stumble across some new bugs in the process, but no smoking guns yet.

One suspicious thing is that I seem to be getting a lot of un-destroyed Creatures, ItemInstances, PlayerConditions, and Encounters. The items and conditions especially are weird, as those are the very things I thought I had finally under control. Did something regress? Are the reports wrong? Is this new memory inflation because of the code we added to monitor things? (E.g. the report keeping a copy of everything, even though the game destroyed it?)

Or maybe the creatures, which host a long list of items and conditions each, are the root? Will destroying those help?

One thing's for sure: I made just about zero progress taming memory today. Bug fixes, a couple. But I can't seem to get ahold of memory right now. I guess that means it's time for a vacation :)

And on that note, Happy Holidays, everyone!

I'll be taking next week off, and therefore pretty quiet on the internet. No work posts each day, etc. But I'll be back on the 3rd, and hopefully, back to business as usual.

Stay safe.
Visit loved ones.
Eat and drink yourselves silly, if that's your thing.

And I'll see y'all in the new year!

Condition Memory Leak Commit, and Tax Prep

Hey Folks! Another split day today, with roughly half coding and half IRS fun.

The coding was wrapping-up the condition memory leaks, and I think that's in a pretty good place now. I found some additional leaks during battles (every move) and in expiring conditions (e.g. poison wasn't destroying itself when finished). Between these and the main changes from earlier this week, the number of conditions resident in memory grows asymptotically. I.e. slower the longer the game is running. And when the game finishes, they all get cleaned up except for the template copies that are used to derive per-creature copies.

Put another way, each new game in the old system generated 150+ new conditions in memory, just by visiting the skill screen and quitting. And battles could inflate that by another 5-15 per turn, permanently.

The new system generates about 80-100 the first time the game reaches the skill screen (30-50% improvement). Battles produce almost nothing each turn (99% improvement). And quitting the game drops it back down to 50-80.

Tiago's got the code now, and hopefully his tests will show an additional decrease in memory bloat per turn and per game!

In the world of taxes, I think I've finally worked out what I need to pay myself in 2016, and importantly, how much tax to withhold. I ended up having to almost file my 2016 taxes to get an estimate, which is annoying. But as usual, I learned a few things about taxes in the process.

The good news is that I think the tax burden now that I'm in the US is lower than when I was in Canada. I guess the question then becomes: is it enough to make up for the drastic increase in cost of living? After all, I'm now paying for my family's health insurance (and copay). And rent is almost 300% my old place. We shall see!

Anyway, I've got the numbers worked out, and I think I'll sleep on it before committing it to the bank account. Never know if I'll think of something at 3am that I missed the first time :)

Have a good night, all!

Hellish Conditions

Still knee-deep in the blood of player conditions here, trying to reduce memory leaks.

Almost half the day was spent restructuring the way conditions are added and removed from creatures. The thrust of this change was to avoid instantiating new conditions where I didn't need to. Often, I only needed to see if a condition existed on a creature, and there was no need to make that creature generate the new condition just to check.

The good news is that the changes seem to be helping. Before the change, the game was generating 152 conditions that never got cleaned up when returning to the main menu. After the change: 46. And even those 46 would be re-used the next time a new game was started (basically, templates from which copies are made later in the game).

The bad news? Quite a lot of code changed. And that could mean stability issues down the line. But, since memory leaks also mean stability issues, it's a rock and a hard place scenario.

I'm still pretty confident in this approach. The wasted memory is down, and I'm putting out the relatively small fires resulting from the changes. Hopefully, it'll be stable enough to check back into the repository for Tiago to work with, and ultimately, we'll see enough of an improvement. (I.e. we'll have enough memory left to load things like music for the game)

Meanwhile, Tiago's still kicking butt sniping other bugs from the list, including a major crash bug resulting from iOS version losing focus (triggered by viewing iOS status bar, exiting app, buying in-app full version unlock, and other sort of important things :)

Procedural Music Redux, and More Memory Leaking

Hey Folks! Did a bit more work on Josh's procedural music for the space game, as well as returning to more memory leak fixes.

Since the procedural music was having timing issues due to my code, Josh and I agreed he'll continue on the other, more traditional tracks. And in the meantime, I'll try a few more things to see if I can get it to work. No need to make Josh wait for me to fix stuff when he has other tasks cleared for development.

So to help execute that plan, I formalize the official soundtrack specs in a spreadsheet, so we could see the specs and current status of each track. He's returned to working on the in-flight tracks for now.

On the mobile project, Tiago's been blasting through the bug list today. Just one right after the other. Plus, I think he was able to source a new iPad in his hometown after much searching, so can can resume testing locally!

Since he's making all that progress on the task list, I've decided to try and tackle the next largest memory leak: player conditions. These things are getting spawned left and right, and I think much of the time, it's just being done wastefully where I was trying to check things on creatures. I've started reworking the way they're added/removed or checked, and hopefully that can start us down a path to more responsible memory usage.

Oh, and I've decided to try and update the software on my dev MacBook. After months in the closet, the last thing I need is to open it up in an emergency and wait 4 hours for OS and software updates. I think OSX will be done today. Windows tomorrow.

That's all for today. Catch you all tomorrow!

Mobile Testing, Music Making, and Taxes

Hey Folks! Hope everyone had a good weekend. We pretty much hibernated here. Though, we did have a nice walk yesterday in sub-freezing weather. Not quite like the picturesque winters up north, but on the other hand, no shoveling!

Today was largely about getting things prepped for the week ahead. Tiago's latest status report looks promising, and we think maybe this time we're really, actually, nearly done :) The last time we thought so, we were interrupted by memory leak hell, and we think we're nearing completion on that. And Tiago's been able to snipe several of the smaller issues over the past week, so we're back to making progress!

Meanwhile, in the space prototype, Josh and I are deciding whether to proceed with this procedural music experiment. The samples I sent him had some issues in the timing. At first, we thought it might be samples getting cut-off before they finished. But the more I listen using simpler test patterns, we might be having trouble with gapless looping. E.g. there may be exactly 1 beat between when a clip is ending and the next starts for a given track, and this is going to cause lag to creep in over time.

It's a weird lag, though, because it's in-time with the beat. Just off by a whole number of beats.

I think there may be a workaround for this, but we may have to fall back to more traditional music. Basically, the way the rest of the game (and NEO Scavenger) works: periodic, randomly-selected tracks.

Finally, tax stuff. I haven't paid myself yet this year since starting the LLC. And I need to do that. And the tricky part about that is that I need to withhold the correct amount of taxes from my paycheck. And in order to do that, I need to know what I'm going to pay myself.

Fortunately, I shouldn't have this conundrum too often. Once I set something up, it should be easier to continue it. It just feels like I'm setting this kind of stuff up every month these days!

Anyway, I'm going to play with taxes for the rest of my day. Have a better night, all!

Email Services, Music-Making, and Other Admin

Hey Folks! Just a quick update today, as I have to run and start making dinner with the fam.

A good chunk of today was spent researching ways to fix my email woes. And current thinking is to offload my email (both personal and website-generated "transactional" emails) from my webhost to a dedicated email service. Something like rackspace.com, GSuite, etc. Still unsure which. But eventually, the new site will be using them anyway, so maybe now's a good time to start moving the email portion over, since my current solution can't reach the Microsoft world.

Second, Josh's latest tracks. I finally got some recordings of the dynamic music-maker with various mixing params, and I want to see what he thinks. His last samples had a sort of Harold Faltermeyer "Sneaking around the mansion" vibe, while this is sort of an Outrun "tropical Ferrari breeze" meets Autechre. And since it's pseudorandom, it sounds slightly different each attempt. I've wrapped-up some videos of it so he can hear for himself, and we can figure out what to do.

Finally, business as usual. Emails, deal offers, and other things that need attention. Some of which were tough calls. And unfortunately, that means I got little actual dev done today.

Oh well. I still think it was a pretty good week. Some good dev work on mobile, website fires (mostly) extinguished, important decisions made, and progress on all fronts.Time for a break! Have a good weekend, all!

Ship-Making Music and Site Maintenance

Hey Folks! Switched things up a bit today and worked on the site and music playback for the space prototype.

As you can probably tell by the red banner at the top, and possibly by the site maintenance earlier today, it was a day of web-admin work. More code updates and patches. The Hotmail/Live/Outlook issue isn't solved yet, and I've asked my webhost about it. However, there's also a new feature (or rather, a revamp of an old feature that was lost): abuse reporting.

On the old site, users could report a post if it seemed abusive or spammy, and it would alert me so I could take a look. Somewhere along the lines, I accidentally replaced that with a different reporting feature that seemingly did nothing. Seriously, Kaaven had to email me with an "is this thing on?" inquiry the other day. Clicking it didn't even provide feedback to the user that anything happened.

So I installed some new software today that should make it more effective. Now, each post's report "link" flags the post so I can take a look. It'll also email me the first time a post gets flagged, so I don't miss it. It's pretty basic, but it should work better than the thing that was there before (which, I reiterate, did nothing). A low bar to exceed, but there it is :)

I also did a bit of audio coding for the space prototype. Taking a break from mobile dev, I turned my attention to Josh's latest samples. It's a refined set of clips that can be used to dynamically form tracks by layering and playing them at a certain tempo.

There were some subtle differences this time, though. For one thing, the tempo was slower. Also, these are shorter and meant to be played entirely, whereas the old ones were longer loops that had random pieces/segments played. This way is both easier to create content for, and easier for me to manage in code.

So far, I think the code is working. I even have two "phases" for the music: an intro and main phase. This way, the opening measures can sound one way while the main part of the "song" is different. For now, only certain tracks like bass and percussion are likely in the intro, while most other tracks come in later. I think it still needs work, though. But I need more time to articulate why, or what's needed.

Anyway, a bit of a different day today. Possibly more of this tomorrow. Tiago, meanwhile, is still kicking butt on bugs. Several more fixed this morning!

That's all for now. Have a good night, all!

AI Item Memory Leak, and Payroll Taxes

Hey Folks! More memory leak fixing today, plus a bit of fun (not) tax research.

The memory leak had me pretty defeated yesterday. Almost half a day of tracing output and trying experiments, and I still couldn't figure out where these orphaned items were coming from. I had a suspicion they were AI related, but couldn't prove it.

Fast forward one night's sleep, and I was finally able to make progress. Yay sleep!

It turns out AI was abandoning certain items if it could not TakeItem or DropItem, especially during spawning when they had no CurrentHex yet. The result was these items being instantiated then orphaned and stuck in memory even after quitting to main menu.

The code now checks for failed take/drop in some key places, and will destroy the ItemInstance in question. So far, this seems to reduce a significant number of orphaned ItemInstances resulting from AICreatures. (Typically, sticks, bottles, rags, and other low-value things.)

In fact, the ItemInstance debug report I made for listing orphaned items on the main menu seems to be 0 for three consecutive tests! They're short tests, to be fair. But that's a big drop from previous testing! Tiago's going to try testing some more tonight, and see if we're in the clear or not.

In less exciting news, with the end of the year fast approaching, I need to figure out how to pay myself. Now that I run an LLC (with S-Corp election), the way I pay myself has changed a bit from the old Sole Proprietorship I used to have. Namely, I need to pay myself wages, withhold the correct amount in taxes, and report/remit all that to the IRS. And that means setting-up some forms and processes that weren't there before.

So far, I've been putting that off because, well, because I hate learning new tax stuff. And I'm afraid of doing it wrong. I've already paid for consulting with accountants, so I think I know how to proceed. But the first time for a new business/tax thing is always annoying and rocky. Ugh.

Anyway, I've done some research, and I'll chew on that tonight. I think I know what I have to do and what forms to file. For now, time to have a beer and relax!

Battle Memory Leaks, and Elusive Leaks

Hey Folks! Work continues on the memory leak patches today.

Tiago found some bugs in the memory leak patch I added that caused battles to have null pointers. He was able to prevent the errors, but it was tricky to sort out which items belonged to the battle vs. regular encounter items. So we plugged away at it a bit, and were finally able to sort them out using the data handler class. Basically, there is one of each battle move in memory that all battles share, so we had to be careful not to delete them prematurely. But also make sure we deleted them when done.

Once that was fixed, I started looking into the remaining items. And things are getting harder to pin down here. Seemingly random items are getting missed on clean-up after a game closes, and no amount of my investigating has been able to find the smoking gun. It almost seems like AI standard loadouts and hex items are to blame, but I can't see why. And I can't prove that it's happening.

I'll probably look at this a bit more tomorrow, but if it's too hard, I might just chalk it up to "good enough" and move on. Tiago says most of the memory leak is plugged after the weekend's changes, so we may be at a point of diminishing returns.

That's all for today. Have a good one, all!