Ruskul's Forum Posts

  • I think we may have a semantics issue here. That aside, I agree that you can make a work around that will satisfy some needs, but not all needs. Unless the workaround is rewriting box2d through events you will not get the same results as using box2d. This is okay, in some cases. One of the biggest problems with work arounds in contruct is that you aren't actually using or modifying what box2d is doing, you are essentially trying to fix what it does after the fact. I actually need kinetic bodies in full box2d glory. Kind of working isn't an option for what I have in mind for it.

    I looked up some newer features and noted that google has made liquidfun which looks amazing. I think fluid dynamics would be awesome. There is already a jscript version of it, so having it in construct 2 might happen sooner than we think.

  • eli0s - I am essentially saying that using pin or setting velocity are the hack arounds. The problem is that using such methods, as you said, are not very precise. More than that, they are not as robust either. they may get the right results for some problems but overall I can't work with that degree of inaccuracy. The video demonstration of box2d kinematics bodies behaves exactly as expected, where the other ways of doing the same thing don't behave the same way. There ends up being a sacrifice of some kind unless you emulate the same stuff going on in box2d via events which would be silly (unless you like using 10,000 events for one object). You are right, there are ways around it, but I figured finding out why its not included in construct is the best place to begin. The code exists in box2d, so why doesn't the feature exist in construct?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Aphrodite - It won't work, simply because the only way you can "move" a physics object is by use of a force or impulse. If you change its position to move it then the object will not function as expected in the box2d physics model. If you set a physics object as immovable and then use events to cause it to rotate in place when it strikes another physics object set as dynamic that object will only resolve collision but it won't fly off as though it was hit. The spinning platform can be solved by using a static body and having a dynamic body anchored to it via a revolute joint. The spinner stays in place and imparts a force/impulse on objects it hits. The moving platform is another problem though because it needs to be able to be moved in a way that makes it have force. If you just move it around without using forces it won't behave correctly. If it slams into another object at high speed the object will move just enough to resolve collision.

    eli0s behaviors (such as rotate, or sin) move things via position setting. This breaks the physics system as you are basically teleporting the object around and it has no energy to impart when it collides with another object. As far as I am aware, there is no other way to move a physics object. You can either apply a force or set its position or set the velocity. An immovable object will not respond to any sort of force. The example you posted is interested but as far as I understand it it is a hack around the problem. Kinetic bodies (which already exist in box2d) are meant to solve this problem. Now that I am thinking about it I don't know if I have tried manually setting velocity on a static body, Let me double check that if that works.

  • Heyo,

    In construct 2 we have access to box 2d physics. Within this realm we can either chose to have a body that is dynamic (reacts to collisions) or static (doesn't move). There is a third type of body available in box2d that I need and perhaps you do to: The kinematic body. This is a hybrid body that can have a linear velocity but that is unaffected by forces acting on it. In other words, it can move but cannot be moved by other objects. Ever wanted to have a moving platform using physics but gave up because every time the player jumps on it it gets thrown off course? A kinematic body would work well here, but all that you can have in construct 2 is dynamic or static. Not every object that moves needs to be moved by other objects. Check out the link below for a short sequence of code demonstrating its uses and a short explanation.

    http://www.emanueleferonato.com/2012/05 ... ic-bodies/

    Ashley Is there a way to bring this functionality of box2d into construct ? I know there was limitations in the box2d version optimized for javascript /html5 (you can't disable collisions- Why is this btw?. Having collision masks would be super helpful). Is this perhaps the same with kinematic bodies? Is the code for this body type already in construct, it just doesn't have editor support?

    and while i'm on the topic of box 2d, is it possible to have chain shapes in construct? Wherever there are internal edges, dynamic bodies trip up on them, chains would solve this! or even ghost vertices.

  • > dynamic lighting/shadowing/volumetric 2d lights

    >

    check this out https://twitter.com/Scirra/status/46735 ... 76/photo/1

    > Blur mask shader. Would be cool to fake DOF in isometric games, or add instagram style DOF faking.

    >

    +1

    HOLY COWS 0.0 . I was looking at trying to work out this on my own, but wow, no need lol

  • Ya thanks, that all makes sense. I already have an initialize group that runs at the start of the layout, I'll try to organize via that and turn certain groups on or off depending on the level. Thanks

  • Hey, I have a sort of silly question:

    Is it okay to have seeming needless booleans in the events that stay true most of the time, and only change once in a while?

    Basically things like - IF daytime then do lots of stuff, else if night then do this other stuff. Is there a better way to do that? Can I just have a text variable with a function name that is called (either day or night). would that help improve event structure?

    I am asking because I am writing one event sheet and trying to encompass multiple possibilities. Some of my levels are "dark" and so apply lighting differently than normal levels. But I still have to ask wether the level is dark every tick so I can have stuff happen if it is... Does this make sense?

    I had heard one event sheet was best. I think it would be better to split the event sheet up into part and have an event sheet that includes event sheet x,y,z... so on for each level. Though that could get out of hand really quickly

  • dynamic lighting/shadowing/volumetric 2d lights

    palettes! - I want to be able to run fancy stuff but then still output to a 32 color palette

    Sheepy +250 - if nobody else is working on this I have been thinking about picking up the ball. I just haven't ever made a shader before. I do have the the programing knowledge though so it shouldnt be too hard right?

  • That is really good to know, Thanks!

  • Ashley Thanks for the info - That all makes sense. if you are rotating layers/layout does that make a difference?

    - I suppose you are right. I have a lot of wants wrapped up in how I chose to layer my game. Thanks.

    Arima - I am running multiple force to own texture layers. (do different blend modes affect a layer the same way as a webgl effect in terms of cpu usage?

    This is my current layer list, it is running fine so far. I think my computer was performing poorly when I was doing some stress tests. I am running the following on an i5 with 25-40% cpu usage. This includes calculating physics as well:

    layout effects + post processing including scaling and rotating

    GUi

    light effects (screen, dodge, or other effects used)

    BackGround (destination over)

    Climate effects

    Liquid (using various shaders)

    Foreground parallax

    Light effects and illumination (multiply/forces own texture)

    Explosions, fire, lasers, and other nonsense (additive blend mode)

    Tilelayer (foreground)

    TileLayer (active)

    TileLaye (background)

    Background parallax 1

    BGP 2

    BGP 3

  • Hey everyone,

    It seems, that increased layer numbers in projects increases the load on the cpu while running the game. I made a test in which I compared the same game but where one instance had many layers and one did not (3 compared to 15).

    I have generally used layers to help me organize objects. This results in no more than a few extra layers. But now I am working on a large project and need many layers. Even though they are not doing anything as far as I can tell it is still increasing cpu usage (3layers 25% cpu)(15layers 65% cpu) intel i5.

    anyone have some tips or insight when dealing with layers?

    It would be nice to have organizational layers that do not have any effect on how construct2 runs - it would only be an editor thing.

  • that's brilliant... I always cursed as I manually stitched it all together via phot0shop. This is a very good idea

  • I was thinking it would be nice to be able to search for multiple things at the same time in the event search tool.

    For example, say I have a player that has 200+ events associated with it. Scattered throughout are applications of force. If I want to change those, whatever aspect, I have to go through all the players events anyway and search doesn't do a whole lot of good. I could search for player and get 200 results, or I could search for force and get 500 results. But if one could do Force AND player it would be a lot easier to hunt down events.

    Just a thought.

  • I figured out what was wrong! I was applying dt to impulses that controlled the player. impulses are not time based so when I tweaked them to get what I wanted out of them while applying dt they became much weaker when the fps increased to 60.

    I still want to know why the game all of a sudden switched fps though, it does seem like a computer thing... and is there a way to set max fps?

  • Hello everyone.

    I don't know what forum to put this in so it went here. This is like a bug but I can't reproduce it and so can't put it in the bugs forum.

    So... there I was, making my game, not making any changes to my events, just my layout, when I hit run the game. the main player no longer behaves as he should. His jumps became lower (but not all the time), and his animation is too slow. I feel like it is a dt issue, but thats the funny part- The game is frame-rate independent and has been working perfectly fine for two months. I thought perhaps somewhere I made a mistake and so I reverted the project back to an earlier known version, destroying the last week of level building progress. This did not fix the problem either! (so I suppose I can restore my level progress)

    Basically, the game simply stopped functioning as it is supposed to. It was working 5-12-2014 fine in the early part of the day, but not later in the late evening. reverting to older known working instances of the project did not help. I am at my wits end and have no idea what to do or look for.

    Does anybody know something that may help? Has anyone experienced this before? I need to make one final note. Along with the game not working the way I expected it to, the game also started running at 60fps. All my projects always ran at 40 (it seemed to be capped there) but now they all run at 60fps. I am wondering if something internal in construct changed that would cause this and thus throw dt off - which doesn't make sense either. The game is fully frame rate independent. Of this I am certain. I made it so several months back and and it has worked like a boss until yesterday.