I suggest you ...

Allow the robot to issue commands to a clone (and vice versa)

A robot should be, for example, able to tell a clone to stop() and rotateCannon() if it saw an enemy that the clone has not seen yet.

5 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    overflo shared this idea  ·   ·  Admin →

    9 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • Phil D. commented  · 

        There is no need to bake this in, as it can be implemented using the existing platform. The more functionality you bake into the API, the less is left to evaluate the skills of the actual developer. If you're going to implement this, I suggest making it a sub-optimal implementation, to leave room and incentive for devs to code a better solution.

      • AdminBernardo Heynemann (Lead, fightcodegame.com) commented  · 

        It's a little cliché but I really like to think it's our game. All the devs in fightcode actually love the game and have active robots.

        I'll definitely discuss with them what you are asking for.

        I think what we wanted is for the clone to be an exercise in control and not just two robots issuing the same commands (go and kill that robot). What I mean is that they should scan for other robots independently, like they could not communicate.

        We might change that. I'll let you know. Thanks for bringing it up. We are all for improving the game engine.

      • overflo commented  · 

        I understand that. It's going to be a tough conversation ;)
        I'll try to rephrase my question:

        Let's say that the clone is now running ahead(1000) which will take quite some time to finish. Let's also say that the parent fired up the onScannedRobot event.
        Is it somehow possible to make the clone stop() right now (+/- 1 turn) _without_ using any not documented internal functions nor taking advantage of some internal structures (which I consider is cheating)?

        If it is possible, fine; although I would prefer to struggle with algorithms than with language magic :)
        If not, then this is what I was asking for at the beginning, for example by making a robot.children array. You're free to disagree, though: your game, your rules :).

      • AdminBernardo Heynemann (Lead, fightcodegame.com) commented  · 

        Not at all. It's a pleasure to answer.

        What I meant is that people are using flags inside the robot closure to communicate between the robots.

        I can't divulge more details. That would be unfair... Sorry.

      • overflo commented  · 

        Thank you for the explanation. It wasn't obvious to me that you were passing a different object each time.

        Using flags doesn't cut it. Doing a one 120 degrees turn is a lot quicker than six 20 degrees turns with checks for a flag in between (for example). That's why I was trying to issue a stop() command as soon as I found an enemy.

        Now, I'm not sure what you meant with your first comment. Did you mean that it is possible to do it only with flags and that you need a closure for that OR did you mean that people were using flags but if you use a closure, you can access the other robot directly?

        Thank you for spending the time to answer all these questions!

      • overflo commented  · 

        If you say so, I'll have to believe you :)

        However, I still don't understand why this (poorly written) snippet using global variables does not work:

        var Robot = function(robot) {};
        var clone;
        Robot.prototype.onIdle = function(ev) {
        ev.robot.clone()
        if(ev.robot.parentId != null)
        clone = ev.robot;
        else
        clone.ahead(100);
        };

        I'm off to read some tutorials about JS closures.

      • Berny Cantos commented  · 

        I'm with the admin, it can be done with code if you spend some time. Maybe the hard thing is that both the main robot, and the clone, share the same instance of the Robot class, this was giving me a real headache until I understood it.

      Feedback and Knowledge Base