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

FMG 2.0: Codebase refactoring and modernization #842

Draft
wants to merge 167 commits into
base: master
Choose a base branch
from
Draft

FMG 2.0: Codebase refactoring and modernization #842

wants to merge 167 commits into from

Conversation

Azgaar
Copy link
Owner

@Azgaar Azgaar commented Jun 24, 2022

Description

Starting working on a major code refactoring and modernization.

Goals:

Contract changes as of today

Regiments:

  • state.military is renamed to state.regiments
  • regiments contract is reworked

Routes:

  • pack.cells.road is renamed to pack.cells.route
  • pack.cells.route values are repurposed, now 1 means road, 2 - trail, 3 - seaRoute
  • pack.routes now stores all relevant routes data

Diplomacy:

  • Ongoing wars are not longer stored in pack.states[0].diplomacy
  • Historical campaigns are not longer stored in pack.states[x].campaigns
    => Both are now stored as an array in pack.events.conflicts

Provinces:

  • pack.states[x].provinces is removed. Now states don't store info about their provinces

Labels:

  • text-anchor for '#labels' element is changed from 'start' to middle. All child tspan elements now should have attribute x equal to 0 instead of a calculated value

Type of change

  • Other (architecture change)

Versioning

  • Version is updated
  • Changed files hash is updated

@Azgaar Azgaar self-assigned this Jun 24, 2022
@Azgaar Azgaar changed the title Vite Migration to es modules using Vite Jun 24, 2022
@Azgaar Azgaar added don't merge POC Proof of Concept labels Jun 24, 2022
Repository owner deleted a comment from netlify bot Jun 24, 2022
@goteguru
Copy link
Collaborator

goteguru commented Jun 26, 2022 via email

@Azgaar
Copy link
Owner Author

Azgaar commented Jun 26, 2022

It's not necessary at all. But that is one-time action that will allow a lot of cool things in the future. It also forces to write a better code and think a lot about the structure

@goteguru
Copy link
Collaborator

goteguru commented Jun 26, 2022 via email

@Azgaar
Copy link
Owner Author

Azgaar commented Jun 26, 2022

Do you mean hot module replacement? If so, it works just fine out of the box.

The template I used is a very basic vanilla-js + typescript:
https://stackblitz.com/edit/vitejs-vite-epqe9h?file=index.html&terminal=dev

@goteguru
Copy link
Collaborator

goteguru commented Jun 26, 2022 via email

@Minivera
Copy link
Contributor

Since we've discussed it in #902 I thought I'd ask, is there some way we can help with this migration work?

@Azgaar
Copy link
Owner Author

Azgaar commented Dec 15, 2022

Since we've discussed it in #902 I thought I'd ask, is there some way we can help with this migration work?

Yes, the UI part if not refactored at all. There are multiple elements to work on.

@Azgaar Azgaar changed the title Migration to ES modules using Vite FMG 2.0: codebase refactoring and modernization Feb 19, 2023
@Azgaar Azgaar changed the title FMG 2.0: codebase refactoring and modernization FMG 2.0: Codebase refactoring and modernization Aug 11, 2023
@Azgaar Azgaar added this to the 2.0 milestone Aug 11, 2023
@Caellian
Copy link

With regards to human readable remark - I don't see how a human readable format could be structured.
BUT, SVG supports metadata which means that maps could be exported as a simplified rendered SVG with current JSON stored in minified format as embedded data.

Benefit of doing that would be that saved maps would have proper thumbnails on certain OSs and could be previewed so the user knows a general layout of the map they're about to open.

@Azgaar
Copy link
Owner Author

Azgaar commented Oct 30, 2023

With regards to human readable remark - I don't see how a human readable format could be structured. BUT, SVG supports metadata which means that maps could be exported as a simplified rendered SVG with current JSON stored in minified format as embedded data.

Benefit of doing that would be that saved maps would have proper thumbnails on certain OSs and could be previewed so the user knows a general layout of the map they're about to open.

There is no intention to store map data in svg. SVG can stay for a while, but the ultimate goal is to separate data from view, so the .map file can be even potentially rendered in other systems outside of FMG.

@Azgaar Azgaar mentioned this pull request Nov 1, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants