tunepunk's Recent Forum Activity

    "improve the engine significantly for serious developers such as storing object references, lists , SOL's, Arrays, in object variables, and building prefabs of objects in a general class based system rather than having to rely on the botched container and family features that always wind up requiring weird work arounds when structural changes have to be made. Instead we're encumbered with the overhead of storing UID's in other objects and having to a search over N objects every-time we want to make an object reference, so even building prefabs, constructors/destructors in events carries a severe overhead. The event engine/SOL system is great, it can be used for rapid prototyping and really quick development, but it needs improvements to actually be usable for performant code in a large game.

    Even as a hobbyist the subscription model doesn't really bother me. Take up any other hobby, and you usually have a club membership fee, gym card, renting place for your band to practice, etc. That they are going from a "free updates to for life" model, (which is a very stupid business model, in terms of securing income their continued development) to Yearly fee is a wise decision. But on a personal note, I would rather have that they would have some kind of IAP model, where you buy features, plugins, and behaviours based on your need. I think that's the way the free versions engines like unity stay afloat. Lots asset packs and plugins in store. Scirra's store selection isn't very big or great though. But considering that they made the decision to go for an online tool (which has running costs) the last thing you want is too many free or one time pay users, if they are not continuously buying assets or plugins either.

    Although I do agree on some points above. I absolutely love the Event Sheet way of working, but I also feel I have to rely too much on inefficient and weird workarounds in some cases, or third party plugins to do some simple things, like raycasting and tweening, custom SOL lists etc. I absolutely agree that they should consider spending more time on those kind of features you mentioned. I'm quite hopeful though that once C3 matures, and after new runtime they will have more time for that. I'm patient... i will support C3, but my main projects I will do in C2 until C3 matures, and get a bigger plugin library and more features.

  • Inserting and deleting elements from an array is O(n) since it uses contiguous storage and has to shunt along all the elements after the affected index. However adding and removing items from the end is fast, because there is nothing else to shunt along. If you can rearrange it to only modify the end it should be faster. Another technique is if you have a fixed size array you can cycle through the same set of elements without inserting/deleting anything (i.e. a circular buffer).

    Dictionaries have per-key storage which means nothing else needs to be modified to add and remove items. Arrays are usually faster if you need to iterate them or do lots of random access, but inserting/removing anywhere apart from the end is usually a pretty bad case for arrays.

    This is all standard computer science stuff, it's the same in pretty much every language.

    Thanks for the info Ashley. I did not know that adding to arrays att back would make that much of a difference. But in this case, where I constantly need to update a kind of custom (SOL) list of UID's it seems dictionary would be better, as in an array, i could be deleting an entry anywhere in the array... and whenever I delete an entry it has to update the the array.

    In this particular test I will be deleting any UID entry that is outside the radius of 50 pixels.

    I will make a mental note, that I should always add or delete stuff from an array from the back if possible.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I did some optimization tests to understand a bit more how to improve my performance on some projects. I couldn't figure out what was wrong so I made this test to see what it was.

    I wasn't looking for this but It seems arrays has a lot more overhead and way slower than for example Dictionary. Check out this example to see what I mean.

    Here's a link to test project.

    https://www.dropbox.com/s/yhikh6nqdsy10yk/array_overhead.c3p?dl=0

    Even a simple 1 dimensional array is much slower than dictionary. Does anyone know why this is the case?. It doesn't use more or less cpu, but seems to lag a bit compared to Dictionary.

  • I would think picking by instance variable would be the most efficient.

    I thought so too, but picking by instance you still have to check through all of the 5000 sprites for that instance variable. By loading all the previously picked in to an array or dictionary, you save your self a lot of work if you need to pick them again.

    Too bad you can't add or remove objects from families in runtime. That would be awesome.

    My next project is to see if I can keep a low/constant pick cost even with 10 times the amount of sprites, in this example.

    Picking CPU usage scales with amount of sprites you check through every tick, so I'm trying to figure out low cost ways of doing picking in large scale layouts with high object count. Smart way of shortlisting the picking.

  • Thanks for your help guys. Some nice solutions there. I wanted to try different ways of picking in a high sprite count environment 5000+ to see what was most efficient.

    Seems like dictionary and behaviors is the winner after all. In case anyone has something even more efficient.

    Here is a link to capx with some of my tests:

    http://tunepunk.com/share/scirra/pick-optimization.capx

    Ethan the plugin by rex was amazing. I might use this the future.

  • Is it possible to pick multiple objects by UID using a string, JSON or something similar instead of using a loop?

    And can I create a string of multiple UIDs, which I can use for picking? I'm trying to limit the amounts of loops I have.

    I don't want to use for each - then add them to an array.

    Then use for each X element of the array to pick them again, as I'm doing at the moment.

    Any ideas how to go about that, and is it possible?

  • Looks nice what's that software with the animations?

  • It has good performance, but you need to investigate and optimize your code a little bit. It's easy to make things work, but sometimes hard to make it efficient, depending on what you do. Sometimes people use too much effects that will make the game slow. That's not c2 that's slow, it's usually bad design choices and bad code.

  • Ashley and Tom Good job with the last couple of updates. The new clipboard setting is pure GOLD! No more annoying copy messages when trying to copy stuff and paste stuff

    I think this one could even be enabled by default on web version, (since chrome and most other browsers don't really allow copy to clipboard) but disabled on the upcoming desktop standalone version, it's that good really!

    I don't know if it was forgot or left in by purpose, but crosshair on "Ctrl+V" I don't really think is needed either? or if it's left in by purpose... maybe a 50% opacity representation of the things you're about to paste instead of the crosshair, so you more easily see that you have something to drop.

    Anyway keep it up. I will report more usability stuff if I find any.

  • If you're making it competitive i guess randomness is not very desirable. If the player does well, they might be accused of just getting a lucky roll, in the randomness. But it all depends on what type of game you end up creating.

  • > Every time I try to copy something I get the warning message, it's a bit annoying but bearable. I get why it's there, but is it possible to add a setting so you can turn it off, and only use the internal copy and paste without warnings?

    >

    I guess this would avoid those warnings, so I've added a new setting in r21 to use in-app clipboard only (i.e. "use fake clipboard").

    [quote:30ikye9g]When you use Paste... is it possible to paste directly where you clicked, or at mouse pointer... instead of having to click a second time...

    This makes sense, no need to show the crosshair when it can just use the clicked position. Changed for r21.

    As for the text format: AFAIK browsers can only copy text, not other formats. It could in fact be useful - for example I can select that text and copy-paste it directly in to C3 and see your sprite.

    Good news!

    Ahhh, that's pretty neat if it works like that.... I just tested it out.

    You don't even get warnings that that this object doesn't exist in the project. it creates a new sprite object as well if it doesn't exist.

    Same was not the case for events. There you get a warning as usual that the referenced objects doesn't exist. Maybe that would be a nice feature for a future update to have a dialogue to create the missing object and variables if not exist. Maybe even have the referenced objects also be loaded in the copy, but only paste if they don't exist?

    I can find many nice uses for this kind of functionality. One thing that comes to mind directly is when helping out other people on the forum. Instead of sharing a c3p file, (it's a bit of a hassle, saving the c3p file on an service like dropbox, sharing the link. Then they have to download the c3p file,open the project) Instead you can share a code snippet, that they can just paste in their project. Maybe very useful for solutions to smaller problems.

    It could also be very useful if you want to build up your own library of useful events/functions and code that you are likely to reuse. Instead of having several different c3p files, to copy and paste between, You can save your useful code snippets in a text file, online document, or whatever, for later reuse, and paste into your project when needed. Very neat and handy.

    Why not have a built in snippet library, that you can just pick from? Kind of like the plugin dialogue, but with events/objects that you save.

    Click one of your saved favorite snippets and it just pastes it into your project. I did some awesome touch controls in another project, that I want to reuse. Highlight those events. Right click... "Save snippet to your library" as.... "touchControls"... for easy access in other projects.

    Anyway. Nice work.

  • Ashley

    should this be happening?

    {"is-c3-clipboard-data":true,"type":"conditions","items":[{"id":"is-between-angles","objectClass":"System","parameters":{"angle":"0","first-angle":"0","second-angle":"45"}}]}[/code:10jmh4e5]
    
    This is what i get, when I copy an event in C3 and paste it here.
    
    And this is what I get when I paste a copied sprite here, as text.
    
    [code:10jmh4e5]{"is-c3-clipboard-data":true,"type":"world-instances","items":[{"type":"Sprite","properties":{"initially-visible":true,"initial-animation":"Animation 1","initial-frame":0,"enable-collisions":true,"live-preview":false},"instanceVariables":{},"behaviors":{},"world":{"x":206,"y":226,"width":4.185689907291271,"height":4.185689907291271,"originX":0.46,"originY":0.5,"color":[1,1,1,1],"angle":0}}],"object-types":[{"name":"Sprite","plugin-id":"Sprite","isGlobal":false,"instanceVariables":[],"behaviorTypes":[],"effectTypes":[],"animations":{"items":[{"frames":[{"width":25,"height":25,"originX":0.46,"originY":0.5,"originalSource":"","exportFormat":"png","exportQuality":0.8,"imageDataIndex":0,"duration":1}],"name":"Animation 1","isLooping":false,"isPingPong":false,"repeatCount":1,"repeatTo":0,"speed":5}],"subfolders":[]}}],"imageData":["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAADEUlEQVRIS72WTWicVRSGn3Pnz6BYiBvFqkkrSClOQAshKf4EBXEtLVJK6U4ouCguXKltdeNKQRfuzEaFFjduhG6qohML4yIJaaFgfkgXrgItSJ1vvrlvOfebvzapLRrmwuXeGWbOc95z7j3nGiMYNgIG94VMXFp76JFa54VgpUNILxqMC/YY3BBsmdHsKP6h663mytGD2U5O/yuk3vjzNQinQE8YBMAEwUACM4gU+2iwGRU+Xz48sXA3aEfIwZWVavnm2DtRejtgZcNKSnYsYEPqhUDRCBLqRJQH7LvF1sZXzM3lPdg2yIHfVp+pwicEnkWUgLJBSVjJHVYSUAxLIoIMdQQdIMfoILuSSeeuHt63UfxueJw5E6beOHEWeF1KxsskQNp7uBzqYkwJkIYDXKZ77vvcjBzp4uLs/o+2QZ5fWH/TFD9Ixo1qV0mla9wBASVYT4rnxKer8NkulJA5TBY+Xp6Z+LGvxPNQujH2jcHTgBt2FcOrQ3z6f3y6Ep8DQKGmncJWrBv5nlvH+5D6r6svEfg0YFVQJULFCkgFVAYrJ2U2pETE5DnKwZJhQTskgLUjyoi834dM/b7+HjEecQAJlAC9tdLNi6vzcPlMoUo5GHju3vtdaeMArE0IFwZKGqvzBgcwaugukKhg/dA5qBcu9z5HKRd3AszaiJbg6jDkB4PHPeES1RQqUesaH1aWTlw3Fw7pek7Whbnhtln67Afgr0G4GmuXQA8b1DwfnhtJ1XTKitDVhkLYO189QCuFSGRmlnkuPC+CFtjfo1VSH0VORnO6FtamkT7b9XtidnpQu86fL9WfPPS1Gc/t2o03ri1uNk/eUSDrXTW7VbswO700M3l5W6mfWlh9Fzj2v6swfLs4s++L7aXev2k2K1PZY19iqv/XfqLI8lK2carXuHbsjN7XH63FD8Fe9Yb1oJ2xaFz66WYrnFufm/znnp2x3yskqzfW3jLjpGD8AXr8lsT80uzk96mnDY37vlb2NjbHxslfgfgyYtrMasUbQj5awcLlCL9sUf75+uxTt3Z6rdwG59/Rhrcb9f8AAAAASUVORK5CYII="]}[/code:10jmh4e5]
    
    I don't get anything like this when I try to copy something in C2 and paste it in a text editor outside C2.
tunepunk's avatar

tunepunk

Member since 2 Mar, 2014

None one is following tunepunk yet!

Connect with tunepunk

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies