I've created an HTML5 RTS Game with Multiplayer & Map Editor

Started by
18 comments, last by kiteflyingmonkey 10 years, 4 months ago

jb_ as i said, you should move the logic to the server side of things (i guess you are running a nodejs server?) so that only the rendering is done on the client (ie only rendering will be paused when tabbed out and the logic of the game will keep running since that is done on the server)

This is even more important from a multiplayer pov since anything happening on the client is open for manipulation (cheating)

i thought about this alot before i wrote the network code, but i figured the best solution is to only send the user input commands to each other, since this is waaaaaaay less traffic. Doind the game on the sever would require to send each units position to the clients every 50ms (game is 20 ticks / sec). This would be a lot more traffic (a looooot). Right now traffic is ~2kb / sec. Traffic the other way would be more than 10 times as much, which is, in my opinion , too much for a game. Also i would need waaay more traffix limit on my server side, which means id have to pay more in the end. Also the server would use way more cpu load since for every game that is played at a time, the server would have to do all the calculations.

Advertisement

Yeah, server load is an important topic in networking games and it can be the cause of many bottlenecks, but threre's a lot of usefull information regarding this on the web.

One series of articles that I've found extra informative is this http://gafferongames.com/networking-for-game-programmers/

Also, I am sure that there are many experienced developers around here that would offer you advice if needed.

*Edit: Regarding hosting and server capacity.. yup, running hosted network games requires really good servers even if the user base isn't that big

Disregarding the pausing issue, if you ever hope to have meaningful multiplayer (in the sense of it being competetive) handling logic on the client is not an option.

I wish I could be more helpful, but I am only learning this stuff my self atm.

PS: I second the suggestion that you should make a dev diary, I would be very interested in reading about the development process of this game.

Thinking about making a dev diary.... but no idea what to write, never did or read any of those.

Great job. I enjoyed it. You got me to play three games. In the second game I lost, so I of course had to play one more. However, I felt like the game generally moved a little too slow. Like the workers gathered gold to slowly and building and training took a little long. But still great work overall. I enjoy real time strategies and would love to see where this goes.
My current game project Platform RPG

i sped up some of the units movement speeds a little bit. I think you were right, it was a little bit too slow.

I have now started a blog, as many ppl requested in response to my game.

You can see the blog here: http://www.jbs-gaming-blog.com/

Atm theres just one post, but more are soon to come.

Awesome, looking forward to hearing more details! We'd love to hear some of the technical details if you're willing to share!

- Jason Astle-Adams

yeah, im willing to share whatever.... at least most. Im just not exactly sure what ppl are intrested most. If you like you can leave a comment and tell me what you would like to know.

Hey awesome news, just write about whatever you've done since your last blog post and focus on things that interests you and it'll be much more fun for you to blog :)

This game is great. I've played it a few times, and have only just managed to beat the AI... Unfortunately, just as I destroyed their last building, it froze, is there meant to be a win screen or something?

This topic is closed to new replies.

Advertisement