Tobye's Forum Posts

  • ome6a1717 - Dealing with this is far simpler than you think. Build your game by setting the window size according to an aspect ratio with the highest resolution (1280x720 for example).

    Then in the game, for any UI elements or things you want to spawn just inside or off screen, use viewPort expressions for the X/Y. Then set the scale mode to your preference (I like scale inner, but letterbox is fine for desktop).

    Now whatever screen size or resolution your game is played on, it should take up the maximum amount of screen, no loss of image quality and all UI elements will be where they need to be with nothing cut off the screen.

    Hope that helps!

  • Potato - Nope, just tried it then. The game loads, but the animation doesn't happen. Plus for some reason it goes to just over 30fps with only 2 objects and no other events.

  • I thought time (every X seconds) was framerate independent?

  • Blacksmith - oh great! But I normally get an email, this is the first time ever I wasn't notified. Thanks :)

  • I must have missed something...when did the debugger come out? I have the latest version and can't remember seeing anything about this anywhere.

  • That's like, raman noodles for breakfast, lunch, and dinner...every day..for 6 months. And working 20 hours a day.

    You mean that's NOT normal for game dev?! :O

  • Hey all, I was just wondering if there is any performance difference between these two methods:

    EASY WAY:

    Boolean = TRUE: Set size to X

    Boolean = FALSE: Set size to Y

    HARD WAY:

    Boolean = TRUE:

    --sub-event: size equals X (inverted): Set size to X

    Boolean = FALSE: set size to Y

    --sub-event: size equals Y (inverted): Set size to Y

    They both do the same thing, but as far as my knowledge goes, the first one will constantly do the process of resizing to X/Y even if it is already at that size. Whereas the second method would only perform the action if it was the wrong size.

    Or, am I wrong, and the game will only perform an action if the result is different anyway? Or is there some other things I should be aware of?

    I have a lot of this sort of stuff going on in my game, using the first version, and it runs fine, so this is more a curiosity question.

  • EncryptedCow - Nice work! But it is a rather specific inventory like I was saying ;) It's hard to make a one-size-fits-all system. Good on you for doing it, I'd like to see it when it's done - very different from any of my methods so far.

  • onion - I don't know of any tutorials, I think it's just that people making RPGs generally don't have a lot of time to write them ^^ But also I have tried helping a few people with some RPG stuff, mainly inventories, but the truth is how you handle most systems will change depending on what you need.

    For example, the easiest way to track inventory is to use a dictionary and just add/subtract values from a key that's the item name. But then you will have difficulty sorting those alphabetically when displayed. Also do you need to know how many of each type of item you carry? Like is there a quest that says you need 5 different types of armour? Then you need to either have more dictionaries (which will make adding items slightly less streamlined) or start using an array (which is overall more complex but will grant you much more functionality).

    So yeah, to write a comprehensive tutorial would take a hell of a long time. So I think the best way to learn the best practice for your game is to really game doc it out first. Find out exactly how much information about your items needs to be available for conditions, then it's actually really straight-forward.

    My main advice though is to make a single function call that can add the items to wherever they need to go depending on parameters. It will save you a lot of headaches!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound - thanks for your time with this! And yeah, spawning usually picks that instance. So still a little unsure of what's up there. Ah well, I best just get on with it using for each loops :)

    Thanks guys!

  • vtrix haha, I'm glad I'm not the only one who can't figure it out ^^ I agree that 'for each' is like a panacea for picking issues, but I am looking at developing for phone and want to really cut down on processing. Also, I just really want to know why it's not working from curiosity! xD

    Maybe Ashley can explain? I also updated the original post with an altered version of vtrix's capx that shows the inverted LOS behaving weirdly.

  • vtrix thanks a lot for your capx! So essentially the thing is you need to run 'for each' loops for LOS, as they don't actually pick the instance? It just seems so strange. All other conditions I can think of pick (like 'on landed', 'on collision', 'is overlapping'). So why is it different for LOS?

    EDIT: Also I tried a new event (not in the for each loops) that says 'has line of sight (inverted)' + is chase: destroy orb. Result was that 2 orbs will eventually destroy themselves, but the third would stay around forever. Do you have any idea about why that is?

    EDIT 2: I should say I ran the above a number of times and got all sorts of different results, sometimes all destroyed instantly, sometimes none, everything in between. This can't be right.

  • I am recently having some troubles with LOS too. Shouldn't 'has Line of Sight' pick the object who has LOS without needing to go through a 'for each' loop? Like if you use 'on landed' for platform behaviour, it will only pick the instance that has landed, not all instances of that object.

  • Hey all,

    Recently I've been have a hell of a lot of trouble with picking and inverting conditions. I really don't understand as I have been using C2 for a very long time and never had this trouble before. So, not sure if it's the new build (139) or I've just gone off the rails.

    capx

    vtrix's altered capx

    In that capx the lasers don't all disappear when out of range. Then if you toggle off the section 'Resizes laser' (which runs the for each loop to resize the laser), they won't resize correctly even though the 'creates laser when in range' section should be doing the exact same thing. It's like it's ignoring the inverted 'has laser to' condition and also fails to pick the right orb when adjusting width of the laser.

    I'm having all sorts of issues like this lately, not just with resizing the laser. So I would really appreciate some help on this!

  • Have a 'lastHit' global variable and set it to the object's name on collision with that object. Then you can say 'on collision with cherry + global variable = cherry: play sound'. Then as a sub-event 'set global variable to cherry'. Setting the variable needs to be after checking the variable, or else it will always be true obviously.

    Hope that helps!