How to use bots in your title packs

Discuss everything related to custom data creation.

Moderator: NADEO

Post Reply
User avatar
steeffeen
Translator
Translator
Posts: 2472
Joined: 14 Oct 2012, 16:22
Location: Germany

Re: How to use bots in your title packs

Post by steeffeen » 12 Apr 2013, 12:10

Eole wrote:Well I agree the UI is not that usefull, but it's easier to test the real performances of the script by example.
And I think it's also safer in general to be able to test a script with bots that have the same properties as a player to avoid tons of specific coding only for testing purpose.
that's a point :)
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks

    User avatar
    w1lla
    Posts: 2373
    Joined: 15 Jun 2010, 11:09
    Location: Netherlands
    Contact:

    Re: How to use bots in your title packs

    Post by w1lla » 12 Apr 2013, 12:16

    Eole wrote:
    w1lla wrote:
    steeffeen wrote:we played some time as toads! so funny :lol:
    it would be great if we could just place usual bots which look like players, i'm missing the fake players which did just stand in the spawns, they were helpful for debugging and stuff
    Well using SetNbFakePlayers() seems to be broken? in Maniascript.

    So this is quite a nice alternative.
    I'm not sure I understood exactly the problem, but now you can use the new Users_SetNbFakeUsers() function instead of SetNbFakePlayers(). And it's much more powerful, as it spawns "real" players with an UI, Score, etc (this thing changed my life ^^).
    K missed it actually :thx:

    It was in the old scripts on maniascript always

    Code: Select all

    SetNbFakePlayers(	Integer 	NbTeam1,
    Integer 	NbTeam2 		
    );
    Thanks for the Headsup...
    TM² Info
    SM Info
    QM Info

    OS: Windows 10 x64 Professional
    MB: MSI 970A-G46
    Processor: AMD FX-6300 3500 mHz
    RAM Memory: 16 GB DDR3
    Video: SAPPHIRE DUAL-X R9 280X 3GB GDDR5
    KB: Logitech G510s
    Mouse: Logitech G300s
    Mode Creation
    ManiaScript Docs

    YonCan
    Posts: 293
    Joined: 26 Mar 2012, 12:42
    Location: Germany

    Re: How to use bots in your title packs

    Post by YonCan » 15 Apr 2013, 13:02

    steeffeen wrote:it would be great if we could just place usual bots which look like players
    :thumbsup:

    User avatar
    steeffeen
    Translator
    Translator
    Posts: 2472
    Joined: 14 Oct 2012, 16:22
    Location: Germany

    Re: How to use bots in your title packs

    Post by steeffeen » 19 Apr 2013, 14:30

    Saunter

    The bot wanders in a zone defined by a point and a radius. More precisely, the bot goes to a random location in this zone, then waits, and chooses another point in the same zone (and loops on this pattern). Use the following Driver's parameters to customize this behaviour :

    Saunter_AnchorPoint (Vec3) -> Center of the zone
    Saunter_Radius (Real) -> Radius of the zone
    Saunter_BaseChillingTime (Integer) -> Time between two moves (in ms)
    Saunter_ChillingDeltaTime (Integer) -> Used to add some randomness in the chilling time. For example, if the BaseChillingTime is 1000 and ChillingDeltaTime is 300, the chilling time will be a random value between 0.7 and 1.3 second.


    The bot will engage the targets within its AggroRadius, following them and shooting at them until they are out of sight or until the distance between the bot and its AnchorPoint is above its DisengageDistance. The bot then disengages and goes back in a random point in its zone.
    i can't quite get it working :?

    here's my code:

    Code: Select all

    declare Bot = CreateBotPlayer(NullId, 0, S_ArmorMax, BlockSpawns[MathLib::Rand(0, BlockSpawns.count-1)], Now);
    InitPlayer(Bot);

    Code: Select all

    Void InitPlayer(CSmPlayer _Player) {
    	// Apply bot hehavior
    	if (_Player.IsFakePlayer && _Player.Driver != Null) {
    		_Player.Driver.Behaviour = CSmPlayerDriver::ESmDriverBehaviour::Saunter;
    		_Player.Driver.AttackFilter = CSmPlayerDriver::ESmAttackFilter::All;
    		_Player.Driver.Saunter_Radius = 100.0;
    		_Player.Driver.Saunter_BaseChillingTime = 500;
    		_Player.Driver.Saunter_ChillingTimeDelta = 500;
    		_Player.Driver.AggroRadius = 50.0;
    		_Player.Driver.Escape_DistanceReset = 50.0;
    		_Player.Driver.Agressivity = 10.0;
    	}
    }
    i know that the whole bot thing isn't finished yet but in the thread it's written, that the bots DO move around
    mine just stay in the spawn and shoot at you if you get in their sight (as usual)

    AND Saunter_AnchorPoint doesn't exist

    any hints? :)
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks

      User avatar
      steeffeen
      Translator
      Translator
      Posts: 2472
      Joined: 14 Oct 2012, 16:22
      Location: Germany

      Re: How to use bots in your title packs

      Post by steeffeen » 19 Apr 2013, 16:19

      Code: Select all

      DbgEnableNavMesh
      i'm dumb :teub:
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks

        User avatar
        steeffeen
        Translator
        Translator
        Posts: 2472
        Joined: 14 Oct 2012, 16:22
        Location: Germany

        Re: How to use bots in your title packs

        Post by steeffeen » 20 Apr 2013, 19:37

        Kak0 wrote:Ok, I think I see where the problem can be. Until I fix it, here is how you can make your bots move : all you have to do is put the global variable DbgEnableNavMesh at True in your StartServer section. Basically, the game should have understood by itself that this variable is supposed to be True when you use bots, but apparently it didn't.
        after some tests i would say that DbgEnableNavMesh should be kept as variable
        if only maps with botpaths would be computed like DbgEnableNavMesh enabled then you couldn't use bots on other maps because they don't move then, for me it's fine to set the variable in a mode where i wan't to use moving bots :thumbsup:

        another question though:

        Code: Select all

        Users_CreateFake(Text, Integer);
        works but fails always on my end
        the fake players gets created successfully and is working, but the script crashes instantly with the following error
        http://www.pictures.esc-clan.net/upload/createfake.jpg

        and a request:
        it would be great if fake players wouldn't be part of the Players array but included in the BotPlayers array
          Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

          ManiaControl, FancyManiaLinks

          User avatar
          TMarc
          Posts: 15035
          Joined: 05 Apr 2011, 19:10
          Location: Europe
          Contact:

          Re: How to use bots in your title packs

          Post by TMarc » 20 Apr 2013, 19:46

          steeffeen wrote:another question though:

          Code: Select all

          Users_CreateFake(Text, Integer);
          works but fails always on my end
          the fake players gets created successfully and is working, but the script crashes instantly with the following error
          http://www.pictures.esc-clan.net/upload/createfake.jpg
          Spontaneous question here: why do you use "*test*" ? Did you try with a string that has no wildcards? E.g. "TestFakeUser_01"?
          Perhaps the engine can create the fake player, but can't attribute the name, which leads to the abort?
          maniaplanet forum global moderator

          Link list with FAQ, Support, Wiki, Tutorials, Community activities, and much more.

          System specs: Intel i7-970 12GB RAM, nVidia RTX 2060 6GB, Creative SB X-Fi, 2xSSD 1xHDD

          User avatar
          steeffeen
          Translator
          Translator
          Posts: 2472
          Joined: 14 Oct 2012, 16:22
          Location: Germany

          Re: How to use bots in your title packs

          Post by steeffeen » 20 Apr 2013, 19:48

          TMarc wrote:
          steeffeen wrote:another question though:

          Code: Select all

          Users_CreateFake(Text, Integer);
          works but fails always on my end
          the fake players gets created successfully and is working, but the script crashes instantly with the following error
          http://www.pictures.esc-clan.net/upload/createfake.jpg
          Spontaneous question here: why do you use "*test*" ? Did you try with a string that has no wildcards? E.g. "TestFakeUser_01"?
          Perhaps the engine can create the fake player, but can't attribute the name, which leads to the abort?
          i tried 100 different names, the bots created with another method have the logins *fakeplayerXYZ*, that's why i tried this name in the screenshot
            Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

            ManiaControl, FancyManiaLinks

            User avatar
            TMarc
            Posts: 15035
            Joined: 05 Apr 2011, 19:10
            Location: Europe
            Contact:

            Re: How to use bots in your title packs

            Post by TMarc » 20 Apr 2013, 19:53

            hm, and if you try "\*test\*", escaping the special characters? :?
            maniaplanet forum global moderator

            Link list with FAQ, Support, Wiki, Tutorials, Community activities, and much more.

            System specs: Intel i7-970 12GB RAM, nVidia RTX 2060 6GB, Creative SB X-Fi, 2xSSD 1xHDD

            User avatar
            steeffeen
            Translator
            Translator
            Posts: 2472
            Joined: 14 Oct 2012, 16:22
            Location: Germany

            Re: How to use bots in your title packs

            Post by steeffeen » 20 Apr 2013, 20:04

            TMarc wrote:hm, and if you try "\*test\*", escaping the special characters? :?
            * isn't a special character...
              Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

              ManiaControl, FancyManiaLinks

              Post Reply

              Return to “Title Pack & Custom Data Creation”

              Who is online

              Users browsing this forum: No registered users and 1 guest