Skip to main content
GameDev.net gamedev.net
🔒 Locked

RTS (diablo) game in HTML 5

Started by igo88 Jan 4, 2011 at 12:08 AM 8 replies 3.2k views
Original Post
igo88
igo88
Hi, my name is Rodrigo...and i have been reading the forum for some time, but i am a real newbie in game development.

I am a C# developer, and have experience in Sql, wcf, sockets, etc...but never done anything about games.

The thing is, i am thinking about programming a RTS game, like diablo, that can be played entirely in a web browser using HTML 5, and web sockets.

I have been reading about how to avoid latency problems, synchronization and some other effects, but i dont know where to start.

Should i start building the server?...the client?...

There is another thing i would like to ask you, how can i handle my map?...like a matrix in my server?...do you have a better idea?...

Thanks in advance, Rodrigo.
Sirisian
Sirisian
Assuming you're familiar with socket programming this should have been pretty obvious where to start.

Start with the server and read the WebSocket 76 handshake stuff. After you get the client connected to the server and the basic handshake completed you can send messages.

One thing that sucks is that the messages must conform to the UTF-8 encoding so you can't send binary data. However, you can get around this by converting a binary protocol to 7-bit encoding (using the ASCII range :P).

Quote:
Original post by igo88
There is another thing i would like to ask you, how can i handle my map?...like a matrix in my server?...do you have a better idea?...

If you're trying to program a multiplayer game and you can't figure out how to store something as basic as a map you'll probably have bigger problems.
igo88
igo88
Quote:
Original post by Sirisian
Assuming you're familiar with socket programming this should have been pretty obvious where to start.

Start with the server and read the WebSocket 76 handshake stuff. After you get the client connected to the server and the basic handshake completed you can send messages.

One thing that sucks is that the messages must conform to the UTF-8 encoding so you can't send binary data. However, you can get around this by converting a binary protocol to 7-bit encoding (using the ASCII range :P).

Quote:
Original post by igo88
There is another thing i would like to ask you, how can i handle my map?...like a matrix in my server?...do you have a better idea?...

If you're trying to program a multiplayer game and you can't figure out how to store something as basic as a map you'll probably have bigger problems.


Thanks for your reply...I have already set up a socket server and connected with the &#106avascript client. And i have already tried using a binary protocol.<br><br>As for the map, is something i can figure out the BEST way...all the options i think, have a drawback.<br><br>Thanks again!
igo88
igo88
Quote:
Original post by CadetUmfer
The first page of 1500 Archers on a 28.8 is required reading for you.

Good luck!


I will be reading it, thanks!

Oberon_Command
Oberon_Command
Quote:
Original post by igo88
The thing is, i am thinking about programming a RTS game, like diablo, that can be played entirely in a web browser using HTML 5, and web sockets.


Minor nitpick, but Diablo isn't an RTS game, it's a "hack 'n slash" RPG. StarCraft would be a good example of an RTS.

Sirisian
Sirisian
Quote:
Original post by igo88
As for the map, is something i can figure out the BEST way...all the options i think, have a drawback.

In that case the best way is to use a 2D array as you said previously when you mentioned a "matrix" probably. If you want your map to to be tile based that works fine. There's no drawback. You just have the clients download the map file. I'd just store them in the WebStorage actually so that clients don't redownload them often (WebStorage is 5 MB according to the standard's recommended size). Do your maps have some special property that you're not telling us? Are they procedurally generated and hidden by fog until the player discovers them? Is this game an MMORTS? Giving as much information as possible would probably help to find the optimal solution.

Also how many units did you plan to have in the game at any one time? If the number is small then you don't really need to use a lock-step system. While it has advantages you can trivially synchronize the units under a player's camera for fairly cheap while still allowing a large number of units in the game. (If you want me to go into more detail I can).

igo88
igo88
So, Diablo is not an RTS...what kind of game would be Diablo?
Ezbez
Ezbez
igo88 - Diablo is an action RPG (other RPGs include Baldur's Gate, Mass Effect, Fallout and Elder Scrolls series). Some RTSs are Starcraft, Age of Empires, and Command and Conquer. Since there is a fairly big difference for networking between the two genres, you should clarify - do you really want to make an RPG or RTS?
igo88
igo88
Yeah i know there is a big difference...and my idea was to program something like diablo, so an RPG would be the choice. I am sorry for the confusion generated

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.