Server Side - Map Boundaries

Started by
2 comments, last by hplus0603 11 years, 11 months ago
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.
Advertisement
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[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]

[/font]

[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

[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]

[/font]

enum Bool { True, False, FileNotFound };
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.
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.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement