econrad003 / yaMazeImp

Yet another maze implementation
GNU General Public License v3.0
1 stars 0 forks source link

Inform7 code #10

Open econrad003 opened 4 years ago

econrad003 commented 4 years ago

One thing that I'd like to do is to generate inform7 code from a maze. This issue is a place for thoughts on this,

For example the maze consisting of cells named foo, bar and baz where foo is linked north of bar might generate inform 7 code that looks something like this:

Foo, bar and baz are rooms.  The description of foo is "the dining hall".
Foo is north of bar.

This might have an intermediate csv representation that looks something like this:

cell,direction,neighbor
foo,north,bar
bar,south,foo
baz,,

or maybe something fancier like this:

cell,foo,"the dining hall"
cell,bar,"the sleeping quarters"
cell,baz,"nowheresville"
link,foo,north,bar,twoway

Of course it would be helpful to be able to load and save the csv code.

econrad003 commented 4 years ago

My thoughts have shifted on this. Instead of a CSV file, I think an INI configuration file makes more sense since data needs to be gathered into groups. In either case, the configuration is editable. I hope to have a prototype soon that uses a basic 8-neighborhood plane extended to three dimensions with "up" and "down".

econrad003 commented 4 years ago

First steps of an implementation have been included in the September 10 update. Still more to do, but I can now generate an INI configuration file from a maze on a 3-D grid (class Grid3d defined in grid3d.py) has the required code, and I can generate usable Inform 7 code from the INI file.

The next steps here:

  1. Recover the 3-D maze from the INI file
  2. Clean up the Inform 7 code
  3. Add a few more hooks to allow more workflow prior to generating Inform 7 code

By that last step, I roughly mean a cycle of the following sort:

maze generation (python) -> SAVE -> INI edit -> LOAD -> python -> SAVE