Went down the rabbit-hole of #egui & #bevy. Managed to get something "functional", but it was utterly unmaintainable code. I built a tileset palette and was able to draw on screen, but it was limited in how I was using egui.
Then I took a week off of work to focus on the editor. I hate UI work and the only way to get past it was to just get in done. The key to getting it done was someone on the #bevy discord directing me to a discussion on the github about implementing egui widgets as SystemParams: https://github.com/bevyengine/bevy/discussions/5522
Literally every place I hit a roadblock, there was an open PR in bevy with a fix. Side-note every one of these PRs is opened by MrGVSV, so they became my absolute favorite person that week.
I did this research into #bevy reflect internals because I started doing load/save with bevy_save. I was misuing it to generate multiple save files in user-specified locations. It gave me a good jumping off point, but ended up being a dead-end.
bevy_save deserialization is done via reflection. Right now every type (even nested types) must be registered with bevy_reflect for this to work. I also hit some Hash reflect headaches too.
Both of these have open PRs, so they'll be resolved.
At this point I took a few steps back and reconsidered what I was doing. I realized I shouldn't be saving #bevy Components for a map editor. This is a generic editor for the moment so I can learn things. The output should be a fixed format, not whatever trash I happen to have in my components at the time (there's a lot; you'll see).
So I took another approach:
Take the entities in the world and construct an intermediate Map representation, and serialize that.
And then my dog died, and that really fucking sucked. Still does. He was a real good pup.
Hard to want to write do anything when you're crying all the time.
After using the level editor for a while, I realized placing tiles by hand is the absolute worst way to do it, especially when you have to manually rotate & select the proper path piece to place. So I'm working on an entirely different approach for level editing next.
Ok, very much in over my head. Went looking for a very dumb example of running a shader in bevy. No uniforms, no craziness, just let me act like this is shadertoy.
So #bevy has so many wonderful examples, but when you're looking for something simple in rendering, all of the examples tend to look way more complex than what you need. So I decide "naw, none of these are it", so I went and read a bunch of code & examples and wrote my own:
Then some of the rendering people in the discord directed me to the post-processing example, and after understanding things I saw it was what I needed. Learning is great! (and updated my gist)
As of today I now have an infinite hex grid shader in #bevy , with the current cursor position highlighting. Sharing source code because it's always helpful to have an example: https://github.com/dmlary/bevy-hex-grid