Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run this on (64bit) windows (7) ? #3

Open
JSettler opened this issue Jun 26, 2021 · 20 comments
Open

How to run this on (64bit) windows (7) ? #3

JSettler opened this issue Jun 26, 2021 · 20 comments

Comments

@JSettler
Copy link

Good day, how can i run this interesting game under windows 7 (64bit) ?

@netcan
Copy link
Owner

netcan commented Jun 27, 2021

for windows, see https://github.com/Rust-SDL2/rust-sdl2#windows-msvc
and
cargo build

@JSettler
Copy link
Author

Thank you for the answer, but i don't have enough space on C: left.
Can i install Rust without having to install the Windows 10 SDK to my system (C:) drive?

@netcan
Copy link
Owner

netcan commented Jun 29, 2021

Thank you for the answer, but i don't have enough space on C: left.
Can i install Rust without having to install the Windows 10 SDK to my system (C:) drive?

you can choose Windows (MinGW) alternate way, it doesn't need msvc(windows sdk)

@JSettler
Copy link
Author

Firstly, thank you very much for this great implementation and your hard work, i finally managed to build and play with it! :)
Kudos.
I have re-partitioned my hard-disc drive (i moved a partition into a free space, with an external tool, and then extended the C: partition into the newly created free space).
Now my C: drive has ~90 GB capacity, thanks to being motivated by your great project (before this change it had only 40 GB, and i was unmotivated to change anything^^).
I was able to install the Visual C++ Build tools and the RustUp-installation, then i downloaded the SDL2-libs and copied those into their Rust-folder (this was all a learning process for me, too!), while trying to compile i got errors, because the install wasn't as easy, i had to manually move some SDL-files to their folders (after searching for their static libraries in the interwebs), but after some trial & error i could build the project and play some games! Yay! :)

I already found a weakness (bug?) in the engine: it attacked with its mouse, which i could capture, i guess it tried to achieve a tempo or a good attack position, but it seemed to suffer from horizon-effect, after that i was able to gain the upper hand and defeat it in my first game.
But the engine is quite good, if one takes into account that it only searches 7-8 plies/half-moves deep (as shown in the console).
Can i give it parameters to set its thinking/searching depth?

@JSettler
Copy link
Author

JSettler commented Jun 30, 2021

AnimalChess_x86-64_(depth7-8).zip
(i forgot to upload the executable, here it is, readily bundled with all needed windows-DLLs)
(its VT-report: https://www.virustotal.com/gui/file/24b08d75ae6735bd8751869caaa6aed15b9e488b0dc18921536017e3f396b490/detection )

[Edit:]
Do you know of this Dou Shou Qi code? (It's based on an engine which was made by Jonathan K. Vis of LIACS institute.)
doushouqi_['OpenDag' based on 'Bagheera'].zip

And lastly, another Dou Shou Qi program i had stored on my backup-hdd (i found it many years ago, in a now defunct website). Unfortunately, it is only for win32. But it does work really well under linux/wine :) [i tested that many months ago]
AnimalChess (jungle game by skookumpete).zip
(its VT report: https://www.virustotal.com/gui/file/37db9529bc7beecb1f510a1ca383899f50aefb1f79b3f7e50517ef871094ff13/detection )

@netcan
Copy link
Owner

netcan commented Jul 1, 2021

I already found a weakness (bug?) in the engine: it attacked with its mouse, which i could capture, i guess it tried to achieve a tempo or a good attack position, but it seemed to suffer from horizon-effect, after that i was able to gain the upper hand and defeat it in my first game.

https://github.com/netcan/AnimalChess/blob/master/core/src/player/alpha_beta.rs#L47
here is strategy file, each chess has weight needs adjust.

But the engine is quite good, if one takes into account that it only searches 7-8 plies/half-moves deep (as shown in the console).
Can i give it parameters to set its thinking/searching depth?

Max depth sets to 100, but it limits in time: 500ms, you can adjust time.
https://github.com/netcan/AnimalChess/blob/master/core/src/player/alpha_beta.rs#L221

@JSettler
Copy link
Author

JSettler commented Jul 1, 2021

Thank you for your kind help :)
You might be interested into this subreddit: https://www.reddit.com/r/DouShouQi
There i put all DSQ-links i found on the web. And i also posted download links for new executables of your program.
(eg. this updated zipfile, which now contains 4 versions of it: AnimalChess_win64_[r2].zip )

@JSettler
Copy link
Author

JSettler commented Jul 3, 2021

Found a weird bug: it sometimes declares its own win, when repeating a position for the third time.
Normally, a repetition is either:

  • a draw (remis) , or
  • illegal by rule , or
  • a loss for the causing side
  • or be avoided by the AI engine
    But never a win for the player who causes it.

@netcan
Copy link
Owner

netcan commented Jul 3, 2021

Found a weird bug: it sometimes declares its own win, when repeating a position for the third time.
Normally, a repetition is either:

  • a draw (remis) , or
  • illegal by rule , or
  • a loss for the causing side
  • or be avoided by the AI engine
    But never a win for the player who causes it.

there is a special rule to prevent game loop forever. you can simply modify check_win to disable it.

https://github.com/netcan/AnimalChess/blob/master/core/src/board.rs#L202

@AnkoGo123
Copy link

AnkoGo123 commented Aug 28, 2021

我按照这个库 https://github.com/Rust-SDL2/rust-sdl2#windows-msvc 教程来做,还是编译出错,so sad!

@netcan
Copy link
Owner

netcan commented Aug 29, 2021

我按照这个库 https://github.com/Rust-SDL2/rust-sdl2#windows-msvc 教程来做,还是编译出错,so sad!

msvc不行还有mingw方案...你也可以用这个人预编译好的包,不过是斗兽棋版本。

@AnkoGo123
Copy link

AnkoGo123 commented Aug 29, 2021 via email

@AnkoGo123
Copy link

你的象棋我终于编译通过后,才发觉没ai的...,然后我来编译这个斗兽棋:结果出现这个错误,之前的象棋我都可以运行过了,为什么这个就不能过呢?很奇怪,hub主可以给点建议吗?如下图:
image

@netcan
Copy link
Owner

netcan commented Aug 29, 2021

你的象棋我终于编译通过后,才发觉没ai的...,然后我来编译这个斗兽棋:结果出现这个错误,之前的象棋我都可以运行过了,为什么这个就不能过呢?很奇怪,hub主可以给点建议吗?如下图:
image

检查一下你clone下来的rust-sdl2目录是不是空的。用下面的命令重新clone下。

git clone --depth=1 --recursive https://github.com/netcan/AnimalChess.git

@AnkoGo123
Copy link

AnkoGo123 commented Aug 29, 2021 via email

@AnkoGo123
Copy link

AnkoGo123 commented Aug 29, 2021

你的象棋我终于编译通过后,才发觉没ai的...,然后我来编译这个斗兽棋:结果出现这个错误,之前的象棋我都可以运行过了,为什么这个就不能过呢?很奇怪,hub主可以给点建议吗?如下图:
image

检查一下你clone下来的rust-sdl2目录是不是空的。用下面的命令重新clone下。

git clone --depth=1 --recursive https://github.com/netcan/AnimalChess.git

可以的,终于成功了,研究了你的项目3天,好艰辛的说,比go真的麻烦太多了。。之后我会在你的2个项目补全这些东西,希望能帮助到后来的人。目前你的象棋没ai,确实有点遗憾,后期我研究好算法后补上,但是这个算法真的不简单,,,我能力有限,包涵

@AnkoGo123
Copy link

AnkoGo123 commented Sep 1, 2021

千辛万苦终于在win10跑起来了,参考链接:https://www.cnblogs.com/kileyi/p/11375216.html
依据本项目,注意文章提到的
Cargo.toml文件中不要加入
[dependencies]
sdl2 = "0.32"

保持hub主原样Cargo.toml内容即可

编译后提示其他缺少的lib库下载:https://www.libsdl.org/projects/
自行fan墙

@AnkoGo123
Copy link

AnkoGo123 commented Sep 1, 2021

建议hub主采用这个gui库:https://github.com/hecrj/iced ,才没这么多艰难的依赖,单是搭建环境都要一周。。。即使是linux也不简单,,,而且我还是老手。。。

@AnkoGo123
Copy link

编译后将AnimalChess\target\debug\animal_chess.exe复制到AnimalChess目录下即可执行,尚不知能否在别人电脑执行,可能需要上面介绍到的其他东西,待验证

@AnkoGo123
Copy link

编译后将AnimalChess\target\debug\animal_chess.exe复制到AnimalChess目录下即可执行,尚不知能否在别人电脑执行,可能需要上面介绍到的其他东西,待验证

经过测试可以在别人电脑运行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants