jwilkins's Recent Forum Activity

  • Yeah I only read from the array once per relevant object at the beginning of the layout, and then write to it only once per relevant object at the end of a layout, or when an object is killed, so I don't foresee any of that being an issue. Thanks for the additional information!

  • AllanR Thank you! That is great to know, in that case I won't implement Bruno's solution since mine already works and based on your information, doesn't have a large enough impact to actually hinder my games performance.

  • brunopalermo That's a much more efficient idea, for some reason I had it in my head that because it's possible that a dungeon uses all 96 rooms, I should build it for that, but the changes of a dungeon actually building out all of those, and that a player explores all of those rooms, and that all of those rooms contain the maximum number of enemies is fairly slim.

    That said, I usually just look up array values based on an XYZ locations related to other values, I haven't looked up an array value based on an ID stored inside a cell, I'll hafta look into how I should do that.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?

  • 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?

jwilkins's avatar

jwilkins

Member since 17 Dec, 2016

None one is following jwilkins yet!

Trophy Case

  • 7-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies