Add an in-game editor#62
Conversation
jasminegamedev
left a comment
There was a problem hiding this comment.
This is just an initial review since this is still just a draft, so I wasn't super thorough, and will probably still do a more thorough review when it's done.
| public const string MapsFolder = "Maps"; | ||
| public const string MapsExtension = "map"; | ||
| public const string MapsExtensionSledge = "map"; | ||
| public const string MapsExtensionFuji = "bin"; |
There was a problem hiding this comment.
I feel like "bin" might be a pretty common file extension in general. If this is a custom format, we may want to come up with a custom extension, just to avoid confusion.
There was a problem hiding this comment.
I think if possible, I'd prefer to leave the current Map file alone instead of renaming it to Sledge, and have this new base map file be named something else instead. Since we're trying to be more careful about not causing breaking changes as much anymore, I don't really want to risk that someone may be using the map for things already, and have that break unexpectedly.
Also probably unlikely, but if any upstream changes are made to the Map class there, it will make the conflicts less messy to sort out as well.
|
|
||
| // Toggle to editor | ||
| if (Input.Keyboard.Pressed(Keys.F3)) | ||
| { |
There was a problem hiding this comment.
Not super important yet since this is still WIP. But I feel like maybe this should be tied behind a setting or something so they have to manually opt into it, similar to what I did for the debug menu, so non-modder players don't accidentally bump the key and open it on accident.
| /// <summary> | ||
| /// Current version of the map format. Needs to be incremented with every change to it. | ||
| /// </summary> | ||
| public const byte FormatVersion = 1; |
There was a problem hiding this comment.
Probably not important while you're still setting this up, but in the long term, we should probably set up a system to upgrade the data when tries to read a map saved in an old version.
| } | ||
|
|
||
| public abstract class EditorDefinition | ||
| { |
There was a problem hiding this comment.
Is the idea that every actor would need its own Editor definition set up for it? Or is there going to be a common definition that is able to load all actors?
It would be nice if we could reuse as much of the actor setup as possible from the existing structure, so modders don't have to define all their actor data twice if they want to be able to use it in both formats, like for common actors shared between multiple mods. Or make it easy to support both with just a few attributes or something.
There was a problem hiding this comment.
Also, just a minor thought. If we do expect to need to create a lot of editor definitions for things, we may want to come up with a more clear name for it, because it wasn't immediately clear to me what this was. The editor prefix made me think it's a component of the editor itself. Maybe something like ActorDefinition might be more clear? (if that's not too confusing with the base actor class)
|
|
||
| namespace Celeste64.Mod.Editor; | ||
|
|
||
| public static class FujiMapWriter |
There was a problem hiding this comment.
Wonder if it might make sense to merge the FujiMap reader file and this FujiMapWriter file together, since they're working with a lot of the same data.
Adds a currently still very WIP in-game editor.
Current TODO list: