zendorf's Forum Posts

  • I tend to break up my event sheets as much as possible, not for performance reasons , but for readability and organisation. Usually I have an event sheet called "common" that is used by every level. It is mainly a set of links to to other event sheets via "include event sheet".

    In turn these other event sheets can call on other event sheets via include events, so you can cascade that hierarchical tree idea as much as you like to break it down. Using lots of functions also helps organisation as these can also be on separate event sheets.

    Also, I find that creating family groups at the outset is important and putting instance variables at the family level is beneficial. Otherwise I start prototyping a game with instance variables on objects, only to later find that I need variations of these objects and have to create a new family and transfer all the events over to family variables which is a pain! Better to start off everything in its own logical family.

    If the sprite is not animated , you can just load in as many frames as you need into this one sprite and use frame offset to display each object. I tend to use this for tiles and non character elements such as bonuses, items, etc. The beauty of this approach is that all your logic, variables etc can run across many similar objects all within one sprite . A mini family as such.

  • Haematite, thats sounds interesting. Are there any examples or tutes on the web of this approach, as I would like to create one for myself?

    Are you saving and loading the tile data to XML via an array?

  • Ok, so I filed an official bug report for the pin and set position lag. Not sure if others consider the platformer behaviour lag as a bug or just a limitation ,and if I should submit it officially? Considering how many buy this software to create a platform game, I can't believe I am the only one that is annoyed by it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Link to .capx file (required!):

    dl.dropbox.com/u/94794009/Contruct_examples/lag%20bug%20example1.capx

    Steps to reproduce:

    In this example I have 5 leader and follower sprites with slightly different setups. Really, all followers should be sticking to the leaders perfectly, but as can be seen this only happens in two cases...3 and 4.

    Examples 2 and 4 are setup with the same behaviours. The leader has a sine behaviour with a pinned follower. It can clearly seen that example2 is lagging but 4 is not! The difference was that example2 initially had a platform behaviour on it, that was then deleted. Also it had been cloned from example1. Seems that deleting a behaviour leaves some remnants?

    Also, examples 3 and 5 have no behaviours, but have a manual sine expression for the leader and a position expression for the follower. As can be seen, 5 is lagging, whereas 3 is not. The difference was that follower5 initially had a pinned behaviour that was deleted.

    Observed result:

    All follower sprites should be sticking to the leaders perfectly, but as can be seen this only happens in two cases...3 and 4.

    Expected result:

    All these setups should exhibit no lag at all.

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    Win8

    Construct 2 version:

    R119

  • admins, is there a way that I can move this thread into the bugs/dev forum or should I start a new thread there?

    cheers...

  • Wisher, thanks for the file, it is an interesting solution. Not sure how practical this is as I was not able to get it to work with multiple platforms. Don't know how this could be applied to a sine style platform movement, but I am playing around with your file and it does give me some hope!

    Ironically I recently came up with a dynamic lag setup using arrays, that I was using for some enemy behaviour. The enemy would be 60 frames behind the position of the player. Was wondering if this could be applied to platforms so that they are one frame/tick behind the player movement. Seems like a very unnecessary thing to have to do though!

    Squiddster, you may be right that some behaviours may be calculating on a different tick to the other events? Which leads me to an example that I hope Ashley can look at, since it illustrates some weird, inconsistent behaviour:

    dl.dropbox.com/u/94794009/Contruct_examples/lag%20bug%20example1.capx

    In this example I have 5 leaders and followers with slightly different setups. Really, all followers should be sticking to the leaders perfectly, but as can be seen this only happens in two cases...3 and 4.

    Examples 2 and 4 are setup with the same behaviours. The leader has a sine behaviour with a pinned follower. It can clearly seen that example2 is lagging but 4 is not! The difference was that example2 initially had a platform behaviour on it, that was then deleted. Also it had been cloned from example1. Seems that deleting a behaviour leaves some remnants?

    Also, examples 3 and 5 have no behaviours, but have a manual sine expression for the leader and a position expression for the follower. As can be seen, 5 is lagging, whereas 3 is not. The difference was that follower5 initially had a pinned behaviour that was deleted.

    This is doing my head in, trying to replicate the bug, so I really hope that Ashley can take a look at this file. This sort of inconsistency is unacceptable in a game engine.

    cheers...

  • Thanks for the replies.

    Wisher, I had suspected that they are not being evaluated on the same tick. Is there any way around this?

    As can be seen by my very simple attached file, even manually constraining a sprite to a platform with sine movement exhibits this same problem. It is not limited to just behaviours though, as it also happens if I put in a manual sine expression for a platform(ie no behaviours).

    Seems that any way of linking two objects is an issue, since using the pin bahviour on an object also has the same problem. It is a worry that I can't constrain two objects without any slippage occurring. Would love to know a solution :)

  • I have been heavily developing several games for 3 months now and feel that I know Construct2 quite well. So far I have been able to work out every technical problem that has surfaced...except for one.

    Getting a non-floaty feel to moving platforms has thus far eluded me! The built in platform behaviour, in general is great and suitable for most platform uses. But when a sprite lands on a moving platform it always lags and looks very "floaty" for both horizontal and vertically moving platforms. I could never put out a professional game that had that look, since you don't even see that in classic games of 20-30 years ago!

    I have tried to code my own platform behaviour, but have run into many issues. It seems that even pinning an object to a moving platform looks laggy, whether I use a sine behaviour or a manually created sine expression.

    I have also played with using physics to create platform behaviour, that does work but once again won't stick to the moving platform properly.

    Even just using a basic expression to constrain a sprite to a moving platform results in lag as can be seen by this basic example:

    dl.dropbox.com/u/94794009/Contruct_examples/platform%20lag%20example.capx

    I really love using C2, but this is driving me up the wall and can really limit what I can do with a platformer. If anyone has any solutions or has written a custom platform behaviour I would appreciate any feedback!

    cheers...

  • I would really like to check out your demo, but I am getting a 404 error in Chrome. Is it still on there?

  • That makes sense. Is there a better way of doing this? In general, I am finding triggered/timed animation the trickiest thing to do in Construct.

  • Ok, thanks for the quick reply ramones! I figured it was something like this and am just trying to work out some of Construct's quirks.

  • Btw, I should add that I know how to get around this issue by using a global variable:

    dl.dropbox.com/u/94794009/Contruct_examples/loopindex_issue_resolve.capx

    I really just wanted to know why the first example doesn't work?

  • I am having a strange problem using the loopindex variable in conjunction with the wait command. I get an error every time I use it, but am unsure if it is a bug or limitation?

    In the example capx file, when you hit spacebar you start to see red squares created randomly...no problem here, and it is using the loopindex variable combined with the wait command for the time stagger.

    Now when you hit shift it should create blue squares in a row using the loopindex to control the x placement, and also to stagger then creation via the wait command. I get a javascript error each time in Chrome.

    Interestingly , if I disable the wait command in this function it runs, but of course without a time stagger.

    Not sure what is going wrong here? Any help would be much appreciated <img src="smileys/smiley1.gif" border="0" align="middle" />

    dl.dropbox.com/u/94794009/Contruct_examples/loopindex_issue.capx

  • I do it in a similar manner to what BluePhaze suggested, except that I use individual frames rather than a strip. Set the animation to be 0 fps and upon object creation a random frame is selected via: round(random(0,x)) where x is the number of frames/objects -1.

    Here is a basic example I whipped up:

    dl.dropbox.com/u/94794009/Contruct_examples/random_object_creation.capx

    Another nifty command that can be used in a similar context is the choose command. Upon triggering one event you could randomly choose between the first three objects : choose(0,1,2) and upon another triggered event choose between the last 3: choose(3,4,5)

  • I hear you on this, and have brought this issue up before.

    My least favourite part of Construct2 is the project management aspect of it. I would ideally like to save iterations of a project with a "save as" command within the project folder structure, so all project files relate to the same project assets.

    Also, the current method of swapping out and appending animated sprites is a nightmare! To import an animate sprite, I have to import the first frame into the sprite editor, and then right click the animation window to import all, except the first frame. Why can't I just import all animate frames at once?

    If I need to replace the animation, it is possible to replace them in the folder and then update but I have found it to be flaky as you have mentioned. Also, since Construct has changed the naming convention, so it is now 000.png 0001.png etc it means I need to re-render out my new sequence to this , instead of something meaningful like alienwalk000.png.

    It is also impossible to multiselect more than one frame of animation to delete before replacing them. We really need an replace all frames function in the sprite editor.

    My current workaround is to rename the animation I want to replace (for instance "walk" becomes "walk_old")Then create a new sprite animation called with the old name("walk") and then import the new frames. Then delete the original sequence("walk_old"). I have found that this works better than replacing frames in the folder structure, but it is clunky!

    Hope to see some love put into this in the future by Scirra   <img src="smileys/smiley1.gif" border="0" align="middle" />