Advertisement

Webrowser game like agar.io and games alike

Started by May 01, 2017 07:35 PM
5 comments, last by hplus0603 7 years, 6 months ago
Hi,

I'd like to make fast to load browser game like agario. Ive already tried working with libgdx but hit a brick wall with socket.io not liking gwt. I'd like to make it in java and I dont really mind what the server side is coded in.

What would you guys suggest for the server side and client side :)? Just tell me what framework / language combination works best in your opinion!

Cheers

Hmm.. I guess you could use Unity? Unity seems popular for that kind of games.

Advertisement

There are many options. You can do it yourself in HTML and JavaScript. You can use many different web frameworks. You can use web engines, including Unity's web engine, Phaser, Craftyjs, Cocos2d-html5, Pixijs, and more.

What works "best" is entirely up to you and the project you are trying to build. What works well for one project may not work well for another. If you are comfortable with a tool you are more likely to be productive than with a tool you are uncomfortable with.

Most (all?) of the ones listed above are free, or at least free to try. Download them, play with them, figure out what you think works for your project.

Unity does not load fast in a browser, because the Unity plug-in is no longer a realistic target (modern browsers don't support it) and their HTML5 target generates really fat JavaScript code.

To make your JavaScript game load fast in a browser, you have to build it in a JavaScript native way, OR you have to pay really close attention to how emscripten translates your C++ code to JavaScript, and shape your C++ to only generate small code. (We did the latter.)

I'd suggest using a library like three.js perhaps?

I don't understand why you think socket.io and libgdx wouldn't be able to co-exist, either.
There are examples on the web, such as: https://github.com/BrentAureli/MultiplayerDemo
enum Bool { True, False, FileNotFound };

Unity does not load fast in a browser, because the Unity plug-in is no longer a realistic target (modern browsers don't support it) and their HTML5 target generates really fat JavaScript code.To make your JavaScript game load fast in a browser, you have to build it in a JavaScript native way, OR you have to pay really close attention to how emscripten translates your C++ code to JavaScript, and shape your C++ to only generate small code. (We did the latter.)I'd suggest using a library like three.js perhaps?I don't understand why you think socket.io and libgdx wouldn't be able to co-exist, either.There are examples on the web, such as: https://github.com/BrentAureli/MultiplayerDemo


Thanks for the reply. I used that guys tutorial as a starter but he never really touched on deploying to html5. The problem with socket.io and libgdx is that the porting to js goes through GWT and GWT doesn't support the socket.io library, well at least that's what I think. Is there a way to make them work together or am I just really wrong?
I don't know, because I've never transpiled anything from Java to JavaScript.
I'd suggest writing in native JavaScript if you want the game to run well in a browser.
Either that, or learn all the most detailed intricacies of how your tool chain and libraries work, to be able to optimize it for the JavaScript target, which is a lot of heavy lifting.
enum Bool { True, False, FileNotFound };
Advertisement

This topic is closed to new replies.

Advertisement