feat : add stockfish 16.1
This commit is contained in:
@@ -29,8 +29,8 @@ import {
|
||||
import { useChessActions } from "@/hooks/useChessActions";
|
||||
import { playGameStartSound } from "@/lib/sounds";
|
||||
import { logAnalyticsEvent } from "@/lib/firebase";
|
||||
import { Stockfish16 } from "@/lib/engine/stockfish16";
|
||||
import { useEffect } from "react";
|
||||
import { isWasmSupported } from "@/lib/engine/shared";
|
||||
|
||||
interface Props {
|
||||
open: boolean;
|
||||
@@ -69,7 +69,7 @@ export default function GameSettingsDialog({ open, onClose }: Props) {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!Stockfish16.isSupported()) {
|
||||
if (!isWasmSupported()) {
|
||||
setEngineName(EngineName.Stockfish11);
|
||||
}
|
||||
}, [setEngineName]);
|
||||
@@ -81,10 +81,9 @@ export default function GameSettingsDialog({ open, onClose }: Props) {
|
||||
</DialogTitle>
|
||||
<DialogContent sx={{ paddingBottom: 0 }}>
|
||||
<Typography>
|
||||
Stockfish 16 Lite (HCE) is the default engine. It offers the best
|
||||
balance between speed and strength. Stockfish 16 is the strongest
|
||||
engine available, but please note that it requires a one time download
|
||||
of 40MB.
|
||||
Stockfish 16.1 Lite is the default engine. It offers the best balance
|
||||
between speed and strength. Stockfish 16.1 is the strongest engine
|
||||
available, note that it requires a one time download of 64MB.
|
||||
</Typography>
|
||||
<Grid
|
||||
marginTop={4}
|
||||
@@ -112,9 +111,7 @@ export default function GameSettingsDialog({ open, onClose }: Props) {
|
||||
key={engine}
|
||||
value={engine}
|
||||
disabled={
|
||||
engine.includes("stockfish_16")
|
||||
? !Stockfish16.isSupported()
|
||||
: false
|
||||
engine !== EngineName.Stockfish11 && !isWasmSupported()
|
||||
}
|
||||
>
|
||||
{engineLabel[engine]}
|
||||
@@ -168,7 +165,9 @@ export default function GameSettingsDialog({ open, onClose }: Props) {
|
||||
}
|
||||
|
||||
const engineLabel: Record<EngineName, string> = {
|
||||
[EngineName.Stockfish16_1]: "Stockfish 16.1 (64MB)",
|
||||
[EngineName.Stockfish16_1Lite]: "Stockfish 16.1 Lite (6MB)",
|
||||
[EngineName.Stockfish16NNUE]: "Stockfish 16 (40MB)",
|
||||
[EngineName.Stockfish16]: "Stockfish 16 Lite (HCE)",
|
||||
[EngineName.Stockfish16NNUE]: "Stockfish 16 (40MB download)",
|
||||
[EngineName.Stockfish11]: "Stockfish 11",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user