nimos100's Recent Forum Activity

  • Yeah its a good idea in general to only have the objects you need. So even if you have 100 objects like these, if only a few are on the screen at the same time it should be fine.

    [quote:2s7i8zq7]the method i display them are just moving from down the layout to the "Visible" layout, so they are created from the beggining, im just moving they like i said...this could drop some performance to the game?

    that will be the easy way to show every shape i need...but i think it will be better to Create the Objects when i really need it right? adding them as an Event/Action...

    i think you know better options to add my objects to the game without losing performance...Note: All the objects has the same Behaviors/Effects...they only change their Shape and Position

    any help would be great thx for reading

    I always prefer to destroy all objects at the beginning of the application, unless its a controller of some kind, where I know there are only 1 that I need or static objects that need to be there and I again know there wont be more during the game. Objects that you spawn during a game should be destroyed in the beginning, which are objects I like to refer to as rogue objects, because if you have them around, weird things and error might occur because you don't really know what these objects are doing. So you can just use the system.create object and create them when you need them. So I would strongly recommend doing that.

    [quote:2s7i8zq7]the graphics are simple as the one you see in the first message...

    What the image looks like doesn't really matter, a sprite is a sprite for the computer, as it uses a RGB code (0-255. 0-255, 0-255) for each pixel to determine the color of that pixel, whether its black or white, red or green will hardly have any impact if any. its about the size of the sprite as it determine the amount of pixels.

    But I wouldn't worry to much about performance, even if you had 100 objects with 10-15 collision points each at the same time, Im not sure performance would be suffering all that much, but you can test that when you have made them

  • From what I can understand by your description you are actually not trying to snap to grid, but to an object?

    Ill try to explain how you can do it, without it getting to messy, since there are quite some things involved.

    A. Drag/Dropping boxes

    Will start with the drag drop functionality as it will be needed later on. So as you start dragging a box you make it go to top of layer.

    Object.Move to top (This is important or the returning of boxes might not work correctly)

    The reason for this is because it makes it easier to make the boxes switch place later on.

    You can use the drag&drop behaviour to handle the drag/dropping.

    Also you add the pin behaviour.

    For each of the boxes and the dotted areas that holds them in the bottom, you add a variable, could be the color if they are unique. This is so you know where each of them should go If they are replaced or dropped outside the dotted boxes.

    So when you have to return them you just test on this variable.

    Dotted boxes

    These are the collision detectors. So each of the dotted markings should be a Sprite object with a collision mesh that fits there size or smaller depending on whether you want to use some snap functionality or not. As the user drags the boxes you need to check if its overlapping or not.

    "This is a simple Box overlapping Dotted box or not on release."

    For each of these boxes you add a variable called End which will keep track of which of the dotted boxes the user dropped the box in. So the left one could have a value of 1 and the right a value of 2.

    Make the boxes go the right place

    Since the dotted collision boxes are static you actually doesn't snap to these as it would make the animation of the scale weird. instead you add 1 imagepoint to each end of the scale. And use these as snapping points. (You will have to move the imagepoint for each of the boxes to the bottom so they will line up correctly).

    So when the player releases a box over a dotted area you snap the box to the correct imagepoint on the scale.

    Events needed

    Event: Snap to scale

    If Box is overlapping Dotted box

    Dotted box.End = 1 (Left one)

    DragDrop on released

    Action:

    Box move to position scale.imagepoint("Left")

    Pin Box to scale ("Position and Angle")

    And you add one for the other end as well of course.

    (You might have to enable the pin behaviour, so it works correctly with the scale animation)

    Event: Replace and return box

    If Box is overlapping Dotted box

    If Box is overlapping Another box

    DragDrop on released

    Pick bottom box (This is why you move the one you are dragging to the top, so its always the one already in the dotted box that gets returned)

    Action:

    Box disable pin to object behaviour. (This will make sure that the box that are returned doesn't follow the scale as it moves.

    Sub event: Return the bottom box

    Pick "Box holder" where color = box.color (This will pick the correct box holder in the bottom)

    Action (Sub event):

    Box set position to "Box holder" (This will move the box to the correct box holder, also you might have to correct the imagepoints if they don't match up)

    That should do it I think, you might have to add a bit here and there depending on how you have made it. Then you just have to add the animation of the scale based on the weight of the boxes or something.

    Hope it makes sense

  • You could make different ways, but here are two examples.

    1.

    Make use of the stairs UID.

    Floor_Up = Hold the UID of the the stair that it leads to on the upper floor.

    Floor_Down = Hold the UID of the the stair that it leads to on the lower floor.

    2.

    Give each stair a variable that identify them instead of the UID.

    Stair_ID = <Stair_ID>

    Floor_Up = Stair_ID to where it leads

    Floor_Down = Stair_ID to where it leads

    Stair_ID could be formatted so is holds the floor nr and a letter if there are more stairs on the same floor.

    Example: "2a" would be the first stair on the second floor, "2b" the second stair.

  • Well this doesn't include an example. But you could start by just making a sprite move randomly around the screen and every time you tell it to move to a new position, you can store the new location in a list or array. So it is possible and shouldn't be much more difficult to do, than to make the player do them in the first place.

    But maybe I misunderstood what you meant.

  • There are no problem in going above 8 points, if you only have a few shapes and you don't add a lot of points. However depending on how accurate you want the collision to be, you can simplify the shapes like the one on the far right could be done with 5 points if you take the outer edges where they stick out, if you want more details, you can add the remaining 3 points where the shape goes the furthest inwards.

    So it pretty much comes down to how precise you want it, making it extremely accurate is rarely useful as the player will most likely not notice it anyway, but if the game lags or run poorly they will notice very fast.

  • No the problem is not connected to that, that merely my lack of knowledge of that new functionality.

    But it sounds like a really good update I think thumbs up for that.

  • Think it would be to messy spawning it on top of the chat window as there will be a high score for each map. Anyway after the bug and the r164.2 update the game have become so buggy to the point of where I have lost patience, and trust in C2 actually working correct in this project. To many things suddenly doesn't work for no apparent reason, things that worked fine yesterday, and even though I haven't changed any code and can see on the debug data that it is correct it still doesn't work. C2 crashed due to the most weird and simple things, and seems to happen only in this project from what I can tell. So I simply doesn't trust that other weird things are not going to happen if I continue working on it.

    So ill have to sack the project, but thanks for the reply anyway.

  • Hi all

    Working with the multiplayer functionality and have run into a problem, that someone have hopefully some idea how to fix.

    The setup

    My initial idea is to just have a host connected at all times. Which will handle the communication and solve the problem of not being able to select a new host when the current one leaves. Whether there is a work around I don't know, so this is what I aim for at the moment.

    On the front page I have an ordinary chat functionality with a chat window and a list of people that are connected. And they can chat with each other.

    The problem

    My problem occurs as a peer for instant click to show high score it goes to a new layout where the chat functionality is not available, when they then go back the peers doesn't show up In the list of connected peers. However testing it there is still connection between the host and the peer, and they can still chat.

    So what I would like is for the host to broadcast the peers when someone enters that layout again. And I can get it to work to some degree meaning that I can broadcast the peers, but it will only broadcast the last connected peer alias several times for each peer count.

    I have tried using a "for 0 to Multiplayer.peercount" and hoped that it would then be able to broadcast each peer alias. But can see any way of picking a peer so I can make sure that it broadcast the correct one.

    Have some alternative ideas of how to solve it, which I haven't tried yet, but I think will work. But have anyone tried anything similar and solved it some clever way?

  • Problem Description

    In lack of better words ill just call it warping "Sprite font" This problem happens for me once in a while and not really sure what causes it. Its linked to C2 and doesn't happen during runtime. Here is a screenshot of what it looks like.

    I have selected where the actual placement of the "Sprite font" is and it some how gets warped and mirrored to the side, as I move the viewport from side to side it changes size and how much it warps.

    It can be easily fixed, by moving the "Sprite font" around a bit and pressing undo. Sometimes it requires a few attempts and then it suddenly pops back into place and looks correct again.

    But it seems to be related to the viewport, as I can zoom out as well and then suddenly It pops back, if I move the viewport it can start warping etc. It seems to be related to that somehow from what I can see.

    Attach a Capx

    Aint linked to a specific CapX but happens at random when using "Sprite font"

    Description of Capx

    Not relevant.

    Steps to Reproduce Bug

    • Don't know, except it only happens with sprite fonts

    Affected Browsers

    Not relevant

    Operating System and Service Pack

    Windows 7

    Construct 2 Version ID

    r164.2 but have happened it other versions as well.

  • [quote:3fcmdkkj]Alright I see, I will look into it and try to make a report, I have to say I'm not really familiar with Construct 2 so I might have made lot's of mistakes. As controling the character, do you think I should use custom controls rather than platform?

    I don't think you made any mistakes regarding the code at least, there are to little code for it to not be noticed.

    Well whether you should use one or the other is up to you, they are different behaviors and suit different purposes so it pretty much comes down to the game you are making.

    [quote:3fcmdkkj]And let me thank you again for your help, thanks a lot and a learned a few more things about C2 on the way.

    Sure no problem

  • Another way I find useful is to your bullets, add a variable called Target and as your turret fires you add the UID of the turret target to the bullets Target variable.

    The reason for this is when the bullet hits the enemy you can use this to make sure that it will only hit that target. This also solves the problem that the turret is actually shooting at its target and not just towards it, as the bullet will collide with the first enemy it hits. But if you plan to make any form for "tactics" for your turrets you will have to add something like this, so the player can actually count on the turrets attacking the targets they should.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see what you mean, its a bit weird.

    I tested it and it seems that it might be a bug with the platform behavior, I haven't used it a lot, so maybe im wrong.

    But if you run the game in debug mode and pickup the green ball then select the player and change Max falling speed to 0 then it stops jumping around.

    To me that doesn't seem to work correctly, the green ball being linked to the players imagepoint shouldn't get influenced by the players max falling speed. Also as you change the Max falling speed the green ball actually moves upwards, which again seems wrong to me, in a way that the imagepoint of the player, moves according to the max falling speed.

    But as I said I have never really used that behavior so maybe im missing something, that someone that have used it knows. But personally I would make a bug report on it and maybe Ashley can verify if its working as intended or not. But to me it seems like a bug.

nimos100's avatar

nimos100

Member since 23 Sep, 2012

None one is following nimos100 yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies