can2nac

Members
  • Content Count

    16
  • Joined

  • Last visited

About can2nac

  • Rank
    Member

Profile Information

  • Location
    Russia

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. can2nac

    melonJS 6.0.0 release

    @obiot checked some forums and people suggest to check other browsers. So i run tests in Firefox and WebGL run better then Canvas (and much better then WebGL in Chrome): steady 60 fps vs 50 on Canvas. BTW number of warnings is also significantly lower. I have attached screens.
  2. can2nac

    melonJS 6.0.0 release

    @obiot first paragraph - correct. Second one - yes, i have also found it out. I don't know if i told you before, but i am not a developer. This is my hobby project and some "general truth" things are not obvious at all to me )) so i kept digging and found the clue regarding textures. So i decided to move UI entirely to HTML+CSS. Although i have moved only 3 UI screens out of 6 i already see sufficient performance increase (roughly speaking 40-50 up to 45-55 (Canvas) and 30 up to 35 (OpenGL)). now about MelonJS 6.1.0. I have used "renderer : me.video.WEBGL" in me.video.init settings. If "failIfMajorPerformanceCaveat: true" (or not specified) and renderer is set to Canvas . Now if i change "failIfMajorPerformanceCaveat: false" it runs in OpenGL mode. Result is the same as with 6.0.0 (same warnings). I have also tested Platformer and got absolutely different result (attached). The only difference between this two tests is that i have added "failIfMajorPerformanceCaveat: false" when forced OpenGL mode. OpenGL was much slower. So i think "it's all about Linux" (or even my machine. @TheBoneJarmer it would be nice if you could test Platformer on your Linux machine and share your results). I will also verify the hypothesis regarding Linux on Apple machine at the office tomorrow. I hope to see no difference or batter performance for WebGL for both games.
  3. can2nac

    melonJS 6.0.0 release

    WebGL on Linux (Ubuntu 16.04 LTS) and Chrome works if you pass failIfMajorPerformanceCaveat: false to me.video.init options I get 40-50/60 fps with CANVAS and 30/50 fps on WebGL. No idea why. I haven't noticed a difference in the resulting picture that is why decided to use Canvas. Do you know why performance differs so much between canvas and webgl (i have fixed warnings in console so textures are POT etc).
  4. can2nac

    How to draw on particular [TMX] layer?

    @obiot sorry for a delay. I have not noticed neither performance increase, nor drop. The frame rate is exactly the same. It should be mentioned that i did nothing regarding the code after migration to v6
  5. can2nac

    How to draw on particular [TMX] layer?

    thanks. I have managed to make it work yesterday by modifying melon.js. The one thing which i didn't get is https://github.com/melonjs/melonJS/wiki/Upgrade-Guide me.Body.accel and me.Body.setVelocity are now deprecated and to be replaced by me.Body.force But both are still available (see console log on screen attached). Is this correct and there is no need to change them to me.Body.force?
  6. can2nac

    How to draw on particular [TMX] layer?

    @obiot tried v6 today, but game crashed during collision detection. I have attached two screens with crash details. Could you please advice on the solution? Here is the function where it starts // simulate character's move to specific tile and check for collision isCollidingWith: function(col, row) { var tileCoords; var orgPlayerPosX; var orgPlayerPosY; var result; // save original character's position to be restored when check is done orgPlayerPosX = this.pos.x; orgPlayerPosY = this.pos.y; tileCoords = this.game.refLayer.getRenderer().tileToPixelCoords(col, row); this.isRenderable = false; this.pos.x = tileCoords.x; this.pos.y = tileCoords.y; // handle collisions against other shapes result = me.collision.check(this); // this is a function which was called before crash this.isRenderable = true; // restore original character's position this.pos.x = orgPlayerPosX; this.pos.y = orgPlayerPosY; return result; }, This is a part of my player.js and i use it to build a matrix of tiles where player can't pass. The matrix is used to A-start lib to build patches.
  7. can2nac

    How to draw on particular [TMX] layer?

    i will. by the way the lack of smooth in motion and camera is due to Loom browser plugin which captures video. I have noticed this also. If it is turned off, game runs much smoother (i'm using 5.1).
  8. can2nac

    hidden GUI objects slow game render?

    i have already tried to do this way but forgot to set keepalive to true. Will have some time to try such approach tomorrow. BTW why giving offscreen position doesn't sound like a good idea to you? It seem like a common approach at least in web dev.
  9. can2nac

    How to draw on particular [TMX] layer?

    In a turn base mode you can see the tiles - path which player is going to walk. This what i asked about in my very first post
  10. can2nac

    How to draw on particular [TMX] layer?

    @obiot here is a short video https://www.useloom.com/share/046ff4f9cfdd415db6abde13cf8626cf Back to z ordering. Here is a video of game in debug mode https://www.useloom.com/share/11e48f8ba0c1476ca5f14748ee1b0cd4 As you can see every square with proper markup (NPC, object) influences on a z index of any object above it (red squares above player, chair etc). All NPCs have the same are of influence, they are not shown for the sake of performance. So we have a matrix of z indexes which stores z index for every tile. Whenever character approaches tile game recalculates those z indexes with regard to those highlighted areas. Originally both NPC are on the same level of tiled map. But they may stand in tiles 3.3, 2.2 and we may also have static object in tiles 4.4 and 1.1. Game recalculates z indexes and tells every participant what their new z index is. When they leave areas of influence their z index gets back to normal. The thing i don't like is that level designer must not take all that stuff into consideration which he will not most probably )) so i want to rebuild this a little bit and put those static objects in a separate objects (just like NPCs). What i don't know is how to deal with objects which occupy more then 1 tile in such case and will adding such amount of objects influence performance? I have searched through the network and found only several discussions on the matter with out some proper solution (( But as i wrote before this is a hobby project and i am okay to give it a try )) Oh, forgot to mention - walls are also marked, because when character is behind them he should not be visible and he should be visible when he is in front of them. Also gaps between rooms were tricky.
  11. can2nac

    How to draw on particular [TMX] layer?

    @obiot sorry, missed you last message. I'm working on RPG engine which will finally evolve in a post-nuclear style game (i hope). I basically copy Fallout 2 / Tactics engine. So right now player can find his path both realtime and turn based. Also added NPCs. They can only walk and talk with NPC so far. Player also has inventory, profile with stats, quests, inventory, loot. NPCs can walk, talk, take decision if path is blocked. Last thing i did was inventory. Spent quite a lot of time because there are two handed and single handed weapon and items, weapon can have different ammo (9mm bullets can be AP, JHP and some other type, forgot the name), the weapon should be loaded and unloaded properly if it already has bullets of other type. Those details take time. This is a hobby project so i spend like hour or two every day, but i keep moving )) now i'll work on a combat: already finished damage calculation (based on player stats, foe armour, weapon, distance etc - as in F2), will do combat itself next without animation so far. One thing on which i spent a lot of time and which still has place for improvements is dynamic z ordering - when player is between two objects and some foe walks around, game should properly reorder objects. So far i put map objects on different layers and placed some empty layers in between. But i do not like the result much.
  12. can2nac

    hidden GUI objects slow game render?

    I added obj.floating = false to GUI obj hide function and obj.floating = true to GUI obj show function and got 50 fps per second. Is this a correct approach to deal with GUI elems hidden/visible states?
  13. How GUI objects slow game render? Hi, i have pretty much GUI panels in RPG game (nav bar, loot panel, inventory, dialogs, quests, stats etc). All of the are a background and a set me.GUI_Object + some labels (up to a 50 objects per a single panel). All together they dropped the refresh rate from 50 down to 40 frames. The thing is that they are not in Viewport i.e. position is -100000;0 , but game still thinks that they are in Viewport (obj.inViewport=true;) despite thier actual position. Floating is set to true for them by me. According to line 13162 in melon.js they will always be inViewport: melon.js, line 13162 // check if object is visible obj.inViewport = isFloating || viewport.isVisible(obj.getBounds()); // update our object isDirty = ((obj.inViewport || obj.alwaysUpdate) && obj.update(dt)) || isDirty; So if obj is floating it will be always inViewport. Why? What is a proper way to temporarely remove GUI objects from the viewport? best
  14. can2nac

    Isometric game made with Melon

    Hi, i'm working on an isometric RPG as a hobby project. For a path finding i used A-Star (https://github.com/bgrins/javascript-astar) You need to build a simplified model of your game world. Size in tiles. Mark those tiles which are blocked, set start and finish points and you will get the path.
  15. can2nac

    How to draw on particular [TMX] layer?

    added zOrder to the me.game.world.addChild call and this did the trick! Thank you, Oliver!