Skip to content

Improve directory structure #45

@fleskesvor

Description

@fleskesvor

We should improve the directory structure of custom scenes to improve re-usability.

What this means is that scenes and their direct dependencies should be compartmentalized to make it easier to build a mental map of how the game is structured, plus make it much easier to re-use things like player characters and action menus in new rooms.

A rough layout might look something like this:

scenes/
├── characters
│   ├── astronaut
│   ├── detective
│   └── doug
├── items
│   ├── bag
│   ├── board
│   ├── boulder
│   ├── moai
│   ├── pedals
│   ├── pipe
│   ├── rug
│   ├── screw
│   ├── seat
│   └── ship
├── menus
│   ├── doug
│   └── space
└── rooms
    ├── clock
    ├── cop
    ├── doug
    ├── hub
    └── space

Where each directory contains a scene (*.tscn file) and a sprites/ directory with the files it uses, plus an animation GDScript file in the case of player characters.

The advantage of this is that if we eg. want to make another doug room, we can just instance the doug player scene and the doug action menu into it without having to either duplicate them or create direct dependencies on different rooms.

Escoria scripts (*.esc files) should remain in the rooms they are used, since we might want to re-use items but have interactions trigger different actions depending on which room they belong to.

This isn't a trivial change, since it will break references within scene files (*.scn and *.tscn), but it might be broken down into manageable chunks by creating the scene directory structure and start moving a few things, like the player scenes at first. Thankfully, Godot has a nice menu for fixing broken dependencies, which will make this task easier.

For reference, there's 187aaa9, which I'm not sure ended up doing much good.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions