LF2 Online by Xôi · Windows guideLF2 Online của Xôi · hướng dẫn cho Windows

INSANE! & XOI on your PCtrên máy tính

A mod's own .exe is the original Little Fighter 2 from 2008: its computer players stop at CRAZY!. INSANE! and XOI live in OpenLF2, which plays the same mod files. Install it once and every mod you have plays with them — and you can train XOI for your own mod, then publish it with INSANE! and XOI built in: its players unzip one folder and play, nothing to install.

File .exe đi kèm bản mod là Little Fighter 2 gốc từ năm 2008: máy chỉ tới CRAZY!. INSANE! và XOI nằm trong OpenLF2, chơi được chính các file của bản mod. Cài một lần là mọi bản mod của bạn đều có hai mức máy này — và bạn còn tự huấn luyện XOI được cho bản mod của mình, rồi xuất bản nó có sẵn INSANE! và XOI: người chơi giải nén một thư mục là chơi, không cài gì.

Quick startBắt đầu nhanh

1 Install OpenLF2Cài OpenLF2 Run OpenLF2-Windows-x64.exe, choose Install for me only. Chạy OpenLF2-Windows-x64.exe, chọn Install for me only.
2 Unzip the XOI kitGiải nén bộ XOI Extract xoi-kit.zip into Documents, say: the files are in its LF2-XOI-kit folder. Giải nén xoi-kit.zip, ví dụ vào Documents: các file nằm trong thư mục LF2-XOI-kit của nó.
3 Drag your mod onto choi.batKéo bản mod vào choi.bat Its .zip, its folder or its .exe. In the game, go past CRAZY! to INSANE! or XOI. File .zip, thư mục hay file .exe của bản mod. Trong game, bấm qua CRAZY! là tới INSANE!, rồi XOI.

Why the mod's .exe stops at CRAZY!Vì sao file .exe của bản mod chỉ tới CRAZY!

An LF2 mod is the original game's program (lf2.exe, often renamed) with new data: fighters, moves, backgrounds. That program has four computer levels, Easy to CRAZY!, written in 2008 for the original fighters. INSANE! — a fifth level that learns every fighter's moves from the mod's data before the match — and XOI — INSANE! with notes from training on every matchup — are part of OpenLF2, an open-source re-implementation of LF2 that reads the same data. So the AI is not put into the mod's .exe: the mod is opened with OpenLF2, and the mod's files stay as they are.

Một bản mod LF2 là chương trình của game gốc (lf2.exe, thường được đổi tên) cộng dữ liệu mới: nhân vật, chiêu, bối cảnh. Chương trình ấy có bốn mức máy, Easy tới CRAZY!, viết năm 2008 cho các nhân vật gốc. INSANE! — mức thứ năm, học chiêu của từng nhân vật từ chính dữ liệu bản mod trước trận — và XOI — INSANE! cộng bộ nhớ huấn luyện từng cặp nhân vật — là một phần của OpenLF2, bản viết lại mã nguồn mở của LF2 đọc cùng dữ liệu ấy. Vì vậy AI không được gắn vào file .exe của bản mod: bản mod được mở bằng OpenLF2, còn các file của bản mod giữ nguyên.

What you needCần những gì

FileWhat it isWhere to get it
OpenLF2-Windows-x64.exeThe OpenLF2 installer for Windows 10 and 11, 64-bit (about 8 MB). OpenLF2-Windows-x86.exe for 32-bit Windows, OpenLF2-Windows-arm64.exe for ARM PCs. Releases of this project on GitHub
xoi-kit.zipchoi.bat (play), xoi-hoc.bat (train), dau-nhieu.bat (measure), spsa.bat (tune), xem.bat (watch), kiem-tra.bat (check), the newest game scripts with INSANE! and XOI, and the training bench (about 3 MB). This site, or the release
xoi-kit-en.zipThe same kit in English, for friends abroad: play.bat, train.bat, measure.bat, spsa.bat, watch.bat, publish.bat, check.bat, their settings and messages in English (its README maps the Vietnamese names of this guide onto them; results in results.txt, the earlier notes as <mod>-xoi-previous.zip). This site, or the release
balance-kit.zipFor mod makers, in English, on its own: balance.bat measures each fighter's win rate against every other one and what each of its moves brings (below; the same tool is in both kits: can-bang.bat, balance.bat). This site, or the release
Your modThe mod as a .zip of its game folder — the folder that has data\data.txt in it, where the mod's .exe is — or that folder itself. A .rar or .7z: extract it first (with 7-Zip).Its author, or wherever you got it
XOI notes (optional)What training learned about the mod: inside the mod's zip (<mod>-xoi.zip, file xoi\notes.txt) or as a text file (<mod>-notes.txt). Without notes, XOI still plays with its tuned numbers (INSANE! with the ones set by hand).Whoever trained the mod — or yourself, below
FileLà gìLấy ở đâu
OpenLF2-Windows-x64.exeBộ cài OpenLF2 cho Windows 10 và 11, 64-bit (khoảng 8 MB). OpenLF2-Windows-x86.exe cho Windows 32-bit, OpenLF2-Windows-arm64.exe cho máy chip ARM. Mục Releases của dự án trên GitHub
xoi-kit.zipchoi.bat (chơi), xoi-hoc.bat (huấn luyện), dau-nhieu.bat (đo), spsa.bat (chỉnh số), xem.bat (xem), kiem-tra.bat (kiểm tra), scripts mới nhất của game có INSANE! và XOI, và bộ công cụ huấn luyện (khoảng 3 MB). Trang này, hoặc trong bản release
xoi-kit-en.zipBộ XOI bản tiếng Anh, để gửi bạn bè nước ngoài: cùng các công cụ dưới tên tiếng Anh (play.bat = choi.bat, train.bat = xoi-hoc.bat, measure.bat = dau-nhieu.bat, spsa.bat, watch.bat = xem.bat, publish.bat = xuat-ban.bat, check.bat = kiem-tra.bat), dòng chỉnh và thông báo bằng tiếng Anh; README của nó ghi tên tương ứng với hướng dẫn này. Trang này, hoặc trong bản release
balance-kit.zipCho người làm mod, bản tiếng Anh, tải riêng: balance.bat đo tỉ lệ thắng của từng nhân vật trước từng nhân vật khác và mỗi chiêu của nó mang lại gì (bên dưới; công cụ này có sẵn trong cả hai bộ XOI: can-bang.bat, balance.bat). Trang này, hoặc trong bản release
Bản mod của bạnBản mod dạng file .zip của thư mục game — thư mục có data\data.txt bên trong, nơi có file .exe của bản mod — hoặc chính thư mục ấy. File .rar hay .7z: giải nén trước (bằng 7-Zip).Tác giả bản mod, hoặc nơi bạn tải về
Bộ nhớ XOI (không bắt buộc)Những gì huấn luyện học được về bản mod: nằm trong file zip bản mod (<tên>-xoi.zip, file xoi\notes.txt) hoặc là một file chữ riêng (<tên>-notes.txt). Không có bộ nhớ thì XOI vẫn chơi bằng các số đã chỉnh của nó (INSANE! dùng số đặt bằng tay).Người đã huấn luyện bản mod — hoặc chính bạn, bên dưới

The three .bat files are for Windows. OpenLF2 itself also runs on Linux, macOS and Android, and in the browser: the web version on this site has INSANE! and XOI too.

Ba file .bat dành cho Windows. Bản thân OpenLF2 còn chạy trên Linux, macOS, Android và trong trình duyệt: bản web trên trang này cũng có INSANE! và XOI.

Install (once)Cài đặt (một lần)

  1. Download OpenLF2-Windows-x64.exe and run it. If Windows shows Windows protected your PC (the installer is not code-signed), click More info, then Run anyway.
  2. Choose Install for me only. It needs no administrator and installs into %LOCALAPPDATA%\Programs\OpenLF2. Install for all users works too: the .bat files find both.
  3. The original game's download is optional. The installer offers to fetch the original Little Fighter 2 (about 30 MB): it is needed only to play the original game — a mod brings its own data. Untick it if you only play mods.
  4. Unzip xoi-kit.zip (right-click it, Extract All…) into a folder you can write to, such as Documents — not into Program Files. The kit is its LF2-XOI-kit folder: the .bat files, the mods you put there and everything they make live together in it.
  1. Tải OpenLF2-Windows-x64.exe rồi chạy. Windows báo Windows protected your PC (bộ cài chưa có chữ ký số) thì bấm More info, rồi Run anyway.
  2. Chọn Install for me only. Không cần quyền quản trị, game được cài vào %LOCALAPPDATA%\Programs\OpenLF2. Chọn Install for all users cũng được: các file .bat tìm được cả hai chỗ.
  3. Không bắt buộc tải game gốc. Bộ cài hỏi có tải Little Fighter 2 gốc không (khoảng 30 MB): chỉ cần khi chơi game gốc — bản mod có dữ liệu riêng. Chỉ chơi bản mod thì bỏ dấu tích.
  4. Giải nén xoi-kit.zip (chuột phải, Extract All…) vào một thư mục ghi được, ví dụ Documents — đừng để trong Program Files. Bộ XOI là thư mục LF2-XOI-kit bên trong: các file .bat, các bản mod bạn đặt vào và mọi thứ chúng tạo ra đều nằm chung ở đó.

Later versions: install a newer OpenLF2 over the old one; unzip a newer kit over the old folder — your mods, notes and results stay (settings you changed inside the .bat files are replaced).

Bản mới về sau: cài OpenLF2 mới đè lên bản cũ; giải nén bộ XOI mới đè lên thư mục cũ — bản mod, bộ nhớ và kết quả của bạn vẫn còn (những dòng bạn đã sửa trong các file .bat thì bị thay).

Play a mod with INSANE! and XOIChơi bản mod với INSANE! và XOI

  1. Put the mod's .zip in the kit folder, next to choi.bat, and double-click choi.bat. Or drag onto choi.bat the mod's .zip, its folder, or its .exe (which stands for its folder). A folder is zipped into the kit folder as <folder name>.zip, which double-clicking plays from then on.
  2. XOI with notes. A <mod>-xoi.zip has them inside, and a double-click picks a *-xoi.zip first. A notes file: select it together with the mod and drag both onto choi.bat — or name it <mod>-notes.txt and leave it next to choi.bat. choi.bat then makes <mod>-xoi.zip in the kit folder; your mod's own file is not changed.
  3. In the game: Game Start, choose the fighters and add computer players (Com); on the difficulty line, go round Easy → Normal → Difficult → CRAZY! → INSANE! → XOI. In the match, the level shows its version — INSANE! v29, or XOI v29, 2926 matchups with how many pairs of fighters its notes know (no notes without any).
  4. A window that stays blue or black, with no pictures? choi.bat draws with OpenGL, since the game's usual renderer ("gpu") shows some PCs nothing but the menu's blue. Should it still happen: right-click choi.bat, Edit, set VE=software, save, and run it again.
  5. The game does not open, or closes at once? Install OpenLF2-Windows-x64.exe — the x86 one is only for 32-bit Windows (x86 builds made before November 2, 2026 close at once wherever they draw with OpenGL, as choi.bat has them do). Should it still happen: put a mod's .zip next to kiem-tra.bat, double-click it, wait about two minutes (game windows may open and close by themselves) and send the kiem-tra.txt it writes.
  1. Đặt file .zip bản mod vào thư mục bộ XOI, cạnh choi.bat, rồi nháy đúp choi.bat. Hoặc kéo thả vào choi.bat file .zip bản mod, thư mục bản mod, hay file .exe của bản mod (thay cho thư mục của nó). Thư mục được nén thành <tên thư mục>.zip trong thư mục bộ XOI; từ đó về sau nháy đúp là chơi file này.
  2. XOI có bộ nhớ. File <tên>-xoi.zip có sẵn bộ nhớ bên trong, và khi nháy đúp choi.bat ưu tiên file *-xoi.zip. Có file bộ nhớ riêng: chọn nó cùng bản mod rồi kéo cả hai vào choi.bat — hoặc đặt tên nó là <tên>-notes.txt và để cạnh choi.bat. choi.bat sẽ tạo <tên>-xoi.zip trong thư mục bộ XOI; file bản mod của bạn giữ nguyên.
  3. Trong game: Game Start, chọn nhân vật và thêm máy (Com); ở dòng mức khó, bấm vòng Easy → Normal → Difficult → CRAZY! → INSANE! → XOI. Trong trận, tên mức hiện kèm phiên bản — INSANE! v29, hoặc XOI v29, 2926 matchups cùng số cặp nhân vật mà bộ nhớ biết (no notes khi không có).
  4. Cửa sổ game chỉ xanh hay đen, không có hình? choi.bat vẽ bằng OpenGL, vì cách vẽ thường dùng của game ("gpu") ở vài máy chỉ hiện nền xanh của menu. Nếu vẫn bị: chuột phải choi.bat, Edit, sửa thành VE=software, lưu, chạy lại.
  5. Game không mở được, hay mở rồi tắt ngay? Cài OpenLF2-Windows-x64.exe — bản x86 chỉ dành cho Windows 32-bit (bản x86 làm trước ngày 2/11/2026 tắt ngay khi vẽ bằng OpenGL, cách vẽ mà choi.bat dùng). Nếu vẫn bị: đặt file .zip bản mod cạnh kiem-tra.bat, nháy đúp, đợi khoảng hai phút (cửa sổ game có thể tự hiện rồi tự tắt) rồi gửi file kiem-tra.txt nó tạo ra.

Settings at the top of choi.batCác dòng chỉnh ở đầu choi.bat

LineEmpty (default) meansSet it to
GAMEThe installed game, found by itself (for you, for all users, or an OpenLF2 folder next to the file)The full path of openlf2.exe installed elsewhere
PACKThe first *-xoi.zip next to choi.bat, else the first .zip (or what you drag onto it)One mod to always play: a .zip or a folder
NOTES<mod>-notes.txt or xoi-<mod>\notes.txt next to choi.bat, if thereA notes file to add to the mod
VEOpenGL — and the game's usual renderer when OpenGL does not opensoftware where the window stays blue or black; gpu, opengl, direct3d11 to pick one
DòngĐể trống (mặc định) làSửa thành
GAMEGame đã cài, tự tìm (cài cho bạn, cho mọi người, hoặc thư mục OpenLF2 cạnh file)Đường dẫn đầy đủ tới openlf2.exe cài ở chỗ khác
PACKFile *-xoi.zip đầu tiên cạnh choi.bat, không có thì file .zip đầu tiên (hoặc thứ bạn kéo thả vào)Một bản mod luôn chơi: file .zip hoặc thư mục
NOTES<tên>-notes.txt hoặc xoi-<tên>\notes.txt cạnh choi.bat, nếu cóMột file bộ nhớ để thêm vào bản mod
VEOpenGL — và cách vẽ thường dùng của game khi OpenGL không mở đượcsoftware khi cửa sổ chỉ xanh hay đen; gpu, opengl, direct3d11 để chọn hẳn một cách

The kit's scripts folder holds the game scripts with the newest INSANE! and XOI. When they are newer than the installed game's, choi.bat lays them over a copy of the installed scripts (scripts-choi) and plays with that: a new AI without reinstalling the game. When the installed game is as new or newer, it plays as installed.

Thư mục scripts của bộ XOI chứa scripts của game với INSANE! và XOI mới nhất. Khi chúng mới hơn scripts của game đã cài, choi.bat ghép chúng lên một bản sao scripts đã cài (scripts-choi) rồi chơi bằng bản ấy: có AI mới mà không phải cài lại game. Game đã cài mới bằng hoặc mới hơn thì chơi đúng như đã cài.

Train XOI for your modHuấn luyện XOI cho bản mod của bạn

Training plays INSANE! against INSANE! in many games of every pair of the mod's fighters, on every processor thread of the PC, with no window drawn, and writes down what each move brought against each opponent and in which situation. The notes go into a copy of the mod's zip; XOI plays with them. What the notes hold and how XOI uses them.

Huấn luyện là cho INSANE! đấu INSANE! thật nhiều trận với mọi cặp nhân vật của bản mod, trên mọi luồng CPU của máy, không vẽ hình, và ghi lại mỗi chiêu đem lại gì trước từng đối thủ, trong hoàn cảnh nào. Bộ nhớ được đóng vào một bản sao của file zip bản mod; XOI chơi với bộ nhớ ấy. Bộ nhớ chứa gì và XOI dùng nó ra sao (tiếng Anh).

  1. Put the mod's .zip next to xoi-hoc.bat — the only mod zip there, or drag it onto xoi-hoc.bat. A mod folder: drag it onto choi.bat once to get its zip.
  2. Look at the settings at the top of xoi-hoc.bat (right-click, Edit; the table below). The defaults train every pair of fighters 100 games on every thread.
  3. Double-click xoi-hoc.bat. It opens one minimized window per thread — they draw nothing; leave them — and waits for them. The PC is busy meanwhile: don't play on it.
  4. When the last window closes, it merges and packs: <mod>-xoi.zip beside the mod's zip — the mod with xoi\notes.txt inside — and xoi-<mod>\notes.txt, the notes alone.
  5. Play <mod>-xoi.zip with choi.bat (pick XOI), and measure it with dau-nhieu.bat.
  1. Đặt file .zip bản mod cạnh xoi-hoc.bat — chỉ một file zip bản mod ở đó, hoặc kéo thả nó vào xoi-hoc.bat. Bản mod dạng thư mục: kéo thư mục vào choi.bat một lần để có file zip.
  2. Xem các dòng chỉnh ở đầu xoi-hoc.bat (chuột phải, Edit; bảng bên dưới). Mặc định: mọi cặp nhân vật, mỗi cặp 100 trận, trên mọi luồng CPU.
  3. Nháy đúp xoi-hoc.bat. Mỗi luồng CPU một cửa sổ thu nhỏ — chúng không vẽ gì, cứ để đó — và file chờ chúng chạy xong. Trong lúc này máy rất bận: đừng chơi game trên máy.
  4. Khi cửa sổ cuối cùng đóng, file gộp và đóng gói: <tên>-xoi.zip cạnh file zip bản mod — bản mod có xoi\notes.txt bên trong — và xoi-<tên>\notes.txt, riêng bộ nhớ.
  5. Chơi <tên>-xoi.zip bằng choi.bat (chọn XOI), và đo nó bằng dau-nhieu.bat.

Settings at the top of xoi-hoc.batCác dòng chỉnh ở đầu xoi-hoc.bat

LineDefaultWhat it does
IDSallFighters to train: every fighter of the mod, or a list of ids such as "1 2 3 7" (only the pairs among them)
VAN100Games of each pair (both fighters are learned). 100–200 is plenty; 20 for a quick first try
SONG_SONG%NUMBER_OF_PROCESSORS%Games played at once, one per thread. Lower it (half, say) to keep the PC usable
HAT_GIONG_DAU5000The first random seed. Change it for every further round (6000, 7000…): rounds add up
NAOsmartWho plays in training: smart = INSANE! against INSANE! (first round); xoi = XOI against XOI on the notes so far
GAME, PACKemptyFound by themselves; set them when the game or the mod is elsewhere
BENCH, SCRIPTSemptyThe kit's tools\ai-bench and scripts, found by themselves
DòngMặc địnhÝ nghĩa
IDSallNhân vật được học: mọi nhân vật của bản mod, hoặc danh sách id như "1 2 3 7" (chỉ các cặp trong số đó)
VAN100Số trận mỗi cặp (học cả hai nhân vật). 100–200 là đủ; 20 để thử nhanh lần đầu
SONG_SONG%NUMBER_OF_PROCESSORS%Số trận chạy cùng lúc, mỗi luồng CPU một trận. Giảm (ví dụ một nửa) để máy còn dùng được
HAT_GIONG_DAU5000Hạt giống ngẫu nhiên đầu tiên. Mỗi đợt học thêm đổi số này (6000, 7000…): các đợt cộng dồn
NAOsmartAi đánh khi học: smart = INSANE! đấu INSANE! (đợt đầu); xoi = XOI đấu XOI bằng bộ nhớ đã có
GAME, PACKtrốngTự tìm; chỉ sửa khi game hay bản mod nằm chỗ khác
BENCH, SCRIPTStrốngtools\ai-bench và scripts của bộ XOI, tự tìm

How long it takesMất bao lâu

Games = pairs × VAN, with n(n−1)/2 pairs for n fighters; a game takes about 1.5 seconds of one thread (more with big fighters and long matches). At VAN=100:

Số trận = số cặp × VAN, với n(n−1)/2 cặp cho n nhân vật; mỗi trận mất chừng 1,5 giây của một luồng (lâu hơn với nhân vật nặng, trận dài). Với VAN=100:

FightersNhân vậtPairsCặp GamesTrận8 threads8 luồng 16 threads16 luồng104 threads104 luồng
2019019,000~1 h~30 min~5 min
4078078,000~4 h~2 h~20 min
77 (Naruto 2.4)2,926292,600~15 h~7.5 h~1.2 h

A big roster on an ordinary PC: start with VAN=20, or with IDS set to the fighters people play most; train more later. Closing the windows stops training; the pairs already finished are kept — run xoi-hoc.bat gop (or drag the xoi-<mod> folder onto it) to merge and pack them. A fighter that only stands (One Piece GrandWorld's Dummy, OPLoS's TrainingBot) used to keep every game of its pairs to the time limit, so the window with those pairs finished long after the others; since November 2, 2026 a game in which nobody loses HP for a minute ends there.

Bản mod nhiều nhân vật trên máy thường: bắt đầu với VAN=20, hoặc đặt IDS là các nhân vật hay được chơi nhất; học thêm sau. Đóng các cửa sổ là dừng huấn luyện; những cặp đã xong vẫn được giữ — chạy xoi-hoc.bat gop (hoặc kéo thư mục xoi-<tên> vào nó) để gộp và đóng gói chúng. Nhân vật chỉ đứng yên (Dummy của One Piece GrandWorld, TrainingBot của OPLoS) trước đây làm mọi trận của các cặp có nó kéo tới hết giờ, nên cửa sổ có các cặp ấy xong sau các cửa sổ khác rất lâu; từ ngày 2/11/2026, trận nào một phút không ai mất máu thì dừng ở đó.

More roundsHọc thêm nhiều đợt

Measure: is XOI stronger?Đo: XOI có mạnh hơn không?

dau-nhieu.bat plays two computer players against each other on every pair of fighters, each in both seats, on every thread, and adds it all up.

dau-nhieu.bat cho hai loại máy đấu nhau trên mọi cặp nhân vật, đổi bên đủ hai chiều, trên mọi luồng CPU, rồi cộng kết quả.

  1. Put <mod>-xoi.zip next to dau-nhieu.bat (it picks a *-xoi.zip first), or drag it onto dau-nhieu.bat.
  2. Defaults: NAO1=xoi against NAO2=smart (INSANE!), IDS=all, VAN=10 games per pair and seat, HAT_GIONG_DAU=1000 — seeds training did not use.
  3. Double-click. At the end it prints every fighter's results and the total, such as Ti le thang cua brains[1]: 55.3% tren 5852 tran co ket qua, sai so khoang +-1.2%: brains[1] (XOI) wins 55.3%, give or take 1.2. More than 50% by more than that margin: XOI is stronger on this mod.
  4. Results stay in ket-qua-<seed>\ (cap.txt: every pair; run-*.txt: every game). Drag that folder onto dau-nhieu.bat to print the summary again.
  1. Đặt <tên>-xoi.zip cạnh dau-nhieu.bat (ưu tiên file *-xoi.zip), hoặc kéo thả nó vào dau-nhieu.bat.
  2. Mặc định: NAO1=xoi đấu NAO2=smart (INSANE!), IDS=all, VAN=10 trận mỗi cặp mỗi bên, HAT_GIONG_DAU=1000 — hạt giống huấn luyện không dùng.
  3. Nháy đúp. Cuối cùng file in kết quả từng nhân vật và tổng, ví dụ Ti le thang cua brains[1]: 55.3% tren 5852 tran co ket qua, sai so khoang +-1.2%: brains[1] (XOI) thắng 55,3%, sai số chừng 1,2. Trên 50% nhiều hơn sai số: XOI mạnh hơn trên bản mod này.
  4. Kết quả được giữ trong ket-qua-<hạt giống>\ (cap.txt: từng cặp; run-*.txt: từng trận). Kéo thư mục ấy vào dau-nhieu.bat để in lại bảng tổng.

Fighter balance: win rates and moves (for mod makers)Cân bằng nhân vật: tỉ lệ thắng và từng chiêu (cho người làm mod)

can-bang.bat (balance.bat in English) has one computer player — XOI — play both sides of every pair of fighters of a mod, on every CPU thread, again and again: each pair on both sides, on the same stage, from the same point of the random sequence. Then it counts each fighter's win rate against all the others and against each one, and what each of its moves brings. The numbers, not a verdict: what to change is the mod maker's to say.

can-bang.bat (bản tiếng Anh: balance.bat) cho một máy — XOI — chơi cả hai bên mọi cặp nhân vật của bản mod, trên mọi luồng CPU, lặp đi lặp lại: mỗi cặp đổi bên đủ hai chiều, cùng sân, cùng điểm xuất phát của dãy số ngẫu nhiên. Rồi nó đếm tỉ lệ thắng của từng nhân vật trước mọi nhân vật khác và trước từng nhân vật, và mỗi chiêu của nó mang lại gì. Báo cáo chỉ ghi số đo được: chỉnh gì là việc của người làm mod.

  1. Put the mod's .zip next to balance.bat (or can-bang.bat in the XOI kit), or drag it onto the file. A mod you trained XOI for: use <mod>-xoi.zip — XOI plays it stronger.
  2. Say how much (in Notepad, at the top): TOTAL_GAMES (all the games, e.g. 200000) or TOTAL_HOURS (all the hours, 7.5 = seven and a half), split into ROUNDS rounds — after each one the report is updated; left empty, the rounds are split for you, each from 10 minutes to an hour. In can-bang.bat: TONG_VAN, TONG_GIO, VONG.
  3. Double-click. Results in balance-<mod>\ (can-bang-<mod>\): report.html (bao-cao.html) to open in a browser, and a text summary results.txt (ket-qua.txt). After every round the file also shows the games per hour, to size the next run.
  4. Pause and go on: close the window (or set RUN_HOURS), run the file again later — the round under way goes on. To measure more: raise the total and run it again; the new games add up.
  1. Đặt file .zip bản mod cạnh can-bang.bat (trong bộ XOI; bộ tiếng Anh: balance.bat), hoặc kéo thả nó vào file. Bản mod đã huấn luyện XOI: dùng <tên>-xoi.zip — XOI chơi mạnh hơn.
  2. Chỉnh bao nhiêu (mở bằng Notepad, ở đầu file): TONG_VAN (tổng số ván, ví dụ 200000) hoặc TONG_GIO (tổng số giờ, 7,5 = 7 giờ rưỡi), chia làm VONG vòng — hết mỗi vòng báo cáo được cập nhật; để trống VONG thì tự chia, mỗi vòng từ 10 phút tới 1 giờ.
  3. Nháy đúp. Kết quả ở can-bang-<tên>\: bao-cao.html mở bằng trình duyệt, và bản tóm tắt ket-qua.txt. Hết mỗi vòng file còn báo số ván một giờ, để tính cho lần sau.
  4. Tạm dừng và làm tiếp: đóng cửa sổ (hoặc đặt GIO_CHAY), lúc khác chạy lại — vòng đang dở được làm tiếp. Đo thêm: tăng tổng rồi chạy lại, các ván mới cộng dồn vào.

Watch two computer players (for a clip)Xem hai máy đánh nhau (để quay clip)

xem.bat plays two computer players against each other in the game's window, fighters named as the game shows them — no ids to look up.

xem.bat cho hai máy đánh nhau trong cửa sổ game, nhân vật gõ theo tên như trong game — không cần tra id.

  1. Open xem.bat in Notepad (right-click, Edit) and set QUAN1, QUAN2: two fighters by name (Crimson, Deep; capitals or not, the first letters are enough: crim) or by id; NAO1, NAO2: xoi (XOI), smart (INSANE!) or classic (with MUC=-1, the original game's AI at CRAZY!).
  2. Double-click it. VAN games, sides swapped every game. In the window F1 pauses, F5 runs fast, F4 ends the game under way (after the last one, it closes the window); the score of each game is printed when the window closes.
  3. Record the window with OBS Studio or the Xbox Game Bar (Win+Alt+R). The same HAT_GIONG plays the same games again — to record once more; another number, other games.
  4. Not sure of a name? Leave QUAN1 empty: it lists the mod's fighters (id and name) and backgrounds into danh-sach.txt. A name that matches nobody: the window lists them too.
  1. Mở xem.bat bằng Notepad (chuột phải, Edit), sửa QUAN1, QUAN2: hai nhân vật theo tên (Crimson, Deep; hoa thường đều được, vài chữ đầu cũng được: crim) hoặc theo id; NAO1, NAO2: xoi (XOI), smart (INSANE!) hoặc classic (với MUC=-1, máy của game gốc ở mức CRAZY!).
  2. Nháy đúp. VAN trận, mỗi trận đổi bên. Trong cửa sổ: F1 dừng, F5 chạy nhanh, F4 bỏ trận đang xem (hết trận thì F4 đóng cửa sổ); đóng cửa sổ là file in tỉ số từng trận.
  3. Quay cửa sổ bằng OBS Studio hoặc Xbox Game Bar (Win+Alt+R). Cùng HAT_GIONG thì ra đúng các trận cũ — quay lại được; đổi số là trận khác.
  4. Không nhớ tên? Để trống QUAN1: file in danh sách nhân vật (id và tên) và màn nền của bản mod ra danh-sach.txt. Gõ tên không khớp ai: cửa sổ game cũng hiện danh sách ấy.

Tune XOI's numbers (SPSA)Chỉnh các con số của XOI (SPSA)

XOI learns, pair by pair, which moves work. spsa.bat tunes something else: the 88 numbers the computer player's judgement rests on — what a hit is worth against what it costs, the score a move needs, how far ahead it answers a blow on its way and when it guards, how bold a standoff makes it, how far to keep from longer arms or from a fallen enemy, when to charge MP, how soon it gives up a move that keeps coming to nothing, and (from package 71) how much bolder or warier the HP just dealt or lost makes it, the six "momentum" numbers, 0 until a tuning moves them — the way chess engines tune theirs. The numbers can suit every mod at once, or one mod alone: a mod then carries its own. The tuned numbers are XOI's alone (from package 43): INSANE! keeps its own, set by hand, so that XOI, the last level, is plainly the stronger.

XOI học theo từng cặp xem chiêu nào hiệu quả. spsa.bat chỉnh thứ khác: 88 con số mà phán đoán của máy dựa vào — một đòn đáng bao nhiêu so với cái giá của nó, điểm một chiêu cần có để ra đòn, nhìn trước bao xa để đỡ hay né đòn đang tới và khi nào thì đỡ, đứng nhìn nhau lâu thì máy bạo dạn lên bao nhiêu, đứng cách đối thủ tay dài hay đối thủ đã ngã bao xa, khi nào nạp MP, một chiêu cứ ra mà không ăn thì bao lâu mới bỏ, và (từ gói 71) máu vừa gây hay vừa mất làm máy hăng lên hay dè dặt đi bao nhiêu, sáu số "đà", bằng 0 cho tới khi được chỉnh — giống cách các chương trình cờ vua chỉnh số của chúng. Các số có thể hợp với mọi bản mod, hoặc riêng một bản mod: bản mod ấy giữ bộ số riêng. Các số chỉnh được chỉ XOI dùng (từ gói 43): INSANE! giữ các số đặt bằng tay của nó, để XOI, mức cuối, mạnh hơn rõ ràng.

  1. Put one or more mods' .zip next to spsa.bat (not the *-xoi.zip copies), or drag one onto it. Several mods: the processes are shared among them, and the numbers suit them all. One mod: the numbers suit that mod best.
  2. Double-click. Each round, every process (one per CPU thread) plays game pairs for PHUT_VONG minutes: two computer players, the 88 numbers nudged one way for one and the other way for the other (each number up or down at random), each playing each fighter of a random pair on the same stage; every number then moves toward whichever did better. All processes stop together, so no thread sits waiting for a slower one (a fast mod simply plays more pairs). After the round the mean step per pair is taken, every mod weighing the same, and the next round starts from there.
  3. 12 rounds of 5 minutes by default, then the tuned numbers play those they started from (XOI's own, or the mod's earlier ones) for PHUT_KIEM_TRA minutes. A pair takes a process about 1 to 3 seconds, on the CPU only (up to about half a GB of memory per process); the processes run at below-normal priority, so the PC stays usable. After each round spsa.bat says how long it took and about how long the rest will take. To pause, close its window and the minimized SPSA windows (or shut the PC down); double-click again to go on — finished rounds stay, and so does what the round under way had played, but for its last few pairs. A PC cut off just as a round's numbers were written (that round's file left full of zeros) is no loss either: run it again and it merges that round from the processes that played it, then goes on. So is Khong gop duoc vong 1 (Could not merge round 1) with the game of packages 69 to 71 on Windows, whose last message cut a process's last line of numbers in two: copy the kit of package 72 or later over the old one, keep the spsa folder, and run it again. Pause timer (package 73): set "GIO_CHAY=8" (RUN_HOURS in the English kit; 7,5 = seven and a half hours) — when the time is up the processes under way stop, keeping what they played, and spsa.bat ends; run it again later to go on. Closing its window stops its games too (package 73 on; before, the games of packages 69–72 kept running in the background — taskkill /F /IM openlf2.exe ends them). Your own settings (rounds, minutes, DOI_THU=classic…) are best kept in a file spsa-cai-dat.bat beside spsa.bat (spsa-settings.bat for the English kit), one set "VONG=60" line each: a new kit's spsa.bat copied over the old one then keeps them. Going on from a finished run (package 75), after updating the game and the kit, say: raise VONG (ROUNDS; 60 to 80 adds 20 rounds) and run it again — the added rounds start from the last round's numbers, the steps go on shrinking as before, they use the new kit's scripts (the new AI), and the run ends with a new check and new packages. Better than starting over: the numbers found still fit, and a new run begins with large steps again. (A run paused half way keeps the scripts it began with to its end.)
  4. Each mod's numbers, ready to use: at the end, xoi-<mod>\tune.txt holds the tuned numbers and <mod>-xoi.zip is the mod with them inside (xoi/tune.txt beside its data folder, with XOI's notes if xoi-hoc.bat trained it). Uploaded to the relay in place of the mod, XOI plays that mod with its own numbers, every player in a room alike (INSANE! keeps its own); the match shows mod tuned beside XOI. Upload it only if the check came out above 50%. With that mod alone next to spsa.bat, the next run goes on from its numbers (and checks against them).
  5. Send spsa\ket-qua.txt to whoever maintains the AI: the tuned numbers, how far each moved, and how the tuned numbers did against the numbers they started from. Numbers that suit every mod go into XOI's own numbers only after they also win the usual measures.
  1. Đặt một hay nhiều file .zip bản mod cạnh spsa.bat (không phải các bản *-xoi.zip), hoặc kéo thả một file vào nó. Nhiều bản mod: các tiến trình chia nhau, các con số hợp với tất cả. Một bản mod: các con số hợp nhất với bản mod ấy.
  2. Nháy đúp. Mỗi vòng, mỗi tiến trình (một luồng CPU) đánh liền các cặp trận trong PHUT_VONG phút: hai máy, 88 con số nhích một phía cho máy này và phía ngược lại cho máy kia (mỗi số lên hay xuống ngẫu nhiên), mỗi máy cầm mỗi nhân vật của một cặp ngẫu nhiên trên cùng một sân; mọi con số rồi dịch về phía máy đánh tốt hơn. Mọi tiến trình dừng cùng lúc nên không luồng nào ngồi chờ luồng chậm (bản mod nhanh chỉ đánh được nhiều cặp hơn). Hết vòng, lấy bước dịch trung bình mỗi cặp, mỗi bản mod nặng như nhau, vòng sau bắt đầu từ đó.
  3. Mặc định 12 vòng × 5 phút, rồi bản đã chỉnh đấu bản gốc trong PHUT_KIEM_TRA phút. Một cặp mất mỗi tiến trình khoảng 1 đến 3 giây, chỉ dùng CPU (mỗi tiến trình tới khoảng nửa GB bộ nhớ); các tiến trình chạy ở mức ưu tiên thấp nên máy vẫn dùng được. Hết mỗi vòng spsa.bat in vòng ấy mất bao lâu và còn khoảng bao lâu. Tạm dừng: đóng cửa sổ của nó và các cửa sổ SPSA thu nhỏ (hoặc tắt máy); nháy đúp lại là làm tiếp — các vòng đã xong được giữ, và cả phần vòng đang dở đã đánh, trừ vài cặp cuối. Máy mất điện đột ngột đúng lúc ghi số cuối vòng (file số của vòng ấy hỏng, toàn số 0) cũng không sao: chạy lại, nó gộp lại vòng ấy từ các tiến trình đã đánh rồi đi tiếp. Báo Khong gop duoc vong 1 với game gói 69 tới 71 trên Windows (dòng báo cuối của game cắt đôi dòng số cuối của một tiến trình) cũng vậy: chép đè bộ XOI từ gói 72 trở lên lên bộ cũ, giữ thư mục spsa, rồi chạy lại. Hẹn giờ tạm dừng (gói 73): set "GIO_CHAY=8" (7,5 = bảy giờ rưỡi) — hết giờ, các tiến trình đang đánh dừng lại, giữ phần đã đánh, và spsa.bat kết thúc; lúc khác chạy lại là làm tiếp. Đóng cửa sổ của nó thì các game của nó cũng dừng (từ gói 73; trước đó game gói 69–72 vẫn chạy ngầm — taskkill /F /IM openlf2.exe tắt chúng). Cài đặt riêng của bạn (số vòng, số phút, DOI_THU=classic…) nên để trong file spsa-cai-dat.bat cạnh spsa.bat (bộ tiếng Anh: spsa-settings.bat), mỗi dòng một cài đặt như set "VONG=60": chép đè spsa.bat của bộ XOI mới lên thì cài đặt vẫn còn. Chỉnh tiếp một đợt đã xong (gói 75), ví dụ sau khi cập nhật game và bộ XOI: tăng VONG (60 lên 80 là thêm 20 vòng) rồi chạy lại — các vòng thêm bắt đầu từ bộ số của vòng cuối, bước dịch nhỏ dần tiếp như cũ, dùng scripts của bộ XOI mới (AI bản mới), và cuối đợt kiểm tra, gói số lại. Tốt hơn chỉnh lại từ đầu: bộ số đã tìm vẫn dùng được, còn một đợt mới thì bắt đầu lại bằng bước dịch lớn. (Một đợt đang tạm dừng giữa chừng thì giữ scripts của nó cho tới hết.)
  4. Bộ số của từng bản mod, dùng được ngay: chạy xong, xoi-<tên>\tune.txt là các số đã chỉnh, và <tên>-xoi.zip là bản mod có bộ số ấy bên trong (xoi/tune.txt cạnh thư mục data, kèm bộ nhớ XOI nếu xoi-hoc.bat đã huấn luyện). Tải nó lên relay thay cho bản mod: XOI chơi bản mod ấy bằng bộ số riêng của nó, mọi người trong phòng như nhau (INSANE! giữ số của nó); trong trận ghi mod tuned cạnh XOI. Chỉ tải lên khi phần kiểm tra trên 50%. Để riêng bản mod ấy cạnh spsa.bat thì lần sau chỉnh tiếp từ bộ số của nó (và kiểm tra so với bộ số ấy).
  5. Gửi spsa\ket-qua.txt cho người làm AI: các số đã chỉnh, mỗi số dịch bao nhiêu, và bản đã chỉnh đấu với các số lúc bắt đầu ra sao. Bộ số hợp với mọi bản mod chỉ được đưa vào bộ số của chính XOI khi cũng thắng ở các phép đo thường dùng.

Settings at the top of spsa.batCác dòng chỉnh ở đầu spsa.bat

XOI's brain: a learned score (hoc-sau.bat)Bộ não XOI: học sâu (hoc-sau.bat)

Before every move XOI works out a score for it by hand-made rules: what the blow is worth, what it costs, how likely the opponent answers first. From package 67 a small neural network — XOI's brain — can sit beside those rules: given the situation (58 numbers: distances, speeds, both fighters' states, HP, MP, the move's damage, reach, MP and kind…) it predicts what the move will bring, HP dealt minus HP taken over the next second and a half, and XOI weighs its own score half with that prediction. The brain learns from XOI's own games, the way chess engines' NNUE networks learn from theirs: hoc-sau.bat records every move XOI starts over thousands of games and what came of it, then trains the network inside the game (a few minutes a million moves). A brain is made for one mod and travels with it as xoi/brain.txt, like the notes and the numbers; the match shows brain beside XOI. Trained on Sauce's pack ("lf2-AI VS and Stage Challenge"), it took XOI from 321 to 377 games won of 720 against Sauce's AI, and 216 to 134 against XOI without it; the same brain did nothing for other mods — each needs its own.

Trước mỗi đòn, XOI tính điểm cho đòn ấy bằng các luật đặt tay: đòn đáng bao nhiêu, tốn bao nhiêu, đối thủ dễ đáp trước đến đâu. Từ gói 67, một mạng nơ-ron nhỏ — bộ não của XOI — có thể đứng cạnh các luật ấy: nhìn tình huống (58 con số: khoảng cách, vận tốc, trạng thái hai bên, máu, MP, sát thương, tầm, MP và loại của đòn…) nó đoán đòn ấy sẽ mang lại gì — máu gây được trừ máu mất trong một giây rưỡi sau — và XOI lấy một nửa điểm tự tính, một nửa lời đoán ấy. Bộ não học từ chính các trận của XOI, như mạng NNUE của các chương trình cờ học từ các ván của chúng: hoc-sau.bat ghi lại mọi lần XOI ra đòn trong hàng nghìn trận cùng kết quả, rồi huấn luyện mạng ngay trong game (vài phút cho một triệu lần ra đòn). Bộ não làm cho một bản mod và đi cùng bản mod ấy dưới tên xoi/brain.txt, như bộ nhớ và bộ số; trong trận ghi brain cạnh XOI. Học trên bản của Sauce ("lf2-AI VS and Stage Challenge"), nó đưa XOI từ 321 lên 377 trận thắng trong 720 trận đấu AI của Sauce, và thắng XOI không có bộ não 216–134; cũng bộ não ấy không giúp gì cho các bản mod khác — mỗi bản mod cần bộ não riêng.

  1. Put one or more mods' .zip next to hoc-sau.bat, or drag one onto it. The original or the <mod>-xoi.zip that spsa.bat or xoi-hoc.bat made both do (package 68 on): XOI records with the mod's numbers and notes — those of xoi-<mod>\ beside the file when it exists, else those inside the zip — so the brain learns the XOI that actually plays the mod; a -xoi.zip beside its original is skipped when the folder is scanned, and its brain lands in the same xoi-<mod>\. Several mods: the processes are shared among them and each mod gets a brain of its own.
  2. Double-click. Each round, every process (one per CPU thread) records for PHUT_GHI minutes: XOI against the mod's own AI scripts where it has them (Sauce's AI), else against itself; random pairs of the mod's fighters on random stages. The data of every round so far is gathered, a brain is trained for each mod, and from the second round XOI records with the brain it just learned, so the brain learns its new play too. A process records about 2,000 moves a minute: 2 rounds of 20 minutes on 80 threads is some 6 million moves (2.5 GB of data) and about an hour of training.
  3. The check: at the end, half the processes play XOI with the brain against the opponent, the other half XOI without it, for PHUT_KIEM_TRA minutes, same seeds: the win rates stand side by side in hoc-sau\ket-qua.txt. To pause, close the windows; double-click again to go on (recorded data is kept). To learn further, raise VONG and run again: it goes on from the next round with all the data so far (package 75: after a finished run, the added rounds record with the new kit's scripts — the new AI). Start over by deleting the hoc-sau folder. Your own settings go in hoc-sau-cai-dat.bat beside it (brain-settings.bat in the English kit), as with spsa.bat.
  4. Each mod's brain, ready to use: xoi-<mod>\brain.txt, and <mod>-xoi.zip is the mod with it inside (xoi/brain.txt beside its data folder, with the mod's numbers and notes if it has them; a -xoi.zip given is updated itself, the earlier one kept as -xoi-truoc.zip). Uploaded to the relay or published, XOI plays that mod with the brain. Upload it only if the check has XOI with the brain winning more than XOI without it. spsa.bat, xoi-hoc.bat and xuat-ban.bat pack the brain too when xoi-<mod>\brain.txt exists.
  5. Send hoc-sau\ket-qua.txt to whoever maintains the AI: the data each round, how well the network predicts (the corr figures: how its predictions go with what happened, where the hand-made score alone gets about 0.2 and the network about 0.45), and the check.
  1. Đặt một hay nhiều file .zip bản mod cạnh hoc-sau.bat, hoặc kéo thả một file vào nó. Bản gốc hay bản <tên>-xoi.zip mà spsa.bat/xoi-hoc.bat làm ra đều được (từ gói 68): XOI ghi dữ liệu với bộ số và bộ nhớ của bản mod — lấy trong xoi-<tên>\ cạnh file nếu có, không thì trong file zip — nên bộ não học đúng XOI đang chơi bản mod ấy; file -xoi.zip nằm cạnh bản gốc thì bị bỏ qua khi tự quét thư mục, và bộ não của nó về cùng xoi-<tên>\. Nhiều bản mod: các tiến trình chia nhau, mỗi bản mod một bộ não riêng.
  2. Nháy đúp. Mỗi lượt, mỗi tiến trình (một luồng CPU) ghi dữ liệu trong PHUT_GHI phút: XOI đánh với AI riêng của bản mod nếu có (AI của Sauce), không thì với chính nó; các cặp nhân vật ngẫu nhiên trên sân ngẫu nhiên. Dữ liệu của mọi lượt từ trước tới giờ được gộp, mỗi bản mod được huấn luyện một bộ não, và từ lượt hai XOI ghi dữ liệu với bộ não vừa học, nên bộ não học được cả cách chơi mới của nó. Một tiến trình ghi chừng 2.000 lần ra đòn mỗi phút: 2 lượt × 20 phút trên máy 80 luồng được chừng 6 triệu lần ra đòn (2,5 GB dữ liệu), huấn luyện chừng một giờ.
  3. Kiểm tra: cuối cùng, một nửa số tiến trình cho XOI có bộ não đánh đối thủ, nửa kia cho XOI không có, trong PHUT_KIEM_TRA phút, cùng hạt giống: hai tỉ lệ thắng đứng cạnh nhau trong hoc-sau\ket-qua.txt. Tạm dừng: đóng các cửa sổ; nháy đúp lại là làm tiếp (dữ liệu đã ghi được giữ). Học thêm: tăng VONG rồi chạy lại — làm tiếp từ lượt kế với tất cả dữ liệu đã có (gói 75: đợt trước đã xong thì các lượt thêm ghi dữ liệu với scripts của bộ XOI mới, AI bản mới). Làm lại từ đầu: xóa thư mục hoc-sau. Cài đặt riêng của bạn để trong hoc-sau-cai-dat.bat cạnh nó (bộ tiếng Anh: brain-settings.bat), như với spsa.bat.
  4. Bộ não của từng bản mod, dùng được ngay: xoi-<tên>\brain.txt, và <tên>-xoi.zip là bản mod có nó bên trong (xoi/brain.txt cạnh thư mục data, kèm bộ số và bộ nhớ của bản mod nếu đã có; đưa vào chính bản -xoi.zip thì nó được cập nhật tại chỗ, bản trước giữ ở -xoi-truoc.zip). Tải lên relay hay xuất bản thì XOI chơi bản mod ấy với bộ não. Chỉ tải lên khi phần kiểm tra cho XOI có bộ não thắng nhiều hơn XOI không có. spsa.bat, xoi-hoc.bat và xuat-ban.bat cũng đóng gói bộ não khi có xoi-<tên>\brain.txt.
  5. Gửi hoc-sau\ket-qua.txt cho người làm AI: dữ liệu từng lượt, mạng đoán tốt đến đâu (các số corr: lời đoán đi cùng kết quả thật đến mức nào — điểm tự tính của XOI được khoảng 0,2, mạng khoảng 0,45), và phần kiểm tra.

Settings at the top of hoc-sau.batCác dòng chỉnh ở đầu hoc-sau.bat

Share what you trainedChia sẻ những gì đã huấn luyện

Publish your mod with INSANE! and XOI built inXuất bản bản mod có sẵn INSANE! và XOI

The kit and OpenLF2's installer are for you, who train. Your mod's players need neither: xuat-ban.bat gives them your mod's own folder as you share it (bg, bgm, data, sprite… and its own .exe) with OpenLF2 put in it, XOI's notes, numbers and brain in xoi\. They extract it and double-click <mod> - INSANE XOI.exe — every level up to INSANE! and XOI, no OpenLF2 to install, no kit, no original LF2. OpenLF2 plays the mod folder it lies in by itself (from package 50; xuat-ban.bat checks the installed one and says when it is older).

Bộ XOI và bộ cài OpenLF2 là cho bạn, người huấn luyện. Người chơi bản mod của bạn không cần cả hai: xuat-ban.bat đưa họ nguyên thư mục gốc của bản mod như bạn chia sẻ (bg, bgm, data, sprite… và cả file .exe của nó), thêm OpenLF2 vào, bộ nhớ, bộ số và bộ não của XOI trong xoi\. Họ giải nén rồi nháy đúp <tên> - INSANE XOI.exe — đủ các mức tới INSANE! và XOI, không cài OpenLF2, không cần bộ XOI, không cần LF2 gốc. OpenLF2 tự chơi thư mục bản mod mà nó nằm trong (từ gói 50; xuat-ban.bat kiểm tra bản đã cài và báo nếu nó cũ hơn).

  1. Train and tune first (train, tune): you get <mod>-xoi.zip, the mod with xoi\notes.txt and xoi\tune.txt inside. Untrained, XOI still plays, with its general numbers and no notes.
  2. Put <mod>-xoi.zip next to xuat-ban.bat (or the mod's zip or folder: the notes and numbers in xoi-<mod>\ beside it go in), or drag it onto xuat-ban.bat. The name players see is the mod's; another: TEN at the top of the file. Your words for them — what the mod is, who made it — go into xuat-ban-README.txt beforehand ({TEN} becomes the name, {EXE} the program, {GOC} the mod's own .exe).
  3. Lock the hidden fighters? xuat-ban.bat asks (C = yes, K = no; or set KHOA_AN at the top). Yes: the players' title screen has no options, the hidden fighters cannot be unlocked and typing lf2.net does nothing — for a mod whose hidden fighters are out of balance. CRAZY!, INSANE! and XOI can still be chosen (from package 49; they otherwise come with the unlock). It is a file in the mod, openlf2.txt (hidden_characters = locked, options = hidden), which OpenLF2 reads from package 48 on.
  4. Double-click xuat-ban.bat. It copies the mod's folder (from its zip, or the folder you gave), puts in the installed OpenLF2 (the program as <mod> - INSANE XOI.exe, its libraries, its scripts — the kit's when newer, the computer players you trained with — and its licences) and README - INSANE XOI.txt, starts the folder once without a window to see that it plays the mod by itself, and zips it.
  5. Share xuat-ban\<mod>.zip. xuat-ban\<mod>\ is the same, unzipped: try it first.
  1. Huấn luyện và chỉnh số trước (huấn luyện, chỉnh số): bạn có <tên>-xoi.zip, bản mod có xoi\notes.txt và xoi\tune.txt bên trong. Chưa huấn luyện thì XOI vẫn chơi, bằng bộ số chung và không có bộ nhớ.
  2. Đặt <tên>-xoi.zip cạnh xuat-ban.bat (hoặc file zip hay thư mục bản mod: bộ nhớ và bộ số trong xoi-<tên>\ cạnh nó được đóng vào), hoặc kéo thả nó vào xuat-ban.bat. Tên người chơi thấy là tên bản mod; muốn tên khác: dòng TEN ở đầu file. Lời của bạn cho người chơi — bản mod là gì, ai làm — viết trước vào xuat-ban-README.txt ({TEN} thành tên bản xuất bản, {EXE} thành file chương trình, {GOC} thành file .exe gốc của bản mod).
  3. Khóa nhân vật ẩn? xuat-ban.bat hỏi (C = có, K = không; hoặc đặt dòng KHOA_AN ở đầu file). Có: màn hình đầu của người chơi không có nút options, nhân vật ẩn không mở khóa được, gõ lf2.net cũng không mở — cho bản mod có nhân vật ẩn mất cân bằng. CRAZY!, INSANE! và XOI vẫn chọn được (từ gói 49; bình thường chúng đi cùng việc mở khóa). Đó là một file trong bản mod, openlf2.txt (hidden_characters = locked, options = hidden), OpenLF2 đọc từ gói 48.
  4. Nháy đúp xuat-ban.bat. Nó chép thư mục bản mod (từ file zip, hoặc thư mục bạn đưa), thêm OpenLF2 đã cài (chương trình thành <tên> - INSANE XOI.exe, các thư viện, scripts — của bộ XOI nếu mới hơn, tức các máy bạn đã huấn luyện — và giấy phép) và README - INSANE XOI.txt, mở thử thư mục một lần không cửa sổ để chắc nó tự chơi được bản mod, rồi nén lại.
  5. Chia sẻ xuat-ban\<tên>.zip. xuat-ban\<tên>\ là bản đã giải nén: chơi thử trước.
<mod>\ what players get (from <mod>.zip): the mod's own folder… bg\ bgm\ data\ sprite\ … the mod's files, as its author shares them <the mod's>.exe the mod's own program: the original LF2, up to CRAZY! readme.txt … the mod's own notes xoi\ XOI's notes.txt and tune.txt …with OpenLF2 put in it: <mod> - INSANE XOI.exe OpenLF2: double-click to play README - INSANE XOI.txt how to play, in Vietnamese and English (from xuat-ban-README.txt) *.dll the libraries OpenLF2 uses (SDL, FFmpeg…) scripts\ the game's scripts: menus, fighting, INSANE! and XOI licenses\ OpenLF2's licence and its libraries'
<tên>\ thứ người chơi nhận (trong <tên>.zip): thư mục gốc của bản mod… bg\ bgm\ data\ sprite\ … các file của bản mod, như tác giả chia sẻ <file của mod>.exe chương trình gốc của bản mod: LF2 cũ, chỉ tới CRAZY! readme.txt … ghi chú của bản mod xoi\ notes.txt và tune.txt của XOI …thêm OpenLF2: <tên> - INSANE XOI.exe OpenLF2: nháy đúp để chơi README - INSANE XOI.txt cách chơi, tiếng Việt và tiếng Anh (từ xuat-ban-README.txt) *.dll các thư viện OpenLF2 dùng (SDL, FFmpeg…) scripts\ scripts của game: menu, đánh nhau, INSANE! và XOI licenses\ giấy phép của OpenLF2 và của các thư viện

Inside the kitBên trong bộ XOI

LF2-XOI-kit\ choi.bat play a mod with INSANE! and XOI xoi-hoc.bat train XOI for a mod dau-nhieu.bat measure: two computer players on every pair spsa.bat tune XOI's numbers by play hoc-sau.bat XOI learns a brain, a network scoring its moves, from its own games xem.bat watch two computer players in the window, fighters by name (for a clip) can-bang.bat fighter balance: win rates and what each move brings xuat-ban.bat publish a mod for its players (its work: xuat-ban.ps1) xuat-ban-README.txt the README published mods get: edit it to add your words kiem-tra.bat the game does not open: find out why (kiem-tra.txt) README.txt the short version of this page version.txt which INSANE! and OpenLF2 this kit is scripts\ the game's scripts with INSANE! and XOI (base\game\smart_ai.lua) tools\ai-bench\ the jobs: learn.lua (training), duel.lua (measuring), record.lua and train.lua (the brain), balance.lua (balance)… made as you go: <mod>.zip a mod folder zipped by choi.bat <mod>-xoi.zip the mod with xoi\notes.txt inside (xoi-hoc.bat, or choi.bat with notes) <mod>-xoi-truoc.zip the previous packing, to compare scripts-choi\ installed scripts with the kit's laid over (choi.bat) xem\ xem.bat's copy of the bench (config.lua, xem.txt: each game's score) danh-sach.txt a mod's fighters and backgrounds (xem.bat with QUAN1 empty) xoi-<mod>\ notes.txt the notes of every round, merged: what you share ban-mod.txt which mod zip was trained dot-<seed>\ one round: p1…pN\out.txt (the game's output) and config.lua goi\xoi\notes.txt a copy, to put into a zip by hand ket-qua-<seed>\ a measurement: cap.txt, run-*.txt spsa\ a tuning: ket-qua.txt (the result), vong-<n>\ (each round), kiem-tra\ (the check) hoc-sau\ a brain's making: ket-qua.txt, du-lieu\ (the recorded moves), luot-<n>\ (each round), kiem-tra\ xoi-<mod>\brain.txt the brain (XOI_BRAIN lines): what spsa.bat, xoi-hoc.bat and xuat-ban.bat pack as xoi\brain.txt can-bang-<mod>\ a balance measurement: bao-cao.html (the report), ket-qua.txt, vong-<n>\ (each round) xuat-ban\ published mods: <mod>.zip to share, <mod>\ unzipped, <mod>-kiem-tra.txt (the trial start)
LF2-XOI-kit\ choi.bat chơi bản mod với INSANE! và XOI xoi-hoc.bat huấn luyện XOI cho bản mod dau-nhieu.bat đo: hai loại máy đấu mọi cặp spsa.bat chỉnh các con số của XOI bằng cách cho máy đánh hoc-sau.bat XOI học bộ não — mạng nơ-ron chấm điểm đòn — từ chính các trận của nó xem.bat xem hai máy đánh nhau trong cửa sổ, chọn nhân vật theo tên (để quay clip) can-bang.bat cân bằng nhân vật: tỉ lệ thắng và mỗi chiêu mang lại gì xuat-ban.bat xuất bản bản mod cho người chơi (phần việc nằm trong xuat-ban.ps1) xuat-ban-README.txt README của bản xuất bản: sửa để thêm lời của bạn kiem-tra.bat game không mở được: tìm lý do (kiem-tra.txt) README.txt bản ngắn của trang này version.txt bộ này là INSANE! và OpenLF2 phiên bản nào scripts\ scripts của game có INSANE! và XOI (base\game\smart_ai.lua) tools\ai-bench\ các việc: learn.lua (huấn luyện), duel.lua (đo), record.lua và train.lua (bộ não), balance.lua (cân bằng)… sinh ra trong lúc dùng: <tên>.zip thư mục bản mod do choi.bat nén lại <tên>-xoi.zip bản mod có xoi\notes.txt bên trong (xoi-hoc.bat, hoặc choi.bat kèm bộ nhớ) <tên>-xoi-truoc.zip bản đóng gói lần trước, để so scripts-choi\ scripts đã cài ghép scripts của bộ XOI (choi.bat) xem\ bản sao bộ công cụ của xem.bat (config.lua, xem.txt: tỉ số từng trận) danh-sach.txt nhân vật và màn nền của bản mod (xem.bat để trống QUAN1) xoi-<tên>\ notes.txt bộ nhớ mọi đợt, đã gộp: thứ để chia sẻ ban-mod.txt file zip bản mod đã được học dot-<hạt giống>\ một đợt: p1…pN\out.txt (kết quả game in ra) và config.lua goi\xoi\notes.txt bản sao, để tự đặt vào file zip bằng tay ket-qua-<hạt giống>\ một lần đo: cap.txt, run-*.txt spsa\ một lần chỉnh: ket-qua.txt (kết quả), vong-<n>\ (từng vòng), kiem-tra\ (phần kiểm tra) hoc-sau\ một lần học bộ não: ket-qua.txt, du-lieu\ (các lần ra đòn đã ghi), luot-<n>\ (từng lượt), kiem-tra\ xoi-<tên>\brain.txt bộ não (các dòng XOI_BRAIN): spsa.bat, xoi-hoc.bat và xuat-ban.bat đóng gói nó thành xoi\brain.txt can-bang-<tên>\ một lần đo cân bằng: bao-cao.html (báo cáo), ket-qua.txt, vong-<n>\ (từng vòng) xuat-ban\ bản xuất bản: <tên>.zip để chia sẻ, <tên>\ đã giải nén, <tên>-kiem-tra.txt (lần mở thử)

The notes file is plain text, one fact per line, each starting with XOI: G the games of a pair, R the opponent's answers to risky moves, M a move's record against an opponent, C its record by situation, P the spots the fighter stood on. A big mod's notes run to megabytes; in a match the game reads only the lines of the pairs in it. Elsewhere than Windows, the same jobs run from a shell: openlf2 --pack mod.zip --mod tools/ai-bench with a config.lua such as return {command = "learn", games = 100, ids = "all"} — see tools/ai-bench/README.md.

File bộ nhớ là chữ thường, mỗi dòng một điều, bắt đầu bằng XOI: G số trận của một cặp, R cách đối thủ đáp lại chiêu liều, M thành tích một chiêu trước một đối thủ, C thành tích ấy theo hoàn cảnh, P các chỗ nhân vật đã đứng. Bộ nhớ của bản mod lớn có thể tới vài MB; trong trận, game chỉ đọc các dòng của những cặp có mặt. Ngoài Windows, cùng các việc này chạy bằng dòng lệnh: openlf2 --pack mod.zip --mod tools/ai-bench với config.lua như return {command = "learn", games = 100, ids = "all"} — xem tools/ai-bench/README.md.

TroubleshootingGặp lỗi

The .bat files speak Vietnamese without accents; here is what their messages mean.

Các file .bat in thông báo tiếng Việt không dấu; dưới đây là cách xử lý.

Message or problemWhat to do
Chua cai OpenLF2, Khong thay gameInstall OpenLF2 (above); installed elsewhere: set GAME to the full path of openlf2.exe.
Khong thay ban mod, Khong thay file zip ban modPut the mod's .zip next to the .bat file, or drag it onto it.
... khong phai file zipA .rar or .7z: extract it (7-Zip) and drag the folder onto choi.bat.
khong co data/data.txtNot an LF2 game folder: pick the folder that has data\data.txt (where the mod's .exe is).
The difficulty never goes past DifficultThe hidden content is locked: on the start screen open Options and tick Unlock hidden characters, or type lf2.net.
The game window stays blue or blackVE=software at the top of choi.bat. Started some other way, OpenLF2 from version 29 of this build checks by itself that its renderer shows pictures and changes it when not.
Windows protected your PCMore info, then Run anyway.
[LOI] Khong dong goi duocPowerShell is blocked on this PC. By hand: open the mod's zip (7-Zip), go into the folder that has data, and drag in the folder xoi-<mod>\goi\xoi.
[LOI] OpenLF2 da cai ... la ban cuxuat-ban.bat: the installed OpenLF2 does not yet play the mod folder it lies in (package 50 on). Install the latest (above) and run it again.
[LOI] Ban xuat ban khong mo duoc ban modThe game could not open the mod (its words are above, and in xuat-ban\<mod>-kiem-tra.txt). A packed or protected .exe cannot be published; otherwise send that file.
[CHU Y] Co hinh game khong doc duocxuat-ban.bat published the mod, but the game leaves out the pictures listed (as it does with choi.bat). An older OpenLF2: install the latest, which reads more kinds of pictures, and publish again.
[LOI] ...\pN chua xong hoac co loiA training window was closed or failed: the pairs it finished are kept; the lines with ERROR say why.
Dot hoc voi hat giong ... da coThat round exists: change HAT_GIONG_DAU, or run xoi-hoc.bat gop to merge only.
The PC crawls while trainingLower SONG_SONG (half the threads, say).
An antivirus warns about a .batThe .bat and .ps1 files are plain text: open them in Notepad to read every line.
Thông báo hay hiện tượngCách xử lý
Chua cai OpenLF2, Khong thay gameCài OpenLF2 (ở trên); cài ở chỗ khác thì đặt GAME là đường dẫn đầy đủ tới openlf2.exe.
Khong thay ban mod, Khong thay file zip ban modĐặt file .zip bản mod cạnh file .bat, hoặc kéo thả nó vào.
... khong phai file zipFile .rar hay .7z: giải nén (7-Zip) rồi kéo thư mục vào choi.bat.
khong co data/data.txtKhông phải thư mục game LF2: chọn thư mục có data\data.txt (nơi có file .exe của bản mod).
Mức khó không qua được DifficultNội dung ẩn đang khóa: ở màn hình khởi động mở Options, tích Unlock hidden characters, hoặc gõ lf2.net.
Cửa sổ game chỉ xanh hay đenVE=software ở đầu choi.bat. Mở game theo cách khác thì OpenLF2 từ bản 29 của bản dựng này tự kiểm tra cách vẽ có hiện hình không và tự đổi khi không.
Windows protected your PCMore info, rồi Run anyway.
[LOI] Khong dong goi duocMáy chặn PowerShell. Làm tay: mở file zip bản mod (7-Zip), vào thư mục có data, kéo thư mục xoi-<tên>\goi\xoi vào đó.
[LOI] OpenLF2 da cai ... la ban cuxuat-ban.bat: OpenLF2 đã cài chưa tự chơi thư mục bản mod mà nó nằm trong (cần từ gói 50). Cài bản mới nhất (ở trên) rồi chạy lại.
[LOI] Ban xuat ban khong mo duoc ban modGame không mở được bản mod (lời báo của game in ở trên, và trong xuat-ban\<tên>-kiem-tra.txt). File .exe bị nén hay khóa thì không xuất bản được; còn lại thì gửi file ấy.
[CHU Y] Co hinh game khong doc duocxuat-ban.bat vẫn xuất bản, nhưng game bỏ qua các hình được liệt kê (như khi chơi bằng choi.bat). OpenLF2 bản cũ: cài bản mới nhất (đọc được nhiều kiểu hình hơn) rồi xuất bản lại.
[LOI] ...\pN chua xong hoac co loiMột cửa sổ huấn luyện bị đóng hoặc lỗi: những cặp nó đã xong vẫn được giữ; các dòng có ERROR cho biết lý do.
Dot hoc voi hat giong ... da coĐợt đó đã có: đổi HAT_GIONG_DAU, hoặc chạy xoi-hoc.bat gop để chỉ gộp.
Máy rất chậm khi huấn luyệnGiảm SONG_SONG (ví dụ một nửa số luồng).
Phần mềm diệt virus cảnh báo file .batCác file .bat và .ps1 là chữ thường: mở bằng Notepad để đọc từng dòng.