Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ferry into lp:widelands
I am thinking a lot about this feature, but for AI it is relay difficult. On most maps it will not be applicable and AI should be very cautious to use it at all. It has complex logic for implementation. So the conclusion is that it is not worth the effort to implement in AI. What could be considered to make it more AI-friendly: - to allow transfer of workers on ferries - not to produce more ferries than needed - allow transport of ferries over roads, or at least extend work radius of ferryyard significantly - introduce WATERROAD_CAPS, and allow a waterroad between two such fields, or WALK_MOVECAPS and WATERROAD_CAPS. These WATERROAD_CAPS can be calculated and/or set by map creator (to restrict fields where waterroad can be built) - not to route the wares over unattended waterroads (to avoid transportation blockages) But I know that all of that violates your intentions for this branch, but an improvement in one of few of them would make AI implementation easier. I will still keep thinking about this, because idea is interesting... -- https://code.launchpad.net/~widelands-dev/widelands/ferry/+merge/351880 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/ferry. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1830868-skip-tests into lp:widelands
Continuous integration builds have changed state: Travis build 5195. State: errored. Details: https://travis-ci.org/widelands/widelands/builds/546082615. Appveyor build 4975. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1830868_skip_tests-4975. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1830868-skip-tests/+merge/368858 Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1830868-skip-tests into lp:widelands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1830868-skip-tests into lp:widelands
Notabilis has proposed merging lp:~widelands-dev/widelands/bug-1830868-skip-tests into lp:widelands. Commit message: Adding compile.sh switch -s to skip building the tests. Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1830868 in widelands: "Add switch to compile.sh for skipping boost unit tests" https://bugs.launchpad.net/widelands/+bug/1830868 For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1830868-skip-tests/+merge/368858 -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1830868-skip-tests into lp:widelands. === modified file 'CMakeLists.txt' --- CMakeLists.txt 2019-05-09 06:43:00 + +++ CMakeLists.txt 2019-06-15 09:39:05 + @@ -48,6 +48,7 @@ option(OPTION_GLEW_STATIC "Use static GLEW Library" OFF) option(OPTION_BUILD_WEBSITE_TOOLS "Build website-related tools" ON) option(OPTION_BUILD_TRANSLATIONS "Build translations" ON) +option(OPTION_BUILD_TESTS "Build tests" ON) if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) message(FATAL_ERROR "Build directory and source directory must not be the same.") @@ -298,17 +299,19 @@ endif (NOT DEFINED WL_VERSION) # Enable testing. -include(CTest) -enable_testing() +if (OPTION_BUILD_TESTS) + include(CTest) + enable_testing() -# Run a test after a normal compile. This magic is needed as 'make test' will -# not rebuild tests: -# http://stackoverflow.com/questions/733475/cmake-ctest-make-test-doesnt-build-tests -add_custom_target(_run_all_tests ALL - COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - DEPENDS wl_tests -) + # Run a test after a normal compile. This magic is needed as 'make test' will + # not rebuild tests: + # http://stackoverflow.com/questions/733475/cmake-ctest-make-test-doesnt-build-tests + add_custom_target(_run_all_tests ALL +COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure +WORKING_DIRECTORY ${CMAKE_BINARY_DIR} +DEPENDS wl_tests + ) +endif (OPTION_BUILD_TESTS) install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/VERSION === modified file 'cmake/WlFunctions.cmake' --- cmake/WlFunctions.cmake 2019-04-18 12:46:07 + +++ cmake/WlFunctions.cmake 2019-06-15 09:39:05 + @@ -178,6 +178,12 @@ # Common test target definition. function(wl_test NAME) + + if (NOT OPTION_BUILD_TESTS) +return() + endif() + + _parse_common_args("${ARGN}") add_executable(${NAME} ${ARG_SRCS}) === modified file 'compile.sh' --- compile.sh 2018-12-06 21:59:09 + +++ compile.sh 2019-06-15 09:39:05 + @@ -38,6 +38,9 @@ echo "-t or --no-translations" echo " Omit building translations." echo " " +echo "-s or --skip-tests" +echo " Skip linking and executing the tests." +echo " " echo "-a or --no-asan If in debug mode, switch off the AddressSanitizer." echo " Release builds are created without AddressSanitizer" echo " by default." @@ -81,6 +84,7 @@ ## Options to control the build. BUILD_WEBSITE="ON" BUILD_TRANSLATIONS="ON" +BUILD_TESTS="ON" BUILD_TYPE="Debug" USE_ASAN="ON" COMPILER="default" @@ -128,6 +132,10 @@ BUILD_TRANSLATIONS="OFF" shift ;; +-s|--skip-tests) + BUILD_TESTS="OFF" +shift +;; -w|--no-website) BUILD_WEBSITE="OFF" shift @@ -169,7 +177,14 @@ echo "Translations will be built." echo "You can use -t or --no-translations to omit building them." else -echo "Translations will not be built." + echo "Translations will not be built." +fi +echo " " +if [ $BUILD_TESTS = "ON" ]; then + echo "Tests will be built." + echo "You can use -s or --skip-tests to omit building them." +else + echo "Tests will not be built." fi echo " " echo "###" @@ -245,9 +260,9 @@ # Compile Widelands compile_widelands () { if [ $buildtool = "ninja" ] || [ $buildtool = "ninja-build" ] ; then - cmake -G Ninja .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPTION_BUILD_WEBSITE_TOOLS=$BUILD_WEBSITE -DOPTION_BUILD_TRANSLATIONS=$BUILD_TRANSLATIONS -DOPTION_ASAN=$USE_ASAN + cmake -G Ninja .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPTION_BUILD_WEBSITE_TOOLS=$BUILD_WEBSITE -DOPTION_BUILD_TRANSLATIONS=$BUILD_TRANSLATIONS -DOPTION_BUILD_TESTS=$BUILD_TESTS -DOPTION_ASAN=$USE_ASAN else - cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPTION_BUILD_WEBSITE_TOOLS=$BUILD_WEBSITE -DOPTION_BUILD_TRANSLATIONS=$BUILD_TRANSLATIONS -DOPTION_ASAN=$USE_ASAN + cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPTION_BUILD_WEBSITE_TOOLS=$BUILD_WEBSITE -DOPTION_BUILD_TRANSLATIONS=$BUILD_TRANSLATIONS -DOPTION_BUILD_TESTS=$BUILD_TESTS -DOPTION_ASAN=$USE_ASAN fi $buildtool -j $CORES @@ -339,6 +354,11 @@ else echo "# - No translations #" fi +if [ $BUILD_TESTS = "ON" ]; then + echo "# -
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ferry into lp:widelands
Whether waterways/ferries are enabled can be checked as map.get_waterway_max_length() >= 2 Typically, they are enabled only on maps where they make sense. Waterways have a maximum length that is map-dependent. If two flags can be connected both by a new road and by a new waterway, the AI should build a waterway only if a road connection is much much longer. Building waterways if a road is also possible nearby makes sense in a handful of corner cases but not in the majority of cases. Also, if there are two flags with the same ware economy but different worker economies, the AI should try very hard to connect them with a normal road if somehow possible. > It would be nice if the ferries were per economy Completely impossible, sorry. A ferry can be sent to any waterway that is in the same FerryFleet as itself – and there can be multiple economies adjacent to the same ocean (not to mention that each economy can be adjacent to multiple oceans). Per-economy distribution (or bookkeeping) of ferries is just not possible. > and AI would know in advance if the waterroad will be supplied by a ferry > immediately You could either – Build the waterway; some 10 seconds later query its fleet whether a ferry is coming, and if not, destroy the new waterway and remember not to retry for some time. – Or if you really want to check before you build a waterway: Check out FerryFleet::find_other_fleet, and copy the pathfinding code from there to obtain the ferryfleet that belongs to the ocean you are interested in; then you can query that fleet for unoccupied ferries. -- https://code.launchpad.net/~widelands-dev/widelands/ferry/+merge/351880 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/ferry. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp
Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands
Thanks for the reviews. A metaserver branch with the requested change is open at https://github.com/widelands/widelands_metaserver/pull/60 and already deployed for testing. -- https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285 Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1826744-lobby-commands. ___ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp