Pixel Envision Ltd.
Mobile Game Development Studio
  • Home
  • About Us
  • Our Games
    • Hyper-Casual
    • Casual Games
      • Don’t Get Caught
      • Hordes of Enemies
      • noded
      • kubic
      • Whip Swing
      • Witches’ Brew
    • Kids Apps
      • Coloring Book
      • Cars & Trucks Puzzle
      • Train Puzzles for Kids
      • Animal Puzzle
      • Fairy Tale Puzzles for Kids
      • Find the Differences
  • Support
  • Privacy Policy
Select Page ...

Category: Tips & Tricks

Game Center Achievement Icon Template

June 1, 2012 iTunes, Tips & Tricks

As you might know while creating Game Center Leaderboards & Achievements in iTunes Connect, you are required to upload an 512×512 image file to be used as icon to represent those.

But when those are displayed in Game Center, icons are shown in a clipped circle with a border. So, it’s hard to tell which parts will be visible when the image is cropped and it might take few updates to get it right…

When working on our first app, we have decided to make a photoshop template to make things easier by taking out the guess work. Here is the masking template we ended up, ZIP file contains a Photoshop PSD file & a PNG file.

To use it simply place your image below the preview mask, after adjusting it’s position & scale, disable/remove that mask and use the result as your leaderboard / achievement icon image.

Game Center Achievement & Leaderboard Icon Template

Unity Plugin Suggestions

April 29, 2012 Reviews, Tips & Tricks, Unity 3D
Vol. 3 of my suggestions list now live! Click here to check it out for most up-to-date information.

It’s been a while since we started working with Unity 3D. One of the fist thing I’ve noticed is the community contributions and the great stuff that you can find at The Unity Asset Store… Simply put, The Unity Asset Store is a place to buy things you can import and use in your own Unity 3D projects. Of course there are other plugins available at developers own web sites too.

As my main motto when start working with a new platform is “do not re-invent the wheel!”, I’ve looked at most of them. Many great programmers developed top notch applications that will save you loads of time & even inspire you to do something you’d never thought before.

Since we had a limited budget, reviewed most and decided on few which stands out. And finally chosen few of them to purchase first.

Here is our short list of best Unity 3D plugins *

  • PlayMaker
  • Ragespline
  • RageTools & RageTools Pro Add-on
  • FingerGestures
  • NGUI: Next-Gen UI kit
  • Prime31 Unity Plugins (StoreKit, Amazon In App, Etcetera for iOS & Android)
  • Shadow Volumes Toolkit
  • Pool Manager 2 (Not purchased)
  • Shatter Toolkit (Not purchased)
  • Mega-Fiers (Not purchased)
  • Multiplatform Toolkit (Not purchased)
  • 2D Toolkit (Not purchased)

If you are looking for a way to greatly enhance your Unity 3D experience, I’ll strongly suggest looking at those… Hopefully, in near feature when we have enough experience with those, I’m planning to write a short review on each of them…

* Best match to our current workflow and planned apps. This is not a complete list and there are other great ones. So, make sure to check asset store for yourself…

FTC & Data collection (Analytics) from kids in mobile apps

March 17, 2012 Tips & Tricks

To be honest, I have came across this few times in the past months but failed to give enough attention to it. But recent policy change that came from Flurry analytics changed that… That is specially important if you are developing apps & games for kids.

COPPA states parental consent may be required to collect data from children in your mobile app or site and proposed new rules would also limit passive data collection about children.

FTC has proposed also to require parental permission when mobile sites or apps track children across different services, using cookies or other identifiers, even if this is done anonymously. That simply includes all kind of analytics activity…

Flurry actually gone ahead and recently updated their privacy policy.

Our Customers may not use the Flurry Services in connection with any application labeled or described as a “Kids” or “Children” application and may not use the Flurry Services a) in connection with any application, advertisement or service directed towards children or b) to collect any personal information of children.

So, you may not use Flurry for apps labeled as for kids; it also means that you may not use Flurry for other apps if they are “directed towards children” or if it in fact collects personal information from children under the age of 13.

And we agree, parents should feel totally safe when they let their kids spend some time with our apps… So, we have decided to “play more active role” and removed Flurry analytics from the recent update (1.3) of Witches’ Brew. That information also placed in our app description. And none of our future apps for kids will include analytics tracking…

For more background on the rules applicable to data collection from kids, read this post.

FTC Report

iTunes AppStore review link for the rating requests...

October 24, 2011 iOS, Tips & Tricks

First app, first mistake…

Our first game is live on the appstore for few days…

Based on our stats there were quite a few users willing to leave a review (thanks to all!) but there were none!

After checking out the code, we found the cause… A simple typo error…

It’s fixed now and 1.1 update submitted to appstore along with other changes. I hope that will put us back on track! Just wanted to share that with our fellow app developers…

Can you spot the difference between two links?

Wrong:
itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsuserReviews?type=Purple+Software&id=

Correct:
itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=

If you couldn’t find it yet, it’s the capital “U” in “viewContentsUserReviews”…

How I integrated osTicket to WordPress

September 7, 2011 PHP, Tips & Tricks

I’ve been looking for ways to provide a proper customer support for our website & products. Of course, just giving out your support email could also do it, but I wanted to have centralized on-line solution which makes things easier on both sides of a support request.

After looking for options (of course there are better paid alternatives), I have decided to use osTicket, which is a widely-used open source support ticket system. osTicket also supports email piping, so customers can submit new support request simply by sending an email to us. Email piping support was one of the key factors for my decision.

osTicket Bugs & Fixes

While working on the integration, I’ve noticed few bugs in the osTicket (v1.6.0 Stable) that needs to be fixed for a proper operation.

Captcha Image Problem

After the installation & setup of osTicket I have noticed captcha images are not shown properly. Most of the major browsers were failing to show captcha image by displaying the red X instead. In order to fix that problem you have to edit following file located in “include” subfolder.

class.captcha.php

Edit that file and look for the line #48 and change it as follows:

PHP
1
2
3
4
5
//Original
Header("(captcha-content-type:) image/png");
 
//Fixed
Header("Content-Type: image/png");

Captcha Validation Problem

When trying out the system, I have noticed submitting a new ticket is not possible for logged in users. Captcha image is not shown for logged in users (which is a proper thing to do) and when the new ticket is submitted, validation fails. In order to fix that problem you have to edit following file located in the root folder. Thanks to rayflexcom @ osTicket forum for the original fix.

open.php

Edit that file and look for the line #23 and change it as follows:

PHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//Original
if (!$thisuser && $cfg->enableCaptcha())
{
    if (!$_POST['captcha']) $errors['captcha'] = 'Enter text shown on the image';
    elseif (strcmp($_SESSION['captcha'], md5($_POST['captcha']))) $errors['captcha'] = 'Invalid - try again!';
}
 
//Fixed
if ($thisclient && $thisclient->getId() && $thisclient->isValid())
{
}
else
{
    if (!$thisuser && $cfg->enableCaptcha())
    {
        if (!$_POST['captcha']) $errors['captcha'] = 'Enter text shown on the image';
        elseif (strcmp($_SESSION['captcha'], md5($_POST['captcha']))) $errors['captcha'] = 'Invalid - try again!';
    }
}

Embed osTicket to your WordPress Template

Initial integration is fairly easy, but to fully embed it into your template you should edit the html/css code in php files.

Base Setup

Locate the following file located in the root folder. This is a bit different than the other methods you can find on internet.

First of all, it checks for the current folder. If the request is coming from the osTicket’s default admin folder (scp) it won’t load the WordPress template. Without that line, osTicket admin pages will be broken hybrid of it’s own design and your template.

Second, if you are using WordPress permalinks like I do, sub-pages (contact/index.php, contact/open.php, etc.) will return header section of your WordPress 404 page. osTicket will work but that will not be very SEO friendly. Just change “/contact/” to match your setup (osticket, support, etc.)

main.inc.php

Edit that file and look for the line #99 (with the other includes and requires which you can find under the line that reads “#include required files”) and add the following code:

PHP
1
2
3
4
5
6
//Original
if (!strpos($_SERVER["SCRIPT_FILENAME"], "/scp/"))
{
    $_SERVER["REQUEST_URI"] = "/contact/";
    include (ROOT_DIR . '../wp-blog-header.php');
}

Template Integration

Edit following files located in the “include/client/” subfolder.

header.inc.php
footer.inc.php

Edit both files and change them as follows:

PHP
1
2
3
4
5
6
7
//header.inc.php
//Add this to the top of the file
get_header();
//Keep the original html menu code starting with <div id="container">
//footer.inc.php
//Add this after the closing div tag for container </div>
get_footer();

For rest of the changes you should check the files on root folder & “include/client/” folder and edit html/css code to match your template.

You can see the live version of my integration by visiting our “support” page.

If you find this useful, please leave a comment and share using the buttons below!

CloudFlare vs. Incapsula - Benchmark Review

August 29, 2011 Tips & Tricks

As I have noted in my previous blog post, I’ve been testing out few CDN services for use with this website; CloudFlare, Incapsula & Torbit.

Currently, Torbit is in invite only beta. Josh Fraser was kind enough to provide me an access but since their system is not public yet, Torbit is not included in the benchmarks. But I have included a short review based on my recent experience. I’m planing to update this post with benchmark numbers in the future as soon as they are eligible…

How I tested

For the load time benchmarks, I have decided to use WebPageTest.org as it is free, providing actual browser results instead of simulated results and offering enough locations to see global timing. In the advanced settings, I have selected “First View Only” & 5 test runs to make sure content get in to the cache. I have repeated those test for multiple times at the different times of day to make sure server load won’t make a big difference.

Test Location
First View only>
Test runs: 5
InMotion
Business Class
East Coast
CloudFlare
Basic (Free) Account
Medium Security (Default)
Incapsula
Free Account
Trial period (All Features)
Dulles, VA – IE8 – DSL 1.624s 1.567s 1.792s
New York, NY – IE8 – DSL 1.685s 1.596s 1.675s
*Atlanta, GA – IE8 – DSL 1.853s 1.740s N/A
Chicago, IL – IE9 – DSL 3.130s 1.715s 2.032s
Kansas City, MO – IE8 – DSL 2.105s 1.730s 2.158s
San Jose, CA – IE8 – DSL 3.806s 1.704s 2.510s
San Francisco, CA – IE9 – DSL 2.620s 3.090s 2.571s
Los Angeles, CA – IE8 – DSL 2.953s 1.987s 2.150s
Montreal, Canada – IE8 – DSL 2.153s 2.003s 2.107s
São Paulo, Brasil – IE8 – DSL 3.700s 3.292s 3.773s
Dublin, Ireland – IE7 – DSL 4.185s 2.673s 2.604s
Gloucester, UK – IE7 – DSL 4.761s 3.306s 3.330s
London, UK – IE8 – DSL 3.833s 2.265s 2.038s
Paris, FR – IE8 – DSL 2.934s 1.921s 2.209s
Amsterdam, NL – IE8 – DSL 3.826s 2.967s 3.566s
Geneva, Switzerland – IE8 – DSL 3.350s 2.332s 3.239s
Frankfurt, DE – IE8 – DSL 4.536s 2.225s 3.591s
Stockholm, Sweden – IE8 – DSL 3.019s 1.903s 3.894s
**Israel – IE8 – DSL 4.446s 403 Error 2.189s
**Nairobi, Kenya – IE8 29.327s 403 Error 35.014s
Delhi, India – IE7 – DSL 8.699s 4.494s 9.532s
Bangalore, India – IE8 – DSL 10.470s 5.442s 5.825s
Hyderabad, India – IE8 – DSL 6.978s 4.787s 4.233s
Moscow, Russia – IE8 – DSL 3.447s 2.280s 3.531s
Singapore – IE8 – DSL 6.022s 4.712s 6.192s
Taipei, Taiwan – IE9 – DSL 5.045s 2.857s 4.009s
***Jiangsu, China – IE7 – DSL 3.728s 2.447s 8.083s
Seoul, Korea – IE 7 – DSL 7.080s 3.059s 7.240s
Tokyo, Japan – IE9 – DSL 4.288s 2.464s 3.803s
Sydney, AU – IE7 – DSL 8.211s 5.011s 7.412s
Wellington, NZ – IE8 – DSL 5.527s 4.072s 5.520s

Remarks

* Atlanta was not available when I did the Incapsula tests.
** CloudFlare returns 403 Error for those locations when using default (MEDIUM) security settings. Setting it to LOW solves that problem.
*** YouTube access blocked in China, so our current home page cannot fully load. Because of that I have used “Start Render” times instead of “Page Load”.

Torbit Review

http://torbit.com

Torbit works in a different way than the other two services. First of all, they do not offer any security features but purely focused on optimizing and speed.

They are offering some unique optimizations such as HTML5 “Local Storage” or “DOM Storage”. Check out the blog post by Josh or read more about Local Storage.

They have a similar DNS based setup as other two but their CDN system works in the old fashioned way. Once they have your JS, CSS & images loaded in to their cache, URL’s pointing those files will be re-written to use their domains. When the browser connection limits are low (for example, it was 2 for IE7) that is very useful as it allows more simultaneous downloads which means faster page loads. But that is not the case with newer browsers as they already have higher connection limits and using multiple domains may reduce performance (that’s my opinion) because of the extra DNS lookups.

They also have limited (since not all images and/or browsers are compatible) support for WebP images. If all the conditions are matched, it will kick in and Torbit will serve WebP versions on those images for further speed up.

Their current benchmark numbers are almost on par with others. And if your site can benefit from the unique optimizations such as using Local Storage you should check them out today!

Incapsula Review

http://www.incapsula.com

If you are primarily looking for security with the added benefit of some extra speed, you should check out Incapsula.

Their free account offers more protection than CloudFlare’s free account. Also they are offering few extra services such as uptime monitoring.

But Incapsula is a bit slower when it comes to the speed. I think that’s because of using less data centers (3 according to that post) spread across the world.

I must also not that I have signed but for their free (Personal) plan but they also have a 30 days trial. So, I had access to all features and tests were done with full acceleration.

On a side note, their setup is a bit different. Instead of a full DNS change you’ll just need to point your A & CNAME to provided locations.

CloudFlare Review

http://www.cloudflare.com

As you can see from my tests CloudFlare provided the fastest access, period. At this time, they have 12 data centers spread around the globe and that information (along with datacenter status) is publicly accessible.

They were a bit slow (but just a bit) for the UK and AU/NZ region. But I’ve been told a new DC for UK is coming very soon.

Their setup is pretty straight forward but as they take over all of your DNS, you should be careful to not to miss any entries. Their system detected pretty much everything but I had to manually setup the TXT record for Domain Keys.

I should also mention about a problem I had, somehow my IP is locked out and I was receiving “502 Bad Gateway” error following a false “Web Page Not Available” message when I try to access my sites. But at the same time, sites were fully accessible to the rest of the world. That problem lasted for a while but eventually it returned to the normal.

There are also some reports of false errors over the web (Google “cloudflare 502”) but don’t forget CF is currently in beta.

Another thing to consider is the pages that is shown to users in case of a failure or blocking. Those pages contain CloudFlare links & logo and there are some who not fond of this. You may beg to differ but for a FREE service that is OK with me. And apparently PRO account will have some control over this very soon.

For me, CloudFlare’s WordPress plugin is better than the provided by Incapsula. Both resolves actual visitors IP’s so WordPress will show it correctly. But on top of that when you mark a comment as a spam, CloudFlare posts that information back to their system to prevent further access of that offending user.

Edit: CloudFlare also supports HTML LocalStorage and other some other tricks when their new (beta) Rocket Loader feature is enabled. Thanks to Matthew Prince of CloudFlare for letting me know.

Verdict

All three services are very good. All has their strengths and weaknesses so you should pick one based on your website & your own requirements. But for Pixel Envision, my pick is:

Next Generation (CDN) Content Delivery Networks

August 27, 2011 Tips & Tricks

While working to get our site ready for our first product, I’ve been looking for options to speed it up globally without spending a dime, if possible. My first tough was using a regular CDN, but then I realize there is a new & better (in my opinion) way to do it…

You may ask, why?

  • Website performance & security at the same time. Your content hosted on could network while getting protected from malicious attacks.
  • Simple configuration, they don’t require you to change a thing on your server. Most (if not all) configured by DNS.
  • Better SEO than regular CDN networks, no URL rewrites required to serve page assets. All your images stays on your master domain, not on another CDN domain or subdomain of yours.

For the last few days I’ve been testing & benchmarking. So, my next blog entry will be a review on those services.

  • CloudFlare
  • Incapsula
  • Torbit

For the record, there are other similar services but I left them out, because they were either too expensive for my needs or simply not available to test.

  • Google Page Speed Service (Access Requested)
  • Yottaa (Access Requested)
  • Cotendo Cloudlet
  • Strangeloop
  • Blaze

Realtime lip-sync code snippet for Flash using AS3

August 17, 2011 Flash, Programming, Tips & Tricks

One of the flash projects I have been working on has required a lip sync talking. Dialogues were dynamic so frame by frame matching was out of the question. So, I ended up with the following action script 3 code which I’m sharing with you here…

It processes the input sound in real time, which returns the different values based on the sound volume and also outputs the sound itself.

You can use those values to match up mouth animation frames as provided in the sample. But you may also simulate the effect using a single mouth image and scaling it based on the values returned by the function…

Usage

  • FLA project is compatible with Flash CS4, contains sample speech & mouth animation images.
  • speech() is the the sound file linked from the library.
  • mouth is the animation clip that contains mouth drawings.

Downloads

  • Sample SWF file for preview.
  • Download FLA project

License

This code is free to use, distribute, modify and study. Mouth animation and the images provided in the sample FLA is NOT free to use in anyway. When referencing please link back to this website / post in any way e.g. direct link, credits etc. If you find this useful, please leave a comment and share using the buttons below!

ActionScript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
- Copyright 2011 Pixel Envision (E.Gonenc)
- http://www.pixelenvision.com/
- support@pixelenvision.com
*/
 
var left: Number;
 
function processSound(event: SampleDataEvent): void {
  var bytes: ByteArray = new ByteArray();
  playerObject.sourceSnd.extract(bytes, 4096);
  bytes.position = 0;
  while (bytes.bytesAvailable & gt; 0) {
    left = bytes.readFloat() * 128;
    if (left & lt; 0) {
      left = -left;
    }
    var scale: Number = left * 2;
  }
  event.data.writeBytes(bytes);
 
  //Define mouth animation here
  if (scale & lt; 1) {
    mouth.gotoAndStop(1);
  } else if (scale & lt; 10) {
    mouth.gotoAndStop(2);
  } else if (scale & lt; 25) {
    mouth.gotoAndStop(3);
  } else if (scale & lt; 50) {
    mouth.gotoAndStop(4);
  } else {
    mouth.gotoAndStop(5);
  }
  //Define mouth animation here
 
  trace(scale);
}
 
var playerObject: Object = new Object();
playerObject.sourceSnd = new speech();
playerObject.outputSnd = new Sound();
playerObject.outputSnd.addEventListener(SampleDataEvent.SAMPLE_DATA, processSound);
playerObject.outputSnd.play();
stop();

«12
  • Tags

    3ds Max Coming Soon CoronaSDK Featured Flash Lua MAXScript PHP Programming Reviews Tips & Tricks Unity 3D Windows Phone
  • Recent Comments

    • Yogesh Singh on ZIP (POSTAL) Code Validation Regex & PHP code for 12 Countries
    • Admin on Maxscript – Vray Cubemap Generator for Unity
    • charlie on Maxscript – Vray Cubemap Generator for Unity
    • Mastan on PHP Currency Converter
    • Rakesh Vishnoi on ZIP (POSTAL) Code Validation Regex & PHP code for 12 Countries
    • Find us on

      amazonandroidapplefacebooklinkedintwitterwindowsyoutube
    • Company Information

      Lytchett House, 13 Freeland Park, Wareham Road, Poole, Dorset, BH16 6FA

      Pixel Envision Limited is a company registered in England, company number: 09558675. Registered Office: Preston Park House, South Road, Brighton, East Sussex, BN1 6SB, United Kingdom

    • Privacy Policy
    Copyright © 2011-2021 Pixel Envision Ltd, all rights reserved.