Matei511's Recent Forum Activity

  • I am trying to make an extremely simple multiplayer game that has no cheat prevention and no input prediction. I have read all the tutorials several times and opened the example files multiple time and i can't get it right. I am just trying to make the sprites move toward the touch or mouse.

    Here's the capx: https://www.dropbox.com/s/5psy3080symyx ... .capx?dl=0

    Thanks in advance!

  • dop2000 maxlive2010 I managed to do it after all. Thank you so much for your help and quick replies.

    In case anyone else is wondering, here's the capx: https://www.dropbox.com/s/qrpughyojtxrn2i/pin.capx?dl=0

  • construct2.96.lt/forum/1/pinforum01.capx

    unfortunately containers won't work because i have multiple object with multiple instances

  • If you add Black and Red sprites to the same container, then they will exist in pairs. You will be able to simply do "Pin Black to Red".

    If you don't want to use container, try this code:

    > System-> For x=0 to Red.count-1
       System -> Pick Nth instance of Red instance=loopindex
          System -> Pick Nth instance of Black instance=loopindex   :   Black pin to Red
    [/code:1e5unmc5]
    
    In both cases sprites will be pinned to each other in the order they were created. Black sprite with lowest UID - to Red with lowest UID and so on.
    

    The problem with containers is that i can create one object and at the same coordoinates. I need multiple objects with multiple instances pinned on diffrent posittions. I noticed now my example capx was flawed and induced you into error. The code won't let me do this right?

  • The easiest way to explain this is by using a capx. I am trying to pin each black square to each red square. So every red square has one black square pinned to it. I tried giving the black square and the red squares i want to pin variables with the same value and use pick by evaluate, but as you can see in preview, all the black squares are pinned to the first square and only the first. Pinning each separately with an event for each pin won't help, since i need this for a bigger project , in which i would have to pin 5 items to each of 50 items. SO 250 events just for pinning.

    Here's the capx: https://www.dropbox.com/s/q3taxjibvlv1t ... .capx?dl=0

    Hope you can help me and thanks in advance!

  • So i want to have something like 8 rooms in my level. The rooms are big (800,1440 pixels). Is it more efficient to use 8 different objects or use 8 instances of a sprite containing 50 or so frames, each frame being one room and set the frames when i need a different room? Does the number of frames influence performance? Even when they are not being used?

  • The system only checks for collisions when it's needed - if you have events "On collision" or "Is overlapping" or if there are behaviors on the objects that register collisions (platform, physics etc.)

    So normally your destroyables should not generate collisions check with the walls.

    You said your layout is (1400,800) - is this in pixels or is this the number of tiles on the tilemap?

    If in pixels, it's not that big and you should be able to use tilemap or even several tilemaps on top of each other.

    If you have lots of individual sprites like destroyables, you can disable/enable collision for them if they are too far from the character or in another room etc.

    System-> Pick by comparison-> Sprite where distance(Sprite.X, Sprite.Y, Character.X, Character.Y)<100 : Sprite Set collision enabled

    System-> Pick by comparison-> Sprite where distance(Sprite.X, Sprite.Y, Character.X, Character.Y)>=100 : Sprite Set collision disabled

    Thanks for the help. There is a very weird thing tho. Something must have went wrong in that project because i copy pasted the room, tilemap, destroyables and players from the other project to a new one, and no i only get a maximum of 40k colission checks, which is way better than 4 million. I didn't have any on colission or overlap events. Weird. I will use your tip anyways, i will aim for 60 fps even on older devices

  • so apparently it was not only the tilemap that caused the problem but also a lot of small object that i also had checking for colissions. since these objects don't move and could never collide with the tilemap anyways, is there a way of checking for colissions only between certain objects (so the player and the destroyables, but not the destroyables with the walls?

  • I have a big room (1400,800) and i am trying to figure out how to do colissions properly ( it's a dungeon so there are a ton of walls) My room is one big sprite(i didn's use a tilemap because i know it's not good at having a lot of diffrent objects like scenery and also i would need something like 3 or 4 of them (because you have no layers on c2 tilemaps). So i have this big image with no colissions, so i just added an invisible tilemap , resized it to be as the room and started making the colissions manually. It works as intended except the fact that i get 4 million colission checks per second in the debugger and lag on mobile. I then instead used like 20 smaller tilemaps (because i read about colissions on the blog and how they are registered) and now it works well, but it's very tiring and takes way too much time. And that's just for one room, and i plan on building over 50. Is there a better way to do it? Or some way to split a big tilemap into 20 smaller ones?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > So i was wondering what is more efficient: having some large images (512 by 512) or 2 tilesets over each other (i need more layers) the image will have both tiles that repeat a lot(walls, corners, etc.) Which i know adds benefits to using tilemap, but also diffrent small parts (cracks,vases,chains,etc.) That are very diffrent, don't appear many times and need no colissions. So which is better?

    >

    i know that tilesets are best for performance

    I know they are effective but only if there are not a lot of diffrent sprites

  • So i was wondering what is more efficient: having some large images (512 by 512) or 2 tilesets over each other (i need more layers) the image will have both tiles that repeat a lot(walls, corners, etc.) Which i know adds benefits to using tilemap, but also diffrent small parts (cracks,vases,chains,etc.) That are very diffrent, don't appear many times and need no colissions. So which is better?

  • I was wondering how you could spawn objects in a certain way: so i want objects to spawn randomly all over the layout except a circle that follows my player so i avoid them spawning right over the player.

    |_________|

    |...............|

    |...... O ....|

    |_________| (ignore the dots)

    so i tried "drawing" what i meant. i want object to spawn randomly in the rectangle (i know how to do that already) except the circle. So everywhere in the rectange but not the circle. the circle will be moving (following the player)

    Thanks in advance!

Matei511's avatar

Matei511

Member since 30 Jun, 2017

None one is following Matei511 yet!

Trophy Case

  • 7-Year Club
  • Email Verified

Progress

8/44
How to earn trophies