• Content Count

  • Joined

  • Last visited

About GAZ082

  • Rank

Contact Methods

  • Twitter

Recent Profile Visitors

445 profile views
  1. Thanks man, yes, i'm already researching about promises, fetch, etc. and got what you mean.
  2. Hey guys I've got something like this to load data from backed and send it to my phaser object: import { makeGame } from '/game.js'; function loadData() { let mapSize = 64; let tileSize = 4; let xhttp = new XMLHttpRequest(); 'GET', 'http://localhost:5000/map?size=' + mapSize + '&tileSize=' + tileSize + '&img=0', true ); xhttp.send(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { let map = JSON.parse(xhttp.responseText); let empire = makeGame(map, mapSize, tileSize); //console.log(empire) returns undefined. } }; } function init(cb) { console.log(cb()); //returns undefined. } window.onload = function() { init(loadData); }; Now i'm trying to make some UI in standard JS+CSS and i need to access the game properties (add/destroy images, stuff like that) and cant get a object outside the main game loop to be the created How can i do that? As you can tell, JS is not my forte :P Thanks!
  3. I'm trying to find a way to render individual tiles as needed, the author of the Tile engine in Phaser3 wrote a series of tutorials here:
  4. I generate server side the map image and then load it to Phaser's tilemap object. I do not generate individual tiles, i use the whole map. Dont know if with the tilemap object i can grab a specific tile and render wherever i want.
  5. Looks like its working. Addind multiple instances of an image make a performance hit? Looks like the memory consumption does not increase by rendering the same image multiple times.
  6. Of course this helps, thanks! I'm working with a tilemap but your tips may head me to the right direction. I'll keep looking for answers and trying things.
  7. Hi there. I want to achieve that my main camera to render the world map "wrapped". See this example, the little top right would be the main camera and i move it to the right. As you can see, the desired effect if that it will render the opposite offset the further right the cam moves. Ideas? Thanks!
  8. GAZ082

    High GPU usage.

    Hi there. I just made a tilemap with an image which can be 200x200 px or 5000x5000 px, the result is the same: GPU usage above 60% and after a few minutes settles down to about 35% , even when doing nothing. I'm using phaser3 in Chrome under Linux x64 on an old Nvidia GTS250 card. Here are the main parts of the code, tried loading the main map as image and also as spritesheet: let config = { type: Phaser.AUTO, width: window.innerWidth * window.devicePixelRatio, height: window.innerHeight * window.devicePixelRatio, zoom: 1, parent: 'map', pixelArt: true, backgroundColor: '#4488AA', scene: { preload: preload, create: create, update: update } }; let game = new Phaser.Game(config); function preload() { this.load.setPath('http://localhost:8080/assets'); this.load.image('tile_set', 'worldMap.png'); also tried this instead of load.image: this.load.spritesheet('tile_set', 'worldMap.png', { frameWidth: tileSize, frameHeight: tileSize }); //also tried this } function create() { let tiles = map.addTilesetImage('tile_set'); let terrain_layer = map.createStaticLayer(0, tiles, 0, 0); } Any tips? Thanks!
  9. Both suggestions mean modifying the tilesheet? I cannot have tiles of different sizes, the tilemap engine requires nxn tiles in all the tilesheet. At least that's what i understand (been using phaser3 for a day). Another thing i'm thinking is just to make a custom RenderTexture or Bitmap as i used to do. Is there a way to convert a bitmap to tilemap so i can use its methods? Thanks!
  10. Hi there. I made a slightly dithered tileset. In the days i did not use any framework i just align them with an offset of 1 pixel left and top to assemble them but now dont know how to do the same with the tilemap feature. Have this: Want this: Any tips? Thanks!
  11. Thank you guys. I think ill have to manually set the textures when switching engines? It's been like 6 years since i messed up with Blender, heh. I dont know what just JC posted, looks like dissected the poor ghosty :'( Funny you do not have cycles samples, i just downloaded 4 or 5 models from and all were Cycles.
  12. Hi gryff *bows* Here is the model! Thanks!
  13. Hi there. I'm trying to import a simple character to play a little with babylonjs. But when i do it, i get on the log: WARNING: No materials have been assigned: On the left is how it's rendered by babylonjs, on the right, what should it be: I modified nothing on the original Blender file. Just loaded and hit export to Babylonjs. What might be wrong? Thanks!