Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Have clones point to other clones

    Feedback
    3
    10
    397
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • SirBots
      SirBots last edited by

      This would be useful for ai clones to attack other ai clones directly.

      Your local coder who is working around the clock to make sure great games are made

      info-creaticode 1 Reply Last reply Reply Quote 0
      • info-creaticode
        CreatiCode @SirBots last edited by

        @sirbots

        Maybe you can use a table to store positions of all clones, and then you can use the “point towards x y” block to turn a sprite towards any of those positions?

        SirBots 1 Reply Last reply Reply Quote 0
        • SirBots
          SirBots @info-creaticode last edited by

          @info-creaticode The fact that the clones are bots, and there is multiple bots (clones) on both teams, I am afraid that it might lag because the table is updating so frequently. Even if I make a sprite for a detection zone to limit how far each bot can track each other, I doubt that will mitigate it should lag ever occur.

          Your local coder who is working around the clock to make sure great games are made

          info-creaticode 1 Reply Last reply Reply Quote 0
          • info-creaticode
            CreatiCode @SirBots last edited by

            @sirbots

            Sure, a new dedicated block would be more efficient. How about a new motion block like this?

            point towards sprite [SPRITENAME] with clone ID [ID]

            info-creaticode 1 Reply Last reply Reply Quote 1
            • info-creaticode
              CreatiCode @info-creaticode last edited by

              @SirBots

              Note that most likely you will still need to know each enemy clone’s position and decide which of your clone will target which enemy clone based on positioning and power. You don’t want to hardcode which of your clone target which enemy clone, right?

              SirBots 1 Reply Last reply Reply Quote 0
              • SirBots
                SirBots @info-creaticode last edited by

                @info-creaticode I want it where they will target the closest clone within a set distance of itself.

                Your local coder who is working around the clock to make sure great games are made

                info-creaticode 1 Reply Last reply Reply Quote 0
                • info-creaticode
                  CreatiCode @SirBots last edited by

                  @sirbots

                  What if there is no clone within the distance limit? What if multiple of your clones will target the same enemy clone?

                  This is becoming very specific to your game, so it is not suitable for a new block, which is meant to be much more generic.

                  SirBots 1 Reply Last reply Reply Quote 0
                  • SirBots
                    SirBots @info-creaticode last edited by SirBots

                    @info-creaticode For now, the ai is set to where they just fire in random directions In front of themselves. The enemy ai does the same, but targets the player if the player is close enough to them. I just published the first version of the game, so you can go check it out.

                    For your question: They would just shoot in random directions and occasionally move.

                    Your local coder who is working around the clock to make sure great games are made

                    info-creaticode Tyller_ 2 Replies Last reply Reply Quote 0
                    • info-creaticode
                      CreatiCode @SirBots last edited by

                      @sirbots

                      Thanks for sharing. It will be an interesting challenge to remix your game and add smarter logic for the clones based on enemy clone positions. Let’s see if there are any volunteers…

                      1 Reply Last reply Reply Quote 0
                      • Tyller_
                        Tyller_ Best Forum Helpers @SirBots last edited by

                        @sirbots I can try, and updating to a table I believe does slightly lag, I have a project that I recreated here that uses this method, I have recreated it in 3 different places as a sort of benchmark (code.org, here, nad codeacademy) and I’m pretty sure I got decent fps at like 30 clones on creaticode, I’m fairly certain that 10-15 was no problem, though I can try to find the project (the project does have similar logic to this, checks distance from every other clone, then checks some values per clone to decide what to do)

                        <div component="post/signature" data-uid="255" class="post-signature">Check out my chat room project so you ppl can not use forums as chat rooms! https://play.creaticode.com/projects/66f2e1dcd1be43d82b886fbd?version=1 <p dir="auto">
                        </div>

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post