nutmix's Forum Posts

  • Well, I removed each action one by one, and the one which caused to go from 60fps to 6fps was:

    [T] wonAmount -> Set X to (viewportleft("main")+viewportright("main"))/2

    However, I do exactly the same thing with sprites above it, which doesn't cause a problem, so this is odd.

    Interestingly, once I call this line, preview doesnt auto update the iphone any more, I have to refresh after hitting the "play" button at the top of C2.

    This doesnt seem possible, but I've reproduced it about 10 times.

    All the other lines put together make about 2-4fps difference btw if I disable them.

  • foolberry - using a single global would be dangerous if there is any multithreaded parts to C2 (I dont know if there are). e.g. if thread A set the "something changed" global to true, the on tick sees this, sets text, then just before it sets the "something changed" back to false, some other thread changes a value and sets the global to true it will be ignored - and the values wont be updated. Anyone one know how multithreaded C2 is? Im familiar with Actionscript, which every one says is single threaded but in fact isnt - e.g. http request callbacks can be executed any time.

    Mipey, this is my backup option, but is tedious.

    teahousemoon I could duplicate the setting of text code in every place its updated, but often I want to add something, then I would have to find and add it to every duplicate place, which in C2 is hard - I often resort to using notepad++ on the xml files.

    The solution I think I will go for is to use rexrainbows function plugin. This is poor second best to a custom event, but will allow me to abstract the updating code into a single maintainable place, but put the calls to it all over the place as required.

    Usually I would not touch a non-C2 plugin for fear of it becoming unsupported in a future version, but I dont think my project will be maintainable without it.

  • Most games have various counters such as balance, health, position etc.

    As there is no "on value change" event, MVC or similar for such values, rather than duplicate the GUI update code in every place which can update the values, I have 10 "every tick" actions to do things like:

    1) calculated and show the latest balance on screen

    2) show the latest bet amount on screen

    3) set any anchored objects to the right X/Y position based on viewport (anchor behaviour doesnt do what I need)

    etc.

    <img src="http://www.ohds.co.uk/c2/everytick.PNG" border="0" />

    When I run the game, I get 6fps when Idle (I.e. absolutely nothing happening - no movement, no animations) on the iphone 4. If I disable the onticks, I get 60fps. I still only get 1fps if I move a tiled background across the screen, but thats another post.

    I saw someone say that C2 is intelligent enough to only run the ontick action if one of the values has changed. This does not seem to be the case.

    What is the best strategy for this?

    Does everyone store the "last value" of each variable, then do checks to see if it has changed every tick? This will also incur an overhead.

    Any magic solutions, e.g. to make an event out of a value change such that it can be caught and actions can be defined in one place?

    Thanks!

  • I wrote the game in a few weeks (its a slot game with skill component). It was running at a healthy 60FPS on an iphone 4, when idle or when animating the reels etc.

    Ive spent the last 6 weeks doing the surrounding control and info pages, settings, paytable explanation pages etc.

    So now there are additional "pages" which are just off-screen collections of sprites and text boxes which I "swipe" in and out when needed with bullet behavior on families and pinned backgrounds etc.

    The problems is now the game runs at 20FPS when idle, and less when animating, even though all the stuff I have added is off screen and doing nothing.

    Any ideas how this can be helped? I cant go live with 20FPS- - its now unresponsive and not nice to use.

    Why do off-screen non-animating sprites kill performance, even when idle?

    would doing something like set enabled to off on the bullets when not in use help (rather than just setting their speed to 0)?

    90% of my sprites are just dumb images. Some are acting as buttons.

    Thanks for any tips.

  • That's pretty useful- I didn't know you could do that, thanks!

    Shame its not easier - i.e. to be able to rename copied objects would be more logical.

  • OddConfection thats a pretty good tip. Ill try and use that where possible.

    Have you found a way of using PIN to object with this? I.e. I have 3 copies of a large backgroud image, and want to pin each to a different specific sprite. Currently, I have cloned the large backround image, which means huge download times. The image needs to move with the objects (I slide them in/out).

  • 3. You need to go to the place where you see 'sounds', 'object types', 'families', 'layouts', in folders, etc. Then, go in the 'object type' folder and delete the 'ghosts'.

    I see this - thanks. Any idea how I see which ones are not used? There are literally hundreds of duplicates in there (struggle with cloning), and I don't see how I can search/see which ones are used or not.

    Is my only option to save as project files, and use something like notepad to search each XML file for each object name?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • THanks sqiddster. I would love to use instances of the same object instead of clone, but then you cant name them (if you name one instance, it renames them all. Also, I need to pin one instance to one object, and one instance to anther, and this is not possible as you only see one instance, not two, in the object picker for pin.

    Pretty much all my duplicate images (they are just that) end up as cloned sprites. I experimented with using tiled backrounds to represent my dumb UI images, but these are limited in that you cant put them in families etc. I experimented with pining them to a 1px invisible sprite, and putting that sprite into the family, but it was just too complicated to maintain them all.

    To be honest, I have found almost no cases where I can use copied instance of the same object, you almost always have to clone them so you can give them different names, or move them to different places etc. The only place I have ever used a copy is when i used it with instance variables, and then only need to operate on them in loops. But usually, you just want to grab a specific instance without the tediousness of looping through them all to find it (especially as the parameter of a function which requires you to pick an object form a list).

  • Ok, its a pretty big bug, I'm amazed that it hasnt been fixed as I saw someone hit the same bug with R90.

    You have to set the speed before you can set the angle. this is like pressing the accelerator before you turn the steering wheel in the direction you want to go!

    This means the object will fly off in the wrong direction until its set.

    As a workaround, I set the speed to 1, then set the angle, then set the speed to my desired speed.

    PLEASE put this in the manual at least as a known bug - I wasted 2 days on this - thats a lot of money for me lost. I was even thinking I would have to write my own version of bullet.

  • Ok, this is very bad, I put a debug statement immediatly after the set angle of motion, and its not getting set.

    I.e:

    .. INFO -> Set angle of motion 90 degrees

       (text) Debug -> Append "angle="&INFO.Bullet.AngleOfMotion

    And the answer:

    "angle=0".

    ???

    There are no other statement which set the angle of motion anywhere in the project.

    Any ideas?

  • Well, I tried some other objects, and lots more anlges, and I can only get sprites to move left or right, never up or down.

    I even tried angles of say -90 (this goes right).

  • Some trial and error results:

    set bullet angle of motion to 180 degrees make it go left.

    set bullet angle of motion to 90 degrees make it go right.

    set bullet angle of motion to 0 degrees make it go right.

    set bullet angle of motion to 270 degrees make it go left.

    So it seems that with this object, I can only make it shoot in left or right direction. The object has no anchors, but has a background image pinned to it.

  • Hi, my project is bloated with about 90% unnecessary duplicated images, and so is very slow to download when it should not be.

    There seem to be 3 duplicate image problems:

    1) A number of cloned images with different names and positions. There is only one actual png file. But for each clone, C2 has a dupliate identical image in the images folder. I would much prefer to use "copy" instead of clone, but then you cant give them different names or behaviors etc.

    2) I have 5 animations. For each animations, i see one animation sheet, and one single frame of the animation for no apparent reason.

    3) I have deleted a lot of objects from all my layouts, but they are still in the exported project (and still show up in the object picker). How do I purge these old ghosts?

  • Hi, usually, when I set the "bullet angle of motion" to 180, it goes left. But sometimes when I run the project, it goes up.

    Usually, when I set a sprite bullet angle of motion to 270, it goes up. But right now, this makes it go left.

    Am I going mad?

    It works for some days, then for no apparent reason, starts going in the wrong direction. Once I fixed it by setting the sprites "set angle" to no in the behavior editor, but now this doesnt fix it either.

  • Wow, brilliant! Problem solved.

    I have never used collision polygons - all my games are casino type games.

    Thanks again guys - great help and advice!