Zebbi's Forum Posts

  • Okay, so let's say I've got these variables:

    XPoint1

    YPoint1

    XPoint2

    YPoint2

    XPoint3

    YPoint3

    XPoint4

    YPoint4

    XPoint5

    YPoint5

    And I've got 5 behaviours that, currently, I have grouped into five different sets of events that, depending on the behavior, checks a system expression against it's relative number (behavior #1 checks for an overlapping point and stores it at XPoint1 and YPoint1, behavior #2 checks for an overlapping point and stores it at XPoint2 and YPoint2, etc). The five behaviors are familied. How do I efficiently, run a "for each "family"" call the relevant pair of variables that correspond to the behavior number in the family, or should I say, the loopnumber of the behavior?

  • So, if I have some variables that are named with different numbers (Height1, Height2, Height3, etc) how do I pick these with a loop index, for instance:

    For each instance

    Set variable Height'loopindex'

    where the variables are each picked based on they're loopindex, because it now correlates to the same name?

  • rexrainbow

    I've been tinkering with this effect and it's really cool! I'm having some trouble getting object positions to track accordingly. I'm using rex's behaviors but I'm using a tiled background for the object ground. Will that impact the way the perspective behavior works? I currently have grass (as the tiled background) and houses (as sprites) but I can't get my houses to appear anywhere after setting up the camera sprite to the ground behavior's camera and the houses perspective behavior to the grass's ground behavior parameters. In the sample capx it looks like 0,0 (on the X and Y parameters of the perspective behavior) is the upper left hand corner of the canvas but I don't see anything populating there when I test things out.

    EDIT: I've also tried setting the logic positions to the sprites current x/y positions, which could be a mistake (as I'm not so confident with all the math), but I thought it was worth a shot. I also don't see them when I try that out.

    It's been a while since I've use this but doesn't the math have to be inverted, or something?

  • The fact canvas+ (and really all non-browser engines) lacks so many features far outweighs any performance difference. Web Audio, form controls, XML parsing, standard-compliant inputs, sometimes even letterbox fullscreen, the list goes on and on. Fast and broken is worse than slower and working. If you can delete features to make something faster, it's not particularly useful if you need the features that got deleted. Note that (at least in the past I saw) it has other problems that come in to play as you increase the scale of your game, such as lacking the memory management that browsers have, so games tend to crash due to running out of memory where they would work in a real browser engine.

    We deprecated non-browser engines a long time ago and I firmly believe no C2 users should use them, even if they're faster in some cases.

    Modern webviews don't have any file size overhead. For example on Android if you target 5.0+, the APK is small compared to the size including Crosswalk. By the end of the year Android 5.0+ should be on the vast majority of devices. It's already at about 2/3rds worldwide.

    Ashley I complied for webview on XDK, and for a simple platformer, the performance was far from usable, whereas canvas+ was perfect, speedwise. It completely screwed up alignment of tiled backgrounds and simulate key didn't work, but it was a usable speed, a solid 60 fps, rather than XDK's attempt. Is phonegap better for performance in your opinion?

  • awesome thanks for validating that! I remember trying that awhile back but yea it was HORRIBLE.. audio was f'd up and performance was terrible.. but that was way before android 5 was out

    It still is horrible, XDK is no better in my opinion.

  • >

    > *quote snip*

    >

    > I 100% agree with you, I also would have liked to have a third tilemap for jump-throughs, which would complicate issues even further, which leads me to suggest that tilemaps need the ability to set behaviors per tile/groups of tiles.

    >

    Well, that wouldn't really work, since adding behaviors to individual tiles would inevitably lead to people trying to add movement behaviors to them, and that wouldn't work for obvious reasons.

    The best workaround I can suggest is to have 3 separate Tilemap objects, instead of 3 instances of the same Tilemap object. That way, you can filter the traces however you want.

    I tried that, but I couldn't copy the tiles to the clones with JSON, but that's on a side note, I don't want to derail this thread.

  • how did you make a web view game? I don't see it as an option in XDK.. there is "cordova" but ultimately that seems (from my most recent game) to be bloaty and ran fine thus leaving me to think it's still using crosswalk.

    Perhaps I get webview if i uncheck "optimize with crosswalk"?

    Yeah, it makes a small apk.

  • The fact canvas+ (and really all non-browser engines) lacks so many features far outweighs any performance difference. Web Audio, form controls, XML parsing, standard-compliant inputs, sometimes even letterbox fullscreen, the list goes on and on. Fast and broken is worse than slower and working. If you can delete features to make something faster, it's not particularly useful if you need the features that got deleted. Note that (at least in the past I saw) it has other problems that come in to play as you increase the scale of your game, such as lacking the memory management that browsers have, so games tend to crash due to running out of memory where they would work in a real browser engine.

    We deprecated non-browser engines a long time ago and I firmly believe no C2 users should use them, even if they're faster in some cases.

    Modern webviews don't have any file size overhead. For example on Android if you target 5.0+, the APK is small compared to the size including Crosswalk. By the end of the year Android 5.0+ should be on the vast majority of devices. It's already at about 2/3rds worldwide.

    Absolutely, I was impressed how small 5.0+ build webview was in compared to even canvas+, but the the performance was just terrible in compared. Do you still recommend XDK as first port of call, or is phonegap better for android?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • >

    > *quote snip*

    >

    > Ahh, so is there a way of sorting it out so I can have a second instance of the tilemap (for backgrounds) with solids disabled and not trigger the trace?

    >

    No. This is also unlikely to change, as having the Solid behavior continue to have an influence after switching it to custom seems arbitrary. Code-wise, I would either have to used an optimized method that might break in future construct versions, or perform a second search through an already filtered list. I'm not really fond of either solution.

    IMO, this problem of yours highlights the Tilemap plugin's inability to mark a tile as having no collision. Though the Tilemap plugin has improved significantly since its initial release, these sorts of shortcomings are why I don't use it in my projects.

    I 100% agree with you, I also would have liked to have a third tilemap for jump-throughs, which would complicate issues even further, which leads me to suggest that tilemaps need the ability to set behaviors per tile/groups of tiles.

  • >

    > >

    > > *quote snip*

    > >

    > > Here's an example, sorry I used 5 traces, it's just for a experiment, but as you can see, the second instance with the solids disabled still affects the trace: https://www.dropbox.com/s/0p6rkii91i8e4 ... .capx?dl=0

    > >

    >

    > Well, I would like to look at your project, but you've got these other plugins in it.

    > [quote:1u81lm8u]

    > MagiCam

    > Simulate key event

    > Platform Plus

    >

    > While I doubt another plugin is causing a problem, it's still a good idea to keep other 3rd party plugins out of a .capx when you are reporting a bug. But most importantly, I'm lazy and don't want to hunt down and install these plugins <img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing">

    >

    Sorry, forgot about those! Here's a cleaned version: https://www.dropbox.com/s/62rf3cy1y7ukn ... .capx?dl=0

    As you see with the delayed function, the added instance causes the tracer to find the obstacles.

    Well, the problem is clear as day! Remember what I said before?

    If you are using the plugin in 'Solid' mode, it will ignore any instances where the 'Solid' behavior is disabled.

    That only applies for 'Solid' obstacle mode. It doesn't work in 'Custom' obstacle mode.

    Ahh, so is there a way of sorting it out so I can have a second instance of the tilemap (for backgrounds) with solids disabled and not trigger the trace?

  • it's a moving target.. i am sure things get faster / slower / shifting all the time.. file size should be the least of your concerns.. if the game is good people will download it. if they choose not to download your game because it's too big, they are fickle and thankfully a very small % of people downloading games.

    Well, it's not a moving target, it's exactly the same as it was last year, canvas+ is fast, xdk is slow, Ashley isn't supporting for cocoon, which I can't understand. Filesize, well, I don't believe anyone would ever download anything I make, I just do them for fun, and yes, people will care if a game is 4mbs vs. 8mbs, so it's important.

  • Well, I just compiled a comparison, and cocoon's canvas+ is still massively faster, but the touch-to-keyboard plugin didn't work, which is disappointing. The filesize for XDK using webview surprisingly is about half of what cocoon's canvas+ gave me, which was really unexpected. Any ideas how to make XDK faster, or is that the best I'm gonna get?

  • The plugin draws a (virtual) line from start point to end point. (you dont need to actual draw that line)

    When that line intersects with an 'obstacle', the expressions Trace.HitX & Trace.HitY will hold the exact coordinates of that intersection.

    Trace.UID will hold the UID of that obstacle.

    So, yes, it detects obstacles only.

    Where 'obstacles' is the description that the author of the plugin gave to what you would like to see named as 'targets', i understand.

    The plugin (although based on) is not a Line-of-sight detector, it is basically the opposite.

    Don't worry, it works fine for what I need it for, I just can't get it work with that particular tilemap setup, I've updated my project and you can see the second instance interrupts the tracer when it's loaded.

  • Pick overlapping point system condition could help.

    I feel so stupid, thanks for pointing that one out, I've even seen it and didn't think to try it!

    That seems to work to check for an overlap within the shape at any point. Or is there a more efficient way I can test for this using one event?

  • The distance() expression only gives you the distance between two points. To get the closest distance between a point and a shape it will be more involved. Take the example of a square shape, you'll need to get the distance from all the corners and all the edges and pick the lowest value.

    Basically you'd setup the imagepoints on your object like this:

    0---1
    |   |
    3---2[/code:ohadkwkd]
    Where 0 is the origin.
    Then to calculate the distances you'd use the distance() expression to get the distance to a point, and for the distance to a line you'd use a vector dot product to see if the the projected point is on the line, then a vector cross product is used to get the distance.
    
    Example here:
    [url=https://dl.dropboxusercontent.com/u/5426011/examples34/closest_dist.capx]https://dl.dropboxusercontent.com/u/542 ... _dist.capx[/url]
    
    Now if that is too much math you can go for an approximate solution:  Put a lot of instances all around the shape you want to get the closest distance to.  It should look like dots going around the object's edge, the closer together the better.  Then you can then do an event like this:
    
    dotSprite: pick closest to  (mouse.x, mouse.y)
    --- set text to distance(dotSprite.x, dotSprite.y, mouse.x, mouse.y)
    

    I see, so maybe distance isn't so much what I'm looking for? What I need really is an expression that tests if a points x/y is overlapping an instance. i know objects can be testing if they're overlapping, but could a point be tested with system expressions?