Posted on 01/28/2015 - 17:15
I received some more information on my GST situation this morning, and that's looking better. It appears that I may have been using the wrong terminology when describing Steam and other services to my accountant and the CRA. According to another accountant I spoke to, my current situation makes me eligible for a "zero-rated" GST. Basically, I have to charge a 0% GST. It sounds silly, but I guess the difference is that such entities can take advantage of tax breaks for any GST expenses during the year. Probably a minimal amount for me, as I don't buy a lot of work supplies with a GST tax, but it's good to know.
I still need to clarify a few more things, but I think I can give my accountant the info they need to proceed with tax returns soon. And that'll be a weight lifted.
Back to fonts, this situation isn't looking good. The hxswfml app that I was coding hit another snag, this time due to heavy processing times. Flash tends to give up if nothing happens for 15 seconds, and with a fully-loaded unicode font like Calibri, that isn't enough processing time. Basically, this might only work for some languages and not others.
The reason Flash enters this at all is because I was hoping to make the font conversion tool run in the browser, so all users could access it.
I briefly looked at compiling it as a native binary application (e.g. an OS-specific .exe or .app), but it looks like the file operation libraries between the Flash and C++ targets are different, so each would require different code to handle loading the files. OpenFL is supposed to smooth over this type of problem, but there's a gap in its coverage that exactly aligns with the way I was loading the font file. (I.e. the FileReference class)
This is doubly disappointing. First of all, it means there's still no way for end-users to add their own fonts to the game. I haven't found a solution for this that does non-English glyphs yet.
And secondly, this could mean some headaches down the road if I decide to use Haxe for NEO Scavenger "2." If loading files is this platform-dependent, that kind of kills one of the major reasons to use Haxe in the first place.
There are still some tricks left to try, but I'm starting to think I should shelve this for now. There are several bug fixes and modding enhancements just sitting there while I tinker with this, and it isn't really fair to hold up the train for something that is not guaranteed to work. Plus, with two trips coming up soon, and a convention booth to plan, my dev time may get interrupted a lot.
I'll give it some thought overnight, but I'm thinking tomorrow I may return to bugs and modding stuff. Fonts may have to wait until more spare time is available.
Posted on 01/27/2015 - 17:35
Hey Folks! Hope everyone had a good weekend. We had a nice, lazy weekend here, and yesterday's birthday trip was a success. Food, shopping, coffee, and walking around in above-freezing weather!
Unfortunately, the party ended this morning as it was back to taxes, accountants, lawyers, and other admin stuff. Speaking with Canada Revenue seemed to indicate that I may be on the hook for GST payments in 2014. And worse, I need to figure out how much revenue came from each province, so I could pay the GST or HST amounts each has.
If that wasn't bad enough, it appears only one of my sales websites reports this level of granularity. And Steam, the largest contributor, wasn't it.
That seemed fishy to me, though. Steam isn't exactly small fries. They probably do nine-figure revenue each year worldwide, they've been in business for over a decade, and they work with dozens (if not hundreds) of Canadian developers. They can't be flying under the radar on this.
Turning to Twitter, I actually got a pretty quick reply from both Andy Moore (of Rockets Rockets Rockets fame) and Daniel Jacobson (studio director of Gaslamp Games, which is currently working on Clockwork Empires). Both Andy and Dan said their accountants gave them the "all clear" on this GST business, which was a bit of a relief. Knowing they're in a similar situation to me, and having both spoken with their respective accountants, makes me feel a bit more confident. (And this would actually match what Fastspring told me a few years back, when I started Blue Bottle Games.)
They've kindly put me in touch with their accountants, and hopefully one or both can shed some light on this situation once and for all. And depending on how things go, maybe I should see if one of those accountants wants to take me on as a client. KPMG is the 800-lb gorilla of tax accountants, but they may not be as familiar with Steam as accountants who already researched this.
I did manage to get an hour or so of work done on the font conversion testing. I picked apart the source code for hxswfml, and I think I've figured out how to convert it from a command-line application to a GUI app that can run in the browser. That, and I think I can see where the parameters define which glyphs to add to the font swf output (my main reason for looking into the code). There's an "all" flag that's supported, so I'm thinking the example app they had on their website must've had just latin character code ranges hard-coded. (Which is why my test font swf was missing cyrillic glyphs.)
I've just about got something compiling, and I hope to get at least a test run done tomorrow. That should tell me whether this is just a matter of expanding the glyph range parameter, or if it's a bigger issue. (Let's hope it's the former!)
I also got word from the convention organizers this afternoon, and the timeline for materials is pretty tight. I may have to switch to that soon to get everything ready in time. Man, things just come fast and furious these days!
Anyway, hope everyone has a good night!
Posted on 01/23/2015 - 16:41
Looks like yesterday's font success may have just been a plateau. When testing non-latin characters today, I ran into several issues.
As a first test, I decided to use cyrillic to see if I could change in-game text to show non-latin content. I packaged a cyrillic font, changed some source code, and fired things up. And only the commas came through.
Thinking that maybe this was due to hard-coded text not being UTF-8 compliant, I decided to try placing the cyrillic text in the neogame.xml. However, even that didn't work.
At this stage, I started to doubt whether the font I was using was actually a cyrillic font. Maybe I just grabbed a decorative Latin font that looked cyrillic? Two fonts later (including the MS standard "Calibri"), I was pretty sure that wasn't the case.
Digging deeper, I decided to check the character codes that the game was displaying. Did the character codes match the Unicode specification for cyrillic characters? In short, yes. Those looked okay.
Finally, it occurred to me that maybe the ttf->swf app I was using wasn't packaging all of the glyphs in the font. Maybe it was only packaging the latin chars? Judging by the file sizes before and after, that seems likely.
So my next step was to download the hxswfml project source to see if I could figure it out. I've checked out the source via SVN to my local machine, and started digging around. There are probably over a hundred folders here, though, so progress is slow. That, and it appears it was written in Haxe 2.0, and the current Haxe 3.0 has some specification changes (such as switch statement pattern matching). Fortunately, that was a quick code edit to fix.
And that's where I am now. I'm ready to compile a debug version of the converter app, and maybe I can step through the code to figure out where it decides which glyphs to copy. More on that next week.
And speaking of next week, I'll be out of the office on Monday. My wife's birthday is that day, so I'm hanging out with her. I should be back on Tuesday, though. And hopefully with some more news on the convention booth!
Have a good weekend, all!
Posted on 01/22/2015 - 17:20
I think I've got a workable solution for fonts!
Please be real please be real please be real...
What you're looking at above is the title screen of NEO Scavenger using a font that is loaded from the game's data folders when launched. This font is not installed on my machine, nor was it created using Flash CS4. Rather, the font was converted to swf format via a free online, open-source tool.
What this means is that I think I can make the game support user-specified fonts, and that the user doesn't need to purchase Flash Professional ($$$) to convert the fonts to the right format. Or in other words, use whatever fonts you like, including other languages!
Now, before we get too carried away, I still need to run some tests. I need to verify that there's a way for the user to specify font name, size, etc. in some config file that the game can read. And I also need to look into the font conversion tool a bit more to see what my options are for using it. (E.g. can I host a copy of it on my site? Should I just link to it?)
However, this is big news for modders who have been asking about extended character sets. Tomorrow, I'll see if it works with non-English fonts, such as Cyrillic, Chinese, etc.
Man, this was a last-minute surprise, and pretty much what I was hoping for. It just took several days of plumbing the depths of the internet to find some comment at the bottom of an archived forum from 2011. You know, a regular day in the life of a Flash programmer :)
Have a good night, all!
Posted on 01/21/2015 - 17:47
Today took a turn for the boring early on, but later suddenly diverted into scary-yet-exciting territory.
First, the boring. I had a lovely chat with KPMG Canada this morning, wherein we discussed US and Canadian tax law, GST registration, tax treaties, and the maelstrom of forms one must navigate. That's right, it's getting to be tax time, and this year, I want someone at my back that can help.
Last year was a bit of a last-minute scramble after I personally finished Canadian taxes, and then folded under the pressure of figuring out US tax law as a Canadian business resident with US citizenship. I finally went with a professional tax preparer for the US portion, but I felt somewhat left out in the cold after working with them. They did the job, but it was hard getting them to respond to questions.
This year, I'm hoping to get an early start. And with Steam Early Access having a pretty big impact on sales, I want to make sure a pro looks things over. KPMG comes pretty highly recommended when it comes to cross-border taxes.
So this morning was tax discussion and accounting review as I gathered materials to get a quote on their fees. Fun times!
However, just as I was finishing that, an interesting turn of events happened. Namely, it appears I may be visiting a certain conference this year, with a whole booth to myself. (What's the emoticon for scared-yet-excited?)
I was sort of unprepared for that. I figured I might have a really tiny presence at the conference, but it turns out I may need to figure out how to fill a 10x10 space with NEO Scavenger decor. Plus, I need to figure out what I'm willing to budget for the event. It's going to cost much more than I originally planned, but maybe there's a way to make it worth the expense.
I'm thinking it may be possible to create a real spectacle of the booth space by decorating it like a post-apocalyptic campsite, jury-rigged out of old trash, tarps, sticks, and fake trees/plants. Like, "welcome to my noise-trap-bedecked slice of forest, complete with trash can fire, grocery cart, sleeping bag, and makeshift shelter."
The decoration part should actually be a lot of fun, and thanks to NEO Scavenger's trash-friendly setting, pretty cheap, too. However, how will I integrate a PC playing station or two into the area? Should I have a table? Chairs? What about signage? Should I have a backdrop behind the fake trees? Lights? A stand with a canvas screen-printed with the company or game logo? And should there be giveaways? Cards? Pins? Game keys?
Not to mention, how am I going to transport all of this gear to and from the con, and what will I do with it all when done?
Lots of questions. Lots of dollars. Lots of stress.
But hopefully, also lots of awesome :)
Posted on 01/20/2015 - 17:40
I actually diverted from font research today after stumbling across a pretty major bug. One player on the Steam forums noticed that their buttons stopped working, and they had a save game that seemed to reproduce the issue on my machine. Yay!
However, I later discovered that the issue might've been due to me loading an old neogame.xml that was lacking some data. Still, the save game helped me pinpoint some weak areas in the code that break when certain data values are corrupted.
First of all, the save game seemed to have some items with NaN durability, and this was causing issues when the AI tried to compare item values during looting. The value comparison was always "true" when AI checked, meaning the AI would get confused and infinitely switch between looting the same two objects. This caused an infinite loop in the game, resulting in the game locking out the player and ending turns over and over until the player died.
To fix this, I added some code to validate the item durability and to reset it to 1.0 if it becomes NaN. It's impossible to know if the NaN was getting close to 0.0 or was closer to 1.0 before it broke, but at least 1.0 is a safe fallback number. It just means items with broken data last longer than they should. This also fixes the AI confusion infinite loop.
Tracing the problem backwards to the source, it looks like the game also managed to screw up the date info. The previous turn was set to NaN hours ago, which means everything in the game that degrades had a durability of NaN because it had been degrading for NaN turns. (See how NaN spreads like wildfire?)
To avoid this issue, I added a fallback value to the game's date info, too. As above, this default value may screw up some finer timing issues in the game, but at least it saves things from a complete crash. (And in practice, this NaN date was the result of missing data in the old neogame.xml file, so it shouldn't happen unless someone accidentally deletes it or modifies it in neogame.xml incorrectly.)
Weather had a similar issue, as that was also something I migrated to the neogame.xml file recently. So I fixed that in a similar way.
Finally, after fixing all of the above, I noticed a huge performance issue that appears if the game thinks a large number of hours has passed since the last turn. (Which was the case in the save game I was testing after I reset the "last turn" date to the beginning of a new game.)
Basically, whenever the player sees a new hex, the game checks to see how many hours have passed since the last visit. And for each of those hours, it checks to see if the hourly scavenge sites have appeared. Normally, this is only a handful of hours per hex, for 5-15 hexes, so most people don't notice it.
However, in the bugged save game, the last turn was a ridiculous number of hours ago. This meant that the game checked for scavenge sites a ridiculous number of times for each revealed hex while the save game was loading, and there was a huge pause with a black screen while it did. I thought the game crashed when it happened, as I'm sure a player would, too.
So I've adjusted this code to check for cases where more than 10 hours have passed, and if this is the case, it will act like the hex had never been visited before. I'll need to playtest this a bit to see if it feels right.
A bit of a detour from my font plans, but I think this was some necessary bulletproofing for the game. This may also help with some of the hard-to-track bugs people report. The ones that happen randomly after long play sessions, which may be the result of NaN-like data creeping in.
That's all for now. Have a good night, all!
Posted on 01/19/2015 - 17:44
Hope everyone had a good weekend! I actually fired up Skyrim again for the first time in a while. I'm not sure what made me think of it, but I had a hankering to explore a fantasy world, and I never really got far with my mage character. I managed to have some fun gaining magic powers and following mage quests before I hit a rut.
Back at work, I discovered had a lot of catching up to do on PR. Quite a few messages came in on Friday evening and over the weekend, including an interview request, and there were also several reviews posted. Some highlights include:
- FraggedNation Developer Interview - I chat with Daley of FraggedNation about NEO Scavenger and it's development.
- RetrospectiveGamin's NEO Scavenger Review - One of the more concise and authoritative reviews I've seen.
- NEO Scavenger: A Terrible Good Game - He hates it, but he loves it. I loved the (semi-NSFW) tone of the piece.
- Indie Megacast Ep. 64: NEO Scavenger - Chris, Patrick, and Rob ruminate about their experiences in NEO Scavenger.
That last one was harsh, but fair. User-experience is definitely a weak suit for NEO Scavenger, and it shows in this podcast. And while it was hard to listen to their frustrations, it was also very useful for me to learn where I failed to communicate to the player. I get the sense that at least some of them really want to like the game, but the game's UI and lack of communication work against it.
Ultimately, however, this is good info. I think if I can improve the interface in future games, I might reach a new group of fans who are deflecting off of the current UI.
I probably still have a bit more PR to do tomorrow. It's been a few days since I've checked tech support forums. But once I do that, I hope to be back into the dev environment and coding!
Have a good night, all!
Posted on 01/16/2015 - 17:37
So the fonts situation has stalled somewhat.
As mentioned yesterday, I made some early progress loading fonts embedded in external swf files and using those to alter NEO Scavenger's UI. The drawback, however, was that most people won't have the tools necessary to create swf files for their fonts. The only way that verifiably works so far is using Flash CS4 (or any Flash CS edition) to export a font installed on the user's machine. And this software is pricey.
While discussing that, however, it occurred to me that I could also try to just load fonts that were already installed on the user's machine. So I set about rewriting the font-loading code to simply load a text file that defines which fonts to use for which UI stuff. I got that to load, and started testing, and...
...no dice. The text file loaded, the settings were updated in NEO Scavenger, but when it came time to render text, I just got blank space. Some more testing, including hard-coding the fonts to use known system fonts such as "Verdana" and "Garamond," also failed. Out of desperation, I tried asking Flash to tell me which fonts were installed, (i.e. Font.enumerateFonts(true)), and oddly, it spat out a litany of fonts. Including the ones I was trying.
Digging further, I noticed I could query each listed font for "hasGlyphs," which basically checks if that font could be rendered with the supplied example text. Asking it to try "Hello World" on all of the fonts, only three came back positive. And they were the embedded pixel fonts that I added to NEO Scavenger.
The weird thing is that some websites seem to be able to do it, such as this one:
Though one notable difference is that this site doesn't have its own embedded fonts. Further research suggests that this may be a...wait for it...limitation of Flash. Namely, Flash can either render embedded fonts (a.k.a. "CFF") or system (a.k.a. "device") fonts, but not both. I'm not sure if that's true, or if this can be switched on-the-fly, but that was the gist of what I read on Adobe's site.
There may be more things I can try. Perhaps I can try not embedding the pixel fonts at all, and loading them dynamically when the game starts, to see if that allows me to use system fonts. Alternatively, maybe I need to go back to looking for easy ways to convert TTF files to SWF so modders can actually use this feature. Or, maybe I need to drop moddable fonts altogether.
I think it's worth at least one more day of research, however. So that'll be Monday.
Hope everyone has a good weekend!
Posted on 01/15/2015 - 17:44
There are a few other modding enhancements I wanted to try and fit into the next update, so I decided to tackle one of the harder ones today: fonts.
A lot of folks have asked for the ability to change the font. Often, this is so they can begin doing translations of the game into their native language. And in other cases, it's for aesthetic or legibility reasons.
In theory, Flash allows us to use fonts in 3 ways:
- Use a font installed on the user's machine.
- Use a font embedded in the Flash app.
- Load a font from an external swf file.
NEO Scavenger currently uses option #2, which uses my custom pixel fonts for the various screen sizes. These fonts are embedded in the app when I compile it. Unfortunately, my font only has the Latin ASCII characters, so accented, Cyrillic, and other non-English glyphs are not possible. And since it's a compile-time embed, end-users cannot change it.
As my first test, I decided to see if I could make #3 work. I generated an swf with a random TTF font inside it, and added some code to load it and use it on the title screen. The good news? It worked!
Now here's the bad news: I generated the font swf using Flash CS4. CS4 is Adobe's professional Flash editing software, is pretty pricey, and I can't see the average modder wanting to drop a few hundred bucks just to convert TTF files to SWF.
There are some font-to-swf converters out there, but I have yet to find one that works. The online one I tried failed to produce anything, and the SWFTools app I downloaded seems to have generated an older SWF format that NEO Scavenger cannot read. (I.e. an AVM1Movie instead of the AVM2Movie format that AS3 requires.) It's possible that there's another converter out there that works, but I have yet to find it.
FlashDevelop may be able to generate an SWF from a TTF. I was poking through some features, and it seems like it could work. And what's more, FlashDevelop is free, and open source. So I'd feel comfortable recommending it to modders. (It's what I use to code, after all!) However, it's far from trivial to use. One would have to install it and the requisite libraries, and have some familiarity with IDEs to get it to work. Not ideal for casual modders.
As I typed this news, it also occurred to me that I kind of ignored option #1. Normally, that option is a non-starter because you can never tell which fonts a user has on their machine. However, if the modder provided the font, it could be installed on the user's machine, and the game would be able to load it (I think). In this case, the modder just needs to edit a text file to tell the game which fonts to use, and provide the text file and font to the end-user (or the URL to the font, if they want to avoid copyright/licensing issues).
It still may be possible, so I'm going to keep looking into it. Here's hoping I can figure something out!
Posted on 01/14/2015 - 17:45
Hey folks! As many of you likely saw, the site underwent some updates today. I had to update the content management system and some of its modules, so the site had to go offline for maintenance just after lunch. Fortunately, the process only lasted a few minutes, and seems to have gone smoothly.
Back on the game, I started looking into some more modding enhancements. One of the first things tackled was the aforementioned PassTime method. I fixed this to update not only the player's items and conditions, but the game world date, weather, visibility, and items in all hexes. Now, PassTime should feel more like time actually passed, with the exception of creatures roaming/aging (which would cause complications if they interrupted a player during an encounter).
In addition to the above, I also moved some more game data into the GameVars table in the xml. Previously, these were all hard-coded, and modders couldn't change them. But now, anyone willing to tinker in the xml can change the following:
- fCloudChanceJan - % chance of clouds in January
- fCloudChanceJuly - % chance of clouds in July
- fCloudChanceVar - % these numbers can fluctuate from year-to-year (e.g. 30 would mean 15% in either direction)
- fPrecipChanceJan - % chance of precipitation in January
- fPrecipChanceJuly - % chance of precip. in July
- fPrecipChanceVar - % these numbers can fluctuate (again, 30 would mean 15% up or down)
- nStartDateDay - The day of the month at which the game starts. (1-31)
- nStartDateHour - The hour at which the game starts. (0-23)
- nStartDateMonth - The month at which the game starts. (1-12)
- nStartDateYear - The year at which the game starts. (YYYY format)
- nStartHexX - The x coordinate of the starting hex (column number, from 0)
- nStartHexY - The y coordinate of the starting hex (row number)
- nTempJanHigh - Average high temp in January (degrees F).
- nTempJanLow - Average low temp in January (degrees F).
- nTempJanVar - Amount these averages can vary (degrees F). E.g. 30 would mean +/15 degrees
- nTempJulyHigh - Average high temp in January (degrees F).
- nTempJulyLow - Average low temp in January (degrees F).
- nTempJulyVar - Amount these averages can vary (degrees F). E.g. 30 would mean +/15 degrees
With these variables exposed, players should be able to alter the starting hex, starting date/time, and climate for the game. Combined with the existing abilities to change the map data and hex art, this should open up quite a few possibilities for new settings.
For reference, this is the sort of stuff I was referring to when I mentioned improving modding after launch. So if there's more stuff like this that you want access to in the game, let me know! I'll do my best to expose what data I can so modders can continue to kick butt :)
Have a good night, all!