Page 1 of 1

Advice on WebGL library

Posted: Mon Jan 16, 2017 3:43 am
by Jackolantern
So I am working on a new game idea, along the lines of an Eye of Beholder, Gold Box, Might and Magic style first-person "gridder" RPG. However, unlike many of the games in the genre (and similar to Might and Magic II - V) I want to have an overworld outside of dungeons, open spaces, etc. This creates a massive strain on art assets to produce a game like this in the traditional way where everything is a sprite arranged in a 2D canvas since every wall has to be drawn from many different angles.

So I feel the most efficient way to achieve this would be to use WebGL to create planes, texture them with the pixel art for the walls, doors, props, etc. and then arrange them in 3D space to create the static scenes needed for the game world. Since these types of games have players moving from one cell or grid to the next with no transition, I won't actually be needing to do much real 3D animation and my needs from a WebGL library or framework are fairly minimal.

The main two I am looking at are Babylon.js and Three.js. Babylon seems more game-focused but I would assume a lot of it I won't need since it is geared towards traditional 3D games (animating rigged models, moving through the 3D world, etc.). Three.js seems like more of a fundamental WebGL library that specializes not just in games but in 3D logos, demos and other general-purpose 3D effects. Unfortunately both of these libraries don't have the strongest documentation. I know that straight canvas could likely meet my needs since it can do pretty much any kind of transformation needed on a bitmap but these operations appear fairly slow and I think a whole screen filled with transforming bitmaps could get very heavy.

So for what I need it for, what library would anyone who has used them suggest? I know Halls has experience with Babylon.js and I think he enjoyed it if I remember right. Are there any good resources you know of for learning Babylon.js? There is one book on Amazon but it is 500 pages and is for traditional 3D game development which I think is quite overkill for my needs. If Three.js is the better way for me to go, do you know of any good resources for it? Or should I take a look at something else entirely?

Thank you!

Re: Advice on WebGL library

Posted: Mon Jan 16, 2017 6:39 am
by a_bertrand
I used Three.js because somehow when I tried Babylon wasn't offering me the right tools. If I remember right it was a question of importing models from my pipeline. I would say both are mostly the same in term of features, so pick one and go for it.

However be warned that I don't think the web is really ready for 3D, the reason is that a full 3D game can have GB of game asset and no browser will keep those in their cache. This lead to massive load time and massive load on your server. Sure if you have small game asset it may still work for you.

Re: Advice on WebGL library

Posted: Mon Jan 16, 2017 8:33 pm
by hallsofvallhalla
Three.js for sure. I actually started this same project on Three.js sometime ago before moving to Unity. I will try to find it. I will also put up my Unity version this afternoon. It is coming along nicely.

Re: Advice on WebGL library

Posted: Tue Jan 17, 2017 1:16 am
by Jackolantern
a_bertrand wrote:I used Three.js because somehow when I tried Babylon wasn't offering me the right tools. If I remember right it was a question of importing models from my pipeline. I would say both are mostly the same in term of features, so pick one and go for it.

However be warned that I don't think the web is really ready for 3D, the reason is that a full 3D game can have GB of game asset and no browser will keep those in their cache. This lead to massive load time and massive load on your server. Sure if you have small game asset it may still work for you.
This is very true. I think for my purposes it will work out, though, because actually being in 3D is going to save me a ton of space. Straight 2D would require me to have bitmaps of every wall from a number of different angles, probably causing 1MB of assets for every single wall. With 3D, I only need one and I can use it to texture a plane and can move it around as needed. And I think a lot of that space in 3D games comes from 3D models and 3D animations, neither of which I will be using. I do agree with you that true 3D games really are a bit early for the browser but I am hoping my uses will work out because they are so minimal.

hallsofvallhalla wrote:Three.js for sure. I actually started this same project on Three.js sometime ago before moving to Unity. I will try to find it. I will also put up my Unity version this afternoon. It is coming along nicely.
I think I was leaning towards Three.js. It will probably be easier for me to work with since it is just a general-purpose WebGL library instead of a game engine. My worries would have been that Babylon would have required me to set up a game world or something else like that when I really just want to make planes, texture them, set a camera location and then move the planes into specific locations and nothing else. No game loop, no dynamic game world, etc.

Re: Advice on WebGL library

Posted: Sat Jan 28, 2017 5:36 pm
by hallsofvallhalla
Sorry for delay. Here is an example of what I have so far

http://indie-resource.com/games/halls/

Re: Advice on WebGL library

Posted: Sat Jan 28, 2017 9:08 pm
by Jackolantern
Very cool! :)