Jump to content

Test game


rpiller
 Share

Recommended Posts

This is extremely early but I have a multiplayer game in the works. I'm wondering if anyone could test this out in chrome. When I test and bring up the console after about a few mins I get an error ERR_CONNECTION_RESET and ERR_CONNECTION_TIMED_OUT. I'm curious to see if it's my connection or if everyone gets these errors.

 

The client pushes it's position to the server 5 times a second via setInterval(). The server also pushes out movements of all clients every 5 seconds. If you open up multiple tabs you should be able to move around and see that (if you don't get this error like I do). Curious of the results others are seeing. Thanks!

 

 

http://www.your-world-game.com/

Link to comment
Share on other sites

See this is what I'm confused about. http://shootr.signalr.net/ can have a bunch of people on it. SignalR makes programming this stuff so easy so that's why I'm using it. I think there are a couple other options for this, but to start with at least I want to get something going quickly and SignalR seems to provide that.

 

Thanks for testing. Will keep updating things slowly to make a game out of this.

 

 

There are optimizations I can do with this. I send a GUID ID myself to ID the users when updating position (5 times a second), which will take up more space than a simple integer value would. SignalR claims to support thousands of connections and I guess has optimizations that can be done with it so I'll look into that as well.

Link to comment
Share on other sites

You can see the requests in the Network tab of Chrome's dev tools. There should also be a network tab in Firebug or Firefox dev tools as well.

 

When I say full request, I mean a full HTTP request. There's a lot of overhead involved in those. This is a good starting point: http://stackoverflow.com/questions/11077857/what-are-long-polling-websockets-server-sent-events-sse-and-comet

 

I'm not familiar with SignalIR, but it looks like it does use Websockets for its requests. Sorry if I jumped the gun and you're already using Websockets.

Link to comment
Share on other sites

Yeah, it looks like SignalR has a hierarchy of technologies it uses in case something isn't supported by the browser. I think I have things a little more stable now. Just need to work on the interpolation as that's giving me a rubber band effect :(

Link to comment
Share on other sites

I use layers & groups to get that. The map is made with Tiled with 3 layers. Ground, Object, Foreground. The base of the tree that is collidable is in the object layer. The top part of the tree is in the foreground layer, and between those layers I make a group where I put all actors so that they'll be drawn before the foreground layer.

 

The concept of the game is a Sims like game but you'll be able to buy "land" (tiles) and be able to plant trees, chop them down, harvest other resources, make buildings that'll aid in making other, more advanced things. The idea is to just create a world. There'll be farmers making wheat, millers milling wheat to flower, bakers using floor to make bread to eat. All of these will be ran by real people.

 

Next on my to do will be to buy tiles/land. This requires login though so I can track who owns what. Lots of work to do :)

Link to comment
Share on other sites

On the topic of websockets:

 

I chose to just go native websockets for the following reasons:

- it's a game, connection needs to be fast, so most fallbacks (like full html requests) won't be enjoyable anyway

- phaser needs a modern browser, so if the game itself runs in the browser, then there is websocket support also

 

So by using native websockets I only exclude people behind "evil" proxies or firewalls.

By using 443 as my websocket port on the server I even got it to work in some of those "evil" scenarios.

 

(Those are just my requirements, but my games are pure hobby, so the requirements for professional games are surely different.)

Link to comment
Share on other sites

I use SignalR because development is so easy. I can focus on my game functions and not the network implementation. It uses RPC with automatic hookups between javascript and C#. There are scaling out benefits that it has built -in also which is nice just in case the game catches on, but my main benefit is ease of use to get stuff up and running quickly. The negative is that it sends data via plain text json and not binary.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...