[cs383_team1] Networking Update

  • From: Mason Fabel <fabe0940@xxxxxxxxxxxxxxxxxx>
  • To: <cs383_team1@xxxxxxxxxxxxx>
  • Date: Sat, 25 Apr 2015 18:35:20 -0700

So, I got a first draft of working network code up this afternoon!

http://imgur.com/poTzeMT

This draft also contains a (very basic) implementation of the
Game/Screen menu system I was talking about. Give Main.java and
MenuScreen.java a quick read to see how it all goes together.

Here's a short summary of what's going on:

* I'm using a nice little library by the name of kryonet, which allows
calls to made to objects on a remote machine. Thus, the front end code
thinks there is a GameMananger present when it actually lives on the server.

* GameManager implements GameManagerInterface now. If you want
something, get it from GameManangerInterface. If it's not there, you
need to add it and then register classes in net/Network.java as
appropriate. Argument and return types need to be registered with the
ObjectSpace, and all other objects used in any way need to be registered
with Kryo. This won't make much sense until you read net/Network.java,
but it is so.

* Input is borked. The UI stuff seems to work (mostly), but moving
around is completely nonfunctional.

* There's only one player. All clients at the moment control the same
player.

* Fonts are screwed up, too. The menu item on the left is Host, on the
right is Join, and on the bottom is Exit. All I see is rectangles where
the characters should be. Someone who actually understands front end
code should probably rework that thing anyways.

* Lag is basically unplayable. Each client is slamming GameManager each
loop; serious effort should be made to cache results and only request
new ones when it's absolutely necessary. One update per client per frame
might work, but right now we are significantly above that.

Things to do:

* Fix input

* Implement multiple players

* Fix lag / implement result caching

As always, thoughts and suggestions are very welcome.

--
Mason Fabel

Other related posts:

  • » [cs383_team1] Networking Update - Mason Fabel