Monday, September 15, 2014

Ads within Blogger

Being the good capitalist, I thought to myself, why not have ads at the bottom of the page?  if what the reader reads is interesting, and they read it in totality, I doubt that they'd mind a simple little ad at the bottom of the page.

So it began, going through the simple few clicks to request the permission to put ads on this blog.  Things went as smooth as butter, I must admit.  Within a day it was approved!  All that was left was to agree to the TOS and finalize what would be presented and how.

As you may notice, there are no ads at the bottom.  The TOS has a new frightening set of clauses that I have not yet encountered before.  That of various clauses surviving indefinitely even after use of the service terminates.

Typically, I would see a timeframe on the survival, a few years at most.  And that is on NDAs that I've signed with previous employers.

It may be argued that the ads service is different - that it does offer a way to interact with various entities where abuse would lead to extra money for whoever benefits from placing the ad.  Sure.

However, everything is becoming a service.  Look at Photoshop - you just rent it.  Same for the developer tools from Apple.  Many things that you used to indefinitely license for a single large sum are being rented on a monthly basis.

MMOs, one of gamings rented games, can be abused like Google ads to make money.  These games typically have local economies and some people will pay real money for what others picked up over long periods of play.  Farming for gold pops to mind.  Should a video game have a contract with clauses that indefinitely survive termination?

For legal purposes, it is easy to assume that anything that is done over the Internet is logged.  Every conversation, every photo.  Be it by the state (see the NSA insanity) or by individual providers (wasn't it reddit that said they can't resist handing logs to suits?)...  of course this survival is used to ensure that if something sketchy appears after termination, it can be caught and dealt with.

But back to the issue - can the survival of termination be abused?  Could it ever become a boon years down the road as companies go back to these old contracts and try to find any reason to extract funds from old users?  I'm not implying any company would do this, but the door could very well be opened at some point.

Or so I believe.  Reading these myriad of software EULAs and TOS just bore me to death.  And given I'm not a lawyer, I'm sure I've misread a few as I sometimes read clauses multiple times to understand an English that, since it leaves no room to interpretation, can be quite dense.

But typically these end. Mor can be terminated if I got the gist wrong during the first reading.  This one doesn't forgive.

On a side-note, I can completely understand why no-one reads these things.  They are long, and typically can be summarized as "we are not responsible for anything (nor have any obligation towards you), you are responsible.  Oh, and give us money if it's a paid service!"...

Sunday, September 14, 2014

Aren't games counter productive?

For the longest time, I tried to reign in my desire to play games so I may be productive at other things.  The problem was, no matter how much control I exerted over myself, there was not net increase in productivity.

Then it dawned upon me: I'm a Sim.  There's a progress bar that craves the entertainment provided by video games.  And that bar was empty.

So I binged, and played about 14 hours of a game in two days.  By the end of it, I was fed up, my meter completely filled, I could then do something else such as work on a web comic.  Read, work on a web comic and be happy about it, laughing as the details came together.

It seems that any rhetoric that advocates for anything in the extreme is worrisome.  A balanced life requires play in addition to work.  And work can't proceed as efficiently until neglected needs are satiated.

That's my theory, and I'm sticking to it.  Mainly since it makes me happier.  :)

Thursday, September 11, 2014

Digging a bit further into SpriteKit

A few throw-away prototypes later, and a few things about SpriteKit have become apparent to me.

First -- SpriteKit is highly optimized for image data.  That is -- sprites.  It is very efficient, put your images in a ".atlas" folder and a texture atlas is built reducing your costly draw calls from dozens (or hundreds depending on your app) to one.

Caveat, that is what SpriteKit does best.

As of writing, a text node will defer to core text   Core text will create a texture.  That will be slapped onto, what I guess is, an SKSpriteNode.  Each text element will incur an additional draw call (even if the text is duplicated - each duplicate will make a new texture.  Copying the SKTextNode results in a copy of the texture as well).  For a simple HUD, this is perfectly acceptable.  I dreamt of a text adventure recently, and SpriteKit would need a bitmap font rendered as SKSpriteNodes even though another framework would be just as good.

The other is drawing filled rects.  My best guess is that they are there as placeholders for an actual image-based sprite object.  They too don't batch that well together, which did surprise me.

How to track the draw calls?  Two ways.  One is to do a frame capture while the application is running on device.  The other, which I find more convenient, is to set the "showDrawCount" property of the "SKView" to true.  Turning on that property was an eye opener.

If we return to the colour-based SKSpriteNodes, be sure to give them a separate zPosition so they blend properly with the other nodes.  I have noticed that the drawing order differs when batching becomes possible.

Speaking of "zPosition"; it is safe to assume that each "zPosition" will result in an additional draw call.  The furthest are drawn first in one call, the nearer in subsequent call.  The mental model that I create for myself is that of creating a bin for each "zPositon" and dispatching each bin at the end.

Before making an image for each possible colour combination, tinting does not affect the number of draw calls.  If you were a stubborn person, you could make a white rectangle, create a sprite, and tint it to your heart's desire.

Notice that I have not delved into physics.  None of my little experiments needed (sophisticated) physics so far hence I can't comment on how that part of SpriteKit behaves.

Overall, I'm actually quite happy with SpriteKit.  The caveats I mention are minimal.  Implementing (or finding an implementation of) a bitmap font for SpriteKit is rather trivial with building the font being the time consuming part.  And as mentioned, coloured blocks can be simulated with flat textures.

And, in most real-world use-cases, I would guess that the caveats I mention are neglible.  For example, when will you display 100 SKLabelNodes?  Or do heavy pixelation with 10,000 SKSpriteNodes?

Wednesday, September 10, 2014

Return to Class

It has been over 5 years since I last attended a lecture within a formal class setting.  Lately, some classes in mathematics have gotten my attention, and since I don't care about the degree anymore, why not just sit in and enjoy the show?

There were two classes that I requested to sit in, and the professors were very kind and said I was welcome as long as I didn't add any work.  Fair.

Not caring whether I passed or failed, I opted to go to the more advanced course first.  In this class, the students were silent and respected the professor.  It was also a challenging class, my mind needed to work quite a bit to follow what was being said.

Even though I could follow if I put in the effort, work was looming over me so I conceded and opted to try the lower-level class.  The culture was completely different.  Throughout I heard other students talking, playing games, navigating Facebook, eating lunch, questioning the professor...  (the prof knew his stuff inside out).  There was a sense of boredom, as though similar material has been seen over and over again (set theory is, admittedly, kind of basic -- and certain concepts can be seen in other classes such as linear algebra).  I felt bad for the students who just sat there playing your colour-matching game-du-jour; they would learn just as much sitting outside (it was this high-school-esque forced attendance rather than this "I wish to learn" voluntary attendance.

Then came the stark realization; I'm better off listening to the lectures that are put out by the major universities.  Even though I enjoy having forced times, these past few times I went to the lectures my mind wasn't thinking of math but of algorithms.

And then my thirst for knowledge would follow my work habits and be satiated when my mind is focused on the subject.

Since I don't care about grades.... why not?