Monday, January 26, 2015

Why Apmin?

Some of you may wonder, why QetriX Apps are managed by “Apmin”. What a weird word!

Well, not really. I like to jam words together, so what will be result of application administration, or app admin for short? Appmin. And “apmin” is just one “p” away, not mentioning that it looks like “admin”, only with a fallen “d”.


Apmin in PHP

I like the word “admin” for administration, but /admin/ may be too obvious for unwanted visitors. I don’t expect QetriX to be hugely popular, so HTTP 404 on /admin/ may be a good thing, even it's rather security by obscurity.

Sunday, January 18, 2015

Mravenci as QetriX WebApp

6 years ago I made a remake of quite popular Czech card game Mravenci (“Ants”, gameplay inspired by Arcomage) for Pocket PC, written in C# for .NET Compact Framework. Because CF is a subset of regular .NET Framework, the same .exe worked on PC as well.

I was recently contacted, if there’s an Android version of the game. I replied there isn’t, because I tried and failed – as my experience with Android is shallow. But it got me thinking and then it hit me.

As I mentioned [2014/02#jetrix earlier], I have some experience with IBM Worklight MobileFirst Platform Foundation. Mobile side in the platform is based on Apache Cordova, which basically is a fullscreen chrome-less WebView (mobile browser), displaying the single page app, written in HTML, CSS and JavaScript.


Mravenci: Black (blue) vs Red (green).

I really like the idea, so I tried to make the game this way. All platforms have support for such apps, so I created basic WebView app in Swift and Objective-C (iOS), Java (Android) and C# (WinPhone). It worked really well and the final app is so tiny!

Everything is based on QetriX structure, with DataStores, “content” dir and such. I took the liberty of developing the game in Firefox on my PC. The development was nice and smooth.

Of course I had to reengineer some major stuff. Because of different aspect ratios, I had to make the whole game fluid (all sizes are percentage based). It may get little bit distorted on 3:2 displays though, so I added CSS media queries.


Mravenci. Build your castle to 100 or destroy opponent’s castle.

Also the original graphics was really low-res, which looked OK, but the blurring wasn’t that good, so I decided to recreate everything possible in HTML (like cards). Besides, I didn’t want to make gray version of each card (when player doesn’t have resources to play it) and grayscale filter doesn’t work on Android 4.3 and older.

The sound is made by HTML5's Web Audio API, but causes some troubles, which I consider acceptable, because audio isn't a key part of the gameplay. Sometimes SFX plays up to 1 sec later, than it should, and sometimes doesn’t play at all.

For the record, the AI doesn't peek into your cards. It analyses it's stats and also your stats, which are both visible to both players. For example, if your wall is too high, it prefers to build the castle, and again if you have no wall, it prefers to attack. In the “easy AI” setting it simply goes thru it's cards from left to right and plays the first one it has resources for.

You can download the game from Google Play and App Store. Try it, it's fun and quite challenging! :-)

Sunday, January 11, 2015

Qarate

I like watching TV series, my list of favorites is quite long. I also like to re-watch them, from time to time, but sometimes only good episodes. I had a list of good ones on my personal wiki, but it was boring to note them each time (and when I watch multiple episodes in a row, I simply forget to note it and then I forget which one was the good one). So I discovered Trakt and was happy about it. Rating was quick and easy enough for me to actually do it.

One day Trakt creators upgraded the website and rating system was still in “to-do”, so now I had nowhere to rate. I tried to google some replacement, but without any success. So, out of frustration, I added a new table “rating” to my personal wiki. It allowed me to rate not only episodes, but anything else – movies, songs, cars, vacations, etc. I was so pleased I thought this might be a nice service for others to use as well.


Qarate Logo. Hajime!

The biggest drawback was, that I had to enter the thing I was rating, mostly episode identification. I don’t want my users to add anything. First of all, it’s not quick and easy. Second of all, it will get wrong and duplicate (sorry, users...). It would require something, where all such data already is. Oh, wait!

I’m building qb for several years now and it will be the perfect marriage: a big database with “everything”, plus a website, that allows you to rate anything. Sounds great.

I looked for a fitting name, which starts with “Q” and contains “rate” and in the shower (which is a common place for ideas for many people, according to one article I read) I thought of “Qarate”. You can pronounce it as “Karate” (martial art) or “Carat” (unit of mass for gems and pearls). Therefore users may form dojos and level as gem rarity and belt colors (like blue diamond is more, than black sapphire).


Rating system will consist of 5 grades with matching score for that entity: +2 (excellent), +1 (good), 0 (meh), -1 (bad) and -2 (terrible). User may have limited +3 grades (the best), which can be used to mark notable things of it’s kind, like one episode in a TV series season.