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

h1emu ai #2138

Draft
wants to merge 22 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/dev-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.12.2
- name: Use Node.js 22.9.0
uses: actions/setup-node@v3
with:
node-version: 20.12.2
node-version: 22.9.0
- run: npm i
- run: npm run lint-quiet
prettier:
name: prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.12.2
- name: Use Node.js 22.9.0
uses: actions/setup-node@v3
with:
node-version: 20.12.2
node-version: 22.9.0
- run: npm i
- run: npm run check_prettier
interfaces-up-to-date:
name: interfaces-up-to-date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.12.2
- name: Use Node.js 22.9.0
uses: actions/setup-node@v3
with:
node-version: 20.12.2
node-version: 22.9.0
- run: npm i
- run: npm run gen-packets-types
- run: npm run gen-packets-interfaces
Expand All @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 21.x]
node-version: [ 22.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -56,7 +56,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.12.2, 20.x, 21.x]
node-version: [22.9.0, 22.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -72,7 +72,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.12.2, 20.x, 21.x]
node-version: [22.9.0, 22.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -86,7 +86,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
node-version: [20.12.2, 20.x, 21.x]
node-version: [22.9.0, 22.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/doc-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.12.2
- name: Use Node.js 22.9.0
uses: actions/setup-node@v3
with:
node-version: 20.12.2
node-version: 22.9.0
- run: npm i
- run: npm run gen-doc
- name: Setup Pages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.12.2
- name: Use Node.js 22.9.0
uses: actions/setup-node@v3
with:
node-version: 20.12.2
node-version: 22.9.0
- uses: docker-practice/actions-setup-docker@master
- run: npm i
- run: npm run build-docker-images
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
registry-url: https://registry.npmjs.org/
- run: npm i
- run: npm publish
Expand Down Expand Up @@ -42,10 +42,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20.12.2
- name: Use Node.js 22.9.0
uses: actions/setup-node@v3
with:
node-version: 20.12.2
node-version: 22.9.0
- uses: olegtarasov/[email protected]
id: tagName
- uses: docker-practice/actions-setup-docker@master
Expand Down
Binary file added data/2016/navData/z1.bin
Binary file not shown.
Binary file added data/2016/navData/z1_fixed.bin
Binary file not shown.
Binary file added data/2016/navData/z1_fixed_wow.bin
Binary file not shown.
Binary file added data/2016/navData/z1_new.bin
Binary file not shown.
121 changes: 121 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
"@types/node": "22.1.0",
"@types/ws": "8.5.12",
"debug": "4.3.6",
"h1emu-ai": "^0.0.1",
"h1emu-core": "1.2.8",
"h1z1-dataschema": "1.7.2",
"js-yaml": "4.1.0",
"mongodb": "6.8.0",
"recast-navigation": "^0.34.0",
"threads": "1.7.0",
"typescript": "5.5.4",
"ws": "8.18.0"
Expand All @@ -46,7 +48,8 @@
"fix-signatures": "npx ts-node ./scripts/fixSignatures.ts && npm run prettier_sources",
"gen-doc": "npm run updt-doc-config && npx typedoc",
"updt-doc-config": "npx ts-node ./scripts/updateTypeDoc.ts",
"start": "node ./scripts/h1z1-server-demo-2016.js",
"start": "node --no-warnings --experimental-require-module ./scripts/h1z1-server-demo-2016.js",
"start-dev": "npm run build && npm start",
"start-echo": "npm run build && npm run build-benchs && node --inspect ./benchmarks/out/echo/echo-server-start.js",
"lint": "npx eslint src",
"lint-quiet": "npx eslint --quiet src",
Expand All @@ -59,15 +62,14 @@
"build-tests": "npx tsc -p tsconfigs/tsconfig-tests.json",
"build-benchs": "npx tsc -p ./benchmarks/tsconfig.json",
"build-docker-images": "npx ts-node ./docker/buildDocker.ts",
"test-mongo": "npm run build && npm run build-tests && MONGO_TESTS='true' node --test",
"test": "npm run build && npm run build-tests && node --test",
"test-mongo": "npm run build && npm run build-tests && MONGO_TESTS='true' node --no-warnings --experimental-require-module --test",
"test": "npm run build && npm run build-tests && node --no-warnings --experimental-require-module --test",
"postinstall": "npm run build",
"publish_release": "git push --tags && git push origin dev && git push origin master && git checkout dev && npm run publish_release-next",
"publish_release-next": "npm version --no-git-tag-version prerelease && git add * && git commit -m 'publish-a-next-version' && npm publish --tag next && git push origin dev",
"check_prettier": "prettier --check ./src && prettier --check ./tests && prettier --check ./benchmarks",
"prettier_sources": "prettier --write ./src && prettier --write ./tests && prettier --write ./benchmarks",
"tests": "npm run gen-packets-types && npm run gen-packets-interfaces && npm run prettier_sources",
"start-dev": "npm run build && npm start"
"tests": "npm run gen-packets-types && npm run gen-packets-interfaces && npm run prettier_sources"
},
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { AddLightweightNpc, AddSimpleNpc } from "types/zone2016packets";
import { ZoneServer2016 } from "../zoneserver";
import { BaseEntity } from "./baseentity";
import { ModelIds, PositionUpdateType } from "../models/enums";
import { CrowdAgent } from "recast-navigation";

function getHeadActor(modelId: number): string {
switch (modelId) {
Expand Down Expand Up @@ -99,6 +100,8 @@ export abstract class BaseLightweightCharacter extends BaseEntity {
/** Determines if the lightweight should be used as a SimpleNpc (non-moving) */
useSimpleStruct: boolean = false;

navAgent?: CrowdAgent;

constructor(
characterId: string,
transientId: number,
Expand Down
Loading
Loading