Sign in to follow this  

Server Side - Map Boundaries

This topic is 2036 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am creating a Flash mmorpg game where the players move around on a 2d map which is basically made up of different movieclips. The client side uses collision detection such as hittestpoint and some other boundary checkings. This is all been coded and works fine so I decided to move onto server side of things and I have made it so multiple clients can interact with each other but I don't think I'm doing it right.

For the server-side, I have no idea how to convert my game map so that the server side can read it and use it to consider the data being sent from the client. For example, I want to have monsters spawning on the game and they need to be controlled by the server so that all players connected on the same map see the same movements. But how do I make it so that the server knows the map boundaries in order to generate the correct positions to make the monsters move relative to the map they're on?

I did come up with one solution- which was to have a client host the monsters and send the data to the server which would then be relayed to all other connected clients to update them. When the host disconnects, another client is chosen as host and they then send out all the monster data. Of course, there are a lot of problems with this: CLient lag, client manipulation of the monster part, lots of bandwidth being used by the client on their end, the server having to send and receive lots of data.

I was just wondering if you guys had any experience in this type of game construction and what possible solutions I could use. My main problem really is converting my game level map into something the server can read so that it can reconstruct the boundaries and limits.

Share this post


Link to post
Share on other sites
[quote][color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][left][background=rgb(250, 251, 252)]how do I make it so that the server knows the map boundaries in order to generate the correct positions to make the monsters move relative to the map they're on?[/quote][/background][/left][/size][/font][/color]

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif][size=3][left][background=rgb(250, 251, 252)]The server will need to load the map to be able to enforce rules related to the map. Generally, when creating game maps, designers will mark special areas on the map that are only available on the server, for things like monster spawns, loot spawns, triggers, and so on. If you write the server in a different language than the clients, then you will have to build the maps in a format that both sides can read, or a format that can be automatically processed into formats that work for each side.[/background][/left][/size][/font][/color]

Share this post


Link to post
Share on other sites
Yeah, but does anyone know a good way of converting a map designed out of Flash Movieclips into something the server could read?

I did code up a mock solution today and create a two dimensional array of the possible paths the monsters can follow which worked OK. Only problem is things like monsters falling to the ground from ledges, I need to design something which when a monster enters too close to a cliff, they will follow the path that takes them to the ground. Hmm.

Share this post


Link to post
Share on other sites
[quote]does anyone know a good way of converting a map designed out of Flash Movieclips into something the server could read?[/quote]

Write a Flash (or better, Air) program that reads the movie clip data, and exports as XML or JSON or something.

I'd prefer to go the other way: design the maps in some XML or JSON or binary format, and then "compile" that map into the flash movie clip that the client loads.

Share this post


Link to post
Share on other sites

This topic is 2036 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this