Protobound Day 12

No sleep today, starting at 4am because there was just no way I was getting any rest. Laid there in bed for 5 hours and could not sleep at all. I might go pass out at some point during the day, I can't be sure.

Drinking some tea to try and wake up a bit. Today's likely going to be a slog. I will at least get saving and loading done, if I have energy and finish early enough I will attempt to add a skill system in, otherwise I will just check out once I finish and lay down or work on a web project, maybe simplify my server management in some way.

For the saving and loading, first I will try to write out the map scene and it's contents to a json file. Once I verify that is working I will create a base scene to be the default scene... maybe like my scene manager for the MMO project (Which was a mistake for that but wouldn't be a problem for this.) that will instantiate the objects and state from within the file.

I will have to be grab the singletons somehow if they are not including when I inst2dict the tree. But this is all speculation, I have no experience with this stuff and will mostly be winging it. What else is new? Anyway I am going to get on that saving file thing once I wake up a little more. Don't need to be making any stupid mistakes I will be debugging all day. If I am not more awake by 6:30 I'll just get started anyway and suffer for it later(maybe).

I also want to move this big ass CRT TV that was left in this place when I moved into this place to the office for breaks. I need more space in the living room and it would be a pretty good monitor for my arcade system as well as my PS2. Hopefully do that over the weekend so next month when I take breaks from studying blender I will have something to look at for somewhat realistic inpsiration. If I can get to PS2 quality models in a couple months time I will be pretty happy. Though I don't expect I will. It's one of those things I will need to practice at and keep doing so I don't get rusty.

I got rusty with my pixel art because I stopped for so long. Originally I was planning to make a sprite a day but things got all screwed up. I have managed to mostly wrestle my days into some kind of routine again, at least enough to be doing these projects. I would like to maybe get setup where I practice my skills in the mornings and work on projects in the afternoons until I have some more focused work or projects. Playing instruments for 15 minutes each a day, making a sprite and a model. Even if I just work on a single model for a week for x minutes a day or a single sprite in the same vain I will make more progress than jumping around constantly. I'm always going to be writing code so it's not like that's going to fall behind, right?

I also have to do some testing with the 3D printer for a larger print, I need to start printing and testing stuff to put in the gecko tanks. I have some polyeurathane to seal prints with as well as some PETG filament to try out but I haven't had the time to do any really large prints and I need to get a camera installed on the octoprint hardware so I can kill the print if it goes wrong and not waste resources on a failed print.

Wow, feeling floaty. Been a bad week for sleep.

Guess I will get started. Here's hoping I don't fuck it up too badly.

Wall number 1: inst2dict expects the object you call it on to have a script. This can not be called on Root to save the state of the entire game. Welp.

to_json() also doesn't do what I thought it did. I think I confused it with Unity there. I knew this was gonna suck.

This is why you add your save system from the very start. Foolish on my part, expected something that wasn't there. Should not rely on such things.

Honestly questioning why I want a save/load in a prototype to begin with. Probably just the tiredness getting to me. I managed to save and load everything BUT the player... somehow. I think this has to do with my data manager which has code to destroy any duplicate player nodes... which is a stupid way to handle such a thing in the first place so I guess I will fix that. The loading system could be seeing the newly loaded player as a duplicate and destroying it.

Well, alright then. It's not that. I'm not sure what to do. I guess I could construct a dict in the Data Manager of all the things I want to save and just write that out to a binary file, then load it through the load scene, constructing the scene from it. While I would rather just save the state of the game like a snapshot... apparently I can't easily do that.

Sleepy brain is really struggling here. I did manage to wander off and find a wavetable synth sound font for my vlc plugin to play midi the way it sounded when I was younger. So I got that going for me, which is nice. I've got something like 160,000 midi files knocking around so it's nice to be able to play them on this machine now. Ah, good old midi.

Anyway, the saving problem... I guess the best thing I can do is construct a dict in the data manager with a path to the current map, the player as a whole(somehow) and serializing that.  Then loading it in the same way.

So I decided to test my data persistance just between maps...

The fuck I do?

So I will need to rely way more heavily on the DataManager and also start getting them flags on the player. It's baaaad. I mean real bad. Many things need changing. Bad day for it. I am gonna hate this project by the time I am done with today.

One bite at a time.

So first, the DataManager. It needs to update the player data it holds every X seconds, on save or when map change is triggered. This means the player needs a timer that will fire a Save_Me() function and update the player object in the DataManager. This requires duplication. Ohhh fuck, that's gonna wreak havoc on so much if it doesn't duplicate right.

Mama, send help!

Better make some tea to wash this shit sammich down. The first bite's a doozy.

Well, I am learning a lot about Godot the hard way. In trying to set the flags properly to not have party members spawn as NPCs on map reload I have managed to DESTROY ALL PARTY MEMBERS on map change. I am unsure as to why this is aside from the duplication function perhaps not persisting data as I expect it to?

Good thing I dropped the skill system, I would not be able to do it in time, no damn way.

Maybe a scene manager is required here. Dammit, should have gone with my first instinct. WELP let's get on it, then.

Scene manager is responsible for loading the maps and putting the player in the right spot in them. If the Load scene does not pass a player object, it's a new game. Load the first map and set it up.

Did I say sandwich? I meant party sub.

Yum

Now I'll need a deciduous en-o-gee drink to wash it down.

So I am attempting to reparent the player to the scene manager on map change. It seems to work but then doesn't. I'll remove the rest of the code after the reparent and see if that works as intended or if something is going screwy.

Well, it crashed. There is no log. This is looking like I wont be able to figure it out today. Getting that "why am I even bothering?" feeling. I know it's because I am really tired and not up for this level of shit... and I said I would do this so I have to do it.

Why would reparenting something be so hard? It seems like yout have no choice but to duplicate. I googled, found someone else's solution. Same crash. Hmmmm... I'm starting to really regret choosing such a complex project to learn with.

I rewrote the code for the 8th time and it works now. Don't ask me why. Fuckin' sorcery.

Well, it kinda works. It does not correctly reparrent back to the map's floor node so I got that to deal with. Back to the same crash but at a different part. Code is identical functionally so I am confused. I always had trouble with the reparenting thing in Godot. It should really have a change_parent(node, new_parent) function built in.

Now it wont even work with a duplicate. Ow my headmeat.

Yeah, now it's crashing at code that runs before the code I changed that was running fine before I changed the code that runs after it. It should have no effect on the code before it but here we are. Leave it to me to create a bug that travels through fucking time.

I got nothin'.

Just nothin'.

I mapped it out and looked at the flow and added print statements even, since the debugger is kinda useless when it just straight crashes. It crashes without printing anything from BEFORE where the crash COULD occur. I am lost. It's not even printing on the player entering the area2d trigger which happens WAAAAAAAY before any of this logic can fire. WHAT THE HELL IS THIS!?

Restarting Godot... maybe I broke the engine and it will be fixed after that?

No. I'm beginning to think Godot may not be able to do what I want it to, like perhaps I have pushed it too hard somehow. I have seen what seem to be far more complex games than this rinky dink pile of code but I managed to break the engine in such a way that I can not debug it.

It's broken me.

All I know is it breaks the second the player touches the area2d unless I comment out the reparenting code and just leave the node as a child of the SceneManager, then it just loads the character underneath the world (as you do).

I'm not sure I can complete the project now. I don't know if it's just because I am tired or what but I feel like even if I do manage to get this working... there is going to be just a cascade of bugs or other insideous bugs that are just waiting for me to do anything. So it would probably take longer than the week and a day I have left and with the way my sleep has been I will likely have a few more days like this where I am just completely fogged and unable to focus.

I could get rid of map changes completely... just have it all outside and scrap any semblance of a story.

The idea to move forward was to keep working with Godot while I picked up 3D art skills and hopefully by the time 4.x came out I could move into 3D game dev. I wanted to come back to Godot because I do like it and it does show a lot of promise but then I run into these weird, cryptic problems that I usually solve with some hackery and come back to find my hacky sand castle has been crushed under the weight of the game I put on top of it. I google around trying to find answers and never really get anywhere.

I was also considering giving Unreal another shot, so I could make a prototype in each of the engines I have used so far since I planned for 3 months, 3 prototypes and already did one in Unity... this is the Godot one and then I would try to make something simple with Unreal.

I really don't even know if sticking with game dev is a good idea, I keep going back and forth on it and I feel like I am wasting my life with it... but at the same time it is something I usually enjoy doing quite a lot.

I hate the game industry, don't want to work in it. The only way I would even bother is if I joined an Indie team or started my own project. The odds of any success in either of those options is veeeeery slim wheras I could be writing APIs and Backends which I also kinda like doing and make more money and have more security.

So when I hit walls like this I will usually struggle on for a good long while... but eventually I will get worn down and start to slip into existential dread. I'll start to think about the things I want to do with my life, the things I would be contributing to the world and what my life would be worth in the end. I think about my goals and how I would accomplish them. I never feel any closer or like I gain any worth no matter what I accomplish here.

I would like to be building robots, really. I mean... that's kinda the primary goal for me. I don't really know how to get there from here. I know game dev can help me... I can pick up skills to simulate things for robots and figure out how to write AI to deal with simulations. I can learn the 3D skills I would need to create chassis and parts to build them physically with 3D printing and laser cutting.

Thing is I also do like game dev and I do have one particular project I would really like to make, it's the reason I started programming in the first place. Aside from the existential issues the main thing in the way of this project is the tools and current status of my skillset.

To complete this project I would need to write a server ecosystem which I am getting better at, I keep plugging away at managing servers and writing server code. I need to learn 3D dev because the only reason I keep trying to do it in 2D is because I can't yet make assets for 3D. It's the main thing holding me back there. Am I wasting my time continuing with 2D dev if I intend to move to 3D dev as soon as I can? Not completely, I don't think but it is somewhat inefficient... I could be spending the time picking up the missing skills.

One thing is certain. I am not getting anything done today. I will take a day and decide tomorrow if I should continue. I don't think I will but I might get a second wind and find some reason that finishing would be worth it in the end.

I might give myself the weekend to think it over. I'm probably going to be out of comission until Monday as it is so I may as well use that time to really consider what I should do. I could just go back to trying to figure out Unreal Engine now that I have Clion and work on learning my way around Blender as well. There are a lot of project I want to get around to and I just never set to doing them. I would like to pick up the Guitar and Ocarina again and will probably take like 20 mins a day on each for practice. It's been a while... could get back into drawing again, learn digital painting. Got that breadboard computer project and some robot projects I want to get to... I want to write a TCP/IP stack to understand that better. So many things I want to do that will further the skillset I am trying to cultivate.

Mantilogs needs some love too, it's desperately in need of better forms and some front end improvements. Gotta get on adding that API to it as well. Probably wont use Django Rest Framework, really sick of frameworks getting in my way. I might stick with Godot. I might just opt to start on a different prototype project with the things I learned from this train wreck in mind.

There's a lot of ways I can go from here. The most important thing is that I learn from this and I will keep the code no matter what I end up doing so I can come back one day and finish it if I do abandon it now(assuming I ever feel like it, this was a learning project not meant to be taken incredibly seriously to begin with.)...

I got stuff I need to do around the house I have been putting off so I could work on this too, could get caught up with housework. Maybe mess around with a MUD or screw around with Intersect Engine and get some kind of world creation going there.

I could also go off the deep end and learn MonoGame or SDL or something. Figure out how to write my own engine so I don't have to play by other people's engine's rules, dammit! Renegade engine! Maybe.

What did I learn from this?

  • Write the save system at the start. Add onto it as needed.
  • Have a solid way to persist data between maps or do not have map transitions.
  • Spend more than an evening planning the big picture.
  • Week-by-week planning works well for me. I'm pretty good at keeping scope narrow if I have determined my deadlines ahead of time.
  • Don't work when you are exhausted. It makes things worse than doing nothing in many situations.
  • It's okay to bite off more than you think you can chew as long as you know you'll probably fail. Get as far as you can and you'll learn a lot.
  • I probably could have done it if I was more familiar with the parts of the engine I had trouble with.
  • I had trouble with the way tilemaps work in Godot.
  • I also had trouble with reparenting objects reliably. The same code would work for some things some of the time but not all of the time or all of the things.
  • I should draw how the data will flow on the whiteboard before I start coding. It'll keep me from writing reduntant functions.
  • I miss playing music. Strange thing to realize while doing this but for some reason I found myself wanting to play music or draw a lot of the time.
  • If I start another 2D prototype I should make it simple, maybe use external resources aside from the graphics. Allow myself time to create my own graphics and music and really make it a simple concept. Maybe pick one mechanic and focus on that.
  • Maybe I should release a clicker or something really stupid simple to at least have one completed game project out there.
  • UI flow is hard to figure out on the fly.
  • I'm more productive with Discord closed.
  • I'm less depressed when I keep busy.
  • Blue light does seem to have an effect on my energy.
  • I kinda want to make an RP heavy multiplayer game sorta like Space Station 13.
  • I should make a full game after the next prototype.
  • I want to move into 3D, given that I could benefit in other areas by doing so but I still really do enjoy the pixel art aesthetic and like to draw pixel art.
  • GDNative probably isn't as hard to use as I felt it was after a day of fumbling around with it mostly blindly. I still need to figure out how to get 3rd party libs to work with it, though.
  • I'll fight every engine I use, it doesn't really matter which one I end up choosing. (Though I think Unity is the best bet I have if I wanted to join some Indie team)
  • Sleep is important to thinky work good. I forget this a lot.
  • I should find a way to reliably use Tiled or some other external world building utilities for Godot maps.
  • I might benefit from making individual, stand-alone, distributable systems for other people to use in Godot or other engines.
  • I prefer the way C, C++ and Rust handle memory to the way it's done in higher level languages like python and GDScript. It's much clearer what's a reference and what's a copy.
  • Static typing would have saved me a lot of headaches. I should use it for GDscript for whatever I do with it in the future.
  • I shouldn't spend every weekday on game dev unless I have to. Even finishing early the last 2 weeks I managed to end up having harder and harder time sleeping at night. This could be something else but I wont know until I experiment.
  • I wear a lot of hats and I can't force myself to only do one thing. I have to exercise all of my skills or I start to get depressed. The small amount of pixel work I did actually made me feel good even if I did half-ass it.
  • I need to spend more time in the visual arts again, I find holding images in my head is harder now that I've been solid logic for so long.
  • I can add trance to the list of music styles that are fine for background while I am coding.
  • I can always get into working on something even if I really don't want to do it before I start.
  • Maybe start a youtube channel if I can.
  • I need to get involved in some communities. Being the only person I have to bounce ideas off of leads to some really dumb shit and maybe people could benefit from the hard lessons I learn.
  • Just make thing.
  • I am either going mad or there are glowy fireflies out there flying around the trees in 4 degrees F which defy any google search results I have come up with. (Unrelated, maybe, depends on if this project was the thing to finally drive me fully into madness.)

With that I am gonna check out. Was I ever really here today?

Cheers.