OpenBW / openbw

OpenBW - free and open-source Best Wargame
159 stars 25 forks source link

Fail to launch exampleAIModule #5

Closed guileen closed 6 years ago

guileen commented 6 years ago

I compiled project on OS X, put Patch_rt.mpq, BroodDat.mpq, StarDat.mpq in working directory, but I got Error: file_reader: failed to open for reading

https://github.com/OpenBW/bwapi/blob/3926e90f4f2f6eef271fdaddd6bf176a4e50e55e/bwapi/OpenBWData/BW/BWData.cpp#L482

The filename is Empty.

N00byEdge commented 6 years ago

That's when you're missing bwapi.ini in the bwapi-data directory. I agree this error should look better. See #4

guileen commented 6 years ago

I think it would be very helpful to give step by step of run ExampleAIMoudle in README.md.

I spent week to work with original Starcraft and BWAPI on OS X, and finally give up. I wish OpenBW could be the classic platform to play AI.

guileen commented 6 years ago

I have copy bwapi.ini into bwapi-data and run in the build folder with below command:

BWAPI_CONFIG_AI__AI=./lib/ExampleAIModule.dylib BWAPI_CONFIG_AUTO_MENU__RACE=Zerg ./bin/BWAPILauncher

but it got stuck at this line , just loop for ever.

The bwapi.ini is copied from orignal bwapi

[ai]
ai     = bwapi-data/AI/ExampleAIModule.dll
ai_dbg = bwapi-data/AI/ExampleAIModuled.dll
tournament =

[auto_menu]
auto_menu = OFF
character_name = FIRST
pause_dbg = OFF
lan_mode = Local Area Network (UDP)
auto_restart = OFF
map = maps/(2)Boxer.scm
game = 
mapiteration = RANDOM
race = Terran
enemy_count = 1
enemy_race = Protoss
enemy_race_1 = Default
enemy_race_2 = Default
enemy_race_3 = Default
enemy_race_4 = Default
enemy_race_5 = Default
enemy_race_6 = Default
enemy_race_7 = Default
game_type = MELEE
game_type_extra =
save_replay = maps/replays/%BOTNAME6%/$Y $b $d/%MAP%_%BOTRACE%%ALLYRACES%vs%ENEMYRACES%_$H$M$S.rep

wait_for_min_players = 2
wait_for_max_players = 8
wait_for_time = 60000

[config]
holiday = ON
shared_memory = ON
console_attach_on_startup = FALSE
console_alloc_on_startup = FALSE
console_attach_auto = TRUE
console_alloc_auto = TRUE

[window]
windowed = OFF
left = 0
top  = 0
width  = 640
height = 480

[starcraft]
sound = ON
screenshots = gif
drop_players = ON
guileen commented 6 years ago

I change auto_menu = OFF to auto_menu=SINGLE_PLAYER then it works, but only a single AI vs an not playable player.

I wonder how to let two AI fight each other.

guileen commented 6 years ago

Got it, just run two instance with multiplay game.