Hello guys, I am decent java coder, and I probably can write anything. There is a game I've been working on for a year and managed to create own java game engine that currently contains advanced map editor. And the game it's self (client and the server) Right now people can join and see eachother and jump together and chat. Also server sends the stats of the player like level, health etc and applies it to the client. Everything works perfectly.So, I am asking for some tips and techniques on making mob system, (I have the mob engine in the client, it has same physics as the character but with the different speed and it walks and jumps randomly and jumps if he sees that there is another platform next to it) so what should I do to make the mob online? Should I create another server specifically for mobs? Or should I add it to the main server? will it add unwanted lag? what should I do?

You know everything about programming huh? Sorry, but that's very naive to say.

No, do not add them to another server. You do know what a server is right? A program that accepts information, processes it, and then sends it to all the clients or stores it in a database or whatever it needs to do. Why would you need to add them to another server? If you have lots of clients connecting together at one time, yes you will experience some lag depending on the server you are using. Mobs should not lag the server as they should be run by the server, not the clients.

nono! I was saying that so that you could think of any way of making the mobs online. And I know what server is lol, I've wrote one. Currently it reads from the ini files and sends the info to the client saying what level is he and all the stats, except for the coordinates, client sends it's coordinates to the server and server sends those to all the players that are connected. Which is another hacking possibility that I am probably willing to fix by checking the last coordinates and the new once, and how different they are. But that will add some more delay to the server maybe... Same for the mobs, (yes I know that everything should be on the server side) if I will add mobs to the server, it will give more stuff to send to the client at the end it would be a whole book from each player to send lol, so I was thinking about creating ANOTHER server and host it on the different pc that will contain everything about the mobs, so basically client will connect to the Game Server and to the Mob server so that would be much less pressure for the server.But I wonder if there is a different way to do it? Take a maplestory mmorpg for example, how does it work? I've seen some vacuum hackers which means that the mobs on this game are on the client and server only sends which way they should walk or somethingWhat do you think?

Umm, sorry but pretty much every MMO out there runs on more than one server.

The trick is to program your server logic so it can be easily paralleled between nodes. Take a look at bigWorld for example, they can handle more than 100K concurrent users distributed over tons of server nodes.

From the start you should program your server so it can be easily expanded if need be. For example, in my MMO Renoria, the server works like this:

1. Central Server (Main command server, controls communication between all nodes and controls security and acts as a pipe between nodes)2. Login Server (Authentication server, controls user login and transition into one of the game server nodes).3. Game Server (Actual server where the game is played. Handles everything in game, from movement, to attacks, to trading, to banning etc)4. Game Server Node (Node attached to the game server, to offload any potential work that may lag the game server itself. Any amount of these nodes can be started and stopped at any time without affecting the game itself. This is only to load balance the game server).5. Database Server (This server controls all the database transactions, and I use a MySQL cluster in Renoria).6. Admin server (Server controls connections to RMT (Management tool) and the iOS/Android app used as a remote control for the server. Will provide constant updates to server load, player capacity, etc).7. Cheat/Security server (This server logs all the cheating entries and broadcasts warnings about possible cheaters to the game masters. Will send constant updates on cheating thresholds attached to players).

All these servers register with the central server and once registered through the central server they may communicate with any other node by sending a request to the central server.

Umm, sorry but pretty much every MMO out there runs on more than one server.

I was unclear. I meant not to use two servers for his current situation. The mobs should be handled on the same server as the players and items, etc. if they're going to interact.

Ahh okay. Yep you're right, all game logic should be handed within the same server, but if he wants to be serious about it he should create some dynamic GameServer nodes to offload work to when the need arises.

@Dxu1994 I understand that. Obviously an entire game doesn't run on one server, but OP I thought OP was asking if he should run mobs and the actual game on two different servers, which is not even a good idea. Players should have a client which connects to a game server which processes input and other game stuff. Clients should send player positions, item info etc... I thought OP was asking if mobs should run on a separate server than the main game server.

And I agree, offloading work to a separate server is a good idea, just make sure you have a good high speed connection between the two or the clients will notice higher jittery movement in the mobs. But honestly, if you're paying for a server, which is a good bit of money per month, you should have a good enough server to host a few players and a decent amount of mobs. Think about Minecraft and how people host their own servers. I personally only ever hosted around 10 people at a time, and I have a decent computer (8gb DDR3, pretty good download and upload times, fx4100 which is ok), and I could play at the same time and no one on my server experienced major lag at all. Now consider Minecraft has to check lots of mobs and player positions etc... Every few frames, and it runs fine still. So unless you're trying to run almost a hundred clients at once, you should be fine with checking for illegal movement, mob positions, world updates etc...

Dxu1994, thanks, that's what I wanted to hear, I just wasn't sure about the logic of multiple servers because that's my first online game I am working on, and I am serious about that, been working on it for a year and not willing to quit. But for now I am aiming this game for 50 people, it's not gonna be MMO right away. It will depend on the interest of the players and the cash that it will bring to get serious hosting gear.

I guess I am gonna start working on the mob server so in the future I wont have to do it.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org