dop2000's Recent Forum Activity

  • Have you tried my demo? I posted it here a few times:

    dropbox.com/s/p40ibb75m9g8z8j/ZoomTouch.capx

    Run in Chrome, it may not work very well in Firefox due to some bug with touches getting "stuck".

  • Your code needs to be optimized for such a big number of objects. And it's not only the ZombieAI, CivilianAI event sheet is just as bad...

    You should avoid using "For each" loops on every tick for a big number of instances. First, pick suitable instances, then loop through them with For each. And don't run it on every tick.

    So, replace this:

    For each Zombie
    Zombie timer "follow" is not running
    Zombit is not eating
     -> do a whole bunch of stuff
    

    With this:

    Every random(1,2) seconds
    Zombie is not eating
    Zombie timer "follow" is not running
    For each Zombie
     -> do a whole bunch of stuff
    

    Avoid using pathfinder too often for too many objects, avoid regenerating obstacle map too often. Consider making pathfinding cells bigger.

    Also, your "While" loops have no emergency exit, so they can get into an infinite loop, or simply run for too long. Add another condition "Loopindex<10" to them to avoid this.

    Try disabling big blocks of code to find what's affecting performance the most. Try to decrease the number of collision checks per tick (it's currently too high).

    Add debug output into your events to see if they work as expected. For example, if you add Browser log "failed" into Civilian On Failed to find path event, you'll see that after a few seconds this event starts running hundreds of times on every second! Which means there is some problem with civilians pathfinding.

    You may need to compromise many things to improve performance..

  • Have you tried searching the forum? This is a very popular question, here are two posts I found:

    construct.net/forum/construct-2/how-do-i-18/how-do-i-draw-lines-68949

    construct.net/forum/construct-2/how-do-i-18/how-do-i-create-a-line-while-d-128365

  • You can set "Unbounded scrolling=Yes" and scroll outside of layout borders.

  • You can convert individual R,G and B channels into one number using rgb() expression, but as far as I know, there is no easy way to "extract" channels from the full rgb color. You can do this with these formulas:

    b=(color % 256)

    g=int(color/256) % 256

    r=int(color/65536)

    Also, check this plugin:

    construct.net/forum/construct-classic/completed-addons-40/plugin-bitwise-operations-41684

  • Lol, I know the feeling. I've been using C2 for almost 3 years and still discovering things like this.

    Most events in Construct pick instances. If at least 1 instance was picked, the event is considered to be true. If no instances were picked, then the event is false, and the "Else" condition is triggered.

  • Yeah, comparing count and picked count should work.

    Here is another way to check if all sprites have their variable set to 1:

    Sprite variable not equal to 1 -> (no actions here)
    Else -> (put your actions here)
    
    (else event will only be triggered if there are no instances with variable not equal to 1)
    
  • I don't think this is possible. The only solution is to keep the same value in a variable.

    EDIT: It's possible with scriping. For example, to get "Outline" effect parameter from an object by UID

    var i = runtime.getInstanceByUid(localVars.objUID);
    i.effects.forEach(function (e) {
    
    if (e.name=="Outline") {
     localVars.result = e.getParameter(localVars.parameterIndex);
    }
    });
    
    
  • Yeah, "pick all" event should should be nested under "path found" event, as it's done on sizcoz's screenshot above. I tried to show it in my first comment, but the new forum kills code formatting...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You do not have permission to view this post

  • No, just some number. You should probably randomly change the wind speed and direction every moment, and display it on the screen, so that players could adjust their aim.

  • Then use overlapping at offset (-windSpeed).

dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 257 followers

Connect with dop2000

Trophy Case

  • 8-Year Club
  • Entrepreneur Sold something in the asset store
  • 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
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    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
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x13
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

28/44
How to earn trophies