WackyToaster's Forum Posts

  • Let´s do it the easy way: tokenat!

    tokenat(str(number), 0, "")

    The number has to be converted to a string with 'str(1234)'

    If you have variable lenghts of numbers you probably want to make use of tokencount and loopindex.

    See: https://www.scirra.com/manual/126/system-expressions

  • Got to the boss, but gave up there because I couldn´t reach that last switch or the dynamite, no clue what I am supposed to do there. Be very careful about what and how you make your game hard. Make your game fun first, then make it hard. The line between hard and just plain annoying is very thin, and I think you crossed it into the annoying part.

    Waiting for paypal

  • I think you should be fine, as long as you keep some things in mind.

    • First of all... what is full-size? 480p? 720p? 1080p? Construct will scale the images up or down regardless of resolution, but the size you choose decides how big the image will be. It depends on what your main target resolution will be.
    • How many layouts do you plan to use? Because one layout = one more image.
    • Do NOT move these big background images. This costs a surprising amount of power. Move the viewport instead.

    I can only guess but if you go for 720p png images you should be able to go for ~1mb per layout. Also depends on how many colors you use (how good it compresses) or you could instead use jpg or gif (lower quality, lower size). Or you could load the images from a server. (Requires internet connection though)

  • [quote:2f3cp1ev] I have no idea what type of game you are making but that seems to me to be a bit overkill.

    I should have made it more clear that this is just an example, I don´t actually make a game right now, just an app. It was just exaggerated to show my thought behind it, that the event system will go through all other events even if they are not in the layout, before getting to the one event that matters, thus eating performance for nothing.

    [quote:2f3cp1ev]what I've learned in my experiences is that ESPECIALLY if there are no instances of the enemies - it will consistently run all code checks pertaining to the non-present enemies.

    What I do is create a spawner for each enemy, and at the start of a layout I check if the spawner exists. If it does, I enable the group for the enemy code and create the enemy per each spawner. If it doesn't exist it disables the group.

    Sounds like a good and easy approach to me. Not having to think about all the includes would make it even easier.

  • Something I always wondered regarding optimisation... what is the best practice for organizing event sheets? Or rather, does any of the approaches make a huge difference, performance or otherwise?

    Let´s say I make a game with several layouts and 1000 enemies, each with individual behavior. Now my personal approach on this is to make an event sheet for each enemy, and use includes in the layout event sheets to only use the enemies I need. So a layout that only uses enemy #874 will also contain only that part of the code. Everything is neatly organized and I´m pretty sure that is the definitive approach for it. (right?)

    Now my question is, if I were to make one single event sheet that contains all 1000 enemies (sounds like code-hell) and include that monstrum in my layout event sheet, again for a layout that only uses enemy #874, how are the events handled then? From what I understand is that the event system will first go through the conditions for enemy #1-#873 (top to bottom, excluding sub-events) and then finally reach the only enemy that is used. Wouldn´t this impact performance? Or is it not even checking the conditions since the layout does not contain the instances? (Isn´t this a check in itself, to see that there is no instance?) If it does impact performance, it should be mentioned in the Performance Tips.

    Now a different situation. I (actually) create a single-screen app. The app can have different states/pages that are currently active, and based on the current state a set of events should run. Since it is only one layout, it needs to include all the code for each state/page. But obviously if I´m on page 3, I don´t need to run the events for the other pages. I handle this by using a state machine (If you haven´t heard of it, google it right now and thank me later ) So it only needs to do very simple checks (state 1, nope. state 2, nope. state 3, yep) However, I could also use the ability to enable/disable groups, I assume this would theoretically be faster, since it doesn´t even have to check anything and only runs the enabled group, but only by a miniscule amount. (right?)

    And now a last question. The event system works top to bottom, and once it worked through all events, it makes the drawcall. This is one tick. But doesn´t that also mean that on a sub-tick level, nothing is allowed to happen at the same time? I´m pretty sure in certain cases this would heavily compromise stability, but in other cases where it doesn´t matter, would it speed up the process? So instead of "Do A, then B, then C, then D" it would be "Do A, B, C and D". Now even if it would speed up, it´s questionable to sacrafice stability to squeeze out 0.0001 fps, but maybe for bigger projects it would actually improve for 3-5 frames and might be worth it as an option. I imagine a sort of "Run simultaneous 'tag'" condition, aswell as a "Run simultaneous events with tag 'tag' now". That would allow stuff to run simultaneous while still beeing somewhat controlled within the event system flow.

    Or maybe I just have too much time to think

  • There´s quite some stuff to think about regarding mobile stuff, recently I took that challenge myself and it was quite a cruise.

    1 - What is the best way to handle fonts when it comes to a mobile app these day? sprite font?

    I think sprite fonts are the fastest option, but webfonts work fine too for me. So I´d go with webfonts, as I think they are a bit easier to handle than sprite fonts.

    2 - The best way to have an app published in the Play Store is still by exporting it with Intel XDK or do we have other better options?

    Use Cordova CLI. I tried all the Phonegap/XDK etc. stuff... just use the CLI. Once you worked into it it´s easy peasy and much less of a hassle.

    3 - Today, for those looking to have an app published in the Play Store, what is the best way to add advertisements using C2? if you make mobile apps/games, what do you use?

    Cannot answer that, but I had some troubles with IAP and admob, so it´s disabled right now. For ads I might actually go a different route, instead of using some kind of ad-network, I will try to go the direct route and simply offer banner space, that I can add in myself. I can even add them without updating the app, as they are loaded from the server. (This version isn´t online yet though)

    4 - As my application handles various information in text, including some that the user can write, what would be the best way to 'save' these texts for the application to load again later?

    There´s a bunch of options for this. The mentioned JSON format is probably the best option. Also you might want to look into local storage.

    5 - About text again: is the text box working fine? if the user touches the text box the android keyboard open and work as intended?

    Yes and no. Textboxes are a bit on the weird side, and actually quite annoying, as different phones and OS handle it different. Even different android versions make a difference.

    When user tap on it, the onscreen keyboard opens fine on all devices. But that´s about the only consistent thing. Now the on-screen keyboard shows and...

    • Everything is fine, yay
    • The keyboard covers a part or all of the input box, pretty annoying
    • The app scrolls up by itself in order to compensate for the missing space
    • The whole app shrinks to whatever space is left with they keyboard, also very annoying

    I still haven´t figured out how to handle this perfectly. If I go ahead and add a fix so the keyboard doesn´t cover the input boxes, on the phones that already compensate by themselves the app will scroll way too high and at best just looks pretty ugly. Same goes for the phones that shrink it, while this usually happens on iPhones, some android phones have this too. Also it does not happen on all iPhones only on some, where I then need to compensate again, or the phone does it by itself, where I cannot compensate for it. Dunno if someone has a catch-all solution for this.

    [quote:aeb8kkk6]The bottom line is that they don't care about your opinion.

    As far as I am aware I have rarely seen a company beeing this engaged with their customers. There´s a huge difference between caring about someones opinions and accepting these opinions. All I can hear is "Wahh wahh why don´t you cater to my needs?!?!?11"

    And for all the hobbyists (as myself) who cry that it´s too expensive... It´s not. I don´t understand why some people see a subscription model and instantly think it´s too expensive without even thinking how much they actually end up paying. Just put it in perspective and suddenly it isn´t all that expensive anymore... Don´t think about the cost, think about the cost per hour. If you use construct a whopping 24 hours a YEAR, that´s a little over 4$ per hour. That´s not even close to expensive compared to other activities and we´re still talking about using it 1 out of 365 days.

    If you go to the cinema 3 times a year that´s roughly 30€ for ~6 hours, so 5$ per hour. It´s literally more expensive than using your construct subscription 1/365 of the available time. (And I haven´t even factored in popcorn & drink)

    And while going to the cinema is fun, using Construct is fun AND........... constructive. *badumm tsshhh* (I ain´t even sorry for this one )

    It's not only the money, the editor has a number of potential non-business friendly problems as a side result of the model:

    - If it cant connect to the internet to check your license - it will lock you out - even if you did pay the renting fee

    - If scirra some day decides to stop developing/supporting it - surprise surprise - you are locked out of all of your projects

    - Editor updates are enforced on the user and may break some things

    - Scirra may increase the fee whenever they want to <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> next year it may become 299$ - you are in such an uncertainty here

    - Your project is not only locked to their editor - it's locked to their licensing model

    - Let me know if you can add more points to this..

    • wrong... just wrong
    • no you won´t be locked out, you just won´t get any more updates
    • valid point, but I never ever had anything broken from an update so far. Also I´m not so sure about the enforced update part because you can work offline and if you are offline you can´t update
    • Hahaha... no. You wanna know why not? Because they´ll lose so many customers if they crank the price up like this they will end up earning less. This just won´t happen in the near future and very likely not in the far future.
    • Have you ever tried opening a Unity project with Unreal Engine? Wow it doesn´t open... whoa how dare they to lock me into their engine? If you want something open, learn Javascript or C++/C#
    • You totally forgot one point on your list: [quote:2hvhl8dw]I am uninformed and too lazy to read about the topic so I´m gonna pull facts out of my ass and spread misinformation /li]

    Excuse my language, I hate it when people do this. How about you inform yourself before you go ahead and post this garbage list: https://www.scirra.com/blog/184/a-first ... onstruct-3

  • How do you use the tokenat? The usual usage is

    tokenat("string", X, "|")
    [/code:2mm7l1ft] The paramenters are 0 based so
    
    "string" - the string you want to read the token out of
    X - The number that defines the position of the token <-- This is where it complains to get a string instead of a number
    "|" - seperator
    
    So if you search your event sheets in C2 for tokenat and review the lines do you find any errors? Else it is probably an import error.
  • I remember Ashley stating that particles are essentially just sprites with bullet bahivor (can´t remember exactly but something like that), so there is basically not much difference in performance between creating particles with the particle object or creating particles with "create object". The benefits are that you can apply physics behavior or other stuff aswell that the particle object does not allow. So apart from the additional impact (performance wise) from the bullet behavior or the physics behavior there is no difference. 250 particles are likely to be way too much though, especially with physics, you probably should do 50ish maximum. But you can try the bullet behavior, I think it has less impact on performance.

    [quote:2sw8uhjo]tons of event sheets.

    Why would you need tons of event sheets for this?

    On enemy hit | Create object "foo" at position XY

    Repeat 20 times |"foo" Set bullet angle to rand(A, B)

    To some degree I understand the problems with subscription based services. Especially for hobbyists (like myself, I try to convert though) this is a dealbreaker. But lets face it, iirc...

    [quote:1hc4vvqg]$99* USD per annum.

    We´re talking about a little over 8$ per month. I don´t understand how anyone has troubles affording this. I´m not exactly earning much and I still have a photoshop licence that costs 12$ per month. It´s pocket money.

    Also...

    [quote:1hc4vvqg]Customers who purchase Construct 2 on or after 1st February 2017 (the launch announcement date) will be eligible 100% discount on the first year subscription price for a license of the same type or lower (where Business is the highest and Personal is the lowest).

    Customers who have purchased Construct 2 prior to February 1st 2017 will be eligible to a 50% discount on the first year subscription price for a license of the same type or lower.

    It´s not like scirra leaves you in the dirt. If you already own C2 you will get it (depending on when you bought) FREE for a whole year, or a whopping 4$ per month for a whole year. You´re not gonna starve because of this and you can test it for a whole year before deciding.

    There are hobbies out there that are a huge multitude more expensive than that or even just activities...

    Don´t buy that bag of chips - Boom, you now can afford a month of C3 (first year)

    I doubt they will just change the model because of some sort of petition. The only thing I can see is them making you able to suspend the subscription on a monthly basis so you can suspend it if you just not gonna use it within the next month. Also it´s understandable why more and more companies switch to subscription models, because if you have one time payments you will get a spike and then for the next several years the income will trickle in while you still have to maintain the development.

    Just my 2 cents

  • I tried importing a techdemo I made with gamepad and couldn´t get it to work. Didn´t spend to much time trying though, but I can confirm that the Gamepad doesn´t seem to pick up properly. I tried restarting C3, plugging controller in & out, etc. I used Windows 7, newest Chrome and XBox 360 controller with wire. C2 picks it up.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Since this bug has practically no documentation on it and the error is called by engine code that c2 generated it's likely that c2 is the root of the problem or one of the plugins. Do I understand this right that cordova/wkwebview creates a local server on localhost in order to run the app? If that's the case the error indicates that for some reason the server gets created twice. How I see it is that wkwebview creates the server and one of the other webview plugins does the same. If I manage to get the error appear in the emulator I will post the log here.

  • Ashley I personally don´t have an Iphone so testing can be a bit complicated, I can try with the emulator though.

    Boxels Depends on what you use to build your project. I use cordova CLI so I use windows cmd and just input "cordova plugin ls"