Author Topic: Unlimited number of networked displays API - for M4 and other connected devices  (Read 459 times)

0 Members and 1 Guest are viewing this topic.

Offline zhulien

  • 464 Plus
  • *****
  • Posts: 459
  • Country: au
    • 8bitology
  • Liked: 182
  • Likes Given: 128
Hi Everyone,


NOTE: it is in POC mode at the moment, but I will release it live over the next week...

I have created the first working version of my networked display API.  There is very little left to do to make it useful, then it can only get more useful from then as I add further commands to the API.


What is it?


Imagine you have all these old devices laying around your place, some useless old phones, tablets, smart TVs, PS3s, Wiis, PCs etc... or you just want some extra screen real-estate... so you stick them all on your desk and wall near your CPC... or you want to display information for the World to watch... status information?  debug information? etc...


You can now do that from your CPC.  With an unlimited number of networked screens for your game or application, with CPC-style Windows support too.  And they generally update at 10 frames per second from the server - almost suitable for real-time internet games!!!


How does it work?


First setup a channel.  You need a private channel GUID (or code) that no-one else knows.  It shouldn't be told to anyone as it is what gives you permissions to update the screens and windows within your channel.  You can give your channel a unique public name though which everyone can know - of course you can even create a private channel that is not known to anyone but yourself (and set it visible later if you like, or never - don't put really private stuff in there though, as there is no HTTPS for now on CPC is there).  This private channel GUID should really be read from a central config file on your SDCard so that all your games and apps can use your channel.


Second setup a screen, or as many screens as you need.  These screens you would normally create dynamically when your game or application starts - afterall, if you have a bunch of CPCs that you all use your channel, you don't want them all writing to the same screen do you?  But you can also have as many screens for your one game or application as you like - a status screen?  a debug screen?  a 24bit graphics screen?  All updated in realtime from your CPC to the rest of the World and your other devices.


Thirdly (optionally) setup some Windows, CPC style on your screens.  These are just labelled regions of your screen which you can use relative locating and printing to...


Fourthly, do something on your screen.  Locate, Print, clear the screen... more to come...  The screens are not static, they are 100% dynamically updated over the internet as fast as your internet connection allows on your display devices - but i have capped it at 10fps for now.


Lastly...  Connect your devices!  Yep, you can go to the channel index, or directly to your own channel to see all your screens.  Alternatively you can even bookmark a specific screen if you know the code (it should be dynamic, but depends how you choose to use them).


Commands for the POC environment:


NOTE: All the below examples, prefix with the following:  http://8bitology.net/poc/vdu/vdu.php


newchannel:


?function=channel&cmd=newchannel&ownerguid=<your private channel guid>&channel=<your public channel name>&description=<a text description of your channel>
eg: ?function=channel&cmd=newchannel&ownerguid=ABCD&channel=batman&description=I%20really%20am%20Batman


newscreen:



?function=screen&cmd=newscreen&owner=<your private channel guid>&ownerguid=<your private screen GUID>&publicguid=<your public screen guid>
eg: ?function=screen&cmd=newscreen&owner=ABCD&ownerguid=XYZ&publicguid=batmask


newwindow:



?function=window&cmd=newwindow&screen=<your private screen guid>&window=<your windowcode>&x=<x position>&y=<y position>&w=<width>&h=<height>
eg: ?function=window&cmd=newwindow&screen=XYZ&window=1&x=1&y=10&w=40&h=5


locate:


?function=window&cmd=locate&screen=<your private screen guid>&window=<your windowcode>&x=<x position>&y=<y position>
eg: ?function=window&cmd=locate&screen=XYZ&window=1&x=15&y=1


print:


?function=window&cmd=print&screen=<your private screen guid>&window=<your windowcode>&text=<the text to print>
eg: ?function=window&cmd=print&screen=XYZ&window=1&text=I am Batman!


Enjoy! and feedback welcome!


Offline zhulien

  • 464 Plus
  • *****
  • Posts: 459
  • Country: au
    • 8bitology
  • Liked: 182
  • Likes Given: 128
Channel Index:  http://8bitology.net/poc/vdu/


Internet Call Demo: http://8bitology.net/poc/framework/itpdemo.htm


Sprite Demo: http://8bitology.net/poc/framework/spritedemo.htm (yep, I have coded sprites too but not yet collision detection).  These sprites will soon be in the networked display and more.


Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.456
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3084
  • Likes Given: 5678
Head spinning. Must digest.

Offline menegator

  • CPC464
  • **
  • Posts: 23
  • Country: gr
    • index.php?action=treasury
  • Liked: 13
  • Likes Given: 282
What?...  how... what???  :o
« Last Edit: 22:16, 24 January 20 by menegator »

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.456
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3084
  • Likes Given: 5678
Having re-read it a few times, I'm still not sure what this does, even though it sounds impressive...

Offline zhulien

  • 464 Plus
  • *****
  • Posts: 459
  • Country: au
    • 8bitology
  • Liked: 182
  • Likes Given: 128
That's ok.  I believe only the PS4 has the ability to do similar but unfortunately only a few games support it. (search for PS4 Second Screen in the Google Play Store).  Just I am using HTML & Canvas and allow unlimited screens, they use a proprietary method and allow 1 additional screen only.

Think of it giving your CPC the ability to have multiple displays - by utilizing browser technology.  The CPC tells the server what to display, the browsers on however many devices looking at the screen update automatically (they can be yourself or an audience).  This gives your newly created CPC software (or patched existing software) the ability to use those extra screens.


At this moment, I only allow cls, window, locate and print in a Mode 1 resolution.  It was a Proof Of Concept (POC), and it is Successful!  With my internet connection, I can actually get 10 frames per second using my PC browser or my Phone Browsers.  I have capped it at 10 though as an experiment for now.


With text only you can put status information, debug information etc.  But I will introduce graphics and other things very soon - I have already created the sprite engine (demo'd above).  Now I am working on a POC for server-side processes - this is to allow the possibility of multi-player games with Non-Player Characters if the POC is successful.  I know I can create my own home-based server, but I need it to work with existing hosting companies to make it useful.


I will post some BASIC examples on here soon - but above is actually all the info you need to get started.
« Last Edit: 11:48, 27 January 20 by zhulien »

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.456
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3084
  • Likes Given: 5678
Great, can't wait to see the examples :)

Offline zhulien

  • 464 Plus
  • *****
  • Posts: 459
  • Country: au
    • 8bitology
  • Liked: 182
  • Likes Given: 128
optional &tag=<tag> can now be added to all window functions.


What this allows is eg: you setup a display, you can simply update a tagged function in-place with a single call instead of having to re-create the display.


Some uses:


You can put a score somewhere with print given a tag of score (?function=window&cmd=print&screen=XYZ&window=1&tag=score&text=0).  You can then just update the score by issuing a replacement command for that specific tag (?function=window&cmd=print&screen=XYZ&window=1&tag=score&text=100).



You can put something somewhere on the screen and locate with a tag such as position (?function=window&cmd=locate&screen=XYZ&window=1&tag=position&x=1&y=1).  You can then just update the position by issuing a replacement command for that specific tag (?function=window&cmd=locate&screen=XYZ&window=1&tag=position&x=1&y=2).  Repeat this and it animates.