Random freezes on Windows Phone 8 Device

Discussion and feedback on Construct 2

Post » Thu May 09, 2013 3:28 pm

Thanks all *relief*

@beufreecasse I had very poor performance to begin with on my 820. If you upload the entire Windows Phone project to a remote location, then change the following in MainPage.xaml.cs:

private string MainUri = "/index.html";

to

private string MainUri = "http://[your remote location]/index.html";

and

Browser.Navigate(new Uri(MainUri, UriKind.Relative));

to

Browser.Navigate(new Uri(MainUri, UriKind.Absolute));

Test out this and see if the performance is better. If it is then there's a way to vastly improve performance.
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Fri May 10, 2013 5:02 pm

@thehen

You were right, when I load my Game from a remote location it works better.

What should I do to improve the performance without running from remote location?

Thank you
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Fri May 10, 2013 6:25 pm

@beufreecasse good to know.

Right, you're probably not going to like this, I know I didn't. You'll need to base64 encode your images as data uris into your c2runtime.js.

So this:

["images/bg-sheet0.png", 369850, 0, 0, 800, 480, 1, 0.5, 0.5,[],[],0]

Becomes this:

["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...", 369850, 0, 0, 800, 480, 1, 0.5, 0.5,[],[],0]

Here is a tool that is relatively quick at encoding.

If anyone knows how to write a build script for Visual Studio to automate this I'd love them for ever. This is a real pain.
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Fri May 10, 2013 8:11 pm

Ok thank you i will work on a tool to it automatically and replace it in the c2runtime.js.
I will share it when it's done.
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Fri May 10, 2013 8:46 pm

@thehen, Ahhhh! base64 encoding images directly into you c2runtime.js. Sounds complicated, not sure I'd know where to put anything!

@beufreecasse, if you can come up with a tool to do this automatically, you'd be a C2 Superstar!!

Good luck, I look forward to seeing the results.
B
32
S
6
G
7
Posts: 489
Reputation: 8,217

Post » Fri May 10, 2013 9:16 pm

@thehen,

I'm always interested to learn something new, and I just had a look at the c2runtime.js file. I could only find one reference that matched the example you gave above. So is this the reference to all of the projects images?

If so, does this mean you just need to run your images through the encoder as a batch, then use the base64 code or string that's created to reference them, or is there more to it than that?

Thanks.
B
32
S
6
G
7
Posts: 489
Reputation: 8,217

Post » Fri May 10, 2013 9:30 pm

@thehen,

Never mind, I was originally looking at a very simple c2runtime.js. I've now checked a larger project and there are LOADS of references. Now I understand why it's such a pain in the !!!

But essentially, I'd just need to encode each image using the tool you mentioned, then update my code with the base64 string that was produced? Is that about right?
B
32
S
6
G
7
Posts: 489
Reputation: 8,217

Post » Fri May 10, 2013 11:02 pm

@Blacksmith before doing this make sure you get performance gains from uploading to a remote location as I described before. It seems related to the number of images in a project. It would be a waste of time if there was no discernible difference between the remote and local versions.

@beufreecasse that would be great if you could!
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Sun May 12, 2013 12:47 am

@thehen

Could you please test it for me, I just finished the tool but I will not be able to test it until monday.

Let me know if you encounter issues.

Base64 Encoding Tool

Thank you
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Sun May 12, 2013 12:27 pm

@thehen, thanks for the very useful tip! It has improved the games performance. Now just have to tackle the tedious task of base64 encoding every image GROAN!!!

@beufreecasse, fantastic work on the encoding tool! Hopefully this will save a great deal of time.

Thank you!
B
32
S
6
G
7
Posts: 489
Reputation: 8,217

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: Baidu [Spider] and 13 guests