Breaking changes to multi-player games API

10 views
Skip to first unread message

Chris Smith

unread,
Feb 22, 2017, 1:49:26 AM2/22/17
to codeworl...@googlegroups.com
Hey everyone!  If you're one of the few people to have played with the multi-player games API, you should know that I broke your code!  To be fair, there *was* a warning that it was experimental and unstable.  (That warning is now gone).

Want to know how to fix your code?  Two steps:

1. gameOf has been renamed to collaborationOf, and unsafeGameOf has been renamed to unsafeCollaborationOf.  So you need to change the function you've used to match.
2. If you were using https://code.world/haskell and calling gameOf, you now need to add the static keyword to your drawing function.

I've also removed the unstable/experimental warning, as we're now willing to commit to the API.  The implementation will continue to be improved over time.

Fernando Alegre

unread,
Feb 22, 2017, 8:24:33 AM2/22/17
to codeworl...@googlegroups.com

So, will we be able to eventually pass arbitrary data between nodes in a collaboration, instead of just user interface events?




From: codeworl...@googlegroups.com <codeworl...@googlegroups.com> on behalf of Chris Smith <cds...@gmail.com>
Sent: Wednesday, February 22, 2017 12:49:25 AM
To: codeworl...@googlegroups.com
Subject: Breaking changes to multi-player games API
 
--
You received this message because you are subscribed to the Google Groups "codeworld-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codeworld-disc...@googlegroups.com.
To post to this group, send email to codeworl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codeworld-discuss/CAPq5PvKnrJkUVM%3DgLFO5X-SGPyCCL5QkzT-1H9foeP3FT4R6bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Chris Smith

unread,
Feb 22, 2017, 11:44:08 AM2/22/17
to codeworl...@googlegroups.com
That isn't the goal for this API.  The point of this API is that you don't deal with message passing at all.  You just define your global state, step functions, and event handler functions, and it all just works.  You should be able to *simulate* a message passing system, but including a list of pending messages in your state.  But something much more complex would be going on at the physical network level.

I think you're referring to https://github.com/google/codeworld/issues/383  That would be a different -- and much more complex -- entry point.

(To make matters confusing, we had a miscommunication in an earlier email thread, so the "collaborationOf" name is used in the issue there.  That isn't what I intended.  I'll edit the issue to suggest a different name, like "communicationOf", instead, for that API.)

On Wed, Feb 22, 2017 at 5:24 AM, Fernando Alegre <FAl...@ebrschools.org> wrote:

So, will we be able to eventually pass arbitrary data between nodes in a collaboration, instead of just user interface events?





Sent: Wednesday, February 22, 2017 12:49:25 AM

Subject: Breaking changes to multi-player games API
Hey everyone!  If you're one of the few people to have played with the multi-player games API, you should know that I broke your code!  To be fair, there *was* a warning that it was experimental and unstable.  (That warning is now gone).

Want to know how to fix your code?  Two steps:

1. gameOf has been renamed to collaborationOf, and unsafeGameOf has been renamed to unsafeCollaborationOf.  So you need to change the function you've used to match.
2. If you were using https://code.world/haskell and calling gameOf, you now need to add the static keyword to your drawing function.

I've also removed the unstable/experimental warning, as we're now willing to commit to the API.  The implementation will continue to be improved over time.

--
You received this message because you are subscribed to the Google Groups "codeworld-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codeworld-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to codeworld-discuss@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "codeworld-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codeworld-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to codeworld-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codeworld-discuss/BN6PR10MB1250AD2D2F0A56B9D0D0A02FC2500%40BN6PR10MB1250.namprd10.prod.outlook.com.
Reply all
Reply to author
Forward
0 new messages