Mort's Forum Posts

  • Currently, the shadowcaster object only supports rectangular objects. Here's a way to make circular objects cast realistic-looking shadows, by generating a ring of rectangular shadowcasters around the edge of the circle.

    You can do something similar by putting a single narrow box in the middle of the circle: - but it's not accurate if the light source is close or the object is large, both of which I need at the moment.

  • Oh, okay - the low FPS does explain it. Thanks!

  • That's weird. Half the time it looks really cool, but then it flickers and there's a sheet of low-res black noise over the top of the slimefall.

    Maybe it was broken by a Construct update. Could I get you to have a look, and see if it works for you (on this new version?) If not, I might try and pin down something for the bugtracker.

  • That particle object is beautiful. Seriously, I'm tempted to put it on a black backdrop and export to screensaver.

  • I wondered if that might be intentional! But it doesn't look quite right to me; shadows are usually soft on planets which have an atmosphere:

    http://antwrp.gsfc.nasa.gov/apod/image/ ... esa_c1.jpg

    ...and the dividing line isn't totally clean even on airless bodies (because of variations in terrain height):

    http://www.astromax.org/planets/images/ ... -Moon5.jpg

    You could replicate the former effect by putting a sprite over each planet (with a gradient sphere, filled black and white, and an effect like Lighten). Then you could adjust opacity of the lighting effect with distance from sun.

    Or you could keep the clean and simple art style. I'll butt out.

  • That's looking good!

    I'd recommend moving the shadows layer below the objects layer, though - that way the shadows trail after the object instead of starting in the middle.

  • Hot damn, that's a good solution.

    Shadows are semitransparent already, yes. But it's at an object level, so if two shadows overlap, the effect adds. (Note: probably abusing terminology).

    David's saying that instead of making the shadows semitransparent, you can put the shadowcasters on a new layer and make the whole layer semitransparent.

    Because layer transparency is done at a whole-layer level, the shadows won't add to each other.

  • That is... troublesome. Difficult to avoid.

    I tried to make a counter-example, but failed - truly, impractically perfect detection is required. Absolute shadows would not add, but only due to maximum values already obtained. Realistic shadows incorporate ambient light, and usually cannot be represented by total darkness. No solution presents itself; an inbuilt event to the shadowcaster plugin is required.

    I find no solutions.

    So very drunk. Flatmate held large gathering, and for the first time in well nigh a year, I need not drive home. Apologies for unhelpful conclusion.

  • Thanks for the timeline example! I think I get how it works now.

  • Yes, I could definitely use a 'rotate around position' action! But now that you've mentioned it, I'm pretty sure one of the math guys on the forum will quote a one-line expression involving sins, coses, and maybe lerps, and it'll somehow work perfectly.

    Anyway, here's a pretty good line-of-sight detector based on instant-hit bullets (which are effectively lines, because they just keep stepping in the same tick until they hit something). The light fires a stream of detectors at the moon that are interrupted if they hit the planet. See code comments for more detail.

    http://www.mediafire.com/?ra3xadhepzb

    Current accuracy looks pretty good to me, but might break down over long range. If you want better accuracy, reduce the size of the detector sprite, reduce the speed of the bullet behaviour, and increase the number of bullets produced per round. It causes slowdown if you scale it up a lot (eg, currently makes I think 40 bullets; 400 is too many).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As far as I know, there's no equivalent to an 'object is shadowed' event.

    You can use the Line of Sight object to *sort of* do this, but it detects Line of Sight to the hotspot instead of any edge that's in sight, so it's not exactly what you want.

    (Also, it doesn't work for your cap, I think because your hotspots are in odd places; they're being used for the rotation.)

    http://www.mediafire.com/?z2m43y9rdv7

    So you probably need to make something relatively inefficient, like shooting lots of sprites in the direction of the object you want detected (with a random component to make them spread out), destroying any that strike stuff that's in the way, and seeing if anything actually hits the target.

  • That's interesting! When the thread's done, I guess I'll add something about particles to that optimization article in the wiki.

  • Hmm, you're right; it works just as well with half the particles at double the size! That's much better.

    Is there an inbuilt reason that particles are more efficient than sprites to render? I've also been making a similar waterfall that's entirely event-based, using sprites.

    http://www.mediafire.com/?wu4j5dtttub

    (Not a very efficient waterfall, but I do need objects to interact with the particles. I'm eventually planning to have a swarm of objects chased through it, encountering some resistance and pushing the blobs of water aside.)

  • Nothing profound - just a simple particle waterfall, in case someone wants a waterfall in their game.

    (Anyone else have any waterfalls to share? I've been trying to make a plasma-based waterfall, but at best it looks like a slow-moving stream trickling down a flat surface.)

    http://www.mediafire.com/?ljiopddy3jn

  • There is an option nobody's mentioned yet - if you're lucky, you might be able to find someone with experience who can do the music specifically for your game. I guess the problem with doing games solo is that there's no way to do top-notch work on everything at once, unless you spend a few years learning about music, a few years on art, and then make the thing.

    The Spirit Engine 2 has some of the best music I've heard in a game, and that was a one-man project - well, one guy working in MMF, and someone else doing the soundtrack.

    (Some of those songs are online - check out 'A lost dream': http://www.syntesis.org/node/65)