jobel's Forum Posts

  • Has this happened to anyone else? I can't get Construct to see Google Drive. Not sure what happened but this is crazy, it won't even come up with a login.

    I connected Dropbox so I could at least still use Construct, but all my projects are in Google Drive.

  • Why is this happening?

    I logged in/out of Google it didn't fix it. Nothing works. I hit 'Refresh' and nothing happens.

  • dop2000 thanks! yes I noticed you made some optimizations. I think it works pretty well.

    no I didn't mean to make better performance than bullet, I mean better behavior with avoiding other boids, i.e. controlling acceleration based on steering away from other boids etc...

  • awesome thanks AllanR!

    I'd love to see what you come up with if you have any ideas!

    Ideally I'd like to use Bullet just because it's easy but I'm going to mess around with not using bullet later and to see if I can emulate Sebastian's (from the video) movement.

    I won't touch the shared version though, I made a copy.

  • dop2000 wow, that does look a lot smoother...looks like fish! I like how you tie in the new vector into the loop and I think you are looking for what is closer? cw or ccw? also great way to fix the 2 spinning off endlessly by randomizing the direction.

    I'm no good at RegEx? (whatever its called) can you explain with this is doing?

    (loopindex%2=0 ? dir : -dir)*loopindex

    I just realized that the video I was following has the c# code included!

    github.com/SebLague/Boids/blob/master/Assets/Scripts/Boid.cs

    one thing I realize is that to find a new angle he uses SphereCast, which checks for a possible collision of the size of the boid rather than just a ray intersection. (its probably more important for him since he's in 3D). C3 doesn't have anything like that except Overlapping at Offset, but I'm not sure how efficient that is..I'm wondering if that would prevent more collisions?

    also I am using bullet behavior whereas he manually calculates the speed/accel/dir. So maybe Bullet is no good here?

     velocity += acceleration * Time.deltaTime;
     float speed = velocity.magnitude;
     Vector3 dir = velocity / speed;
     speed = Mathf.Clamp (speed, settings.minSpeed, settings.maxSpeed);
     velocity = dir * speed;
    
     cachedTransform.position += velocity * Time.deltaTime;
     cachedTransform.forward = dir;
     position = cachedTransform.position;
     forward = dir;
    

    pretty sure 'forward' in this case means this.forward (as in the boid's movement). same with position.

  • mekonbekon

    Thanks, it's a fun project to try to emulate..

    I'm not sure anglelerp works because the angle+3 is not constant. It is updating a new angle every tick, also I think it has to be some calculation since it has to turn faster than 3 if the collision is very close.

    So I think the anglelerp just makes it turn slower, which does make it looks less jittery.

    Ideally I'm looking for less collisions.

  • hi, I'm trying to recreate Sebastian Lague's video on boids in Construct.

    I have the first 2 rules (Separation and Alignment) working okay. Although the turning could use some work.

    Any suggestions on making the turning not so jittery? or at least the concept I should approach? right now I'm just rotating 3 degrees in valid direction where no other boid is. I need it fast to make sure they avoid each other, but it seems like there needs to be some sort of ramp tied into how close the other boid is.

    Also I sometimes get pairs swirling around each other endlessly... :/

    drive.google.com/file/d/1e70farNbRKXZNyez9A2KMA9j870fUq_x/view

    (see video I am trying to follow)

    youtu.be/bqtqltqcQhw

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Usually it happens to me with a large project. Recently it happened 7 times in a row. Then some nights it never happens. There doesn't seem to be a pattern. It must be the way I am in and out of the project. I honestly don't know.

    Although I was testing a student's project which was relatively small (less than 50 Events) and it happened. And this never happened to the student since making the project.

    Ashley So I was thinking that recently I had changed Construct to open a Worker in another TAB opposed to a new window (I did this since Zoom would automatically show another TAB I opened on the same window, instead of another a whole separate window when sharing my scrren). I'm grasping here, but could that have something to do with it?

  • dop2000 ahh thank you! I should have known about these functions!

  • If we color a sprite solid white, then in the editor properties (on the left) set the color to 255,0,0 (red)

    Then in code we want to change that to green how do we convert the values so its exactly the color we want?

    Since Set Color has values from 0-100 and in the editor the values go from 0-255

    Should I instead only rely on Set Color since that adds a tint whereas Color doesn't? But don't I need to reset it in between?

    I hope I'm not the only one very confused by this...

  • I think what OP is asking is can you assign 2 tags to the same audio.

    you can't do this either, but you can refer to the last played audio with leaving the tag blank like this:

    Start of Layout > Audio compression on tag "weapons"
    
    OnShoot > Play shoot.wav tag: "weapons"
    
    	// change pitch of last played shoot sound
    	Audio playbackspeed random(0.9,1.1) tag: ""
    
  • Ashley I had been using Construct with a large project for about 3 hours - in and out of preview mode with no issues, when at the end of my night I previewed one last time, then quickly exited and the grayed out issue happened.

    Could it have anything to do with the particular Construct Event Sheet that is running when closing?

  • Ashley I think I got a decent screen shot after hitting F12

    as I said, right after this message, I hit F4 started the game, 2 seconds in I hit Escape (Browser Close) and all was well.

  • OK, so that sounds more like something to do with Construct. But there's still very little to go on, as ever the reproducible steps are key. Any idea if you can narrow down when precisely the "greying out" (dimmer) appears?

    Ashley Another clue is that it does not seem to happen on small projects. I have a project that is about 2000 events and 5000 actions with 8 layouts and 15 event sheets and this is where it seems to happen often.

    When I try to reproduce the problem, it doesn't happen, this is why it feels random or something I am doing and not totally aware of... I'm usually quitting the game really fast because I am testing, maybe the game is in the middle of some action or something? But I am using worker so I'm not sure how that effects the Construct tab in Chrome.

    Not working on it until tomorrow, I will investigate more then...

  • Ashley the "grayed out form" is the same grayed out look the rest of the sheet gets when you double-click an action and get the pop-up box. The Sheet underneath the pop-up dialogue is grayed out.

    Except that when I return from the worker (closed using Browser>Close) the Construct3 Sheet is completely grayed out as if I have a dialogue opened.

    It seems only hot keys work like: Ctrl-S and F4. When you play the game again and close, it usually goes back to normal. But one time tonight it happened 4 times in a row. But other than that time it does feel random. I'll see if I can get a good screen shot of it.. not sure it will show you much.