Leaderboard


Popular Content

Showing most liked content on 01/22/2017 in all areas

  1. Hello! I am making a step-by-step strategy game (like Fallout tactics, JA2) i uploaded demo on the site. You can test it now. i am working alone and it is my first experience with babylon engine. i am going to make online PvP battles (in the future), but now you can play with bots only. I made some levels and the boss in the end. Now you can: -run on the map, bots will run to you; -change the player (by clicking on the bottom icons); -shot the bots, kill bots (bots have simple ai and can kill you); -use 3 types of weapons (sword, gun and melee); -open the inventory, move items in the inventory; -finish your turn and see enemie's turn; -refresh browser window (server saves the state). -your players can hide in "invisible mode" (invisible icon located near the inventory icon) Some models do not have textures, it is ok. GUI is quite simple. AI is stupid now. (game is using php server for bot's AI calculatiuons, so you can't play offline) Thank you.
    4 likes
  2. 1 like
  3. 1 like
  4. WebGL will call out to C/C++ code and will just use the underlying buffer regardless of if your JavaScript code sees it as Uint32Array or Int32Array so no copies will be made. Buffers are just flat slabs of bytes and can be viewed in different ways. If buffers are created or copied depends on what constructor you use(see the page you linked), if you use the typed array directly (as with regular arrays) you get a copy BUT if you use the underlying buffer object instead then you're instead given a view. The example below should show the difference in usage (you can test it in chrome,firefox or node) var x=new Uint32Array([123]); // array copy construction var y=new Int32Array(x); // typed array copy construction y[0]=-44; console.log(x[0]+","+y[0]); // prints 123,-44 var z=new Int32Array(x.buffer); // using the view creation constructor (notice the buffer) z[0]=145; console.log(x[0]+","+y[0]+","+z[0]); // prints 145,-44,145 z[0]=-145; console.log(x[0]+","+y[0]+","+z[0]); // prints 4294967151,-44,-145 In the first printout x[0] retains it's value since y got a separate buffer via the copy constructor. For the second printout however x[0] has changed the value when we changed z[0] since they share the same underlying buffer, in this example you see why one can use either Int32Array or Uint32Array since the representation is the same for positive integers below 2^31. The third printout again changes x[0] when z[0] is changed due to using the same buffer but this time the values shown are different, this is because negative numbers has the top sign bit set and this is where the unsigned and signed representations of 32bit integers differ. For unsigned numbers the top bit means that the value is between 2^31 and 2^32-1 (2147483648 to 4294967295) whereas for signed numbers this means that the number is negative. Anyhow, as i said before. For mesh indices you're unlikely to have 2147483648 indices or more so using Int32 or Uint32 won't matter much today.
    1 like
  5. Thank you! It is a multiplayer idle game - players battle against other players (mini-games) to earn permanent and temporary bonuses.
    1 like
  6. You could also mix two lights with same setup + different generators if needed: https://jsfiddle.net/q1k3wLd0/5/
    1 like
  7. 1 like
  8. @royibernthal the feature's done, the PG is updated, you can find a sample here: http://babylonjs-playground.com/#1KYG17#1 I hope it fits your needs
    1 like
  9. That *is* what I need, yes! Thank you!
    1 like
  10. This file contains 256 variants of fog for one tile. Tile on map has 8 neigbor tiles. Check if all 8 neighbors visible or not, and so get 8 bits. This 8 bits is 0-255 numeric index, by this index we take fog tile on texture i showed.
    1 like