Jump to content

  • Log In with Google      Sign In   
  • Create Account

hplus0603

Member Since 03 Jun 2003
Online Last Active Today, 07:37 PM

#5185593 OpenSSL tutorials?

Posted by hplus0603 on 07 October 2014 - 12:55 PM

Also, there's a few blog posts from people trying to do this, and swearing at the terrible and inconsistent design of the API.
Reading through it, I would tend to agree.
If you can use a higher-level library like libcurl, that's probably better for you.


#5185415 MMORPG separated servers (world, login) and the client to it

Posted by hplus0603 on 06 October 2014 - 06:23 PM

I still don't understand what the problem is.

The simplest, and most robust, way to spin up instances of maps is to have a mapping, server-side, of instance-id to ip-address:port, and give this out to each player that wants to join that instance. If you have the CPU/RAM, you could have thousands of instances on a physical host, and thus have thousands of ports active on that host.

A perhaps slightly more efficient variant, if your application is perfect in threading and memory management, is to spin up a single game server, and have that load each map static data once, and create a separate "game world instance" per instance with dynamic data. That will save some RAM (through static map and code sharing,) but is significantly more complex.

In this second case, you would have to give some token to each user, which would identify the instance ID when the user connects back to the server.

The simplicity of option 1) is super great -- if a server process crashes, all other instances stay up. If you need more servers, just add more possible IP addresses that the instance could be hosted on. This also scales easily to cloud hosted solution.


#5185206 MMORPG separated servers (world, login) and the client to it

Posted by hplus0603 on 05 October 2014 - 07:01 PM

I think, because i cannot open a port each time I add a new map. I want to make separate " servers" for dungeons as well and I cannot open as much port as I have to.


Why not? Will you have more than 16,000 instances of maps/dungeons on a single server?


#5185135 MMORPG separated servers (world, login) and the client to it

Posted by hplus0603 on 05 October 2014 - 10:08 AM

The problem is, if i have 10-20 maps, I will have to open 10-20 +1 port on the server computer.


Why is this a problem?


#5185055 MMORPG separated servers (world, login) and the client to it

Posted by hplus0603 on 04 October 2014 - 09:10 PM

The right answer depends on how you intend to build your world.

If your world will be made up of multiple, separate shards (areas, instances, levels, ...) then it makes sense to have the login server tell the client "your character's current area is available at foo.bar.com:12343" and have the client make a world connection to that address.

If your world view is a single, large, seamless world, then perhaps you're better off creating a "gateway" server which handles all the connections to clients -- spin up as many of these as you need, and load balance with HAProxy or an F5 or whatever. The gateway server would then make/break connections to the different world and login and whatever-else servers, and funnel requests from all its clients across each of those connections.

In general, though, the best you can do is to make sure that you're well defined in what your protocols look like. What kinds of data does the client send, and when, and what kinds of data does each server send, and when? The more you can make this "stateless" (as in "I just stream out information X on interval Y") rather than "RPC" (node X sends a request and then waits for node Y to send a response) the better your system will likely perform in reality.


#5184814 Why do i get lag?

Posted by hplus0603 on 03 October 2014 - 01:25 PM

I think Raknet uses UDP, and thus doesn't need TCP_NODELAY. I missed the mention of raknet in the initial question.

Does Raknet do packet scheduling? Does it actually send packets at the same frequency as your simulation time steps?

In general, you should assume that full round-trip time will be bigger than your time step, and schedule all commands for some future tick, rather than requiring each client to get the data to you each time you take a step.


#5184418 Why do i get lag?

Posted by hplus0603 on 01 October 2014 - 03:22 PM

In typical lockstep simulations, you will send commands for X steps into the future. This means that the commands will actually be queued, and take effect later.

If you are using TCP, are you turning on TCP_NODELAY on your sockets?


#5183770 rate/hate/appreciate my mog server update model

Posted by hplus0603 on 29 September 2014 - 09:33 AM

I was asking for input on the whole [everything is-a record has-a record_session updates-a session] programming model.


That's one way of expressing the data-flow plumbing. I'm sure it can be made to work fine.

I find that what ends up being interesting in networked games is not the plumbing (important as it might be) but instead the game rules and how they collaborate with UI/display to give a particular "feel" to the game.


#5181270 What can be scripted and what should not in a server?

Posted by hplus0603 on 18 September 2014 - 09:04 AM

That depends entirely on your specific needs.

If you're trying to get thousands of players interacting on a single piece of server hardware with advanced physical interaction, being able to optimize using a profiler and staying away from GC pauses will be important.

If you're putting less than a hundred players on a single server and the main things the server does are enforcing rules on a per-skill basis and verifying/storing data, you could write the entire thing in Lua and it would run fine.

Separately, trying to debug a system that runs partially in a scripting language and partially in a native language can be challenging, because there are very few debugging systems that can "step into" across the language boundary.


#5180861 Online Board Game Framework

Posted by hplus0603 on 16 September 2014 - 05:50 PM

I think this is a fine goal.

I don't know of a good online board game framework, but there are various open source online chess programs, and other online games (such as MUDs and whatnot) that you can study.


#5180465 sqlite as db backend for mmorpg?

Posted by hplus0603 on 15 September 2014 - 09:15 AM

Not really. Anytime I've thrown real, heavy, multi-process workloads at sqlite, it's choked. It's not what it's good at.


#5179683 Question about P2P networking

Posted by hplus0603 on 11 September 2014 - 02:56 PM

Starcraft 1 worked ok with 8 players via P2P


I think your assumptions don't quite hold true.

First, in Starcraft, there is a host, so the topology is client/server.

Second, Starcraft also uses the lock-step simulation method -- similar to the "1,500 archers on a 28,800 modem" article that's linked from the FAQ. This also means that a tick rate of 5 or 10 Hz sends very little data, because only input commands are sent, and they're only sent to the host. (and then a single packet with data from all players received from the host.)

Third, Starcraft has very much latency. They are just good at hiding it. The "Yes, sir!" acknowledgement animation for each command is there to hide the latency of actually making the units move on every player's machines at the same time.


#5179668 Question about P2P networking

Posted by hplus0603 on 11 September 2014 - 01:53 PM

First, I don't think sending 60 packets per second will scale well at all. Most games send fewer packets with more data -- for example, sending 10, 12, 15, or 20 packets per second, containing 6, 5, 4, or 3 ticks' worth of player data per packet. This means that there will be more delay in receiving and playing the data on the other end; this is a necessary evil for networked gameplay.

Second, I don't think 8 player peer-to-peer mesh will work. That means each player has 7 other connections, and if you send 20 packets per second, that's sending 140 AND receiving 140 packets per second. As you may see from the Awesomenauts discussion on this board, that high a packet rate doesn't work well for peer-to-peer games on the internet.

I would recommend moving to a client-server topology. You may run the server on one of the client machines; that's fine, but sending and receiving 20 packets per second (containing a integrated update for 7 other players) is a lot less work, and is how successful games like Quake, Counter-Strike, and friends work.

I don't think multi-threading your engine will cause any significant change in latency.


#5179427 Construct 2, GM or GS for mp game?

Posted by hplus0603 on 10 September 2014 - 03:23 PM

Yes, Unity has network multiplayer support, to some extent, and it will probably work OK for 5 people (at least no worse than Game Maker :-)

I have to ask, though -- if you like and understand GameMaker, and it has network support, then why would you use some other tool, which means you'd have to learn a new tool?

Also, the Unreal Engine 4 added a new kind of gameplay control called Blueprint Scripting, which is a graph-based scripting language, which may be easier for non-programmers to use -- no C++ required. There are several example games developed entirely using blueprint scripting, and there are tutorials for how to do that in multiplayer. The biggest challenge for you would be to "dumb down" the 3D game engine to a 2D display. (There are a few sample games that use 2D, including "Tappy Chicken" and "Swing Ninja."

UE4 is also nice because you can "buy" it for $19, and use it and get updates for 29 days. Then cancel the subscription to not get billed for a second month. You can still keep using the engine (totally legit!) and just aren't getting patches/updates. If/when you ship a game that makes more than some minimum amount of money, you give Epic 5%. It is a very nice environment, used to make many different kinds of games. The main draw-back is that it doesn't work great on the lowest-end PCs or cell phones.

Also, Unreal Engine skills will translate directly to many game studios -- it's the most-licensed, most-used engine in the AAA games industry.


#5178553 The importance of packet count

Posted by hplus0603 on 06 September 2014 - 11:17 AM

Thanks for sharing!

On the sending (and receiving) machines, there are some overheads in large numbers of packets, depending on how good the drivers and hardware are. I seem to recall that you do fully-connected peer-to-peer, so number of packets will likely grown much faster than for a client/server topology.

Different networks work differently. For example, on some networks, it may be that once you "have the aether" you can send a little or a lot with approximately the same cost. I would imagine this to be more marked on WiFi networks, but it would probably be noticeable on most kinds of networks to some extent.

Did you get any commonality among the networks that have the problems you're talking about? Are they WiFi? Are they using file sharing at the same time? Are they some particular ISP or part of the world? A little more data on what you saw might make it possible to get a little more clarity on what's going on.




PARTNERS