Author Topic: Which Client/Server Model?  (Read 4870 times)

0 Members and 1 Guest are viewing this topic.

Offline Mickey Kudlo

Which Client/Server Model?
« on: April 16, 2012, 11:17:43 pm »
V1/V2/V3 all use the seperate client/server model and I never really gave out the server.exe.
I would like to make it single player as well, for tablet and such, so no network is needed.
That means, the program has both client and server code. Would be easier/faster to code I think.
People would be able to run their own private worlds and possibly add content (not sure how that would happen yet).
It also opens it up to easier hacking but don't think it will be too easy.
Maybe even being able to move your player around from world to world (big hacking issue!!) unless players always stored on a website, well, players that jump around.
You may have conquered my worlds, but I destroyed them!

Offline Zachariel

  • Full Member
  • ***
  • Posts: 189
  • Attack: 89
    Defense: 88
    Attack Member
  • Karma: -10
  • Gender: Male
    • View Profile

  • Total Badges: 17
    Badges: (View All)
    Windows User Topic Starter Combination
Re: Which Client/Server Model?
« Reply #1 on: April 17, 2012, 12:29:59 am »
I woke up 3 am tonight and laid awake, restless and unable to fall asleep, because I was thinking about how
the client/server model should work. I come back online at 8 am and lo, behold, Mickey asks which
client/server model we should use.

I got just the thing for you:

I envisioned an unified client/server executable, like you, but it does not quite work as you imagined it.
Current online 3D games make the server calculate some or all parts of the physics and other data,
so the player could not noclip through walls, wallhack and perform live injection or replay with
packet editors to go into godmode or give themselves millions of dollars.

Currently, the servers are being the slave workhorses, while the clients are the consumers and
only render and calculate what the main server tells them to. This causes linear increase in server
costs with every additional player.

But we can't allow clients to calculate their physics and data, because someone will sooner or later
hack it and fair multiplay would become impossible.

So I thought... what if... clients would calculate physics, BUT, someone ELSEs' physics.

Imagine this:
Client connects to central server and beings playing.
After some time, when the server has performed as a traditional server and integrated the user
into the game and verified that the client is doing correct physics calculation,
the server randomly chooses 3 (or more) clients and tells them about the newly joined client.

The server forwards all physics and environment related data to the 3 clients and then tells the newly
joined client the IP addresses of the 3 other clients. At this point, when the newly joined client does
something in the game which requires physics, it first tells the other 3 clients what it is going to do, then
it calculates the effect on its own computer. By now, the info has reached the 3 clients, who separately
calculate, based on the new players position, environment, and his actions, (as received from the main server)
what the result will be. After the new player has calculated the result of its actions, he sends the result to
the 3 clients and the main server, at which point the 3 clients verify that the new client performed the calculation truthfully.
Then, the 3 clients (who don't know about eachother) send the results of their calculations to the central computer,
who decides by majority vote the correct result of the action done by the new player.

Note: all other calculation, such as login/off, inventory content, who is visible to whom
(to prevent wallhack), etc. is performed by the main server.

This is an amazing system, since it relieves the central server from performing direct physics calculation for some players,
shifting the burden to the clients, while still verifying all the physics and being continuously informed of all the
actions taking place in the game.
This should, in theory, allow amazing scalability to massive scales while keeping the server costs as low
as possible AND eliminating any possible noclip packet injection hack.

The server should be able to detect players using modified clients, who try to hack physics, and ban them.

Since all connections begin with the main server, there is no way to hack the game even if all the players
use malicious modified clients, since any discrepancy will (and should) result in an immediate permaban.
EDIT: ...since any discrepancy with the physics algorithms harÐcoded in the server code will...

EDIT:
The server should begin shifting physics calculation to other clients, when the amount of connected players
reaches over a certain threshold.
Also, the server should continue to exclusively calculate the physics of randomly chosen players to detect malicious clients.
If a malicious client does physics while a server-controlled client is in the same room with the malicious user,
they both have to send the resulting state of physics object X to the server.
If the discrepancy is insignificant, the server tells the non-controlled client the correct location of the object
as it calculated it for the controlled client. If the discrepancy is huge, the server bans the non-controlled client AND
any or all of the 3 verifying clients whose result matched with the malicious user result.

Since all non server-controlled client physics are calculated by other clients, meaning that everyone is connected one
way or the other with everyone else, this should cause a chain banning for all malicious users, since,
when the server begins to doubt the calculations of a player and at some point it decided the actions done by that player
to be correct based on the results calculated by the verifying clients, the server beings to also doubt the verifiers and
the verifiers of verifiers. This leads to taking command of physics calculations for the suspicious clients one-by-one and banning
all the clients participating in the hack.

Also, since all the clients basically contain the server code, any client can set up a personal server and act as a main host,
which overviews all data and forwards it between participants. Note: all players joining the official servers should always run in
"client" mode. If they were allowed to run in server mode, you could as well hand over all other users personal data on a silver platter.


EDIT 2:
When I played Face of Mankind and 10 players turned simultaneously their flashlights on while in the same room,
massive lag was caused, because their client/server model makes each player calculate all other player lightray
physics (or they have just poop coding) who are in the vicinity.
The model I proposed should eliminate this issue, since the main server knows all object and lightmap data and just
forwards the rendering info to relevant clients, who are in each others proximity, while allowing the physics calculations
to spread out to clients who might be idling or in a complete different place is the game, reducing overall load and lag.

EDIT 3:
Also, all lightmap calculations should be simple additive algorithms. I'll create a separate topic about it if Mickey approves,
since i'd like to throw in other physics engine ideas and it might be a long post.
This one has already exceeded any limit above which people are capable of retaining any interest in reading it.
Congratulations if you made it to this end!

Until I append EDIT 4 here...

EDIT 4:
This was all said assuming that you plan to make RPGWO in 3D...
If 2D, then commercial success will become more questionable and the action verification
done by clients becomes a lot more simplified and less resource hungry.

(I prefer 3D, its all the rage the past 10 years or so...)

EDIT 5:
ALTHOUGH, Angry Birds is a huge success, but that is a short-term entertainment side-scroller.
« Last Edit: April 17, 2012, 09:55:37 am by Zachariel »

Offline Greatest

  • Hero Member
  • *****
  • Posts: 1330
  • Attack: 161
    Defense: 91
    Attack Member
  • Karma: 9
  • Gender: Male
  • I'm better than you!
    • View Profile

  • Total Badges: 38
    Badges: (View All)
    Linux User Mobile User Tenth year Anniversary
Re: Which Client/Server Model?
« Reply #2 on: April 17, 2012, 10:31:57 am »
theres no real way around it, you'll need a seperate client/server.  I don't know why anyone would want to play rpgwo solo, so there shouldn't be any problems with that, but running server and client(V1) works fine if they do. 

@Zach thats just craziness!  I didn't read your entire post, but you would have to get controls sent from 1 pc to the server, then send those to a 2nd pc, then wait for them to be sent back to the server...that means big time lag.  say you're standing around in a pk zone and someone comes up and attacks you, do you really want to stand there and wait 2-3 seconds taking damage before you can hit them back?
why does Fox keep cancelling good shows?

Offline Mickey Kudlo

Re: Which Client/Server Model?
« Reply #3 on: April 17, 2012, 11:51:21 am »
I am not using Unity because it DOES cost $$$ for android and iOS. One of my goals is to get the game on ghey tablets.

The idea of spreading verification of client actions to other client(s) is interesting but still has holes in it. The idea of a server is having trusted code do the verifies and data modifications. If you use a client to verify anything, you can never really trust the results. But there is some things you can have the client do to help the server.

My want of a single player mode, is a disconnected machine runnning the code. I would like to allow it. Plus it opens up some features just for single players, I think.

You may have conquered my worlds, but I destroyed them!

Offline Zachariel

  • Full Member
  • ***
  • Posts: 189
  • Attack: 89
    Defense: 88
    Attack Member
  • Karma: -10
  • Gender: Male
    • View Profile

  • Total Badges: 17
    Badges: (View All)
    Windows User Topic Starter Combination
Re: Which Client/Server Model?
« Reply #4 on: April 17, 2012, 12:03:40 pm »
@Zach thats just craziness!  I didn't read your entire post, but you would have to get controls sent from 1 pc to the server,
then send those to a 2nd pc, then wait for them to be sent back to the server...that means big time lag.  
say you're standing around in a pk zone and someone comes up and attacks you, do you really want to stand there and
wait 2-3 seconds taking damage before you can hit them back?
Checks don't have to be performed for all physics calculations. Say, there is 1 check for 100 calculations.
And it does not have to be time-critical.
A client can go through with calculating its physics and displaying them immediately,
but the results for some previous calculations are sent to the server,
who can determine if the client is being truthful even 2-3 seconds later than the actual event took place.

@ Mickey:
Three bottles of rum on the dead mans' chest; yo ho ho and a bottle of rum...

EDIT:
Single player is a good idea, but there should be a captivating storyline.
Minecraft single player is quite frankly, boring, unless you plan to experiment
with redwire circuits. Even they implemented some sort of storyline in the end.
« Last Edit: April 17, 2012, 12:06:21 pm by Zachariel »

Offline Naed

Re: Which Client/Server Model?
« Reply #5 on: April 17, 2012, 04:23:22 pm »
Client and Server Model.

Solo nobody cares if a player cheats, solo characters and worlds cannot be converted to a server world unless the owner of the server permits it. The trust level on a server is based on who runs the server and modern players are well aware of this fact.

Perhaps if we have an open server for people to run their own servers and then a closed server to play on in a regulated manner, where cheating of any sort is impossible, and so is modification. Kinda like Phobos vs other Servers, though there was always some level of corruption. The Phobos type servers might be pay to play for hardcore players? I personally likely the pay to own land schema because it prevents someone from making 50 accounts and being silly with them and corruption worlds.

Minecraft is dyeing because of the massive segregation of players across servers, there is no real community. RPGWO community was always close knit and competitive.

I'm all for allowing players to sandbox, but it does remove a lot of community involvement that would otherwise be forced.

Offline Mickey Kudlo

Re: Which Client/Server Model?
« Reply #6 on: April 17, 2012, 06:22:06 pm »
@Naed: I see your point with people playing their single player world more than the multi-player worlds but I don't think it will be significant. In Minecraft, others can come around and screw up what you built since no land ownership, but not so for RPGWO. But with that logic in mind, I should never release the server though which I don't want to go that route this time.
Still thinkning about it.
You may have conquered my worlds, but I destroyed them!

Offline Naed

Re: Which Client/Server Model?
« Reply #7 on: April 17, 2012, 06:48:55 pm »
A note on land ownership, there should probably be a neutral area for land plots, say 5 units where the land is not build-able but it is still loot-able, and claiming adjacent lots give the owner the bonus space in between. Just a thought, was always issue with breaking into homes.

Offline Greatest

  • Hero Member
  • *****
  • Posts: 1330
  • Attack: 161
    Defense: 91
    Attack Member
  • Karma: 9
  • Gender: Male
  • I'm better than you!
    • View Profile

  • Total Badges: 38
    Badges: (View All)
    Linux User Mobile User Tenth year Anniversary
Re: Which Client/Server Model?
« Reply #8 on: April 17, 2012, 07:52:05 pm »
A note on land ownership, there should probably be a neutral area for land plots, say 5 units where the land is not build-able but it is still loot-able, and claiming adjacent lots give the owner the bonus space in between. Just a thought, was always issue with breaking into homes.
that would suck...
1 plot of 20X20 taking 5 spaces off each side where you can't build = 10X10, 1/4 of a plot, with 25 types of plants, growing each in a row of 5, thats not even enough room to farm
2 plots of 20X20 taking 5 off each side where you can't build = 30X10, 3/4 of a plot, barely enough to farm

the easiest/best way to get around the problem you're talking about is to make bumping into houses impossible.  I'm not sure, but I think it was fixed in the last V1 update, and doesn't work at all in V2...so your problem isn't a problem
why does Fox keep cancelling good shows?

Offline Mickey Kudlo

Re: Which Client/Server Model?
« Reply #9 on: April 17, 2012, 10:04:30 pm »
I believe I have decided to do a seperate client and server but release the server with the client as we go. That way, people can still play on their own if/when they want/need on whatever platform.
You may have conquered my worlds, but I destroyed them!

Offline @@Admin Nash

Re: Which Client/Server Model?
« Reply #10 on: April 17, 2012, 11:12:11 pm »
Note to Zach: editing a post 500 times makes the topic hard to read...

Good choice Mick

Offline Zachariel

  • Full Member
  • ***
  • Posts: 189
  • Attack: 89
    Defense: 88
    Attack Member
  • Karma: -10
  • Gender: Male
    • View Profile

  • Total Badges: 17
    Badges: (View All)
    Windows User Topic Starter Combination
Re: Which Client/Server Model?
« Reply #11 on: April 18, 2012, 12:32:55 am »
And I thought I was doing a favor by not triple posting...

I guess my idea sounded so scary that Mickey decided to fall back to separate client/server model.

At least I think I helped to reach a decision... sort of...
(attempting to feel useful)

Offline Jon The Great

Re: Which Client/Server Model?
« Reply #12 on: April 18, 2012, 12:41:39 am »
Client/Server is safer

Would like to see if possible having multiple servers hosting a single world so we can go beyond having a couple hundred people online at a time in the world.

Offline Zachariel

  • Full Member
  • ***
  • Posts: 189
  • Attack: 89
    Defense: 88
    Attack Member
  • Karma: -10
  • Gender: Male
    • View Profile

  • Total Badges: 17
    Badges: (View All)
    Windows User Topic Starter Combination
Re: Which Client/Server Model?
« Reply #13 on: April 18, 2012, 12:47:03 am »
Well, it is possible, if the physical servers are not too far apart from each other, preferably in the same rack
and with gigabit ethernet cards.
Perhaps it would be better to dedicate one server machine as a data storage and multiple aux servers as the
environment managers, which fetch data from the storage server, calculate state of the world and forward
the results to the players.
Since there are only so many cycles a CPU can perform per second, using one to store and forward data and
others to get/put and process data, it should be possible to manage hundreds of connected players simultaneously.
« Last Edit: April 18, 2012, 12:50:55 am by Zachariel »

Offline Miner 49er

  • Sr. Member
  • ****
  • Posts: 301
  • Attack: 2852
    Defense: 2961
    Attack Member
  • Karma: 13
  • Gender: Male
    • View Profile

  • Total Badges: 35
    Badges: (View All)
    10 Poll Votes Tenth year Anniversary Karma Bad
Re: Which Client/Server Model?
« Reply #14 on: April 18, 2012, 01:08:22 am »
Client/Server is safer

Would like to see if possible having multiple servers hosting a single world so we can go beyond having a couple hundred people online at a time in the world.

Well, I'm sure that is not too tough to do, although, depending on how many people you are truly aiming for, it might not be needed.

If you use Haven and Hearth as an example (http://www.havenandhearth.com/portal/)

Their server is a single threaded C application, which handles up to 1500 players. (which I believe is the maximum amount of players they had online before)
 
As far as I'm aware, the only lag issues they had was due to their file system causing IO lag.

Offline Pokemon Steve

Re: Which Client/Server Model?
« Reply #15 on: April 18, 2012, 10:57:21 am »
I think this discussion should be moved to and IRC channel. I would be more inclined to participate if it were.

Offline Jon The Great

Re: Which Client/Server Model?
« Reply #16 on: April 18, 2012, 10:59:59 am »
Who still uses IRC though and you need another client and there is no log/topics to keep track of. You would have to be there all the time or logged in all the time.
IRC is good for meetings/real time communication but discussions need an area to refer back and forth

Offline Pokemon Steve

Re: Which Client/Server Model?
« Reply #17 on: April 18, 2012, 11:03:38 am »
I'll make a bot to take care of that, and graph activity using Google visualization api so people can find most active times and read the logs during that time.

Offline Pokemon Steve

Re: Which Client/Server Model?
« Reply #18 on: April 18, 2012, 11:04:23 am »
Everyone who is anybody uses IRC still. Kids use forums.

Offline Miner 49er

  • Sr. Member
  • ****
  • Posts: 301
  • Attack: 2852
    Defense: 2961
    Attack Member
  • Karma: 13
  • Gender: Male
    • View Profile

  • Total Badges: 35
    Badges: (View All)
    10 Poll Votes Tenth year Anniversary Karma Bad
Re: Which Client/Server Model?
« Reply #19 on: April 18, 2012, 11:11:14 am »
Plenty of people still use IRC (including me). I probably wouldn't use it for this though.

 

Related Topics

  Subject / Started by Replies Last post
CLient

Started by magem « 1 2 » RPGWO Chat

29 Replies
4418 Views
Last post May 22, 2007, 11:02:34 am
by The Muffin Man
5 Replies
3658 Views
Last post April 01, 2008, 09:48:28 pm
by Mezmeer
21 Replies
3050 Views
Last post July 30, 2008, 10:35:41 pm
by Mack the Blacksmith
1 Replies
1999 Views
Last post October 18, 2010, 05:11:29 pm
by Kalose
6 Replies
1753 Views
Last post May 15, 2015, 08:20:06 pm
by uderghad