Lou Bagel's Recent Forum Activity

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

  • Try Construct 3

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

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

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

  • Have you run into performance issues already? I have a feeling you might be overthinking this.

    The example projects seem to loop over all instances, which is fine for the limited scope of the examples but would not work out well for projects with larger levels and lots of instances.

    ...

    Our profiling has shown it's not unusual for even a fairly complex game to spend 10% of the time on the logic, and 90% of the time on rendering

    Quote From: construct.net/en/blogs/construct-official-blog-1/optimisation-dont-waste-time-768

  • I believe it is because you have the scale rate at 0

  • One idea is to define my own borders within a layout at max size but that method would be very complicated and tedious to implement...

    I'm not sure why that would be very complicated and tedious. Can you explain the issues you have with that method?

    I think that is your easiest route. Make the layout very large. What is the downside of having large parts of the layout unused?

    You could cover the unused area with a tiled background, block it off with solid objects, or whatever else you need to do, depending on your game mechanics.

    If you are thinking of issues more so with the level editor part, you could set the area of the tilemap, which would stop them from trying to edit the tiles outside the level. If not using a tilemap and something like drag and drop, you could just have an event to check on drop if the dropped position is greater than the level width/height.

    Maybe there is a way to change the layout size now, but I know in the past it was not possible. Even if it is, I'm still not sure how it would make anything that much easier for you here.

Lou Bagel's avatar

Lou Bagel

Member since 7 Sep, 2015

Twitter
Lou Bagel has 3 followers

Connect with Lou Bagel

Trophy Case

  • 10-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x2
    Popular Game One of your games has over 1,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies