The Daily Click ::. Forums ::. Klik Coding Help ::. MOOCLICK Online RPG question
 

Post Reply  Post Oekaki 
 

Posted By Message

kazukeri



Registered
  23/04/2007
Points
  4
23rd April, 2007 at 06:36:53 -

Hi, I'm making an online rpg using mooclick, all the basic stuff like players and chat is already working with no problems.
My problem is how can I make monsters that are synchronized on all of the clients.
What I'm not sure is where the monster data (position ,hp ,etc..) should be held and should server manage that?
Should the server send the data to all players about where the monsters are, in that case the server would move monsters (like simulation) and clients would just update their location and data.
I couldn't find anything about monsters in mmorpg architecture in the internet and this forum as well. If anyone knows how this should be done and have time to help me, please reply. thx


 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
23rd April, 2007 at 08:43:18 -

You'd have to build some sort of server application that would keep track of all enemies in each area, and send the data to all connected clients. This means that you'd have to either set up your own server, or ask the owner of your current server to install your server application on their machine.

But there are other ways to do this, for example having each client store some enemy data locally, sending their data around to other players. The problem with this system is that if there are no players, there can't be no enemies either, unless you save enemy data on the server each time all players leave an area.

Both methods cost a lot of bandwidth though, as lots of enemy data has to constantly be sent to all players to keep the enemies in sync.

 
n/a

Aptennap



Registered
  23/04/2004
Points
  916
23rd April, 2007 at 12:10:31 -

Make enmeis that dont move and dont die?

 
Oh sweet mary.

kazukeri



Registered
  23/04/2007
Points
  4
23rd April, 2007 at 12:16:22 -

Thanks for help axel, I think the first way is better, but I'm not sure how to store monster data, should that data (id,X,Y,hp,etc) be inside some 2d array in the server? then server would generate movement by changing the data inside that array and send that to player. But this way it is bit complicated. I can’t think of any other way.

 
n/a

WillWill

Give me stuff

Registered
  24/07/2006
Points
  552
23rd April, 2007 at 16:19:34 -

This is a bit ahead of my 'things to think about' in my own personal MMO (yes, everyone has a MMO these days ). I'm assuming you're going with the server idea, which to me sounds more appealing. Working out a server is a problem that comes on later, for now you could simply just beta-test locally which you probably are already thinking of doing. Here is my suggestion and ideal for my own mmo:

Array Object - The 2D Array is upon start of level 'loaded' with all the necessary values for X and Y positions. For example you could load value 1 in a X and Y position, which we will assume to be a monster.

INI Object - This object contains all the actual variables for your NPC's (environment aswell for me to change animations). With this you could create an INI Object that contains the following:

[Monster1]
Type="Flying Fisharoo"
X="354"
Y="250"
HP="40"
MaxHP="50"

[Monster2]
Type="Bazooka Joe"
X="34"
Y="50"
HP="550"
MaxHP="600"

[Monster3]
Type="Rolling Rat"
X="3"
Y="20"
HP="4"
MaxHP="10"

That's exactly how the data is stored in an INI File, and as you can see all these groups (groups are the [] ones) are individiuals in-game. Checking all these objects and sending them would be very messy, but if we stored values for what monster that is at what X and Y position in the Array Object, that would work as a shortcut to the monsters in the INI Files (for example if the String was "Monster1" on X250,Y24, it would refer to Monster1 in the INI Object). Sadly I don't think I got the message through to you as it is slightly complicated (at least for me), but this is how I'm doing most of my stuff, and it's been working pretty well sofar.

Image Edited by the Author.

 
http://www.morphboy.newgrounds.com/
^ Free tunes, as long as you contact me.

Aptennap



Registered
  23/04/2004
Points
  916
23rd April, 2007 at 23:58:10 -

Don't forget to add map.
[Monster1]
Type="Flying Fisharoo"
Map="0"
X="354"
Y="250"
HP="40"
MaxHP="50"


 
Oh sweet mary.

WillWill

Give me stuff

Registered
  24/07/2006
Points
  552
24th April, 2007 at 02:42:29 -

Yay, a follow-up to my idea.

 
http://www.morphboy.newgrounds.com/
^ Free tunes, as long as you contact me.

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
24th April, 2007 at 06:13:04 -

INIs are hackable, unless you do like me and have all external files MD5ed on startup.

 
n/a

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
24th April, 2007 at 07:10:29 -

The most efficient is byte code.

12 12 38 44 1F 88 B1 = 8Dˆ±



 
Old member (~2004-2007).

kazukeri



Registered
  23/04/2007
Points
  4
24th April, 2007 at 08:34:09 -

Great I'll get to work and try it .
Thanks for the help everyone.
While making maps should every map be a different channel (like forest is "channel1", town "channel2"?
I also noticed that if I send a long string via "server message to all" it makes the server crash, anyone had that problem before?


 
n/a

Aptennap



Registered
  23/04/2004
Points
  916
24th April, 2007 at 11:29:01 -

1-Depends if you want people to still be able to chat with eachother even when on dierent maps then make them have the same channel.
2-Send two server messages instead of one he can handle that, I think...

 
Oh sweet mary.

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
24th April, 2007 at 11:33:41 -

Don't use server messages. Just use Player -> Channel -> Send text on channel. It will automatically send the message to all players in the current channel.

Image Edited by the Author.

 
n/a

kazukeri



Registered
  23/04/2007
Points
  4
24th April, 2007 at 12:28:28 -

Hmm, then the server is just another player, because of the server message bug I use it like that, anyway if a player is connected to more then one channel is it possible to choose on what channel to send text or to send it to every channel that you are connected to?

 
n/a

Reno



Registered
  11/01/2005
Points
  906
24th April, 2007 at 16:55:24 -

heh Axels using MY idea for the AI sync for the players
Just dont give me any credit geez

Image Edited by the Author.

 
Reborn Again
   

Post Reply



 



Advertisement

Worth A Click