jwilkins's Recent Forum Activity

  • So I'm trying to optimize my dungeon generation. Currently I use a similar method to the "3D Castle Maze" example. I generate a tilemap at runtime that then creates 3D objects as solid walls on each applicable tile.

    However ideally I would like to optimize this further. Because my generated dungeons can be quite large and complex, and because I am spawning hundreds of enemies, I do start to see performance drops when I reach 900+ objects.

    One way to reduce the number of 3D objects is to identify straight lines of repeating tiles and create a single 3D object that is the length/width of those identical tiles (plus their corners) instead of one 3D object per tile.

    I have an over complicated, very broken version of this already so I'm hoping someone can point me to a simpler solution to this. Currently I ID every "corner" tile and repeat a check in 1 direction for that corner until it ID's a different corner, and spawn the 3D object based on that information. Unfortunately this is really complicated and falls apart a bit at some weirder junctions you can see in the screenshot below:

    Tagged:

  • I've been having random, intermittent visual issues with effects in 3D through out my project. This either seems to be tied to updates being made to Construct or changes I am making in development that I assume won't affect established effects but apparently do. Here's some examples:

    Here we have an issue where a tint effect placed on a sprite being used as a 3D face screws up some aspects of other 3D objects behind it.

    The above issue has been occurring for a longer period, some bullet objects display even when behind a 3d object.

    These kinds of issues have been popping up through out the project, what should I look for to fix them and what might be some best practices to avoid them going forward?

    Thanks in advance

  • A stupid method I have used is to pin a fan shaped sprite to the player billboard facing toward the camera. Your player billboard is already locked to the camera so if you pin the angle of the fan, it should do the same.

    Then you set any wall colliding with that fan to invisible. This has some obvious drawbacks, like allowing players to see through walls, but works well enough in many cases.

    Alternatively, you could use the Line of Sight behavior to cast a ray in the direction of the camera from the player, and then clamp the camera distance to the length of that ray if it intersects a solid object. That might have some issues to, just spitballing.

  • A quick follow up because I had an idea on how to approach this that I think would work, but presents edge-cases I can't account for and just isn't as stable as the original brute-force method.

    My idea was to identify corner tiles in the generated tilemap and then assign each one a direction. The system then repeats a check in that direction from that corner until it identifies a tile different from the wall connected to the tile:

    Tilemap being used (arrows id corners and which direction they check for):

    I couldn't use the Auto-16 tilebrush and had to use the 47 in order to identify both inner and outer corners. This ALMOST works:

    There are some positioning issues I could work through, the bigger issue is that using this method, sometimes a wall is created that has no "spawn corner":

    Short of brute-force checking corners for connecting walls and fixing them after the original run, I can't think of an elegant solution to this. I'm probably going to revert back to the "one tile one 3Dobject approach", but I wanted to document this here in case anyone has a similar issue and wants to refine my approach. Here's my function:

  • You are likely going to need to split the colored parts of the sprite into their own sprite(s) and pin them to the player object.

    You can change the color of the specific colored parts using "Replace Color" but I am not aware of any way you can apply specific effects to specific colors.

  • The title doesn't do a great job of explaining what I hope to do, so let me explain.

    I have a procedural generator that carves dungeons using a tilemap and brush. Once the tilemap carving is completed, I check every tile in the tilemap and if it is an edge tile (in the brush editor this is any tile that isn't the 10th tile in the brush) and place a 3D object on it.

    The end result is this:

    Which looks fine. But, for several reasons, I would prefer to only place one 3D object down per uninterrupted instance of an edge tile. I.E. a straight wall of the same tile places one 3D object that spans the entire length or height of that wall.

    I'm not sure how to go about doing that though, any suggestions?

  • I did look there of course but made the mistake of searching for "Is in Debug" instead of "Is in Preview", thank you all the same.

  • I seem to recall this is a feature, that I can check to see if the game is running in a preview and then call actions if it is or isn't, but I cannot for the life of me find where this is located in the documentation.

    Tagged:

  • You do not have permission to view this post

  • You can create an object for the camera, and use the pin behavior to attach it at whatever distance you want from the player.

  • So... this issue has become weirder.

    I've spent the day trying to troubleshoot this issue with no luck. The "Damager" object still does not destroy with it's pinned "CreatureCollision" object.

    Now, because "Damager" is a multi-purpose object that can be used for a variety of attacks (projectiles, melee, area of effect, etc) it has a number of behaviors that I simply disable/enable to fit my needs.

    For giggles I removed the "Orbit" behavior from "Damager". I wasn't using it yet for any attacks, and I figured MAYBE it was interfering with the Pin behavior because they share Pin features. I dunno, I'm grasping at straws here.

    Anyways, this resulted in something I've never seen, the next time the "Damager" object glitched, it remained visible as usual... but disappeared from the debugger and no longer interacts (I.E. damages the player:

    As you can see, there are NO instances of "ParentDamager" or its "DamagerFamily". But its right there, and there are no objects that share this sprite. It's not a side of a 3D object either, it is JUST a sprite.

    Does anyone have ANY suggestions on what I should be looking at to fix this? Is this just a straight up bug?

    EDIT: One last update on this for anyone that ever runs into this as well. I was not able to replicate this in another .capx, so I don't know what bizarre collection of settings/behaviors/actions lead to this, but I can tell you how I "fixed" it.

    I think that the issue may have been a scale tween that was set to "Destroy on Complete". Something must have been interfering with it and preventing it from completing (Possibly the "destroy with pinned object?"), but that doesn't explain the above debugger weirdness.

    Ultimately I just circumvented this by unchecking the "Destroy on Complete" box in the scale tween, and slapping a timer that is the same duration as the tween, but destroys via an action.

    TL;DR, I don't know what caused this but I can tell you how to work around it, if anyone has any more insight or suggestions I'd love to hear them.

  • A straightforward way to achieve this is to create multiple 9-Patches with different images (your animation frames), place them in a container with one another, set them to the same size/patch settings, and have one of them use the Timer behavior to selectively turn their visibility on and off.

    There may also be some plugins people have made to achieve similar results, but the above will brute-force the result you are looking for.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
jwilkins's avatar

jwilkins

Member since 17 Dec, 2016

None one is following jwilkins yet!

Trophy Case

  • 8-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies