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

expose functionality of ArxMap.finalize() as cli commands #9

Open
meszaros-lajos-gyorgy opened this issue Apr 2, 2024 · 2 comments
Milestone

Comments

@meszaros-lajos-gyorgy
Copy link
Collaborator

meszaros-lajos-gyorgy commented Apr 2, 2024

Converting mapdata from ftl to json and back can be done with arx-convert, but that repo doesn't do any checks or validations whether the provided mapdata is actually correct and will it load in the game. Creating a level with arx-level-generator is something like this:

import { ArxMap } from 'arx-level-generator'

const settings = new Settings()
const level = new ArxMap();

// ...

level.finalize(settings) // <----- this part does the "magic"!
level.saveToDisk(settings)

ArxMap.finalize(settings) removes out of bound polygons, calculates normals, room data and lighting. This needs to be exposed, like so:

arx-level-generator finalize level8.fts.json --output=level8.fts.finalized.json

There is one problem: changing the polygons would also affect the llf file, so the cli command would need to have 2 json files as an input and 2 files for output.

@meszaros-lajos-gyorgy
Copy link
Collaborator Author

ArxMap.finalize() now requires a settings parameter from which 2 parameters are read:

  • calculateLighting
  • lightingCalculatorMode

Those will have to be passed as cli args as well.

@meszaros-lajos-gyorgy
Copy link
Collaborator Author

This is still to be finished by implementing the remaining things in src/bin/cli.ts

@meszaros-lajos-gyorgy meszaros-lajos-gyorgy added this to the v22.0.0 milestone Dec 24, 2024
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

1 participant