Success Story: Sony Xperia Z3

Earlier this year, my trusty and much beloved Nexus 5 broke, and I suddenly found myself in the market for a new phone. I knew I did not want a Samsung, for reasons that are mostly related to the additional malware installed on them, and I could not get a new Nexus through the office’s vendor. A friend seemed happy with her Z1, and the Z3 was getting good reviews, so I decided to put my dislike of all things Sony aside, and got an Xperia.

I must say, I don’t regret this. The Z3 runs Lollipop, and has some Sony bundleware on it to push their media empire, but it is mostly unobtrusive and feels almost like a stock Google phone.

My worries about the quality of Sony hardware were also unfounded. It seems that the Ericsson engineering is showing in this device, with a great touch screen and far superior battery life than my Nexus had. I get almost 5 days of standby or two says of active use from a charge. That is after disabling mobile data, since I am on WiFi at least 80% of any given day anyhow, so YMMV on this, but I sure like not having battery anxiety towards the end of every day like I did with virtually all previous Android phones that I have owned.

Success Story: Pocket Reader

I have recently discovered Pocket Reader, and I am getting a lot of value from it. I noticed that I tend to have a lot of open tabs, both on my phone and in Chrome, that are “I will read this later”, and now I just store that into Pocket for later reading. It makes those pages available offline on my phone, so I can catch up on my reading on the bus or plane when I don’t have a network, which is great. Also, when I read something good, it’s always there in the archived posts for me to find later. So this app has conveniences that RSS readers don’t, and in fact supplements feedly for me, especially for wordy posts. Whenever I think “this is interesting, but too long for my bathroom break”, I just shove it into Pocket for later.

What offline reading does not deal well with is video content. So all the lazy-ass web journalisms that talk into their webcam instea of writing, you suck! The same goes for websites that break every article into several “pages” as if there was a limit to how long an HTML document can be, just to get more ad impressions. Stop doing that, or at least add a “full article” view.

Maps and Coordinates

The classic Eressea game has an unusual coordinate system for hex maps. For the future, I’m going to go with the system that Tiled uses, and all my work on the hexmap already uses it. Speaking of the map, I owe an image of the work I did on the selection:

Now with new tileset, ripped from Magellan.

The map you see here is from Eressea, because while I was not updating this Tumblr, I worked on a new report format for the old game that would write JSON maps for Tiled. It’s incomplete, but my game can read it, and I already learned something important: There are several ways to draw the same data, and it is important to know whether the first or second line of hexes is staggered (indented half a hex to the right). My game now reads this information and displays the map accordingly.

So even though that export is not on my roadmap to an MVP, it was still useful because it showed me a bug in my thinking before fixing it became too expensive (in this case, only rendering the tiles and the selection needed to change, as well as mouse-picking).

Map selection

I made a simple selection marker, controlled by keyboard or mouse clicks. It is visually a square, the mouse click boxes are not hexagonal, but it works. Good enough for today.
Starting to get a bit antsy about making things other than UI. Watched two episodes of B5 today, and have Kingsman with Colin Firth lined up for an evening movie. Easter soon.

Menus

I mentioned menus in my last post. Here’s how the main menu looks right now. It does not mark disabled entries in a different color yet (that’s on my TODO list), but it works.

image

What does not seem to work, however, are inline images in tumblr. Maybe it is a combination of privacy addons in my chrome going wild, but the images I insert into my posts do not seem to get uploaded. I had to link them from imgur in my last post. Trying this one more time…

Works when I’m posting from an incognito window (all addons disabled), so I guess that’s my own fault in some way. This is the kind of shit that keeps me from getting work done, because I just cannot let it rest…

Update: That’s it! Looks like HTTPS Everywhere doesn’t play nice with tumblr.com – I guess I can selectively disable it on this site? Mystery solved!

Building UI Elements

I’m a day late with this update, even though I worked through the weekend. A week into this project, and I have already got problems with focus, but I have been able to get some UI elements to work.

The game is going to have a large map view with hex tiles, so the first thing I built was that. I will be using a modified version of the Tiles JSON format as my report format, and step one was loading that map from disk. I also prototyped that I could load it from a web server, but it’s a ways before that protoype will make it into my actual code. Here’s what the map looks like:

The map can be scrolled with the mouse, but needs an active selection and detail view before I can call it done.

I am going to need a menu that opens up when pressing escape from the main view, so I prototypes that as well, with a bitmap font that my friend Andy posted a while ago. So I can count the bitmap font class among the things I built, too. Then I prototypes a login screen. My current rough idea is that I will give players a hexadecimal code to connect to their position in the game, and combine that with a code generated by the app. Since I’m still a bit sketchy on the details and not quite there yet, I didn’t finish the dialog until I’m actually going to need it. For now, it is the first UI element I have that supports all the interesting inputs: keyboard, mouse and game controllers.

Last but not least, I tested the Android version of LÖVE with the hex map, and made sure that I could get the game running on my phone. Overall, I’m still pleased with the technology choice, even though I seem to be building very much from scratch. I hope to finish the hex map for my next update, and then move on to communicating with a web server for map data by the end of the week.

Client Technology

With the decision to start writing the client first came the question of client technology. The existing Eressea client, Magellan, is written in Java, and even if I wanted to use some code from it, I would not be able to run it on a mobile device. I also do not know the code base, since it is mostly written by player volunteers.

So unlike the server situation, there is no reason to stick to the language used in the past, and I am free to choose whatever I want. The real constraint here is mobile, and the options that I know of are Cordova/Phonegap (HTML5 and Javascript), Unity and LÖVE.

Cordova is the only one of these that I have practical experience with, and while it’s a great choice for an app with a lot of UI, it is not what I would choose for a game in which I want to render a lot of bitmaps. I am also not a huge fan of Javascript. Unity is hot with other indies, but it is a 3D engine first, and there is a learning curve that I do not feel like scaling right now. I would also have to brush up on my rusty 3D math, just to make 2D projections. That seems like a waste. On the other hand, Unity skills are very marketable in the game industry right now.

Finally, there is LÖVE. I had only briefly looked at it before, but it looks exactly like the engine that I had always wanted to write myself: Built on solid, industry-proven, portable C libraries (SDL, PhysicsFS, Box2D), with Lua as the programming language, and Android and iOS ports in addition to the desktop releases. There is an active developer community, and an IRC channel where people answer questions. I think it’s charming, so I wrote a few prototypes for key technology (networking, UI, controller input), got a simple map viewer for Tiled to run on my phone, and decided that my search for technology was over.