jwilkins's Forum Posts

  • I haven't run into any issues with this yet, but I am concerned I might in the future and want to address this earlier in my project rather than waiting until it becomes a problem.

    So, I'm using a seed generator to procedurally generate dungeon rooms. These rooms are connected to one another, but are separate layouts. This mostly works right out of the box, but there is of course the issue of tracking changes made to the seeded rooms, specifically Enemy Health, position, and state.

    I've addressed this with a 3D array that records those values for each enemy whenever you leave a room, and then loads them when you enter it. It works great!

    But the array is by far the largest I have ever worked with, clocking in at 24,000 cells. Most of these cells are empty (there is an X column for every potential room in a dungeon, with a potential maximum of 96 rooms in a dungeon) and these cells mostly just store integers, though a handful do store small strings.

    Do I run the risk of this being too large? If this is too vague, what would be a good rule of thumb regarding array size?

  • Mobile devices are much less powerful than a PC, so there could be any number of issues. That said, one common issue is updating text every tick or too often, this is a very resource hungry process on any device but will slow down mobile devices especially.

  • This might seem a little silly since this is immediately being marked as solved, but in an effort to answer this question for future users with the same issue, I wanted to do a quick bit of documenting my solution to a problem that has been asked at least a few times before here based on search results of this forum.

    Firstly, you should know that if you want to host your Construct built games on your website, you really shouldn't use Wix as your website design kit. I found this out the hard way, but unfortunately Wix does not give you access to your sites folder structure. You have to upload files through the built-in uploader, and the uploader will not accept javascript files. But, if like me, you made the mistake of jumping on a deal because you needed a website fast for some reason, and you didn't learn this until after the fact, then you aren't out of luck, you just have to go about it differently.

    This guide got me 90% of the way to embedding my games into my site. To put it simply, you are creating a Netlify.com account and uploading a zipped folder with your HTML5 Exported game in it. Then, you copy the address it gives you for this, and place that into Wix's iFrame tool. This is all covered better in the linked guide, however this will only work for you if you had planned to embed a single game. You can upload more deployables using Netlify, but only if you do so on your own domain, and we cant link our Wix domain (or at least I could not find a way to do so).

    The way around this is very simple, but not covered in the above documentation. If you wish to embed more games into your site, simply place them all into a folder, then zip that folder and upload it the same as documented above to netlify. You can then append the subfolder name to the end of the URL in your iFrame and it should work flawlessly. An example would be yourdeploy.netlify.com/Game1

    Again, this might seem obvious, but it might also help some people with the same problem in the future.

  • Colludium Awesome! Can you briefly explain how its meant to work?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the suggestions. I actually found a way that, while an elegant solution for me, might not be the best for others, but I figured I'd document it here.

    The short of it is that I am already heavily utilizing functions in my game (because you always should), so the PlayerFamily picks the appropriate MountFamily in this case, then passes that MountFamily objects UID to a function that identifies the MountFamily by its UID.

    However this function instead picks the MountFamily AS a PlayerFamily (remember, all Mounts are Players, but not all Players are Mounts) giving me access to all of the PlayerFamily functionality I already have setup.

    It would maybe be a little cumbersome on its own, but this baton pass approach easily fits into my heavy use of functions already, so it worked very naturally for my project.

  • So I have 2 families.

    The first is simply called "PlayerFamily", and encompasses everything in the game that is a "player", in other words objects that move, jump, attack, etc.

    The second is called "MountFamily". Every object in "MountFamily" is also a member of "PlayerFamily". Mounts are differentiated because they are players that can be ridden (horse, boar, dragon, etc).

    Generally I pick my objects via the "PlayerFamily", but what's the best way to check if an object in "PlayerFamily" is also in "MountFamily"?

  • The "Scroll to" Behavior is going to handle this for you. Put the behavior on every object you want the camera to follow and it will automatically find a middle point if it can. If objects are too far away it will still place the center of the camera in between them, but you'd need to manually add in some camera zoom features to fit the characters.

  • The easiest way to avoid infinite loop is to include a condition like "loopindex<100" to the While loop.

    While that's useful to know it doesn't actually help in this situation. The problem is that I can't come up with a way for this While loop to have something resembling an "else" that doesn't create an infinite loop.

    Currently I have a "While" loop that checks to see if the shadow is overlapping a platform, and if that platform is in the same "Z-Lane" as the shadow. If it is, it sets the shadows Y position to shadow.y-1

    This causes the shadow snap to the tops of platforms higher than its starting position, but I cannot figure out how to reverse this and have it snap to the tops of platforms lower than it's starting position.

    Pseudocode wise it needs to look something like this:

    While

    NOT Overlapping a platform

    OR

    Overlapping platform, but platform's Zlane is not equal to shadow Zlane

    Set shadow.y to shadow.y+1

    But if I just do that, it will flip between the previous while loop and this one.

  • Just as an update, I have been able to figure out half the issue by utilizing a suggestion left in this thread:

    construct.net/en/forum/construct-2/how-do-i-18/blob-shadows-69294

    My code now uses a "While" loop that checks to see if the shadow is overlapping a platform, and if that platform is in the same "Z-Lane" as the shadow. If it is, it sets the shadows Y position to shadow.y-1

    This now means that the shadow snaps to the top of a platform IF the player jumps from a low point to a higher point. However I cannot come up with a solution that doesn't create an infinite loop to snap the shadow downwards.

    Any suggestions?

  • You need to identify (Pick) specific instances of objects.

    If for instance you wish to pick the pinned cat of a hitbox, you can do so with cat.pin.pinnedUID which returns the UID of the object pinned. Using this with the "Pick by comparison" condition will let you identify specific objects and all subsequent sub events will occur only to that pinned instance of the objects.

  • You can use the container suggestion earlier, but I also don't understand why you wouldn't use the Pin Behavior instead of updating the X,Y every tick? Add the pin behavior to your "fanatico" and then on creation of your hitbox have it create and pin the fanatico to itself.

  • I'm making a platformer with multiple lanes by using Colludium's Platform2 Behavior. This makes collision events a little different.

    When the player jumps or is thrown into the air they need to create a shadow sprite that follows their X position and is destroyed when they land. That stuff is all easy to setup, no real concerns there.

    Where things get difficult is adjusting the Y position of the shadow sprite object based on the highest Y position of any solid object underneath the player.

    Additionally, the Platform2 behavior utilizes collision masking, meaning there are multiple layers of platforms in my game so we also want to ignore the layers not currently in the same "ZLane" as the character casting the shadow.

    Ideally this solution also can account for dozens of these shadows being cast at a time, as I would like the non-player characters to cast them as well (so long as they are on screen of course).

    I've tried a couple approaches to this but nothing has worked to my satisfaction thus far. I really do want shadows in because it helps the player know what lane theyre in and where they can expect to land.

  • Hmm, I think I see what you are doing. I hadn't thought to use the dictionary object, that thing is much easier to organize than arrays, maybe that is the best way to go about this. Thanks for the food for thought!

  • That is very similar to the setup I am looking at relixes. In your case, what do you plan to do for enemies that have no weapon associated with them? This is of course assuming you plan on adding enemies like that.

  • So bear with me here, this is more a question of a best practices, and it's also going to get into the weeds a bit. I'll outline the issue, then outline the options I know of, along with their pro's and con's. Please read the whole post if you have a suggestion.

    I'm making an action RPG. Prototyping is going really well! Because the sprites are very simple 2D pixel art, attack animations utilize paper-dolling techniques where I overlay a weapon sprite animation on top of or underneath the player. This function extends to all humanoid enemies as well. Because I want the player to be able to play as and/or recruit any of the creatures they come across, player objects and enemy objects are functionally the same. This is also helpful for/required for other gameplay elements. Players and enemies are all grouped under the same Family I'll refer to from here as "Character Family".

    So far this has worked really great! Originally I was pinning the weapon sprite to the Character Family sprite, and then storing the information for the attacks (range, frames where collision detection is necessary to register hits, knockback values, etc) inside those weapon sprites.

    Then I hit my snag: This only works for Character Family sprites that use weapons. I have plans for other Character Family sprites (creatures for instance) to not use weapons, and instead call attack animations from their sprite sheet. I can't store all the information for those attacks in an object that they won't have pinned to them.

    Here are the options I have come up with so far:

    1. Store all the instance variables for the weapons inside the Character Family instead, and update them when appropriate. This is going to heavily bloat my Character Family instance variables, so I'd like to avoid it. Right now human players only have 2 attack animations per weapon, but enemies without weapons could potentially have more, which adds up quickly considering how many values each attack needs to store.
    2. Create "dummy" weapon objects for creatures. The brute force method for doing this would be to create invisible dummy weapons for each creature, but I could easily modify this to instead point to one weapon per enemy attack. It's inelegant but it does keep things relatively well organized.
    3. Store attack information in an array. This is the obvious one, but it too has some setbacks I can't get around. Specifically, I am trying to automate as much of this work as possible, and as such having been using families and functions a LOT. But if I want to attach an array to an objects container, I can't do so within a family, so I can't reference it easily (unless I can and I just don't know how).

    Any help here would be appreciated, and I'll try to explain everything else around this better if needed.