Page 4 of 16

Re: How to use bots in your title packs

Posted: 11 Apr 2013, 13:47
by Kak0
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.

Re: How to use bots in your title packs

Posted: 11 Apr 2013, 14:23
by Fadden
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...

Re: How to use bots in your title packs

Posted: 11 Apr 2013, 14:34
by Kak0
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.

Re: How to use bots in your title packs

Posted: 11 Apr 2013, 14:38
by steeffeen
could you please explain what this variable does exactly?

Re: How to use bots in your title packs

Posted: 11 Apr 2013, 14:46
by Fadden
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 !

Re: How to use bots in your title packs

Posted: 11 Apr 2013, 15:41
by Kak0
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.

Re: How to use bots in your title packs

Posted: 11 Apr 2013, 15:46
by steeffeen
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

Re: How to use bots in your title packs

Posted: 12 Apr 2013, 11:59
by Eole
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 ^^).

Re: How to use bots in your title packs

Posted: 12 Apr 2013, 12:02
by steeffeen
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?^^

Re: How to use bots in your title packs

Posted: 12 Apr 2013, 12:09
by Eole
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.