Problem
The current chart mainly answers the question:
How much total research is required to reach this drive from a neutral baseline?
That is useful for general planning, but it becomes less accurate once a campaign is already underway. In a real save, many prerequisite technologies or projects may already be completed, some projects may be partially researched, some projects may be visible and researchable, and others may not yet be available to the player's faction.
Because Terra Invicta uses project unlock and availability mechanics, two drives with similar total research cost can have very different practical costs in a specific save. A drive may also be theoretically on the chart but not currently researchable at all.
The chart should support a save-aware view that answers:
Given this save file, how much research remains before this drive can actually be used, and is the required project currently available?
Direction
Do not require users to run TI_Parser or any external command-line tool. Engine Charts is a static web page, and the save-aware workflow should preserve that user experience.
The default implementation should parse Terra Invicta .gz save files directly in the browser. The save should remain local to the user's machine and should not be uploaded to a server in the default path.
The browser parser should be intentionally minimal. It should not attempt to replicate the full TI_Parser planning model. It only needs to extract the subset of save data required by Engine Charts.
Initial browser-native scope
The first implementation should support:
- Local
.gz save upload in the browser
- Local gzip decompression
- Parsing in a Web Worker to avoid blocking the UI
- Extraction of the player faction or selected faction where possible
- Completed global technologies
- Completed faction projects
- Currently available faction projects where possible
- Active research progress
- Stored or partial project progress where possible
- Mapping extracted research state to the existing Engine Charts drive/project catalog
- A chart mode that can switch between total research and remaining research
- Visual status for each drive/project based on save state
Save-derived statuses
Each drive or drive-unlocking project should be classified into a status such as:
- Already researched
- Researchable now
- Partially completed
- Global prerequisite available but faction project not yet acquired
- Missing prerequisite technology
- Blocked or unavailable
- Unknown / unsupported save format
These statuses should be visible in the chart, tooltip, or detail panel. The UI should avoid implying that a drive is immediately researchable when the save data does not support that conclusion.
Ship preset import scope
Existing ship design import is useful, but it should be secondary to research-state import.
The first ship import pass should only extract enough information to create or suggest dry mass / ship assumption presets, such as:
- Ship design name
- Hull type where available
- Drive name
- Reactor / power plant name
- Radiator name where available
- Dry mass / wet mass / propellant mass where recoverable
- Utility modules where relevant
Full reconstruction of every ship stat should not be required for the first pass.
Performance and operational requirements
- Save parsing should run in a Web Worker.
- Large save files should not freeze the main UI thread.
- The UI should show parsing progress or at least a clear loading state.
- The parser should return a compact context object to the main thread rather than exposing the entire parsed save object to the chart UI.
- The parser should fail gracefully on unsupported or changed save formats.
- Save files should not be uploaded to a server in the default implementation.
- The page should clearly communicate that parsing is local.
Browser compatibility notes
The preferred path is:
- Read the uploaded
.gz file as binary data.
- Decompress it locally using browser-supported gzip handling where available.
- Fall back to a bundled gzip library if needed.
- Parse the decompressed JSON inside a Web Worker.
- Extract only the compact Engine Charts context needed by the UI.
The implementation should avoid parsing large saves on the main thread.
Acceptance criteria
Out of scope for MVP
Optional future backend fallback
If browser-native parsing proves too slow, too memory-heavy, or too difficult to maintain, a Python backend can be considered as an optional fallback. The cheapest practical backend shape would be a small FastAPI service that reuses TI_Parser internals and returns only a compact Engine Charts context object.
However, a backend should not be the default unless necessary, because it introduces:
- Save file upload and privacy concerns
- Hosting and operating costs
- CORS and abuse-prevention requirements
- Failure modes outside GitHub Pages
- A more complex deployment model
If implemented later, the backend should:
- Enforce upload size limits
- Avoid storing save files
- Avoid logging save contents
- Return only compact derived chart context
- Be clearly labeled as optional server-side parsing
Suggested implementation phases
Phase 1: Research-state import MVP
Phase 2: Better availability classification
Phase 3: Ship design preset import
Phase 4: Optional backend fallback
Problem
The current chart mainly answers the question:
That is useful for general planning, but it becomes less accurate once a campaign is already underway. In a real save, many prerequisite technologies or projects may already be completed, some projects may be partially researched, some projects may be visible and researchable, and others may not yet be available to the player's faction.
Because Terra Invicta uses project unlock and availability mechanics, two drives with similar total research cost can have very different practical costs in a specific save. A drive may also be theoretically on the chart but not currently researchable at all.
The chart should support a save-aware view that answers:
Direction
Do not require users to run TI_Parser or any external command-line tool. Engine Charts is a static web page, and the save-aware workflow should preserve that user experience.
The default implementation should parse Terra Invicta
.gzsave files directly in the browser. The save should remain local to the user's machine and should not be uploaded to a server in the default path.The browser parser should be intentionally minimal. It should not attempt to replicate the full TI_Parser planning model. It only needs to extract the subset of save data required by Engine Charts.
Initial browser-native scope
The first implementation should support:
.gzsave upload in the browserSave-derived statuses
Each drive or drive-unlocking project should be classified into a status such as:
These statuses should be visible in the chart, tooltip, or detail panel. The UI should avoid implying that a drive is immediately researchable when the save data does not support that conclusion.
Ship preset import scope
Existing ship design import is useful, but it should be secondary to research-state import.
The first ship import pass should only extract enough information to create or suggest dry mass / ship assumption presets, such as:
Full reconstruction of every ship stat should not be required for the first pass.
Performance and operational requirements
Browser compatibility notes
The preferred path is:
.gzfile as binary data.The implementation should avoid parsing large saves on the main thread.
Acceptance criteria
.gzsave file directly in the Engine Charts page.Out of scope for MVP
Optional future backend fallback
If browser-native parsing proves too slow, too memory-heavy, or too difficult to maintain, a Python backend can be considered as an optional fallback. The cheapest practical backend shape would be a small FastAPI service that reuses TI_Parser internals and returns only a compact Engine Charts context object.
However, a backend should not be the default unless necessary, because it introduces:
If implemented later, the backend should:
Suggested implementation phases
Phase 1: Research-state import MVP
.gzsaves locally.Phase 2: Better availability classification
Phase 3: Ship design preset import
Phase 4: Optional backend fallback