Incredible. GUI level/cave editing tool

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andrew Davie

And, now I'm getting the hang of using Claude... I thought why not ask it to make a level editor GUI tool for me. So I did. And it did. About half an hour later I have a fully functional tool that pulls levels from source code, allows me to visually edit them (or create new ones), save them back to the source code (in text/human-readable format), and do a build and play them immediately.

Tool has line draw, rectangle draw, multi-level undo, and more. It's incredible; completely changing the nature of programming. Who would have thought. Glad I'm retired and not a professional programmer anymore.

Anyway, here's the video of it in action. I first load an existing cave, make some changes and then do a build/test. Working!  Then I create a completely new cave from scratch, save it, do a build and run -- worked first time.  Absolutely incredible.


Andrew Davie

Here are the prompts I used...

Here are the four prompts that built the GUI tool, in order, verbatim:

Quotewrite me a stand-alone GUI editing tool that lets me draw a cave in a 40x22 grid. Provide characters from the characterset that I can choose from graphically as my current "cursor" to let me draw those characters onto the board. Give me a "save" menu option to save the board in the source-code format. The extents of the cave are determined by the boundary of the non-0 characters. represent char 0 (blank) with a thin red 'x' through the character. On saving/export, try to break down into draw_filled_rect, draw_line, etc., to reduce space. Look at the caves in caveData.c for format. You can use the tool cave_visualizer.py to check your workings (that your compressed cave decompresses properly). allow the tool to import caves from caveData.c for editing. If we import and edit a cave, allow it to be over-written (save) or written as a new cave (save-as). we only need one representative character of each TYPE in the char selection menu. Try to include the character name (e.g., "CH_DIRT") as a tooltip on the menu selections.

Quoteit's briliant so far, with minimal test. TY. Can you please put a zoom on + and - so I can see the board better?

Quoteit's really awesome so far. TY.
Tooltips are unreadable — ust a kind of yellow shape (with white text?) if so change text to black
Please for the CH_MELLON_HUSK character put a front-facing player sprite shape instead of the character.
add a multi-level undo on Command-U and also in an edit menu.

QuoteTooltip on menu has diamond sides -- change to square sides like the tooltip for the board.
Drop the CH_ prefix and just use the name (e.g., CH_BLANK --> BLANK). In the board tooltip, just use the same (no type as requested last pass).
Move undo onto CMd-z and redo to Cmd-shift-z
Init with mellon husk in middle of board. If a new mellon husk is placed then remove the old and replace with CH_BLANK.
put the line draw on shift-click, and the box-draw on shift-cmd-click
You're doing an amazing job, TY.
Add an edit/clear board command which will clear the board (but remember, insert mellon husk at middle)

That it, in total. And I get what the video shows. I'm still pretty much... flabbergasted.

Andrew Davie

More features.  Palette for character menu selection. Cave properties. Random object definition. Defined border size/areas.

In the video I create a complex new cave from scratch, and then run/play it. I see there's a bug in water level init. I go back to the editor, disable the water, save and do a build. This is gonna make 100 custom caves really quick to make. I'm impressed, really.

There are a few unimplemented things, of course, but for a few hours total work this is remarkable.
I'm out of Claude credit for now - will have to wait till the next reset.


Andrew Davie

#3
GUI tool much improved. Now has multiple tabs (for editing several caves at once), generates a png image of the cave on save, has a "control view" which shows the geometry connectivity (lines, rectangles) when ctrl is pressed, rectangle and line draw, delete, undo, bounds editing/handling, out of bounds areas, random object definition, scroll limits, and much more.

In the rather long video I go through an entire editing session, creating a complex cave - and install it in the game code and then play it in the emulator. In one rather smooth pipeline.



Andrew Davie

Here is release 0.0 of the Cave Editor!
Unzip, read the CaveEditor.md in the doc directory.
TL;DR -- MacOS has a broken Tk, so reinstall as the manual says
Then run cave_editor.py in the tools directory.
Sample caves are in cave_data

Let me know how it goes. I expect maybe one person to even try it :)





Andrew Davie

I've udpated the cave editor to include the new conglomerate type, and draw the "rounded"-joined shapes in real time for both the conglomerate and the geodoge. It's pretty neat, as shown in the video.


New version attached.


marcoj

Jeepers. Something like that would take me weeks/months. I am kind of jelly, and am asking AI to make one for my game. Let's see if it can decode all the bitpack hacking in my game :D

marcoj

That is impressive, and kind of scary. It even worked out the Atari colour palette, and even presented the RandomTerrain palette as an option for it's source.

Andrew Davie

Quote from: marcoj on 22 Aug 2026, 10:02 PMThat is impressive, and kind of scary. It even worked out the Atari colour palette, and even presented the RandomTerrain palette as an option for it's source.

Very impressive!  Changes the nature of programming, as I said.

Andrew Davie

Quote from: marcoj on 22 Aug 2026, 10:02 PMThat is impressive, and kind of scary. It even worked out the Atari colour palette, and even presented the RandomTerrain palette as an option for it's source.

I have erase object on right-click (two-finger-tap).
I also have different view modes on the ctrl and option keys (showing automatically generated objects vs. manually edited). The tool also optimises the data so redundant edits are not included.
And - a feature i really like -- it renders a PNG of the level when I save, so I can always go look at that to see a rendering of what it should look like. I link to that PNG in the source code it generates, so I can shift-click on that in the IDE to see the PNG. Super cool!

Andrew Davie

I've added a "Planet Linkage" mode to the GUI tool. This lets me link teleports and doors to the destination for the player to go to when these are used.  There are 11 planets (one test planet for learning how to play properly), and each planet consists of 10 levels. The levels are interlinked in a "random" way -- that is, it's not linear. Depending on which door or teleport you use, you end up at a different location.

I wanted to make a way to easily visualise and edit these links - and thus is born the planet linkage editor (a part of the cave editor). I show it in action in this video. I'm manually creating links from the auto-detected and highlighted doors and teleports to destination locations on other levels.

It uses the levels that the cave editor was used to create, and updates whenever you update those caves. It's pretty cool.


Andrew Davie

The planet linkage tool is working - and all of the doors and teleports working as linked in the editor. I can now setup 10 planets (well, 11 with a test planet) each with 10 levels + landing level.  The real task left, then, is to design the levels and do the linkages.

The planet link tool outputs a graphical representation of the links, as shown.


Andrew Davie

Updated visuals.
And a binary to test!  You should see the links work exactly as shown in the image.



Andrew Davie

Here's a bit more video of the cave editor/planet link editor in use. I've refined things a bit. Note the new open level dialog gives a preview, the links are easier to see. Much work on the zooming on both whole-planet and individual level.  In the video I link in a new level to the 2nd planet, and then play the game -- which at that point already has the new links that I literally just edited.


Bomberman94

When the filename says ,,ARM7" is this already a PlusCart version?