boolean's Forum Posts

  • Very cool, thanks mate!

  • Edit - Never mind, I think I was just misunderstanding what max_distance was in pushOutSolidNearest.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you set the physics gravity to 30 then change the global variable ay to 50*30 or 1500.

    Oh, 50! That fixes it. I figured out at one point that I probably should be multiplying ay, but I was doing 500 * gravity, not 50. That makes sense though - 500 I'm guessing is based on 50 * gravity(10), so setting it back to 50 and then multiplying it works. At the risk of badgering you too much, where does the number 50 come from? Why is that the base value?

    Thanks mate! You're like a mysterious super-hero of games coding.

  • Sorry to double post, but I had a question for R0J0hound :

    I was wondering if there was a way to speed up the object that travels along the path?

    I'm only just getting used to physics so I may be way off here. I'm trying to set my object to have gravity 30 so that it travels up and down quite fast. The algorithm in your capx seems to take the mass of the object into account, but will always give it enough vx and vy to get to it's destination, therefore putting it at a constant speed regardless of the mass.

    For now I was able to just cobble together a solution where I multiply the vx and vy by 1.75 for gravity 30, which works out fine (the bullet travels much faster and follows the line nicely), but surely there is a better way of doing it? <img src="smileys/smiley1.gif" border="0" align="middle" />

    Is there another or better way to speed up the object as it travels along the path, be it by increasing the gravity or otherwise?

  • If you are just showing different states of the same object, your best bet would be to do what zendorf suggested in the linked thread, where you set each blood type to be an animation frame and then just choose one at random.

  • R0J0hound: That's...holy heck. I think I just spent the last month fiddling with a system that I can just replace with this. I'm both amazed and kicking myself at the same time. I don't know what to feel!

  • Hi,

    Currently, when I change layout, the global variables will reset

    Unless you are triggering the "Reset global variables" action, they shouldn't be. That's the whole purpose of global variables.

    Global Variable Demo Capx

    R115: Press space bar to progress to the next level. Notice how the score does not reset.

    Be sure you don't have any "On start of layout" events where you are setting the score back to 0 - this will fire every time you change to a new layout, not just the first time you start your game.

  • Yeah, super good news, it's only an issue with chrome.

    Testing the capx in Firefox, there are a few variations but not as marked as in Chrome.

    Easy solution, stop using Chrome, yeah ! ^^

    I can get it to happen in FireFox too, but it seems Firefox takes more load to get the FPS down. Here's my firefox test with more sprites:

    <img src="https://dl.dropbox.com/u/20830426/firefoxTest.png" border="0" />

    Also, I'm not sure this test is valid anyway, as you're unlikely to have such a logic in a "true" game. I'm not understanding how spawning 10k sprite is a good way to "lock" the FPS, as the loop only happens when the character is out of the screen, and the layout is supposedly restarted at this moment anyway.

    Perhaps I didn't describe the original post properly. The problem isn't so much that if you just happen to have 300000 sprites on screen C2 starts to go wonky, it's that lower frame rates seem to have an affect on the jump arc of the platform behaviour. The purpose of spawning all the sprites and keeping them on screen was simply a way bog the browser down to lower frame rates. I wanted to see how performing the exact same action at different frame rates changed the jump path the player took.

    The locking the frame rate post was separate from spawning all these sprites - That second post was what happens to the jump path when the frame rate is locked at 60. At that point, the gravity or whatever seems to be causing the variation, works out fine. It's when fps fluctuations occur that the course of the player changes. The second post was more of a real world example, the first post is what seems to be the same problem taken much more extreme (ie. forcing the game to run at around 30fps instead of 58fps).

    I'm no expert at this though <img src="smileys/smiley1.gif" border="0" align="middle" />

  • So here's a funny thing, I added the following condition in:

    <img src="https://dl.dropbox.com/u/20830426/c2FrameLock.png" border="0" />

    This is in a version where I'm not spawning 10000 objects each test, but is more of a general test of jump accuracy.

    With the frame rate locked at 60fps all three runs overlap perfectly:

    <img src="https://dl.dropbox.com/u/20830426/frameLocked.png" border="0" />

    Without locking at a framerate of 60, the following variations in jump height appear (remembering this is just letting chrome hover around 58-60fps without artificially hampering the fps):

    <img src="https://dl.dropbox.com/u/20830426/notFrameLocked.png" border="0" />

    The difference isn't much but it is highlighting the same problem - that the frame-rate jitter is causing different jump heights.

    Ashley: Not being that familiar with this territory myself, is this a solvable problem? Being HTML5 is there anything that can be done code wise to correct this?

  • It seems the gravity is taking effect at the same period of duration, but with less FPS momentum not incrementing as high in the same amount of time. Maybe because motion is still rendered at a per step.

    That's what I was thinking too, and may be the same problem as the infamous quake3 jump height bug, where higher frames means gravity is applied more often.

    Try and use *dt after all your events if you didn't ...

    Since this is just using the built in platform behaviour, it should be using dt anyway.

  • Hi all

    I'm working on a game that is a bit of a super-meat-boy/I-wanna-be-the-guy type game, so I'm trying to keep certain events timed the same when the layout restarts and the player replays the level.

    I'm using the platformer behaviour and I'm noticing that when the FPS drops, the jump arcs go all loopy. I think this is combining with the fact sometimes the browser will drop in frame rate for a moment while the player is jumping and where before they could make the jump fine, now the jump arc doubles in height, causing them to run into an enemy. I found this thread from back in October where slw666 seemed to be having the same problem, but Ashley implied it should be working fine.

    I did some tests to see how much the frame rate affects the player movement. In the screenshot below I ran the same layout three times ? The first was at 60FPS, the second was around 40-45FPS and the last was sitting at about 25-30FPS. Those numbers are roughly correct based on the Chrome FPS counter. I got those frame rates by saying once the player left the layout, spawn 10000 instances of a sprite and then restart the layout and repeat.

    <img src="https://dl.dropbox.com/u/20830426/jumpArcs.png" border="0">

    Test Capx

    If you run the capx above you might end up with different numbers, but you should still see the jump arcs changing when the frame rate drops.

    I'm not much of an expert in this area, so I'm at a bit of a loss of what to do. Should the framerate be affecting the player jump arc? Is it maybe that it is working but my test is flawed?

  • Ashley - for those of us that fail at maths - any chance of a feature like the following in construct? :)

    Click the image to go to the page - it's about box2D.

    I can't find any current examples in Construct2, not for lack of searching the manual, tutorials , forums and google.

    I tried running through that same tutorial just last week - At first I tried making a plugin that interacted with Box2D directly, but managed to confuse myself. Then I tried recreating it in Construct...but managed to confuse myself <img src="smileys/smiley9.gif" border="0" align="middle">

    Could something like this be done through C2/plugin?

  • Can we maybe have a sticky thread saying there won't be a suggestion forum before whiteclaws explodes?

    I still think there's merit in at least having a single sticky thread for it where people can post too (like the "What shader effects do you want"?" thread), if not to cut down on the number of repeated posts of the same ideas, but also for plugin makers to get ideas.

  • 1) Ah good point. So I think what's happening is that the pick nearest is only selecting one single enemy (which is good), but then spawning a hit sensor that is overlapping both enemies (which is bad).

    Download V2 Capx

    What this is now doing is spawning a hit sensor, but we are recording the UID (a unique ID that Construct assigns to every object) to it's instance variable. You can then use the "Pick by unique ID" to ensure that, when a sensor is overlapping the enemy, it only picks the one with the ID that we assigned to it.

    2) I noticed that a few times myself. The reason it's happening is because it's saying only if the hit sensor is overlapping the enemy, then apply damage and destroy it. If the enemy is destroyed before this event is run (in the case of two players attacking one enemy), the second hit sensor is never destroyed because the enemy is already dead. To get around this I think you can add a condition at line 29 that when an enemy dies, any hit sensors that are overlapping it are also destroyed.

    <img src="https://dl.dropbox.com/u/20830426/rtsFixesScreens/question2.png" border="0">

    Combined with the first note above, this screenshot is a little out of date (since we are now only destroying hit sensors assigned to the enemy), but you get the idea.

    Hope this helps. You've done an impressive amount of work so far already, it's looking to be a really cool game <img src="smileys/smiley1.gif" border="0" align="middle">

  • I think there were a few issues together which were causing the problem. I refactored some of your capx and it seems to be working now:

    Capx Download

    However:

    1) If I've completely misunderstood what you are trying to do, let me know <img src="smileys/smiley1.gif" border="0" align="middle">

    2) I've only fixed the player sprites for now. Assuming I understood the post correctly it should be fairly easy to update the enemy AI.

    Hopefully, if I got it right, this helps in some way <img src="smileys/smiley12.gif" border="0" align="middle">