Lou Bagel's Forum Posts

  • > I could not find any but still the project does not open in R397.

    Press F12 and check error messages in console log.

    Oh thanks for this! I didn't think of that right away and have a large project - was browsing through thinking I'd never find them.

    If the new version of Construct isn't going to allow these filenames, I wonder if a hotfix can be applied to the previous version to trim these spaces on filenames.

  • Thanks for those suggestions. After playing around with this a bit more I think what I setup works for now. If I need to update this later I'll keep what you two posted in mind.

    I felt like making a minute long dev vlog video about this:

    Subscribe to Construct videos now
  • I don't remember when the "Allows Sliding" property was added to the 8-direction behavior, but I thought it was exactly what I was looking for in my project. The player could get snagged on some solids in spots and I thought it could help gracefully slide around objects at times.

    It did help, but I noticed it caused a lot of shaking at times. When I held on the movement controls to keep the player moving into a solid either several objects would shake or the entire screen would shake, maybe due to scrollTo behavior on the player is shaking the viewport/camera.

    I'm not wanting to file a bug report (or complain) as I seem to have found one solution: Turn on pixel rounding in the project. I'm not wanting to do this in my project as it seems to make the camera movement choppy at times.

    Another solution to the shaking objects it to make sure objects are at integer pixel values themselves. I tested that and it stopped objects from shaking. This didn't stop the entire screen from shaking at times though, as I assume that is caused by the player being at a non-pixel value.

    Instead of trying to troubleshoot this and add a bunch of changes (in my large project) to prevent this, I thought it might be better to re-create this functionality. I always view pre-built functionality, such as behaviors, as quicker to use but less flexibility, whereas custom solutions can take longer (sometimes much longer) to create but can be fully customized.

    In this case I mainly just want players to not get stuck going through doorways as easy. At least that was the only real spot I was getting caught on. I don't have that many diagonal (non-rectangle) solids in my project so I don't need much sliding. So I don't even need to re-create the entire functionality; I just need something very specific.

    Trying to think how the sliding functionality works under the hood, I figured if moving down and running into a solid, it might simply check if the object can continue to move down if moved slightly to the left or right. I thought that might be why the screen shakes - as the sliding mechanic keeps moving the objects back and forth to check for slidability.

    I created a sprite that if overlapping with the player while moving the event would set the player's X value over one pixel. A bit to my surprise, it worked and looked as smooth as can be! I added some variables to the object to control direction and amount and came up with this event:

    Now I'm not sure this will be my final solution. I just came up with it and I'm not excited about having to have four extra sprites in the project for each doorway. But it definitely is helping so I'm gonna roll with it for now, fine tune it as I go, but also be open to trying completely new solutions.

    GIF: imgur.com/a/v0bCft1

    So why am I posting this? One is just to share this in case anyone else is looking into this. But though I don't have a specific question I'm asking, I would love any additional info on any of the topics I've brought up or corrections on some of the assumptions I've made. So for example:

    • Anyone else experience the shaking when allow sliding enabled? Any other solutions to resolve?
    • How does allow sliding work under the hood? (I actually haven't looked if any of Construct's code/repos are public)
    • Has anyone implemented their own custom sliding mechanic?
  • Intro

    So I've always wished that there was an integer scale outer option for the fullscreen mode. I think I might have figured out a simple work-around.

    The purpose is to keep integer scales to avoid warping pixel art but also filling the entire space, aka no black bars. If you aren't familiar, see the defining the issue section at the end.

    But I think there are a lot of people that have been trying to solve this issue. Google searching it has come up with several forum posts on this topic and feature requests. From the forum responses, it doesn't seem people have had much success figuring out work arounds for this.

    Experimenting with things, I think I just found an easy solution to this. I am still thinking it through and working out all the details, but wanted to post here to share and see if anyone can think of side-effects or issues this setup might cause. So feel free to call anything out or ask any questions. I'll be trying to work out the details and test this over the next week or two.

    Workaround

    So far, it seems pretty simple:

    • Set viewport size to 1920x1080
    • Set Fullscreen mode to Scale Inner
    • Adjust zoom (layout scale; probably dynamically in events)

    Essentially the viewport size is set to the largest possible size* so there is no scaling. Therefore, the integer scale is preserved. The scale inner setting will never have black bars.

    If you do step 1 and 2 then preview your game, you will notice your game is probably zoomed out, depending what your viewport size was previously. So now all you need to do is zoom back in. I'm thinking this could be done in events based on actual viewport size, but I'll have to do some more testing.

    When I test it out, my game seems to keep it's pixel perfectness at any integer zoom level. It might actually zoom out more cleanly as well, since scale of 1 in this setup is subjectively "zoomed out" for my game.

    Defining the issue

    Before I had a viewport size of 640x360 with Letterbox Integer Scale. The Letterbox Integer Scale kept pixel perfectness and if fullscreen the game would scale 3x (640 x 3 = 1920). But if it wasn't full screen, there would be black bars (unless window was exactly 640x360 or 1280x720). So I switched to Scale Outer.

    Scale Outer would fill all the space so no black bars. But lets say the layout was 1920x1000, the game would scale up only 2.77777x (1000 / 360 = 2.7777..). This would fill the height and then show extra space horizontally. But of course the non-integer scale would distort pixel art.

    Example of distorted pixel art:

    It doesn't always "distort" in the same way:

    Same art not distorted:

    In the past I have seen the response to simply choose a resolution that scales evenly into 1920x1080. But now, ultra-wide and over-sized monitors* are becoming more popular and phones resolutions are all over the place. Meaning there is no way to pick one resolution that scales evenly into all devices.

    As I mentioned Integer Scale Outer - it doesn't exist but has been requested. The proposed resolution, to use the example above, would take the 1920x1000 viewport and scale up 2x and then fill the extra space. The 2x comes from 1000 / 360 = 2.777 rounded down to the nearest integer. This would keep pixel perfect and fill all the space - no workarounds needed. But of course it is not a current option.

    *Over-sized & Ultra-wide monitors: my workaround wouldn't solve for this, I don't believe. I don't have a larger monitor, so can't really test, but I'd think I could just make the viewport size even larger to accommodate these resolutions. I might end up doing that, but since I can only test myself at 1920x1080, for now, I'll test this out to see if any other issues or drawbacks.

    Conclusion

    Sorry for the length but wanted to explain all the details for anyone new to this topic. Especially if this is a good workaround, that way when someone is searching for an answer they can get all the details here.

    Like I said, I just came up with this so it isn't a proven solution. Feel free to call out anything as I am looking for a long-term solution.

    TL;DR

    Look at the bullet points, as they are steps to fill the entire screen but keep pixel perfectness (integer scaling).

  • Great work! I felt the stress immediately! It's a lot of fun already and you could definitely take this idea a few directions. Some quick thoughts:

    - I think overall your point about repetition being a fear will make designing this game really fun. The mechanics are great, and you could have a blast adding variety to this. Are there drunk patrons that you want to avoid serving? Are there animations or bonuses for serving a streak of five customers (he's on fire - nba jam)? Does someone get a promotion at work and buy a round for every customer at the bar?

    - The overcooked "how many orders can you fulfill" was the first place I went for 'goal'. But you could add values to different drinks or patrons to spice that up (if a group shows up, they order three drinks at once, but you get more points if you pull it off).

    - It forgot who did what. Eventually cashier = money = green made sense, so maybe each worker having a different colour shirt would help (if this a broader issue)

    - Maybe more visual emphasis (e.g. bigger animations) on the actions besides progress bars would help the player keep track of what actions were happening, and when the action has ended.

    - After I got the hang of it, I wanted the workers to switch tiles faster.

    I hope you keep exploring it!

    For some reason I'm not getting notified of responses anymore so I just now saw this - Thank you! These are all great thoughts and points.

    Right now I've gotten back to the project I was working on before the jam, but I do hope to do more with Busy Bar once I figure out a plan that sounds good.

  • Wow, I just kind of mind dumped here. Call it post-jam venting.

    Here are some cleaner links for you:

    Another screenshot, just for a visual:

  • Very cool!

  • Busy Bar

    Ludum Dare 54 Compo Entry

    Theme: Limited Space

    Play Here: loubagel.itch.io/busy-bar

    There is a lot I wanted to do with this, but of course, in 48 hours, there is only so much that can be accomplished.

    I decided to focus on getting the basics working well and animated how I wanted. There are a few issues I'm aware of, but for the most part, everything is working pretty well.

    The additional features and such that I wanted to add were more employee types, which could be combined in different ways to make new drinks. Like a liquor pourer, person that uses a blender, person that shakes cocktails, and some more written down. So if someone wanted a martini you need the pourer and then the shaker person. For a margarita you would need the pourer and then the blender person.

    The amount of additional art this would need was one of the factors I didn't attempt this in the 48 hours. I was also hoping for a could of different locations, or visuals for different bars. I thought allowing the user to place where they want the different equipment and such (taps; cash register; clean mugs; sink; plus the other new characters would require their own equipment) would add some strategy to the setup. But alas, that would be another big undertaking.

    But I guess my main question for anyone that checks it out is regarding to the goal of the game. While playing/testing, I naturally tried to go as fast as I could. Probably due to other similar games being a race against time to serve as many customers as possible and keep them happy. But when doing this, I found it tedious and stressful, and didn't really enjoy it that much. Also, I didn't really even notice most of the animations, which I spent a decent amount of effort trying to make satisfying (I know some of them are a bit off, like the barback not really cleaning the right part of the bar, or the bar at all if in the middle spot on the 2nd level).

    I feel like I have something decent started here - maybe for a simple little mobile game - but not sure what I'd want the player striving for.

    One idea I had was making it like a puzzle. Therefore the goal would be trying to serve all the customers in the least amount of moves as possible. I think that would reduce any stress of trying to go as fast as possible, but not sure if that sounds interesting, or maybe still tedious. Also, I've never been keen on the idea of creating a ton of different puzzle levels. When playing games like that, I always think it seems like it would take a decent amount of time and effort to make enough puzzle levels and little reward, as players either fly right through them or get frustrated if they are too hard. I dunno, maybe I'll give it a go.

    End of rant - just let me know what you think, ha. Thanks.

  • Thanks for writing out the logic of how you would achieve that elsewhere. My brain is a bit foggy today and I'm not in a good spot to write out all of the logic, but let me tell you how I would get started.

    This is a non-scripting approach, as I agree, the scripting side of Construct removes a lot of the advantages of Construct.

    Create a Family. I'll call it inventoryFamily for now.

    Think of the Family as the equivalent of a class. Of course a lot of differences though. Adding sprites to this family will add all the behaviors, effects, and instance variables to the sprite.

    To start, will add a string instance variable to the inventoryFamily. I'd just call it inventory.

    Create a function for addToInventory. One param will be uid, which first condition will be to select inventoryFamily by UID.

    Now you are sure you have the instance you want. Another param can be the inventory item to add, whether it is a word or a reference number. Adding would set inventory = inventory & "," & param (if inventory has value). You can also use scripting in an event, if you want to make use of like .split(',') .push and .join(',').

    If another action needs to be taken I'd make another function for that. Sometimes I'll make a function for each different action and other times I'll make one function and pass a param for the different actions. Of course the latter turns into a long event of elses, but if it is only a few actions for each sometimes I'd prefer that to keep them organized and not pollute the function namespace.

    This also isn't my favorite, but I'd probably do call function by name. That way, the name of the follow-up action (removeMoney, modifyHealth) could be stored wherever you need it (with the item type; if action from the carrier, would create an instanceVariable on the inventoryFamily of pickupItemAction; or pass the param into the function).

    It would be great to be able to attach a function to an object such as a method, but the functions that first grab the instance by UID achieve the same thing.

    custom actions canʻt return a value

    Does creating a function with a return value not take care of this?

    As for some of the other limitations you mentioned - let me remind you my brain is foggy and also mention you prob know more than I do, so this isn't disputing what you say - but I'm not sure about some of the direct downsides or limitations. For example, in general you don't want to pollute the global space, but what advantage is it if all Construct objects were NOT in the global space?

    I kind of suggested using scripting because it sounded like you wanted to adhere to common programming practices. I almost always use events, unless I want to hit an API or its code I want to use elsewhere.

    I think the thing I like the most about using Construct (non-scripting) is the syntax check. It will prevent you on the spot from using a variable that isn't declared or missing a comma or period somewhere. It's not really even a pain point in my normal dev/day job, but its just nice that when you build your project to preview your game, you don't have everything breaking because of a typo.

    I know that didn't address everything, but maybe it's all I got, ha!

  • Cool idea. I like it.

  • With the examples in the original post, I think it would make more sense to provide your solution in other engines/languages and the problem you forsee implementing in Construct since your claim is that Construct causes difficulties.

    I do agree that sometimes I find myself wishing I could quickly use a .map() to achieve something - and yes, you can use JavaScript in Construct. As others have said, it is preference.

    But with events, I don't see why you couldn't achieve either of those with mostly instance variables and functions.

    Picking in events is essentially filtering, which can be done on instance variables. Functions can have return values - if you want to break out complex logic into re-usable bits. tokenAt and tokenCount can be used if you want an instance variable as an array. If you need an array of objects, you can use tokenAt and uids. If you want an array of custom objects, as opposed to instances, I prob would recommend JavaScript.

    My point is that these are the same tools you would use to achieve your functionality in any programming language. It does seem a bit awkward at times, but that is because Construct was originally built as a no-code engine. So there are some trade-offs there - think target audience. However, I'm a programmer and still enjoy using Construct. I'm not actually sure why, but I do!

    but with constructs current limitations . . . to avoid c3 limitations in functions and custom actions.

    What are the limitations? Can you elaborate?

    Also, I'm not sure who said it, but I don't think it is fair to say a lot of loops or for eachs would kill performance. Of course a certain amount of loops will kill performance - anywhere, any engine, platform - but I've seen people act like adding a couple of "for loops" into their project is the end of the world. I'm just saying, test it to see if it actually does, especially if you are making a video comparing engines, ha.

  • All I am asking for is a scripting interface to query the collision cells, it could be something like:

    runtime.collisionCells.getInstancesInRect(x1,y1,x2,y2)

    You don't think that would loop over every instance under the hood? I'm not sure how that would be more performant.

    I wasn't arguing anything. I was trying to be helpful in first defining the problem you want solved. But clearly you have issues with that, or with me, or something, so I won't waste either of our time with further comments.

  • Yes, I'm aware that the amount of collision checks can add up quickly, but a high number doesn't always result in poor performance. In the screenshot below, I have 19,317 checks per tick but still have 60fps.

    Which is why I asked if you actually saw poor performance from using the built-in behaviors and event triggers/checks and looping through instances, as you mentioned that they do in the tutorials.

    I believe that the people behind Construct are good developers. I'm a JavaScript developer myself but have read some of the articles about things Construct does under the hood and realized they have way more expertise than me in a lot of the areas relating to making a game engine. What am I saying? I trust them. If the engine has built in collision detection - I trust that it is the optimal way, and a lot better than I could create in a couple of days.

    ^That blurb might feel like a tangent - but that is what I meant by the "you might be overthinking it" bit

    Also, the original ask of checking collisions without having to loop over all instances - from a programming perspective, I'm not sure how that is possible, ha. You can't get something from nothing - not sure what other way you could start from other than an array of objects and at minimum filtering the array.

    So I'd probably start with setting up the project as recommended - like as you see in the example projects - and sharing the performance stats. Collision checks per tick; Frame rate; how many objects you have in your project or on screen; any other issues you are seeing. Also, remove the collision checks to test the root of any issue you are seeing.

    From your response, I still can't tell if you have done that or not.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You have the scale rate at 1?

    What do you have Fullscreen Mode set to?

  • How did they get there in the first place?

    That would be where I would start.

    You can also have an event to check if they overlap a solid and move them, but I wouldn't go to that solution first, as you might run into it later at undesired times.