Zebbi's Recent Forum Activity

  • Shortest path to first available tile.

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

    Ooh, any way of fixing that bug when you click on the same spot twice? It sends the player to the far left corner?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Shortest path to first available tile.

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

    Ahh, thank you! I'll look at this right now and work it into my engine, was really hoping for an answer tonight, thanks so much!! R.I.P. Carrie Fisher <img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very Sad">

  • > Ahh, is canvas resizing not the same as using a shader to accomplish it?

    >

    > Set canvas size

    > If a fullscreen mode is in use, this effectively changes the size of the Window size project property, which adjusts the size of the viewport.

    >

    Set Canvas Size just changes the window size property which adjusts the size of viewport, it doesn't stretch the game. As i understand, you want to stretch it

    > doubling the resolution to x2 (or tripling to x3, quad with x3, etc) and resizing the height by 1.2 to create old-skool rectangular pixels? Like how they aspect correct in SCUMMVM by doing a scale and changing 320x200 to 320x240 after the scaling

    >

    You can't stretch the game from 320x200 to 320x240, you can only change the viewport with Set Canvas Size action.

    Here's a quote from scummvm:

    [quote:29eqzzh8]Most games supported by ScummVM were designed to be played at a screen resolution of 320x200 using rectangular pixels (higher than they were wide). Most modern systems however are using square pixels, which means that the image appears to be squeezed vertically and the characters look wider and shorter than they should. If this option is checked, ScummVM corrects for this by stretching the game window to a resolution of 320x240 which with square pixels looks the same as 320x200 on old monitors. As with Graphic filters, this takes a little processing power to achieve. We can combine this with a Graphic filter, and for example with a scaling of x2 the window size will be 640x480 instead of 640x400.

    I'm trying to work out if canvas size should be set at all? What shader would be best for upscaling in C2? I thik the Somebody scale shader would be fine to stretch, but the game first needs upscaling evenly by x2 or x3, etc.

  • No problem! Maybe a genius like R0J0hound could take a look at how easy it would be to turn some of the hard codes more dynamic, things like the array events for each object should be able to be selected by the name of the sprite, and somehow work modulo into the expression so it only makes a new page if there's 1-4 items over each division of 4? (I'm probably being cheeky asking for this! :p )

  • I've successfully used the easystar pathfinding for tilemap algorithm to make a character walk to where the mouse is click ala:

    You'll notice in that example if you click on an unwalkable tile, the player doesn't move. Is there a way of working out the nearest walkable tile and making the player move to that, so wherever you click, the player always walks somewhere, just not through an un-walkable tile?

  • Can anyone show me an example of how to make a character move to a tile using moveto? I've been studying the second example, and can't quite figure out how to simply make a sprite move through the nodes to a tile?

    EDIT: Found one:

    Is it possible to make a character move to the nearest walkable tile if you click on an unwalkable tile?

    EDIT: got that one too!

  • Hi ! I recently stumbled upon this neat little API for pathfinding and thought it would be cool to wrap it up inside a plugin/behavior for C2. I thought a behavior extending the official tilemap made the most sense for this so here goes :

    live example (Drag and drop the blue/green square, and right-click to add/remove obstacle.)

    example capx

    behavior files

    easystar demo done in C2 (need moveTo behavior)

    live version

    The behavior is rather straightforward, just hook it up to a tilemap, define walkables tiles with the appropriate actions and you're set. It uses a tag system so you can make multiple find path calls simultaneously, and EasyStar.js allows for asynchronous calculation if need be. Just try it out !

    edit: corrected links, added another demo

    New behavior files v1.01

    v1.01 has an updated core (now using EasyStar 0.2.3, slightly modified to accommodate C2)

    Key features are an optimized algorithm, possibility to add specific costs at tile coordinates, option to enable/disable corner cutting when moving diagonally

    Does the example work properly with the updated files? Doesn't seem to draw the route properly?

  • > Is GPU scaling still expensive to use?

    >

    Nope, but rendering is. Anyway, canvas resizing will not help, you need another way, maybe shaders or effect, or maybe you can try to resize everything in your game to make it look as needed.

    Ahh, is canvas resizing not the same as using a shader to accomplish it?

  • Wow, I'm gonna take a serious look at this. Thanks for sharing with the community, mate.

    No problem! Please do let me know what you find, any bugs or what not!

    I have the garbage bin there to remove items from inventory, as you can imagine it would be easy to use that function and switch it for whatever you need like, giving an item or using it, just click the item on the bin to remove it

  • > maybe doing an extra *1.2 on the height might work?

    >

    Well, it will maybe look how you want it to, but the performance will be really bad, imagine this on 4k display, your game will render on 8k or more, then stretch to screen size. I guess it's not possible in c2 to render the game in one resolution and then stretch it to another resolution, other than screen resolution.

    Hmm, wish I could read proper code and I could figure out how ScummVM does it and try and work that in Is GPU scaling still expensive to use?

  • This isn't a plugin matriax but it works!

  • I've done it!

Zebbi's avatar

Zebbi

Member since 20 Jan, 2014

None one is following Zebbi yet!

Connect with Zebbi

Trophy Case

  • 10-Year Club
  • x3
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

12/44
How to earn trophies