Abaita's Recent Forum Activity

  • Thanks a lot, i will give it a try. Good to know that there is a way without the nickname-plugin.

  • Thanks for the answer.

    So if i understand it correctly i need to use the animation of a single sprite and add frames for each sprite i want to spawn dynamically? So if i want to create i.e. sprite having ID 5 i need to spawn that generic sprite and switch to frame 5? So that could be a solution but would also prevent that those sprites can be animated, right? And also maintaining those sprites would get really nasty. Imagine hundreds of sprites and now you need to add, remove or update some of them.

    What i did not understand completly is the 2nd example. is it possible to have different animations for a single sprite and give them names?

    I guess the 3rd example addresses the count i mentioned, but i think you might got it wrong. It was not my intention to show different sprites for one or five bananas. the count would be just text.

    Or did i get something wrong?

  • Hey folks,

    maybe a simple question but i have no idea to handle this.

    How do you deal with inventories? Lets say there are hundreds of different items in your game and the player has five of them which you want to show with a little icon and the amount of it. i.e. five tomatos, three bananas, ....

    So in json your inventory could be like this:

    [
    	{
    		"itemType": 1
    		,"count": 5
    	}
    	,{
    		"itemType": 2
    		,"count": 3
    	}
    ][/code:1y1ihw4p]How can i map those type-IDs to a specific sprite to spawn it in the inventory layer?
    It seems that it is a problem in general to spawn a specific sprite.
    
    How do you handle those use-cases?
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sethmaster Wait (0) is not sufficient. 500ms works for me. maybe ~16ms (duration of a tick) does the same job.

    But why do you not like the idea of having a new event which indicates that pathfinding can be safely used. using a system.wait to achieve this does feel like a dirty hack.

  • Thanks for your feedback.

    Well i don't think so since "generate obstacle map" is executed right after filling the tilemap without delay. to make it work i needed to put the "wait"-action after "generate obstacle map".

  • In my project a solid tilemap is randomly generated and right after that the obstacle map is regenerated.

    Later on the "find path"-action is triggered on a enemy-sprite since i want them to move to the player as soon as possible.

    In "path found" i start the movement as usual but the path which was found is always a straight line to the player ignoring all obstacles

    BUT if i put a System.wait(5 sec) after the "regenerate obstacle map"-action it works correctly. so i guess the regeneration of the obstacle map is an asynchronous process. But in that case there should be an event like "on obstacle map regenerated" where i can hook in to start the pathfinding.

    Or did i something wrong?

  • Hi guys,

    i am generating a tilemap with solid behavior at runtime. after that i put a player and enemy at random positions. the enemy got the pathfinding behavior and starts to move towards the player right after the game started. but its path is always a straight line ignoring all obstacles. therefore i added an "regenerate obstacle map" right after the tilemap was generated. unfortunatelly it changed nothing, the enemy is still ignoring the obstacles.

    BUT if i put a System.wait right after the "regenerate obstacle map" it worked fine. So that means regenerating the map takes a while and not just 1 tick as statet in the manual.

    So my question is: Is there an event like "On obstacle map finished"? I was not able to find it. Or maybe i am using a wrong approach, how did you handle that problem in your projects?

  • The bug-thread was closed. Ashley replied:

    [quote:25uvnxuz]

    Closing as not a bug: you're just seeing the effect of linear sampling over sub-pixel positions. This is a normal result in computer graphics.

    For pixel-perfect display, use the project settings 'Letterbox integer scale', Pixel rounding on, and 'Point' sampling.

    I tried those settings but the situation got even worse. after loading the example only vertical lines are shown. and if i move around those vertical lines start to flicker and sometimes disappear completely leaving a blank screen. also when using "Letterbox integer scale" the resolution is a lot smaller.

    so my bug ticket was closed and i still have no clue what is going on here...

  • After switching to "Letterbox integer scale", activating Pixel rounding and Point-sampling it is even worse than before. after loading the game only vertical lines are shown. and if i move around those vertical lines start to flicker and sometimes disappear completely. i have no idea what i am doing wrong.

    But still on my dev-system it helps just to deactivate WebGL...

  • martdsam yeah, i noticed your example with a tiledbackground. it even flickers with a single sprite.

    Colludium turning off seemless-mode changes nothing. but it was worth a try.

    Thanks for your help guys.

    i just created a bug-report:

  • Problem Description

    When using a tilemap, tiledbackground or even a single sprite made of 1px lines those lines start to flicker on movement.

    But the problem nearly disappears when turning off WebGL.

    First i started an "How To"-thread to ask if i doing something wrong, i am justing adding the link as reference:

    how-to-prevent-flickering-on-tilemaps_t182182

    Attach a Capx

    https://www.dropbox.com/s/kruahx1t1fb6v ... .capx?dl=0

    Description of Capx

    It contains a tilemap made of 1px lines. on top there is a blue rectangle-sprite having 8-direction behavior so you can move across the map.

    Steps to Reproduce Bug

    • just move around using arrowkeys to cause movement of tilemap
    • or: assign the 8-direction behavior to the tilemap to move it directly

    Observed Result

    heavy flickering of those lines depending on movement-direction.

    Expected Result

    Nothing should flicker like rendering without WebGL

    Affected Browsers

    • FireFox: YES
    • NWjs: YES

    Operating System and Service Pack

    Win 10

    Construct 2 Version ID

    r233 (stable)

  • I just noticed that the flickering nearly disappears when turning off WebGL. Turning on "Pixel Rounding" also seems to help but only on TileMaps containing a few Tiles. But that can't be the solution, right? Did i something wrong or is this an Construct 2 issue?

Abaita's avatar

Abaita

Member since 12 Dec, 2015

None one is following Abaita yet!

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies