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

Editor: export generated headers to files when compiling the game #1007

Closed
ghost opened this issue Dec 12, 2019 · 3 comments
Closed

Editor: export generated headers to files when compiling the game #1007

ghost opened this issue Dec 12, 2019 · 3 comments
Labels
context: game building related to compiling the game from input assets context: script compiler type: enhancement a suggestion or necessity to have something improved what: editor related to the game editor

Comments

@ghost
Copy link

ghost commented Dec 12, 2019

Related to a task of making a stand-alone script compiler.
E.g. see #872

There is a generated script header that is never actually saved on disk, but only passed into compiler via memory. From the top of my head, these include:

  • API header; not really generated, but embedded as resource into editor exe.
  • Game object symbols declaration: includes script names and/or backward compatible numeric IDs of all the game objects from the game. Also arrays of game objects and their sizes are declared there (e.g. character[], inventory[], and so forth).
  • Variables generated by the Global Variables pane.
  • Script headers created by the plugins (iirc): they contain plugin API to be used in scripts.

The problem here is that persistent script sources alone are not enough to complete the game script compilation outside of the editor. Therefore all the above should also be written to disk as a preliminary step.

This may also help analyzing any compilation problems, because above headers are not normally accessible by end users.

Questions to consider:

  • where to export these to (project root dir, or special "intermediate output" directory).
  • when to export...; obviously, if user changes game data, but does not recompile, the last written generated headers will become off-sync. Is this going to be an issue? If so, what could be done about this?
@ivan-mogilko ivan-mogilko added type: enhancement a suggestion or necessity to have something improved what: editor related to the game editor context: script compiler context: game building related to compiling the game from input assets labels Dec 12, 2019
@rofl0r
Copy link
Contributor

rofl0r commented Dec 14, 2019

API header; not really generated, but embedded as resource into editor exe.

isn't that agsdefns.sh ? i already supply that together with ascc.

Game object symbols declaration: includes script names and/or backward compatible numeric IDs of all the game objects from the game. Also arrays of game objects and their sizes are declared there (e.g. character[], inventory[], and so forth).

i'd suggest to export these as ash file with a comment on top like "do not modify, generated by engine".

when to export

yea, i'd vote for "whenever xml file is written"

where to export

project dir seems like the obvious choice.

@ivan-mogilko
Copy link
Contributor

Note: because #1146 is now a ticket dedicated for writing standalone tool, this ticket may be seen as a task of removing same operations within Editor and replacing with calls to standalone tool(s) instead.

@ivan-mogilko
Copy link
Contributor

I shall close this, because original idea for this ticket does not seem suitable anymore, after there are tools that generate this data from game project files.

Perhaps we may return to this question when we make Editor use standalone tools instead of running operations internally.

@ivan-mogilko ivan-mogilko closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context: game building related to compiling the game from input assets context: script compiler type: enhancement a suggestion or necessity to have something improved what: editor related to the game editor
Projects
None yet
Development

No branches or pull requests

2 participants