I will use my favorite online game to help you. Tanarus
1. How are the routines and memory usage divided between the user and the game server?
You have 4 teams. 5 tanks on each. (Red, Blue, Gray, Green)
Then you have different types of tanks (Mag, Van, Cham, Lite, Dev)
Different Weapons (too many to list)
Each tank (player sitting at home) simply store only their information.
team, weapons, armor/crits, and location.
They also store the needed information about other tanks.(what team, tank, and location.)
When you are hit it goes something like this.
1.They fire and hit.
2.Packet is sent to the server then routed to you.
3.Your computer handles it from here on.
Ok. Online gaming means data stream.
2. Using packets, how are the locations of other players kept track of and displayed on the users screen in the proper location?
(this is the one that keeps me up nights)
Each player (meaning their computer) sends its information to the server. Lets say armor/crits, location/direction/speed.
The server simply routes the information to other players.
Any thing that you do that other players can see is here.
Lets say this is our data stream.
----player id, location/direction/speed, armor/crits, other stuffs---
string int x,y,z angle, int int int string
player id = Who the player is.
location = Just that. Note the three int. Remember we are in a 3D world.
direction = which way you are traveling. I think its two int which tell the horizontal and vertical angles, but I don't recall
speed = you already know.
armor/crits = nm
other stuffs = here is the fun part. This is the core of the data stream.
i.e. fire weapons, missiles, mine sweeps, etc.
Sorry but thats the programmers job.
3. Back to question one, assuming it would be impossible for one user to store information for 3000 users in memory (not to mention NPC's) how does the code determine which information to keep, and which to destroy.
It just deponds on how powerful the server is.
4. This one may be a bit more general, but how much memory would take to host three thousand users playing such a game, how much of the information gets written to hard disk compared to how much actually resides in memory, and how how are the packets sent between users so seamlessly?
owwww. After all that here is some design.
the rest just depends on what you want to be able to do inside the game.
int timeOfDay; //just to add effects
long bounty; //how much you get for killing them
long score; //How many point you have collected
cTank playersTank; //Configs on the players tank
int bays; //Spots to store weapons
array<cWeapon> weapons; //list of weapons
void draw(); //your draw method
void specialWeapons(); //places whatever weapons that
//come with the tank in the
mostly methods. there is alot more but its 4:20 a.m. and I have to go.
Hopefully you will have more questions. So just post them.
I will hit you back.
All that, I just came up with.
I love programming off the top of my head.
But thats how I would design it.