megatronx's Forum Posts

  • I've had similar weird frustrations in the past but I've not encountered this one. Try creating a local variable and first assign it the token-at value before then passing the local variable in the function call? Ie no text calcs inside the function call command. Hopefully might help you...

    Thanks, but I've tired that already and with no luck. :/

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you are really using 1000 objects, good idea might be to group. Let's say every 50 objects you add 1 to variable Group, and every tick or milliseconds you will calculate path for next group. At least this way you wont be calculating for all of the 1000 objects at the same time, and it will give those behind some time to recalculate the path.

    It is going to be tricky. you'll need count amount of objects based of their distance first. if 1000 of them is close, you will have to group them starting from direction of the mouse click. I don't know precisely atm ( really tired ).

    OK, Another Idea, which might be better, is to spawn several nodes/zones towards destination, before looking for path, and chain it, so they will look for first node first, then whe they arrive to first node they will look for second etc. This will significantly shorten path calculating.

    EDIT@ So, had one more thought about it. And in theory that's how I would try and program it:

    Have an invisible unit, super fast, that will be spawned from the nearest selected unit, and will go shortest path, dropping nodes on it's way, every number of pixels passed, and each node have variable for that node +1, so node one is 1, node 2 is 2 etc. Then check one by one for nearest unit ( or use loop to get a number of nearest units. You might ask on the forums how to do it, cause i don't know; maybe look in to this ), selected but not moving units, and trigger on their path towards first node. For each one getting in the area of that node, find new path towards next node. And when you change the final destination point, destroy the nodes and create new ones.

    Should work!

  • Yo,

    I'm fighting with one function call. Basically I'm using tokenat to get global variable, and send its value to function. But it doesn't work! The variable is not being called ( as it's being taken as a string). Don't know if it's a bug or by the design - can anyone help?

  • Shadow of the Colossus intro... if I think about it, the whole game is like one epic cut scene,

    Devil May Cry, original, the intro, and talk with demon spider.

    Besides that , you've mentioned most of it.

  • Hello,

    (@Ashley... Do not take this the wrong way)

    I must say i am disappointed with Scirras treatment of 2 major platforms (atleest in my humble opinion) wich are iOS and Android.

    To release an app/game for those two we are totaly left to mercy on 3rd partys solutions wich have questionable, half baked products...

    I am no programmer (this is why i chose Construct in the first place) and this is really frustrating.

    I just managed to complete export to iOS with Ludei... and that worked OK (aldo they have shitty instructions in their plugin wich lead me the wrong way).

    And as i wanted to do the same for Android i realized that theres no way i can have official leaderboard in my game.

    As i understaind, Ludei seems to be leaving further development to community... wich will maybe work and maybe not...

    Please correct me if i'm wrong.

    Is there any way that Scirra can develop some quality solutions that will work as they shud... leaderboards, in app purchases etc?

    If it is the question of money... tell us, maybe community will contribute? After all, it is for benefit of us all, no?

    Thank you.

    Yes, you probably right that it is a matter of money. Ashley would have to hire someone to get it done, as he himself has full hands of work atm. This has been talked about countless of times, that it is loads of work. But again, you're right - people would contribute. But would that be enough? dunno

  • Hi,

    I would like to suggest adding an extra optional parameter input field, which would allow to pick/create object via its written name.

    I have large number of Tiled Backgrounds Each requiring to be created on the run. My option right now is to make loads of events, each creating one of those tiled bg's. With that extra parameter filed, I would cut down on events to just one ( with the name being called from variable, that holds different value per sprite that is used as spawn). Same would go for PICKING, FOR EACH loop, and other that require to pick object from the pop up box.

    What do you guys think, would it be useful for ya too?

  • > The more I think about it, its kinda starting to seem to me like MMF's features are useless and redundant. Still a little helpful shortcut, but its not much though.

    >

    I don't know. I can't even remember the workflow of GF and MMF.

  • Genius, will give it a shot when have a spare moment

  • > The second issue is the way Every X seconds work, it does not reset between layout (it is every X seconds taking the start of the game for reference).

    >

    > I'll admit you are not the only one to think it should restart between layouts

    >

    I agree, I think it should be reset between layouts. I also would like to see a global timer that starts at zero when the layout starts, and counts up. I also want it to be possible to set this timer (and have it count up from the position you set it to). The difference between this and the timer behavior is that it should keep rising even after the event for it goes off. so like you could do an event when it reaches two seconds, and then another event when it reaches 5 seconds, etc. People may be tired of hearing me mention MMF, but MMF has this feature.

    There might be already a plugin in plugin section that does that. If not, just create a variable, to which you will add 1 every second, and then in game refer to it. Literally one variable and one event.

    As for Every X not resetting - it should, I agree. Makes no sense otherwise. Here's a quick fix, which I haven't tried ( cause I'm working on single layout ) but it might work: add condition to those events, something like varTime = True, and on end of layout set it to False, and to True at beginning of the next one. Alternatively use TImer behavior.

  • On button down:

    • Every tick: add 1 to VARcharge.
    • VARCharge > 20, Trigger Once: Set animation to charge.

    On button released, VARCharge > 100: shoot charge shot

  • Have you tried FOR EACH?

    I also just tired RTS example, and they don't go back to previous path point.

  • megatronx I looked at load from url, but it wants a web address.. how do you load a local file? like for previewing or on dropbox?

    RamPackWobble yeah this is what I was going to do, or since I have an unbound layout I would just make the no longer bkgrd invisible. I have 5 different background, was just look for an efficient way to do it.

    You didn't read the tutorial, did you?

  • [quote:32bv2yu0]Thx for the capx, will check it when update to latest stable when will be released. Although, you do check for distance, right? So if distance is less then X, then you turn collisions off, yeah?

    Yes and its fairly simple to add.

    Here are the code:

    As you can see its pretty straight forward to add.

    That's cool, but it wont work for a platformer at all ( cause enemies will fall trough floor)... unless you'd make your own behavior that will move the enemies across without need for collision checks with solids, something like : Check for overlap at offset -> decide on direction -> Check for terrain type ( as check if its straight, or rising etc ) -> Set destination X,Y -> turn this chain off, an set moving on -> Repeat the process on arrival.

  • [quote:3mnglyep]Can I ask you why you'd need a group for distance checking? Wouldn't simple comparison of distance be enough?

    - Distance < n

    -- Is overlapping

    --- do stuff

    I guess you might be able to do that as well, but I haven't tested that, so not sure what performance that would get you. But from guessing I would assume that you would get worse performance, as you are just introducing another check for no apparent reason. You might as well just use "Is overlapping" without the distance check, as C2 will still check for overlapping regardless of that distance check.

    What my group does is it actually turn Off/On whether an object should even be checked for collisions based on distance between objects. So as C2 checks for collisions for each object, suddenly there are far less objects (Those outside range) what it doesn't test against and therefore its basically a test whether its better to just make collision checks for each object, or if its worth using distance checks to turn off collision detection all together for certain objects, even though it requires a distance check to do it. And based on my testing at least it can in fact improve performance quite a lot, as to not doing it.

    (Just disable the group called "Disable collision" to see the difference, and yes its a terrible group name )

    Thx for the capx, will check it when update to latest stable when will be released. Although, you do check for distance, right? So if distance is less then X, then you turn collisions off, yeah?

  • [quote:w6x57yis]

    (Collision group is the name of the group in my program that does the distance checking, not something you find in C2)

    1. Using overlapping (With the Collision group disabled)

    Number of objects: 2490

    FPS: 8-9

    Collision checks per sec: 18000-21000

    2. Using On collision event (With the Collision group disabled)

    Number of objects: 2512

    FPS: 2-3

    Collision checks per sec: 1013025+

    3. Using overlapping (With the Collision group Enabled)

    Number of objects: 2501

    FPS: 29-30

    Collision checks per sec: 12000-15000

    4. Using On collision event (With the Collision group enabled)

    Number of objects: 2464

    FPS: 3-4

    Collision checks per sec: 2048000-3100000

    These are my tests that I just did, as it removes overlapping objects before checking collisions, there is a slight difference in amount of objects. But nothing that will change the results in any significant way.

    But if you look at the collision per secs, which is from the debugger, it goes nuts on the On collision event, even when you remove the squares that are overlapping. So something is clearly not the same but there aint really a lot you can do with the "On collision" event as its part of C2 and cant be modified.

    Number 3 uses a functionality that disable collision checking based on range. So adding something like this can increase performance quite a lot.

    Can I ask you why you'd need a group for distance checking? Wouldn't simple comparison of distance be enough?

    • Distance < n

    -- Is overlapping

    --- do stuff