Madguy's Forum Posts

  • Ashley Holy crap, I made a breakthrough on this, and I think it's a legit bug-- though it's likely a pretty rare one.

    My Pathfinding Cell Size was set to 64, and Cell Border set to -35. Kind of an odd choice of settings, but it worked well for me, EXCEPT...

    Check out this screenshot of my 10240x10240 layout-- the areas in red are the collision cells, which are created using the algorithm from the example pathfinding capx.

    http://tinypic.com/r/2n0j0he/8

    There's a horizontal line of collision cells missing! And yes, this ONLY occurs when the window size is at certain settings like 1920x1080! If I change the Cell Border to other settings, that missing line fills in! Bizarre!

    I'm going to investigate further and write up something official..

  • Here's a screenshot of the problem in action:

    http://postimg.org/image/ca9epgr7b/

    The highlighted object is attempting to path through a wall, which you can see by the node arrows close by (they use the same algorithm as the demo project that comes with Construct 2). It looks like he's actually aware of the wall to his north, but not the one to his west, since he's attempting to path around the wall to his north, but not the one to his west. Which makes no sense, because they're using the same tilemap.

    The wall is part of a tilemap that's been given the Solid property. All characters in the game were given the same pathfinding properties and custom obstacles (including the tilemap) and had their obstacle maps regenerated at the same time, and most of the others in this same scene are pathfinding around walls properly.

    Aside from a really bad cell size/border, what could cause something like this to happen, and so inconsistently at that?

  • Thanks for your quick reply. It made no sense to me either.. I'll investigate further and attempt to whip together a .capx.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I wanted to address this issue here before writing up an official bug report-- It’s probably going to take me some time to get an easily reproducible case of this in a .capx, and I wanted to see if it’s a known issue or if there’s some sort of workaround.

    Up until recently, I had my game running at a Window Size of 1280x1024. I switched the size to 1920x1080, and started noticing some issues with my objects’ pathfinding.

    Occasionally, my objects (which are using Custom Obstacle Pathfinding movement) would attempt to path through walls (which were added as a pathfinding obstacle once, shortly after the start of the layout). I have not been able to reproduce the issue with any sort of consistency. It’s like the pathfinding just occasionally decides to give the object an incorrect path with little rhyme or reason, causing the object to walk into a wall and continue trying to walk through it until pathfinding is stopped. According to the debugger, a path has been found for the object-- apparently it’s just a bad path.

    After extensive testing over the past few weeks, I’ve determined that the pathfinding issues do not occur at 1280x1024, at all-- not once. Literally, the only thing that I change for this testing is window size-- none of the game logic is changed at all. Simply put, the issue occurs regularly (if inconsistently) at 1920x1080, but not at 1280x1024.

    Ashley (or anyone else who may have dealt with this), does this make any sense to you? Is there anything in the pathfinding code that would be affected by window size? Like I said, I’d be happy to provide an example .capx and write up an official bug report, but I don’t want to waste anyone’s time either if there’s some sort of workaround or if I’m somehow doing something wrong here.

    Many thanx

  • I wanted to bring up this topic again, as I've been looking for a solution myself.

    Ordering sprite objects is pretty easy to do in a non-costly way. It could look something like this:

    CONDITIONS:

    System -> Every 0.05 Seconds

    System -> For Each SpriteObject order by SpriteObject.Y ascending

    SpriteObject -> Is on-screen

    ACTIONS:

    -> SpriteObject -> Move to top of layer

    However, Tilemaps seem to be another story.

    Someone please correct me if I'm wrong, but I don't think there's a simple, effective way to have a Sprite to pass behind or in front of a tile in a tilemap based on Y position, since there is no way of changing the Z-order of individual tiles. You could change the Z-order of the entire tilemap based on a sprite's position, but that's not really ideal at all for a bunch of reasons.

    The only workarounds I can think of would be:

    • Use sprites more often. This would be the only way to effectively have a small cactus like in the first post.
    • Have two tilemaps, one for tiles that the sprites will always pass in front of, and one for tiles that sprites will always pass behind. This would be effective for something like the large trees from the third post, where you could have a base that the player always passes in front of, and upper parts of the tree that the player always passes behind. Though in this case, it would probably be more efficient to use a sprite for the tree instead.

    If anyone has any other solutions to add, I'd love to hear them.

  • I'm wondering if this at all relates to the issue that I started having recently? https://www.scirra.com/forum/performance-issues-stutter-in-chrome-out-of-nowhere_t106103?

  • > I'm pretty positive that the issue has something to do with Chrome, and not the game itself or Construct 2.

    >

    So you've tried IE and Firefox and they are not affected?

    This particular game has always had performance issues on Firefox and IE that weren't present in Chrome, so I haven't used those browsers on a regular basis and it isn't easy to make a comparison. However, IE does seem to be outperforming Chrome now, which was never true in the past.

    Again, the game is very CPU-heavy.. has a very large map (10240x10240 to be exact), usually close to 1000 objects though I'm trying to get this number down (it's procedurally generated), and a lot of AI going on, though I've done my best to make this all happen as efficiently as possible. Chrome (when it's working) is soundly trouncing the other browsers.

  • Last night, the game I'm working on started having a lot of frame rate stutter on my Windows 8 desktop PC. I'm pretty positive that the issue has something to do with Chrome, and not the game itself or Construct 2. Older backups of the game are having the same issue, and the game is working fine on a much slower PC that I had lying around. Furthermore, the game runs completely fine when I preview in Node-Webkit.

    Prior to when this issue started occurring, I set the game (running in preview mode in Chrome) to fullscreen mode while simultaneously changing the window size from 1280x1024 to 1920x1080, and then set it back to windowed mode. I repeated this several times. At one point, I got a black screen and a popup stating that WebGL had failed. And that's about when the problem started occurring. There was also a Construct 2 crash at some point around that time.

    I've also noticed that the text (in text objects) looks a bit different than it used to, which indicates to me that there's something going on with the way things are being rendered..

    I should note that the game isn't graphically intensive, but it is fairly CPU intensive due to a lot of AI routines firing frequently. Normally, the game hovers around 60 fps, but I'm seeing a lot of lag now. Interestingly, I've also been working on a game that's very graphically intensive but not CPU intensive-- and that game is working without a hitch in Chrome!

    So far, I've attempted the following: reinstalling Chrome and Construct 2, enabling ‘Override Software Rendering List’ under chrome://flags, deleting my browser cache, and doing a system restore to a couple of days ago. Nothing I do seems to be getting Chrome back to working the way it did before. It's not a HUGE deal since the Node-Webkit preview is working fine, but still.. totally baffled.

    Any suggestions? What could have caused webgl/html5 to randomly start having performance issues in Chrome?

  • One of the games I'm working on at the moment is around 150 MB, almost all of which is images. Previously, when I previewed the game, it would take about 5-7 seconds to load. Now, seemingly out of nowhere, the game started taking about 25 seconds to load, and I am really stumped as to what might be causing this.

    Things I've tried in my efforts to solve this:

    • Restarting my computer.
    • Previewing on different browsers. (the problem happens on all of them)
    • Reverting to an older build of the game.
    • Reinstalling Construct 2.

    I didn't install anything new on my PC that might have caused the problem. From what I can recall, I closed Construct 2, ran one of my Steam games, closed the game, opened Construct 2 again, and the problem had started occurring.

    I don't seem to have any other problems with things loading slowly off the hard disk.

    When loading the game in Chrome, I see the "Waiting for localhost..." appear and disappear a bunch of times (if that means anything to anyone).

  • Making use of the LayerToCanvas expression and setting the layer's parallax to 0 is one way of dealing with this issue, but I'm having difficulty getting the text to line up properly with the buttons that I placed behind it. Kinda baffled by this one. This method still seems like a roundabout solution, and I get the feeling there's a simpler way of doing things.

  • In the game that I'm working on, I have text that appears over my character's heads. This text is on a layer with a scale rate of 0, because I don't want the text to shrink when the camera zooms out. However, the x/y positioning of the text in relation to the character gets messed up as I zoom in and out.

    I've been trying to figure out the equation I'd need to use in order to keep the text properly aligned with the characters. (Currently I'm just setting the text position to character.X and character.Y) I imagine it's not a terribly complicated equation, but math is sadly not my strong suit, and the solution has been eluding me for the past hour or so..

  • I've actually constructed a bunch of levels, minus a lot of the detail I plan to add later. I just didn't notice performance issues because my computer is pretty speedy. Then I looked at the Task Manager and realized that the game was using like 1.5 gigs of RAM. It looks like I'm going to have to basically go through and replace every object in every layout that was a part of my giant "mega-art-object"... manually. Trust me, I am kicking myself right now for not recognizing this sooner! :D

    Bear in mind I'm not putting anywhere close to 500 objects in any individual layout, as the game is broken up into compact, Metroid-ish size rooms. The issue I was having was purely due to me storing wayyy too much art in a single object.

  • I think I might not have explained myself well enough. <img src="smileys/smiley17.gif" border="0" align="middle" />

    I actually read that article prior to starting work on this game. I'm doing my art in a similar fashion to Rayman Origins-- using lots of smaller pieces of art that comprise a layout, and reusing this art whenever possible. When I referred to my "300 pieces of art" that I was using, that's what I was referring to-- smaller pieces of art, not an entire background.

    I'm just trying to figure out the most memory-efficient way to get this art onto the screen.

  • I've been working on a game for awhile and currently have a lot of the background artwork completed. Up until now, I've been placing each piece of art in a separate frame of a single object (which now has around 300 frames). This was a pretty bad idea on my part, because placing the art object into a scene causes the game to eat up TONS of RAM, since all of the art assets are loaded into memory.

    I'm considering two options:

    • Split the assets into about 12 individual "art" objects, as opposed to 1. My game has around 12 different varieties of backgrounds, so each object would contain the relevant assets.
    • Create an individual object for each piece of art. So, 300 objects with 1 frame, instead of 1 object with 300 frames.

    I think the latter approach would be better from a memory usage standpoint. I'm curious if there would be any major disadvantage to using this method, in terms of performance?

  • I get the feeling that there's a simple solution to this issue, but I can't for the life of me figure it out.

    I added the tint effect to one of my layers. Then I realized that I didn't want that effect to be present for the entire layer, just parts of the later. I'd like to accomplish this by creating a sprite, adding a tint (or tint mask?) effect, a non-normal blend mode, etc. to it, and placing it over certain parts of the layer. So far, no luck in figuring out how to make the part of the layer behind the sprite look the same as if I had added a tint effect to the entire layer. Any suggestions?