CrudeMik's Forum Posts

  • purplemonkey Yonder looks superb, great style. Also love the website, can't wait to see more

  • On Nereus and Orbit (before I moved Orbit to Unity) I would experience exactly the same issue where shrinking the game window would improve frame rate performance. I fixed it on Nereus by limiting the number of objects in my scene. I would randomly generate an asteroid field, and found that if I reduced the number of objects in the level to <1000 performance was rock solid, anything like 1500 to 2000 and it would really start to chug on my laptop BUT weirdly, shrinking the window would bring the frame rate back right up.

    Another prototype I worked on had a massive tilemap, I'm talking a layout size of 8960, 5040 with a tilemap covering a lot of it made up of 16x16 tiles. Again, bad performance at full screen, solid 60 when reducing the window size, reducing the internal rendering resolution and all that didn't seem to make any difference.

    On my desktop (which is very powerful) I get a solid 60 on the Airscape demo fullscreen. I can't test my integrated chip laptop right now will edit post with results later.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • lol for some reason when I shot that screengrab CPU was at 18%, it's not like that most the time haha

  • mattb thanks for this - I really like your example and suggestions. I think I'm going to persist with my collided style but also use distances as you suggest for some of the objects to avoid. The colliders are working quite nicely atm, "f obstacles are in front of & behind the ship, thrustBackwards always ends up true" - this is true, but my collided shapes look like this:

    And when an object is in front of the ship, the ship will also boost left or right - the 'last collided' check makes the direction of sideways thrust mostly work out except if the ship is surrounded, at which point it just shoots the asteroid in front of it

    I'm setting up the containers now and reducing as many overlap checks as possible, will get back to you with the results. I'm currently using 20-35% CPU with 12 ships in the scene:

  • mattb - Nice one, I'll put up another video in a couple days to show the use of these AI, they're quite a fundamental part of the game now.

  • Amazing thanks for the info everyone I'm working through these suggestions now. Straight off the bat, rf900 limiting every tick to seconds has made quite a big saving.

    kingpirux that would be interesting to see, however I want this AI to use the same control / physics as the player, the player can take control of the AI at any point and I want the interactions between the AI and player to be similar.

    R0J0hound - yes I am using a lot of overlapping to pick, this is a good idea I'll integrate it and see what happens

    thanks!

  • Hey,

    I have a project with these roaming AI which don't use path finding but instead each has collision sprites pinned to their body and they use those to check collisions against other physics objects and thrust away from them, here's a snippet of my code to show generally how I'm putting it together:

    I'm quite happy it all works well enough but I'm finding that with 8 / 12 / 16 AI in the scene my CPU is climbing up and up, I want there to be quite a lot of AI if possible so I'm wondering if there's better ways to achieve similar results.

    I'm using a lot of if this is overlapping blah blah to pick instances, where I'm betting there's a smarter way to pick these guys with UID's and the such but I can't think of how.

    Here's a video of them in action

  • Started adding AI to the game:

    AI seeks resources in asteroids, manages fuel and shares information within a network of docking platforms. The AI simulates player inputs to navigate the environment, they seek to assigned x and y positions and use collision polys to avoid physics objects. They can seek around objects as the left and right collides has a ‘last collided’ check on them which allows the AI to strafe when an object is detected in front of them.

    They try to conserve fuel where possible and when they have either started to run low or have collected enough data, they attempt to dock at the nearest landing platform.

  • Thank you R0J0hound - that works

  • Hi,

    I have this bit of code:

    I want instances of itself to be an 'obstacle' - I need some code where if object a is overlapping object b and also overlapping object b(not self) then do action

    This is all in aid of having AI that avoid obstacles and also each other - but I don't want to use Boids.

    Any help greatly appreciated as always

  • Interesting findings. I'm seeing a improvement by doing this (image below), though compared with the complex collision checks going on in the other event sheets, this is still taking up the most % which I don't quite get. As TiAm says though debug readings are not 100% accurate.

    Hasuak - yes I have very silly naming conventions haha.

  • nimos100 - I get you, yeah that makes sense I'll go through an optimize that way, turning off collisions on sprites that are just for background art for example?

    I like the distant object off / on example, I wonder how it works with physics, what's the difference between collision properties and collision box 2d?

  • nimos100 - shit! wow so is overlapping and trigger once it is then.

    I'm still getting creeping performance, only less severe, I'll keep poking at it.

  • nimos100 - is overlapping better?

  • ah I think it was the asteroids overlapping asteroids, destroy asteroids event that was doing it actually, I'm now using only 15% CPU at the start, will leave it running and see what happens.