Topic: Automated network game testing
Tibor Topic Opener |
Posted at: 2016-08-29, 20:37
Hi I would like to set up some automated tests - to test AI. The setup would be - starting from command line, so the comand would start a map, all slots as AI, and also load a script - that would set up a gamespeed and terminate the game after f.e. 5 hours of gametime. And over and over. The game help does not indicate that loading a map this way is possible. Also, when I use "--scenario=" I am not able to make it use my script. I run: /var/widelands/BZR/ai-post-b19-installed/widelands --scenario=/home/tibor/.widelands/maps/Crabsome\ Island.wmf --script=/var/widelands/BZR/TESTING/SLOT1/scripting/init.lua it loads, but script is not run, see error I got: Trying to run: /var/widelands/BZR/TESTING/SLOT1/scripting/init.lua: not found. I did more experiments, but I am not able to figure it out. The minimum that would do is to start the game with given speed. But this option is not available either... Any ideas? Top Quote |
SirVer |
Posted at: 2016-08-29, 20:53
this should work: Now try:
The layered file system will only allow searching in directories registered with it, not arbitrary paths. Top Quote |
Tibor Topic Opener |
Posted at: 2016-08-29, 21:19
Great, it works! Partially at least ... now I am getting:
The script is (shortened):
Top Quote |
SirVer |
Posted at: 2016-08-30, 06:25
The problem is the
this spawns a new coroutine which will keep running for the rest of the game and eventually close the game. Top Quote |
Tibor Topic Opener |
Posted at: 2016-08-30, 11:01
Thanks, it works! Top Quote |
Tibor Topic Opener |
Posted at: 2016-08-30, 19:59
Well, but I just noticed the game is standing, time is going, but AI is doing nothing and the screen is black - though I dont need to see anything, so this is not a problem... Top Quote |
SirVer |
Posted at: 2016-08-31, 06:28
I think if you start a map using As for seeing something, if you leave the first player as a human, you will be controlling it. You can add a Top Quote |
Tibor Topic Opener |
Posted at: 2016-09-04, 21:32
Well, I modified player_names, now I see that AI starts (custom printfs in terminal), but there are no other logs on the terminal - as expected by normal run of game. The screen is dark of course. So how can I verify that "--scenario=" option is working as supposed? Top Quote |
GunChleoc |
Posted at: 2016-09-05, 08:05
You could add some Lua code to the scenario with a print statement to the console. Busy indexing nil values Top Quote |
Tibor Topic Opener |
Posted at: 2016-09-05, 20:52
I have a print in scenario file, it is printed. Another issue - when I save network game and load it with --loadgame - it is loaded as single player game - so first player is "lost" for my testing. Frustrating.... Top Quote |