How to use bots in your title packs

Discuss everything related to custom data creation.

Moderator: NADEO

Kak0
Posts: 156
Joined: 11 May 2012, 09:25

Re: How to use bots in your title packs

Post by Kak0 » 11 Apr 2013, 13:47

Fadden wrote:For example with this very simple script that does nothing except spawing bots and players, bots don't move. They shoot when you approach, stop shoot when you are too far, and never shoot again if you are anew next to them.
The map used is Horde_single. I suppose I do something wrong...
What I don't understand is that they move when I test it. Have you modified the map or do you just use the one in the assets I gave ?

For the behaviour against an enemy, there seems to be a problem indeed, I'll investigate.

Fadden
Posts: 172
Joined: 10 May 2011, 18:21
Contact:

Re: How to use bots in your title packs

Post by Fadden » 11 Apr 2013, 14:23

I use the map in the BotExemple.zip, not modified. I also test a personnal map, but same problem : bots don't move...

I tried the following :
- Launch a server with Horde script (ok)
- Copy my code instead of the horde code, save and test : bots move !
- Quit the server, then relaunch it with the Horde script file that now contains my code : bots don't move...
Elle est où la poulette ?
[url=htp://forumrocket.forumactif.fr]Team Rocket[/url]

Kak0
Posts: 156
Joined: 11 May 2012, 09:25

Re: How to use bots in your title packs

Post by Kak0 » 11 Apr 2013, 14:34

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.

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 » 11 Apr 2013, 14:38

could you please explain what this variable does exactly?
    Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

    ManiaControl, FancyManiaLinks

    Fadden
    Posts: 172
    Joined: 10 May 2011, 18:21
    Contact:

    Re: How to use bots in your title packs

    Post by Fadden » 11 Apr 2013, 14:46

    Oh ok it works ! I thought that didn't work because if I put DbgEnableNavMesh = True in the startserver section, save and test, bot don't move. I quit the server, relaunch with the script that now contain DbgEnableNavMesh = True and it works :)
    That explains all my problem, but it's a little strange because the startserver section is normally runned after clicking on "save and test".

    Thanks you very much !
    Elle est où la poulette ?
    [url=htp://forumrocket.forumactif.fr]Team Rocket[/url]

    Kak0
    Posts: 156
    Joined: 11 May 2012, 09:25

    Re: How to use bots in your title packs

    Post by Kak0 » 11 Apr 2013, 15:41

    steeffeen wrote:could you please explain what this variable does exactly?
    In order to move on the map, the bots follow an invisible mesh, called the NavMesh. If this mesh is not computed when the map is loaded, the bots won't move, since in their point of view there is nowhere to go. This variable forces the game to compute the NavMesh.

    I spoke a bit too fast when I said it was a bug. When you use autonomous bots on a map, the NavMesh will always be created when this map is loaded, since the mode doesn't know if there are such bots. However, not calculating the NavMesh makes the map load faster. The point of being able to set this variable at False is to be able to use a map without being forced to compute the NavMesh (and thus avoiding an unnecessary increase of the loading time), for instance when you want to play on maps designed for a mode that use BotPaths, while your mode doesn't need them.

    I don't know if being able to control the computation of the NavMesh is really an important feature. We will see in the future if we keep it this way. Maybe an automatic computation when the map uses bots (regardless of their nature) would be more comfortable, but after all it's just one line in the script ^^ I'd like to have the opinion of the modders and mapmakers on that topic.

    Anyway I edited the documentation.

    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 » 11 Apr 2013, 15:46

    wow much thanks for the explanation, all clear now! :thumbsup:

    well as you've said i don't think that it's THAT much important.. i haven't felt any difference in loading times while trying out things with bots so the loading time difference might be very small and negligible (imo)
    => for me it would be fine to always compute the navmesh if there are any botpaths
      Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

      ManiaControl, FancyManiaLinks

      User avatar
      Eole
      Nadeo
      Nadeo
      Posts: 1252
      Joined: 26 Apr 2011, 21:08

      Re: How to use bots in your title packs

      Post by Eole » 12 Apr 2013, 11:59

      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 ^^).
      Contribute to the ManiaPlanet documentation on GitHub
      A question about ManiaScript? Ask it here!

      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:02

      Eole wrote: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 ^^).
      score is nice of course, but for what do you need the UI if you can't see/test it anyways?^^
        Game Mode and Title Pack Creator, Developer, ShootMania-Player & more

        ManiaControl, FancyManiaLinks

        User avatar
        Eole
        Nadeo
        Nadeo
        Posts: 1252
        Joined: 26 Apr 2011, 21:08

        Re: How to use bots in your title packs

        Post by Eole » 12 Apr 2013, 12:09

        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.
        Contribute to the ManiaPlanet documentation on GitHub
        A question about ManiaScript? Ask it here!

        Post Reply

        Return to “Title Pack & Custom Data Creation”

        Who is online

        Users browsing this forum: No registered users and 1 guest