GeorgeZaharia's Recent Forum Activity

  • dop2000 I agree with what you are saying, but have you actually tried running random() and choose() a million times and comparing them? I have tried it just now on my very low-end android phone (which probably costs about $20 now).

    1,000,000 calculations of round(random(17)) take about 5 seconds.

    1,000,000 calculations of choose(1,2,3...,17) take about 6 seconds.

    I really doubt that igalencar needs to spawn one million explosions at once, and even if he was, the difference in performance of these two math functions would be the least of his worries.

    90% agree on that (since my entire point was about optimization), for sake of argument, im not going to write 100 pages of how C3 calculates things, and what to take in consideration convince yourself

    Here is the 1000.000 loop example , you will also say that the 20% -80% difference in cpu usage has no effect when comes to 14 animations, and i have a argument against that also(which is based on how C3 calculates things, as any html5 engine, however it should not freeze your computer at 14 animations, but would significantly increase your cpu usage causing more load for a spike of a moment added to other cpu utilization ur app does in same time, that might cause ur game to freeze.), but im going to wait for your reply not anticipate it.

    He asked why his animation freezes, and all i said is depends on multiple variations basically but a bit more specific. One of the reason being the way he coded the logic to pick that animation, 2nd being the compression the images he uses have, 3rd being depending on the device, 4th various input add here.

    You still didn't said if the problem was solved or not??? igalencar Also if the problem persists, a screen shot of that call and before and after wait calls or every 2 seconds stuff, will help a lot to identify the problem.

  • dop2000 There is practically no difference in performance between using floor(random(17)) or choose(1,2,3...17).

    You can try them in "Repeat 1000000 times" loop and you'll see that both expression take the same (very little) time to compute.

    the idea of optimizing was mostly meant for mobiles, while on computers you wont see any difference, when it comes to mobiles, you will see there is a big difference in performance especially when you load heavy assets, and have a non-optimize code of logic. Think on mobiles as a 10% of ur computer power. while there are mobile phones that can beat a Pentium 2 or even some low end today's laptops on memory their power is not stable is just fluctuating. So having a clean code would help a lot. As you said, pc performance difference of code from floor to choose is not noticeable, and agree on that, but i think is a difference on mobile, atleast from my past experience (last 4 years). Also keep in mind not everybody has a workstation to build their games on like me and you, their probably running on some normal computer build of <300$. And not everybody has the latest iphone or samsung.

  • Hello everyone.. in my space game i have a obkect that is a explosion animation .. int that object i have 17 diferent animations with about 40 frames each.

    So when i spawn it i do a floor(random(17)) to create a variation of the explosion.

    But when it does the game freezes for a bit.

    Is there a option to preload all animations?

    There are three reasons it might freeze,

    1) Not enough rendering power on your device in which case you want to optimize the frames and lower the quality of them and adjust frame size based on your game design screen ratio. One mistake most people do when they create a game, is forget to optimize their assets, which saves a lot of memory usage, for images i always use services like tinypng, which compresses the images by 80% or more in some cases, for example from a batch of 20 files at 50mb i get back 2/3mb size batch file. Which is insane, and in the same time very important for game memory usage, your game runs faster, higher fps etc.

    2) The 2nd reason it might freeze, is that your load animation event the floor(random(17)) trigger to pick the animation, might run in a loop. Make sure it triggers only once when the bomb explodes, or car explodes or whatever it is. Instead of floor(random(17)) i would use choose(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17) its less computation power for the runtime to calculate, in choose(123...) the runtime picks one item from list 1 time, in floor(random(17)) the runtime has to pick a random number including fractions like 1.111111 ,2.3543677 and then discard the decimal to make it a round fixed number.

    3) I mentioned above resizing your images based on your game design screen ration, for example if you have a game that is running on a 864x480 layout, and your animation is like 32x32px then that should be the frame inside the animation, if you have frames that are 256 x256 and you use C2 to resize them down to 32px that might also cause your freeze, because when the animation loads Construct has to resize all frames in that animation in 1-10 ticks to 32px.

  • Artpunk

    Was this ever addressed? Is it still the case that you can't specify which ad type to show?

    You where able to choose what ads you would show, from beginning.

    However that reply was referring to a dropdown selection that would load 1 advert code reference at a time and then choosing if you want to show a video or static advert. Which is practical impossible since there are 2 different advert objects created when you are setting the Facebook ads, one is for video, the other is for normal adverts, with two different code reference, so you can't call "for example 1 sprite and then call a video plugin using the same code". But you can call them both separated by loading each one of them before are needed then show the advert.

    Is a bit more coding to do in the game, but i think is not that big of a deal.

    I don't think will ever be addressed, since works as is.

  • those kindle fire have other browser then silk browser? if the answer is yes. then probably majority of people are using Chrome even on Kindle Fire, in this case i wouldn't worry about it.

    However if is must be done, then try exporting your game/app/website with a fullscreen mode Outer Scale. that way your game will fill the container its in. ! Important notice, the objects inside ur website at that point will be a bit larger and their position will be looking like is not where it should be thats because you have to adjust them based on the new fullscreen mode, or create a div that fits the entire website but restricts the construct app to sit at a surtain screen ratio.

  • Do you still need it guys? I'm working on it.

    Yeap C2 would benefit from it for sure. I have both C2 and C3 but definitely would be useful for those that still want to use C2 or are using C2.

  • Hi all,

    I like to make a small railroad simulation game with Construct 3. I have the book "Learning Construct 2" which mention that simulation games are very difficult to make in C2.

    Simulation games are the easiest to make in C2 and C3 not sure why he said are difficult.

    I do agree in the case where, if you compare a simulation game to a 2 minute game then the simulation game is difficult, but the same process of creating the 2 minute game goes in the simulation game as well just more complex. So definitely, C2 and C3 can create a simulation game, now there are a few things that might be difficult and maybe even impossible to achieve but those are influenced by your ability into coding, graphics and logic programming in Construct and other skills that you personally might not have, or knowledge about some things required by Construct or your game logic and assets, however everything can be learned, all you need is give it some time, and not expect over night results. The beauty of C2 and C3 is that you can do a pretty complex game with it, with zero knowledge of the traditional coding and programming. However do not expect Crisis 3 to be made in Construct also do not expect Unity 3d games made in Construct.

    From my opinion i see it as a prototyping tool, that can be used to make games, apps and even animations in minutes, as long as finished products, but then again if you read the manual there are 3 stages of knowledge: Beginner, Intermediate and Advanced, i would also add Pro Level after Advanced cause there are people in this community that are working in Construct like are breathing air, but thats off topic.

    Resuming to the difficulty, the process of polishing your application and becoming a intricate final product is another story, and when you are asking if its possible or difficult to make a simulation game in Construct ... to me makes no sense that question!

    Any game is possible if you know the engine you will use, and any game is difficult if you have zero knowledge in the engine your about to use.

    Now about the book: Who wrote the book? - is he even a Construct user? or he is just a writer?

    If is the book i found online, those details in there are same details you find in the Construct official manual which is free, the same templates in the book are the same as the default templates and tutorials that are made by the official channel and can be found both on construct.net and on

    Subscribe to Construct videos now

    .

    I think the book writer is just a writer and the information in the book might be written just to be written by somebody else (im not going to buy the book just to prove it, but il trust my guts and usually im right, unless the book was created by scirra members and i mean official members, then the difficult part might actually be true to a surtain extent or into a surtain situation).

    My advice to you:

    Before you go into a course tutorial online outside official information, first make sure you have a basic understanding of the engine you are about to use to make your application with, before you buy a "specialized training book".

    The answer to your question if is difficult to make a simulation game in Construct being 2 or 3 or Classic is the same: "Is as difficult as you make it."

    This was not a rant or diss, was my honest opinion.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am so excited to say that I have reached 30 million views & 150k Subscribers and Today I received my Silver Button.

    Feeling Awesome

    congrats man

  • How can I use BBCode to apply style to a certain word in a Text object.

    For example: "<b>Hello</b>, I am a <color=#fff>regular</color> string."

    I don't want to use a million Text instances to accomplish that..

    <b>&"Hello"&</b>&", I am a"& <color=#fff>&"regular"&</color>&" string."[/code:2fi2hany]
    
    something like the above if you want to use the code inside the text itself, however Construct doesn't allow css directly in the text you have to manually edit it by events using a text input object and not a text object... and find each specific word and give it a css based on the text case sensitivity, however might be a headache, id just use sprite fonts or sprites directly instead of text, if that is just a message you want to use. 
    
    also it might work with js ... but ehm there not enough tutorials around about this. may i ask what is that you want to achieve? in what context like behavior will be used? that way il probably be able to help better.
    
    to use css on text inputs see this [url=https://www.scirra.com/tutorials/1283/easily-add-css-effects]tutorial[/url] < for C2 runtime and C3. if C3 runtime is not usable yet since is experimental.
    
    edited: i was about to say might be supported in C3 runtime, as Ashley said bellow.
    
    However personally i noticed, C3 runtime might not be compatible with some behaviors or plugins yet since is still in development.
  • Thank you so much for the detailed reply.

    I could found compare animation frame I guess it's not the same.

    ENEMY EVENT SHEET specific part of the knock-back + ignore for 1 second:

    No problem, was my pleasure.

    Animation frame count works, faster then wait condition between, as long as the play animation is not interrupted by what ii said bellow.

    You could set the ignore off after the animation hit has finished playing that way you eliminate the wait 1 or 2 seconds condition which is causing your delayed animation. see capx bellow as how to convert it with simple default C3 conditions and no wait actions or every 2 conditions, i also left a conclusion there, in case things are confusing, however i might of made the conclusion a bit confusing by itself. the idea in the end is try code your game animations without any wait actions in the animation code. just trigger the animation when is needed and not mix it with the delay of other conditions mid animation playing, hope it makes sense, and helps you in your development, and sorry for the late response.

    Download: animation example.c3p

    However your animation control system is probably better. But i bet you included the event system above and eliminated all the wait conditions and expressions from it. Which kinda reaches what i was saying.

  • Iterations display random combinations. Can click on them and customize and save to DB.

    Would have a DB of colors

    DB of models. etc

    if as the person above mentioned models you mean animation sprites, which are frames and not actual 3d models, then is doable, you just host the files on a online database, and use ajax to call them and set them to sprites, same goes for the colors.

    can be done with ajax, or google spreed sheets, try this tutorials :

    example 1 ajax

    example 2 google spreed sheets db

    search query

  • Your issue: As you can see the on collision the player is "trying" to run the "HIT" animation from beginning but it stops for a few ms and then begins.

    i experienced something similar the past few years the solution was because of the way i was arranging the condition for example:

    when hit happens > animation 1 
    if landed behavior etc .... < this takes about 0.1 0.2 seconds to calculate and trigger the actions.
    if got hit with count objects ... < same here, depends on how many objects the plugin has to count and verify collisions with.
    if animation 1 finished play animation 2
    
    ////////////// this is usually how people code things in C2/C3 and that is a bad adoption, cause is against how Construct Works /////// this is the nr 1 cause in slow performance and "broken" code in Construct, in my experience.[/code:1wd4pmc3]
    
    the fix is simple  by moving the last condition after 1st animation or put 1st even should fix your delay
    
    [code:1wd4pmc3]when hit happens > animation 1 
    if animation 1 finished play animation 2
    if landed behavior etc ....
    if got hit with count objects ...
    [/code:1wd4pmc3]
    or in another case, you might want to check for collisions first then trigger animation in that case the following format should apply.
    [code:1wd4pmc3]
    if landed behavior etc ....
    if got hit with count objects ...
    when hit happens > animation 1 
    if animation 1 finished play animation 2
    [/code:1wd4pmc3]
    
    also make sure your animation frame speeds are default or to 0.1 or what the default speed is, do not confuse frame speed with animation speed they are different things.
    
    another thing to check, any "wait" or "every 1 second" conditions, between the conditions you have, needs to be removed from there and place at bottom of the event sheet, that way all code runs normal and wait happens after all animations and visuals are fast played, the "wait" & "every 1 second" conditions dont only apply to the condition are on, but to every condition in your event sheet that is under them, same thing applies to conditions that take a long time to calculate things as explained above they will delay the entire game system if placed 1st, C2/C3 as any website html5 code (css style, js etc), will read the code from top to bottom, therefore you need to prioritize the order of the conditions(this is a pretty well known issue, that is to be taken in consideration when you optimize your game/app for speed... but im guessing not many people do optimizations on their game).
    
    if any of the above are not fixing your issue, one simple trick is to increase the speed of the animation that gets lagged, and to last less then it does now, as i see your animation is pretty fast, and natural, there is only a slight delay, if you decrease the time should last, that will "fake" the fast movement, (if ur lagged animation has the same frame duplicated just remove some of the frames, since they are the same frame duplicated and there will be no changes in visual experience outside how fast it plays).
GeorgeZaharia's avatar

GeorgeZaharia

Member since 30 Jun, 2014

Twitter
GeorgeZaharia has 36 followers

Trophy Case

  • 10-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • 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
  • x9
    Popular Game One of your games has over 1,000 players
  • x21
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

21/44
How to earn trophies

Blogs

  • Construct For Dummies - Simple Tutorial Collection

    I scour the Construct forums for users tutorial requests, and create small quick and simple tutorials using Construct's defaults features so anyone can use and apply them.

  • My Dev Logs

    Thinking on games 24/7 is fun and waste of time and unproductive if we don't bring those game ideas to life. In this blog im bringing my game ideas to life and log their development process.