Client <-> Game Interfaces

25 views
Skip to first unread message

Kyle Unverferth

unread,
May 21, 2017, 2:55:20 PM5/21/17
to FOSS Card Games
Right now my game engine is plain Scala, and compiles to JavaScript, Scala (JVM), and Native through LLVM. The client is Scala.js, talking either to a local JS game service, or over a websocket to Scala for server games. I wrote a dumb depth-first solver, and a few other clients. All of these pieces speak the same API language, composed of the minimum amount of message types, namely the following:

Requests: "Select Card (id)", "Select Pile (id)", "Move Cards (ids, src, tgt)", "Undo", and "Redo".

Responses: "Card Hidden (id)", "Card Revealed (id)", "Cards Moved (ids, tgt)". Each response also carries a sequence of possible moves.

I bring this up because I think it would be really cool if my client could use PySolFC's (or anyone else's) games on the server. I hate making or porting solitaire games, so using the community's hard work is pretty appealing. It looks like there's already a pretty clean separation between PySolFC's UI and logic. What's the pythonic way to run a headless server, passing game messages back and forth? Would this be simple for PySolFC?

Shlomi Fish

unread,
May 21, 2017, 3:28:16 PM5/21/17
to Kyle Unverferth, FOSS Card Games
Hi Kyle!

See below for my reply,

On Sun, May 21, 2017 at 9:55 PM, Kyle Unverferth <ky...@kyleu.com> wrote:
Right now my game engine is plain Scala, and compiles to JavaScript, Scala (JVM), and Native through LLVM. The client is Scala.js, talking either to a local JS game service, or over a websocket to Scala for server games. I wrote a dumb depth-first solver, and a few other clients. All of these pieces speak the same API language, composed of the minimum amount of message types, namely the following:

Requests: "Select Card (id)", "Select Pile (id)", "Move Cards (ids, src, tgt)", "Undo", and "Redo".

Responses: "Card Hidden (id)", "Card Revealed (id)", "Cards Moved (ids, tgt)". Each response also carries a sequence of possible moves.

I bring this up because I think it would be really cool if my client could use PySolFC's (or anyone else's) games on the server. I hate making or porting solitaire games, so using the community's hard work is pretty appealing.

It is.
 
It looks like there's already a pretty clean separation between PySolFC's UI and logic.

Possibly. I'm still not intimately familiar with the code.
 
What's the pythonic way to run a headless server, passing game messages back and forth? Would this be simple for PySolFC?

Python supports:

1. Plain synchronous and async sockets.

4. There's also https://en.wikipedia.org/wiki/Pyjs for compiling python into JS and https://en.wikipedia.org/wiki/Jython for compiling to the JVM , and https://en.wikipedia.org/wiki/Cython for compiling to C (etc.)

Is there anything else you need?
 

--
You received this message because you are subscribed to the Google Groups "FOSS Card Games" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foss-card-games+unsubscribe@googlegroups.com.
To post to this group, send email to foss-card-games@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/foss-card-games/4de7816e-cf3a-45c5-a4d9-1087f1d89ff8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Shlomi Fish http://www.shlomifish.org/

You can never truly appreciate The Gilmore Girls until you've watched it in the original Klingon.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

Kyle Unverferth

unread,
May 21, 2017, 3:38:35 PM5/21/17
to FOSS Card Games
Ok, I may spend some time trying to get a "headless" PySolFC running. Have you been able to get it running on OSX? I'm testing it in a Linux VM.


On Sunday, May 21, 2017 at 1:28:16 PM UTC-6, Shlomi Fish wrote:
Hi Kyle!

See below for my reply,
On Sun, May 21, 2017 at 9:55 PM, Kyle Unverferth <ky...@kyleu.com> wrote:
Right now my game engine is plain Scala, and compiles to JavaScript, Scala (JVM), and Native through LLVM. The client is Scala.js, talking either to a local JS game service, or over a websocket to Scala for server games. I wrote a dumb depth-first solver, and a few other clients. All of these pieces speak the same API language, composed of the minimum amount of message types, namely the following:

Requests: "Select Card (id)", "Select Pile (id)", "Move Cards (ids, src, tgt)", "Undo", and "Redo".

Responses: "Card Hidden (id)", "Card Revealed (id)", "Cards Moved (ids, tgt)". Each response also carries a sequence of possible moves.

I bring this up because I think it would be really cool if my client could use PySolFC's (or anyone else's) games on the server. I hate making or porting solitaire games, so using the community's hard work is pretty appealing.

It is.
 
It looks like there's already a pretty clean separation between PySolFC's UI and logic.

Possibly. I'm still not intimately familiar with the code.
 
What's the pythonic way to run a headless server, passing game messages back and forth? Would this be simple for PySolFC?

Python supports:

1. Plain synchronous and async sockets.

4. There's also https://en.wikipedia.org/wiki/Pyjs for compiling python into JS and https://en.wikipedia.org/wiki/Jython for compiling to the JVM , and https://en.wikipedia.org/wiki/Cython for compiling to C (etc.)

Is there anything else you need?
 

--
You received this message because you are subscribed to the Google Groups "FOSS Card Games" group.
To unsubscribe from this group and stop receiving emails from it, send an email to foss-card-gam...@googlegroups.com.
To post to this group, send email to foss-ca...@googlegroups.com.

Shlomi Fish

unread,
May 21, 2017, 3:50:16 PM5/21/17
to Kyle Unverferth, FOSS Card Games
Hi Kyle!


On Sun, May 21, 2017 at 10:38 PM, Kyle Unverferth <ky...@kyleu.com> wrote:
Ok, I may spend some time trying to get a "headless" PySolFC running.

Cool. Note that it uses the GPLv3 licence, which is restrictive (but still FOSS). See https://en.wikipedia.org/wiki/GNU_General_Public_License and https://www.gnu.org/licenses/gpl-faq.html .
 
Have you been able to get it running on OSX? I'm testing it in a Linux VM.


I believe the latest SF.net released version of PySol FC ran fine on Mac OS X. Furthermore, my intention is that my fork should run fine on all of X11, Windows and Mac OS X - if it doesn't then it is a bug. If my PySol branch does not work for you on OS X, then feel free to fix that and send me a pull-req.

Regards,

-- Shlomi Fish
 
To unsubscribe from this group and stop receiving emails from it, send an email to foss-card-games+unsubscribe@googlegroups.com.
To post to this group, send email to foss-card-games@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/foss-card-games/f7a9dd5f-e6ed-48d9-902d-23f76b8c0d02%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages