Ashley's Recent Forum Activity

  • http://sourceforge.net/apps/mediawiki/c ... el_Shaders

    [quote:w90dumg1]float hotspotX; The X co-ordinate of the hotspot of the object with the effect, in texture co-ordinates.

    float hotspotY; The Y co-ordinate of the hotspot of the object with the effect, in texture co-ordinates.

    Angle isn't available I'm afraid...

  • You do not have permission to view this post

  • Lots of modern browsers have ******** javascript optimisations (involving compiling it to machine code) which is a plus.

  • You do not have permission to view this post

  • if I use external textures as in load files to fill sprites are the external textures all converted to PNG before the app runs?

    If you mean actions like "Load frame from file" at runtime, then no, they're decompressed and loaded directly in to video memory. There would be no point converting the file to PNG then loading in to video memory! That would be the same as decompress source file -> recompress source file as PNG -> decompress PNG -> load to video memory!

    [quote:20r9lmez]Is it faster to use external textures instead of ones inside the cap?

    Probably not, it would only affect the startup time, and if the startup time of your application is fine, there's no point caring.

    [quote:20r9lmez]When I add a sprite to Construct it converts it to a PNG, but if it's loaded in the runtime will Construct convert it to a PNG as well?

    As I said earlier, once images are saved in Construct, they stay PNG, and the runtime loads them as PNG.

    Basically, to summarise the system:

    Images in Construct are stored as PNG, given to the runtime, and then decompressed to video memory on startup or another time (depending on your texture loading settings).

    Images loaded at runtime are immediately decompressed to video memory.

    That's it!

  • As soon as you hit save in the picture editor, the image is converted to PNG and stored inside the .cap. They're also exported to the runtime as PNG. So what you use before importing it doesn't matter, although I'd recommend something lossless obviously.

  • Still makes me wonder why the last pixels are clipped. I've been under the assumption that no matter what size the sprite/texture is it's dimensions are always stretched to the power of two in the GPU memory.

    Maybe some engines do this, but Construct does not, it places the texture unscaled with transparent edges on the smallest power-of-two texture that can accomodate it.

    You could also get into the habit of using .dds files

    Construct does not use DDS internally, so the file format you use won't affect this.

    As for your original problem, the technical reason the clipping of 1 pixel occurs is this:

    Construct supports scrolling to floating-point co-ordinates (this will happen centering the window on almost any moving sprite) for optimal display. It makes scrolling and motion very smooth. However, it causes a problem for tiling.

    Graphics cards can natively tile any power-of-two texture seamlessly, a bit like using a mesh distort on a sprite with UV co-ordinates above 1. The problem is when the texture is not power-of-two, Construct stores it on a power-of-two texture with transparent edges, so tiling that would have transparent areas between each tile - not very useful.

    So in that mode, Tiled Background resorts to an alternative tiling system which basically amounts to drawing separate sprites in a grid. However, when you scroll to a floating-point co-ordinate, you end up drawing these tiles at floating-point offsets, which overlap, but due to the way they blend, they have one pixel seams between them. There were a lot of complaints about the seaming - it doesn't look good at all. So as a fix, pretty much the only thing that I could do was move the tiling back one pixel, so the next tile covers up the seam. But you lose one pixel to the bottom and to the right of your tile. As far as I remember, if you stretch up an image to fill the power-of-two texture and tile that, it blurs the actual texture, so isn't any good either. Basically, there's no way to perfectly tile non power-of-two textures with floating point scrolling.

    Note the layout editor does not support floating-point scrolling, so you always see it perfectly here. (it should probably preview the same as it'll appear in the runtime though, I guess that's a bug)

    The only way around it is to use power-of-two textures. I can't even make it tile perfectly if you disable floating point scrolling by forcing scrolling to round(x) and round(y) - then applications which do scroll smoothly will see their tiles jittering by one pixel when it hits an integer scroll position.

    So yeah, it's complicated. But basically you can totally side-step all the problems, just by using a power-of-two texture, as is documented (although maybe the object itself should tell you). Those tile perfectly on the GPU. So, there's your explanation, and your fix

  • I don't think anyone's started an XML plugin yet. So feel free to start one. Post any questions you have here and I'll try to answer them all!

  • Just curious how many of you have a 64-bit OS. To check for Vista or Windows 7, go Start, right-click Computer, select Properties, and it's listed under 'System type' (eg. "64-bit operating system"). I've forgotten how to check on XP

    Note this is different to having a 64-bit CPU. You can still install a 32-bit OS on a 64-bit CPU, and most CPUs these days support 64-bit, but I'm sure there are still a lot of 32-bit OSs around (mainly due to XP).

    I'm not going to be coding anything 64-bit any time soon (the only benefit is possibly a small performance gain on 64-bit systems, and involves substantial code maintenance), but it'd be interesting to know how far 64 bit has gotten these days.

  • Don't bother with looping/IDs. Just put the array in a container with the enemy and each enemy gets its own copy of an array. See Containers.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Put something on the tracker and I'll have a look for the next build...

  • Never heard of this before. I would suggest ensuring your graphics card drivers are up-to-date and seeing if that helps.

Ashley's avatar

Ashley

Early Adopter

Member since 21 May, 2007

Twitter
Ashley has 1,447,035 followers

Connect with Ashley

Trophy Case

  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • Forum Mega Brain Made 20,000 posts in the forums
  • x109
    Coach One of your tutorials has over 1,000 readers
  • x63
    Educator One of your tutorials has over 10,000 readers
  • x3
    Teacher One of your tutorials has over 100,000 readers
  • Sensei One of your tutorials has over 1,000,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • x36
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

32/44
How to earn trophies

Blogs