Skip to content

Add an in-game editor#62

Draft
psyGamer wants to merge 101 commits into
FujiAPI:devfrom
psyGamer:editor
Draft

Add an in-game editor#62
psyGamer wants to merge 101 commits into
FujiAPI:devfrom
psyGamer:editor

Conversation

@psyGamer
Copy link
Copy Markdown

@psyGamer psyGamer commented Mar 10, 2024

Adds a currently still very WIP in-game editor.

Current TODO list:

  • Actor placement/selection
  • Actor picker for placement
  • Tool system
  • Local and global world spaces
  • Geometry editing
    • Vertex editing
    • Edge editing
    • Face editing
    • Vertex snapping
    • Edge snapping
    • Face snapping
    • Vertex colouring
    • Multi-texture fade
  • Play testing spawn locations
    • Position you were last at
    • Checkpoint you last triggered
    • Cursor position from editor
    • Nearest checkpoint to cursor position from editor
    • A specific checkpoint
    • Start of level

Copy link
Copy Markdown
Collaborator

@jasminegamedev jasminegamedev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Source/Data/Assets.cs
public const string MapsFolder = "Maps";
public const string MapsExtension = "map";
public const string MapsExtensionSledge = "map";
public const string MapsExtensionFuji = "bin";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Source/Data/Map.cs
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Source/Scenes/World.cs

// Toggle to editor
if (Input.Keyboard.Pressed(Keys.F3))
{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Source/Mod/Editor/Map/FujiMapWriter.cs Outdated
/// <summary>
/// Current version of the map format. Needs to be incremented with every change to it.
/// </summary>
public const byte FormatVersion = 1;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Comment thread Source/Mod/Editor/Map/FujiMapWriter.cs Outdated

namespace Celeste64.Mod.Editor;

public static class FujiMapWriter
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Successfully merging this pull request may close these issues.

2 participants