ewanvalentine Posted March 3, 2017 Share Posted March 3, 2017 Hi folks, Babylon.js/game dev n00b here. I've started attempting to make a real-time strategy game, similar to Red Alert or Starcraft. So far, I have a bunch of blocks you can create and move around a flat map. I'm just posting this here so I could get your feedback, or suggestions, am I doing anything obviously wrong? https://github.com/ewanvalentine/game-guild Cheers, Ewan Quote Link to comment Share on other sites More sharing options...
Temechon Posted March 3, 2017 Share Posted March 3, 2017 Hi, In order to have the best performance, don't forget to use Solid Particle System (very easy to use once you got the concept) that can be used to draw everything that is repeated in your game (I use it personnally to draw a tile map). For units, you can use instances (very easy as well, just do mesh.createInstance()). It could be cool to show us a running demo somewhere ! Good luck Quote Link to comment Share on other sites More sharing options...
jerome Posted March 3, 2017 Share Posted March 3, 2017 The SPS is the right guy for this job. This would nice if someone who already did once a tiled block world with it could put somewhere a little tuto or a simple commented PG about this... This question is recurrent. Please search the forum, you'll find that someone called BeanstalkBlue did something equivalent some days ago : documentation : http://doc.babylonjs.com/overviews/solid_particle_system Quote Link to comment Share on other sites More sharing options...
Temechon Posted March 3, 2017 Share Posted March 3, 2017 I plan to do it, and relaunch my serie of Babylon.js tutorial. (When i'll have some time) Quick playground, same behaviour but for a forest with random positions http://www.babylonjs-playground.com/#DBJ1I#1 Don't try to make more than 1000 trees, as the model is very complex for this kind of thing and it will crash your browser. jerome 1 Quote Link to comment Share on other sites More sharing options...
ewanvalentine Posted March 3, 2017 Author Share Posted March 3, 2017 8 hours ago, Temechon said: Hi, In order to have the best performance, don't forget to use Solid Particle System (very easy to use once you got the concept) that can be used to draw everything that is repeated in your game (I use it personnally to draw a tile map). For units, you can use instances (very easy as well, just do mesh.createInstance()). It could be cool to show us a running demo somewhere ! Good luck Ahaaa that looks so useful! I guess I could use that for terrain elements. I've also updated it to use `Mesh.clone(name)` instead of creating a new mesh each time. It seems to be running a little smoother, albeit still very slow :/ Thanks for the advice! Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted March 3, 2017 Share Posted March 3, 2017 note that instances have some limitations, things like materials and skeleton animations will be the same across all instances of that unit, see; http://www.babylonjs.com/Demos/InstancedBones/ so clones is the way to go, i'm not sure whether the SPS allows seperate skeletons & animations for each particle(unit) @jerome ? because if that's the case, it would be pretty neat. Quote Link to comment Share on other sites More sharing options...
jerome Posted March 4, 2017 Share Posted March 4, 2017 no for the skeleton regarding the SPS, but I thought it was more about creating a tiled word here. it should work with animations though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.