Nabu's Recent Forum Activity

  • You do not have permission to view this post

  • Hi,

    You can use the Sytem option Layout Scale to scale whole layout, layers and objects in it, or do it for each object with the scale property of these objects.

  • Sorry, I did not understand. You want to randomly move the bomb every X seconds, or spawn random floor parts ?

    If it's moving the bomb to a random position, it's something like that :

    Every X seconds => Set bomb position to X(random(x1, x2) and Y(random(y1, y2) with x1, 2 and y1, 2, being the intervals.

    If you provide a small capx, we should show you more precisely.

  • Ok, I was a little bit confused so I misread some things. Thanks to you !

  • Hello,

    I'm pleased to study a bit you capx and work around with Multiplayer plugin for tests. One thing remains obscure to me : in the "enemy" part, which seems to be shared by both host and peer, you gave a random point for the enemy patrol behavior ai. I don't understand how this does not conflict with multiple connected instances of the game. I mean, is the random function already synched when in multiplayer for secure random number generation ? (Or do we have to program this by ourself ?) I saw that it works, but why ? Why this function does not return different values ? And why it is done on the peer instance ? This should be only on the host that make all the calculations and send to peer via multiplayer messages or synched objects, although I know there's many ways to implement game logic in multiplayer (like host does main calculations and send results, or host and peer have the same simulation synchronized by functions, etc...).

    Is it because the TankBase is synched so when you do a modification, it's done once ?

    I saw that you disabled a random angle set at Projectile object creation. Is it for the same reason ? Because the object is not synched, so you can't use random function and set the spawner object's angle to be sure it shared ?

    I miss something. Do you have some time to explain me more ? I feel lost ! The multiplayer plugin is the most difficult to deal with in Construct 2.

    By the way, thanks for your useful template !

  • Hello,

    "Every X seconds" doesn't work per instance, so if you want several objects of the same type or family firing, only one will.

    You can add an instance variable (named "timer" for example) and at every tick (or every x seconds), for each object, add dt (in system expression) to the timer. In the same time you check if the timer is higher than a value, and if it is, you can fire.

    • Add a "timer" instance variable for your object.
    • Every tick => for each object => add dt to object instance variable timer

    - If timer is higher than value : can shoot.

    I hope it's clear enough. Sorry I don't know the Rexrainbow's timer plugin.

  • Hello,

    First I'm sorry to post this in the general discussion, but I've already posted three times a similar topic in the bugs section that was moved in the closed bugs. The problem is related to creating objects with physic behavior on the fly. As seen in this topic https://www.scirra.com/forum/physics-error-and-crash_t150137, other people encounter the same bug, and it seems to be not linked to how many objects you create even though the bug occurs more often with many objects created.

    After testing, and reading others comments and experiences, I'm pretty sure it's not the "way" asm.js is programmed, but a memory leak.

    So I posted here because Ashley closed the topic each time with no more explanation and we can't discuss any more about and maybe find a solution.

    If someone is interested, we can go further together. It's a big issue for me as I'm working on a commercial project and at the moment I'm stuck on this (it crashes the program).

    Thank you all for your time.

  • Ooh... So why do we encounter the problem when there's only few objects in game ? I really don't think it comes from the memory limitation, but rather a memory leak.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Problem Description

    Physics behavior bug / crash when creating objects on the fly. Possible memory extension fix in beta r209 did not fix the problem, and does not help to support more objects.

    Attach a Capx

    https://www.dropbox.com/s/et90z0zdwswqepe/physics_bug.capx?dl=0

    Description of Capx

    Simple layout with physic objects. Left mouse click to spawn coins high rate.

    Steps to Reproduce Bug

    Just spawn some objects with left mouse click, (hundreds of them, it's fast) and the crash will happen.

    Same capx from previous bug report.

    Observed Result

    App crash with physics behavior related debug data.

    Expected Result

    Being able to support more objects. The problem also shows with tilemap with physics behavior.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Windows 7 SP1

    Construct 2 Version ID

    Beta r209

  • Ok, thanks for the fix and explanations. In some projects the bug is still here when there's only few objects though.

    After testing, the problem is not solved. I still get bugs with physic objects created on the fly.

  • When you select a layer, don't you have the "Locked" property under "Editor properties" on the left ? Or the lock buttons amoung the others in the layers tab toolbar on the right ?

  • Hello,

    Here's how to do that : https://www.dropbox.com/s/mb8oxg5zgnis9wt/spawnEnemyOnScore.capx?dl=0

    You can search and use the Rex's Nickname behavior to create object by a nickname you set on each object type that had this behavior, so have a different one for each object type in your family. In a cleaner way and fewer events.

Nabu's avatar

Nabu

Member since 14 Feb, 2015

Twitter
Nabu has 1 followers

Connect with Nabu

Trophy Case

  • 9-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

13/44
How to earn trophies