Array Experiments. Screen sharing.

Discuss game development design and post your game ideas

Post » Tue Aug 18, 2015 11:23 am

I had an idea for using arrays to make custom screen sharing test using construct 2.

Would it be possible to fill a 640x480 array with RGB values? (RGB values for every point on screen) every 0.05 seconds?

For optimization purposes you probably only have to write to the array for those pixels that actually change, or even better the change is bigger than a certain value from what it was before.

For example: If one of the pixels on your screen change from White to black, you only write to the array for those coordinates. You take the RGB values of the Array coordinates that changed and send it AsJSON using multiplayer plugin or Photon Cloud? The reciever updates the array on their end. for those pixels that changed.

Is it possible to Compress the Data in some way internally construct 2 to use even lower bandwidth?

Any ideas, could this work?

I'm curious to try it out.
Follow my progress on Twitter
or in this thread Archer Devlog
B
35
S
15
G
17
Posts: 944
Reputation: 12,210

Post » Tue Aug 18, 2015 6:48 pm

You could, but it would be hard to get the 20fps you want.

For an initial test you could try just sending an array as json and see how it performs. Since it's all text the size of the data could vary a lot. Sending only the pixels that changed would be less data to send up to a point. Since you'd need to send color and position, you could actually need to send more data.

Getting the colors into the array is the next slow bit. Grabbing pixels is kind of slow, and the only plugin that does it somewhat is the canvas plugin. You'll want to do this in straight javascript for an acceptable speed. Same with arrays. Even looping over them in javascript is much faster than with events.

Compression is possible, but with that amount of data you'll need to use javascript instead of events.

A better solution would be to leverage html5 video streaming, but still javascript would be needed.


But you could go a simpler route, like just sending the player's input so both sides can recreate the same image.
B
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

Post » Tue Aug 18, 2015 9:59 pm

@R0J0hound Thanks! I'm not much of a coder so javascript will be a bit of a hassle for me. But the main idea would be to have another software output the stream. For example while playing Skyrim on your PC a stream of the game will be sent over wifi to your html5 app on your phone. then can use touch controls to control the game, basically play pc games on your tab or phone while on the home wifi.

I know i would probably need a server app running on the pc that handles the stream and handles the inputs from the phone.

So thats where the array idea seemed like a good start to see if i can get the one screen mirrored on another device in a simple way.
Follow my progress on Twitter
or in this thread Archer Devlog
B
35
S
15
G
17
Posts: 944
Reputation: 12,210


Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 1 guest