VERGE-RPG
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. Coolcoder360
    C
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 63
    • Groups 0

    Coolcoder360

    @Coolcoder360

    82
    Reputation
    19
    Profile views
    63
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    Coolcoder360 Unfollow Follow

    Best posts made by Coolcoder360

    • Coolcoder360's Devlog/updates thread

      I guess there’s this Gruedorf thing, may as well participate and hopefully have motivation/accountability on this project.
      I’m not working on a game yet, just a game engine that I have code named “Nebula 3” which is my 3rd complete re-write that I’ve named Nebula, probably my 10th rewrite of a game engine in total, over the course of something like 7 years or so, but this one is the final rewrite I’m sure.

      Basically Nebula 3 is a 3D game engine that uses an ECS(Entity Component System) under the hood this time, which I got pre-canned in the form of Flecs. Flecs lets me focus less on how to store objects in the world and more on functionality, which is great because all my previous iterations had 3d functionality working, but not a very good method of storing entities in the world.

      Currently in addition to the ECS, I have Lua scripting working, and I’ve implemented a basic OpenGL renderer for now, and I even have input binding, and text input working. With a working console even.
      There is a separate rendering and update loops, with all Lua calls for the input being handled in the Update loop due to some quirks with the ECS system not liking things changing while it is running the systems.
      In addition, Unicode support is a thing that actually sort of works too, character input is given as UTF-32, converted to UTF-8, then back to UTF-32 to render the text, tested with Japanese, only issue is switching fonts to support the characters needed.

      I can’t show any screenshots as I found out that for some reason my full screen OpenGL window doesn’t show up in screenshots, so I guess I’ll need to implement in engine screenshotting capabilities, which was already planned, just moves the timeline up a bit.

      Plus before the screenshots can be captured, I have another segfault to deal with, this time I believe caused by attempting to load things onto the GPU in the update thread, I need to queue items that need to be loaded to the GPU to be done on the render thread instead of the update thread. This was caused by re-arranging things to be done completely from Lua scripts instead of hardcoded C++.

      Next steps include: fixing above mentioned bugs, working further on UI elements, and porting over old 3d rendering and model loading code from older projects,

      The UI is planned to be “done” with an in-engine editor in a working state by the end of March 2021. With an in-engine console with console commands counting as an editor.

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      So in-between when I wrote that post and now, I’ve fixed my crashing, split the textures and fonts to load the data in the update thread, but load the textures to the GPU in the render thread, and added screenshot functionality to my engine.

      So behold, I have an FPS counter which keeps track of how often the render thread runs per second, as well as a TPS (Ticks Per Second) counter which counts how often the update thread runs per second, locked at about 60TPS.
      Also I have a console that has working text input.
      Screemshoot_02-09-2021_2233.png

      I promise the texture rendering works too, I just was too excited from getting both my crashing issue and the new screenshot feature working that I decided I didn’t feel like throwing a texture in there.
      I’d say today has been a productive day 😄
      Maybe next week I’ll have buttons and graphics to show off more of.

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      Missed a couple weeks, been busy with life things.

      So far I decided to kind of temporarily scrap the schedule I had for my game engine, and just go forth and add in the 3d stuff right away instead of waiting, since that seemed a little bit more interesting than just doing lua bindings. So I ported all the mesh/model loading stuff I had from a previous iteration, then realized I need to add lua bindings for that too now…

      I’ve added in the components to how I think I want to put meshes and models into my ECS, but I have not touched rendering stuff just yet, since well I want the lua scripts to be able to add the meshes/models to the scene, so the lua bindings must happen first.
      In a week or two when I get around to finishing the lua bindings then I’ll have the fun task of testing all these lua bindings I’ve been adding, and fixing all the bugs that will inevitably spring forth.

      Hopefully at that point I’ll be able to make a demo/test showing off the UI buttons which are yet to be tested, as well as the 3d model rendering.
      I know the loading works from my previous iteration, I basically copy pasted the code from there.

      For the model loading I use Assimp, which allows loading of pretty much any common format that I would want to use, along with loading in the animations. I haven’t bothered tackling animations yet in this iteration or any previous iteration, the skinning is a bit complicated for a first go, and I’ll need a way to keep track of animation frames/keyframes to play it back, so that’s very much an in progress thing.

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      Bout time for another update I think.
      So I got the 3d movement and spawn/exit location picking working ish just after the last post, so now you can see what it’ll look like in game:
      screenshot000.png

      Yes movement works.

      Then I also made the map look much better too with map zoom and scrolling buttons:
      screenshot001.png

      The reason I say the entry/exit location picking works-ish is because I’m not really satisfied with the location selection, basically right now it just chooses the tile, then loops through the tile to select the nearest “open” square, it does this because I didn’t bother to have it track which tiles have the spawn/exit values in them, so right now it’ll end up putting the player and the exit into the middle of a hallway.

      You can see the player as the yellow circle on the above map, and the exit as the blue square.

      I’ve thought about potentially having the map track/only update if you’ve seen an area, but that seems like potentially scope creep I don’t know that I care for, so I’ll probably look into that after I get enemies and combat working, since that’s like the next things required to make this actually be a game.

      I think next time I’ll try to have more UI figured out, not sure I’ll do inventory, but at least the scrolling text showing what happened, or what is going on would be nice to have so I can potentially have debug printing in there instead of to console.

      I may also see if I can set up a jenkins job to build this as well, since I already have a jenkins semi-working on my laptop, it has bad uptime, but if it works to build Linux, no problems there, then I might take a break from dev on this project to work on making a docker image to build windows builds from linux, which would be helpful so I can just press buttons to get both builds of this project. Since I plan on chunking this project out commercially prior to finishing up my game engine project.

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      Well here we are, the end of November. I 1000% got distracted by other things instead of working on the roguelike for the crunchless challenge thing I was trying to do. But hey I didn’t crunch on anything so i succeeded on the crunchless part of it! I just didn’t do much of anything programming or game dev related.

      My 3d printer came in and I got distracted and now have another new project: I’m making a redox split keyboard with Kailh box jade switches. Parts are all on order and arrive in January, printing the case and the keycaps myself, so far the two test keycaps I made feel okay to me, but I don’t have any other box switches to test fit them with so I need to wait until january when they arrive to test fit them to make sure that they will work.

      Back to the Game engine project

      Yeah I went back to working on my game engine project again. Still trying to get scene saving/loading working, still using json for that, and currently bored of writing save/load logic so will likely keep saving json until either I run into it taking up too much memory/space, or it takes too long to load when needed. I think lazy route is best for getting anything actually finished/shipped.

      So basically I’m stuck on writing out how to convert a bunch of different components that an entity might have to JSON, and then I eventually need to write the code to load all that back in too, which I don’t think is even started yet.

      But it has been a while since I provided screenshots, and I was super close to getting json output actually, so here have some screenshots of me showing me typing a console command to save an entity, and then let me show some json that was generated from the Entity that was saved.

      Screenshot first:
      Screemshoot_11-29-2021_223413.png

      And a screenshot showing the feedback you get from running the command, I know it’s not much feedback but its something:
      Screemshoot_11-29-2021_223416.png

      And now check out the json generated for the cube you see in the screenshot, in a file called “MeshEntity.json”

       {"EcsName":{"value":"MeshEntity"},"TransformComponent":{"position":{"x":0,"y    ":0,"z":0},"rotation":{"w":0,"x":0,"y":0,"z":0},"scale":1},"VisibleComponent    ":{"opaque":true,"visible":true}}
      
      

      I haven’t fully figured out how I want to save Mesh components yet, part of the issue is with this specific case, I don’t have a RUID/path to just store to a model, that mesh is generated in Lua, which means that if I wanted to store it I would likely have to parse/store out the entire freaking mesh into the json, including vert data, face data, texcoord data, and maybe vert color data, and texture data somehow since the texture is handled by being a material set to the mesh.

      So I’m so close yet so far. I’m hoping that if I set up model loading from files, that I can make it easier to save that out to json, and then either just won’t save programmically generated meshes, or something. idk yet.

      I also have a few other components not implemented yet, and loading hasn’t been touched at all, neither is saving the children of the entity selected to save. But still this is good progress!

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      Well Cereal has been a bit more of a pain than I expected, the examples make it all look easy, you just do something like the following:

      template<class Archive>
      void serialize(Archive & ar, NameComponent & ncomp){
          ar(ncomp.string);
      }
      

      And then now that component can be saved and loaded, with some extra setup crap of course, but that’s how its supposed to work.

      Well, I do that, but there’s little info on if you put it in the header or in your cpp file, or what, so I’ve tried a few combinations and keep getting some errors that look like this:

      Error: static assertion failed: cereal could not find any output serialization functions for the provided type and archive combination. 
      
       Types must either have a serialize function, load/save pair, or load_minimal/save_minimal pair (you may not mix these). 
       Serialize functions generally have the following signature: 
      
       template<class Archive> 
         void serialize(Archive & ar) 
         { 
           ar( member1, member2, member3 ); 
         } 
      

      And in fact it’s longer than that, and this is repeated multiple times too. So now I’ve tried doing some combination of crap like this:

      269 template<class Archive>
      270 void serialize(Archive & ar, TransformComponent &tcomp){
      271     ar(tcomp.position.x, tcomp.position.y, tcomp.position.z);
      272     ar(tcomp.rotation.x, tcomp.rotation.y, tcomp.rotation.z, tcomp.rotation.w);
      273     ar(tcomp.scale);
      274 }
      275 template<>
      276 void serialize<cereal::JSONOutputArchive>(cereal::JSONOutputArchive & ar, TransformComponent &tcomp){
      277     ar(tcomp.position.x, tcomp.position.y, tcomp.position.z);
      278     ar(tcomp.rotation.x, tcomp.rotation.y, tcomp.rotation.z, tcomp.rotation.w);
      279     ar(tcomp.scale);
      280 }
      281 template<>
      282 void serialize<cereal::JSONInputArchive>(cereal::JSONInputArchive & ar, TransformComponent &tcomp){
      283     ar(tcomp.position.x, tcomp.position.y, tcomp.position.z);
      284     ar(tcomp.rotation.x, tcomp.rotation.y, tcomp.rotation.z, tcomp.rotation.w);
      285     ar(tcomp.scale);
      286 }
      

      And I think that kind of fixes some of it? but that’s not what the docs say you can do, that’s not how the EnTT serialization example does it, and it’s specific to outputting to JSON, so if I want to switch what format I output to, since Cereal bakes in JSON, XML, and Binary outputting, then I’d have to rewrite the same function 2x for each additional format. Not an ideal situation.

      I suspect the answer is that either its a quirk of templates that I always forget about, to where you have to have the template stuff be either only in the cpp or only in the header, (And it doesn’t help I’m doing this all in a single header, where I use defines to compile the “cpp” part of it, stb header style, so that means it’s easy to confuse myself in which section I’m putting it into) or it’s to do with the Cereal supporting C++ 11 but I’m compiling against C++ 17 and something changed.

      In other news, I’m doing Cereal a little bit non-mainstream. Basically the library writes to streams, so you would usually do an ifstream to input a file directly, or an ofstream to output to a file directly. That doesn’t fit in with how I planned things, to where I want everything File/FS related to be handled by my FSManager so that I could possibly be loading stuff from a zipped archive or something else entirely instead of just files straight on the disk. So I needed to figure out how to get it to write to/read from memory so that the underlying file/whatever doesn’t actually matter. stringstream is okay for that, if you need to write strings, but what if you want to write binary streams to memory instead of to a file?

      Well I found spanstream! A feature that is part of the C++ 23 standard… which isn’t released/supported yet… So now I know how to implement binary save/load to memory later, for now I guess I’m just using stringstream but there are a few issues with that I think, specifically that I’m not sure how Cereal would deal with endianess, etc etc. Suppose that’s a battle for another day…

      Plus I’m sure I won’t really have much of anything actually implemented using this engine until like 2023 or 2024 anyways, so it’s likely that the C++23 standard would be out by the time I’m ready to release anything 😛

      ECS switch progress

      The good news though on progress with converting to EnTT is that I sort of have the hierarchy stuff figured out, the only iffy part is really in deleting the children of children when you remove an entity, I haven’t written it to traverse down the tree that far, and I’m not doing recursion on that part because of simplicity, and laziness.

      Maybe I’ll do the traversal farther down the tree at a later time, but I’m not really expecting to have many cases of children of children, but I suppose I should allow it to delete them eventually. Most likely I’ll want it all to be flat/in loops instead of recursive though, recursion just seems like a bad idea if you’re trying to be portable to a bunch of different platforms because it’s hard to say if there will be enough space for all the stack frames needed, and you can potentially loop infinitely but good luck recursing infinitely.

      Also another issue though is that this deletion all happens in the Update Thread, so it will basically hold up updating anything until it finishes, so I think not letting it get caught in a loop is likely a good idea, and for now I can just be careful about not having things nested more than one layer that will need to be deleted.

      Summary/Next Steps

      So I’m basically at the same place I was at with Flecs already, just struggling through saving/loading again/still. Just with a different type of struggle, but I think this struggle is worth it, because being able to save/load from 3 types at once is far better than the previous single type i had of just json.

      After I finish off the serialization crap I basically just need to test it, which I’ve been keeping the lua bindings updates for all this so it should be EZ PZ to just get in game, send some commands and such in the console to add some stuff, then save it out, then remove the entities I added, and load them back and make sure they’re still there.

      Then after that I’ll be pretty much done with my 0.0.1 milestone. Next would be my 0.0.2 milestone, I’ll probably need to update the Quire a bit but it basically consists of implementing saving/loading assets/scene data from archives, creating those archives (Since I’m planning to implement all editing in engine, this also has the added benefit of basically being able to bundle world editing/map making/modding tools in game, it’s not laziness of not wanting to make a separate editor, its a feature!)

      Then beyond that for the 0.0.2 milestone is basic audio features implemented with miniaudio which I think now has a high level API which does 3d spatial audio if I read the docs correctly, not sure if I’ll do that or just use the low level API as planned previously.

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      Well I’ve been trying to do Cereal, but here’s kind of the issue, I follow the tutorials but it doesn’t work for me, I can’t get it to compile because it’s for whatever reason not able to find the serialization functions I’ve written, unless I specialize each of the functions as I mentioned before, where I re-write the same thing for every combination of input and output that I want to do.

      To me that means I’d rather just write the serialization stuff myself to do Json, XMl, Binary, whatever I want to do rather than try to get Cereal to work the way its supposed to.

      Additionally, I found this issue which basically says that Cereal doesn’t work right in a recent version of clang, but they were able to work around it by uncommenting some asserts. I use g++ with cmake, but I figured what the heck, I’ll go uncomment the asserts that are causing failures too. That let’s it compile! but then I just get this for the json output:

        1 {
        2     "value0": "NameComponent",
        3     "value1": {},
        4     "value2": "TransformComponent",
        5     "value3": {},
        6     "value4": "EntityEnd"
      ~                               
      

      And what I didn’t even notice until now, I don’t even have the closing } in there. So in my mind, Cereal is out of the competition now, if you can get it to work with your compiler, great, but for me, I don’t think having XMl, Json, and Binary support if I want to write the same thing 6 times is enough for me to use it.

      So I’m planning to go back to the picojson, however this time i’m going to try to not do it the dumb dumb way, and I’ll write serialization methods for types, that way I can have less struggle of writing everything out the long way. This does mean I’m still re-writing my serialization stuff I had before, even though I kept what I had before, but I think my hope is that this means that I can more easily use the serialization again elsewhere if needed, so I could serialize things like settings, configuration, input mappings, etc hopefully more easily in the future.

      So right now the plan is to basically make a SerDes abstract class, which I would then use as a base for having a JsonSerDes and other such serialization classes, so I could potentially serialize to multiple formats that way, and then each such class would have a .save(type) function implemented for each type that needs to be serialized. This does mean writing all the serialization for each type manually, but hopefully that should be minimal effort, and then hopefully I can find a way to have Json, Binary, etc saving/loading happen by just changing which class is used, and then calling the same set of methods on it.

      This does add some complications in that Json is key/value based, and binary and other formats are not, so there may be some confusion/confusing stuff going on there to where it might not be as clear to read the Json as it would be if I did it the way I did before, but I think this will be least effort in terms of being able to write the SceneLoader to be able to save/load to each format without any extra effort, and as long as saving it out happens in the same way as loading it in does, maybe that does not matter. I could also likely allow using std::map<std::string, value> type deals to allow saving things that already have key/value pairs, perhaps there is a way I can denote the key/string in a binary format as well without much issues. Something yet to be determined I suppose, or maybe I could use BSON or protobuf for binary save/load instead of a custom format.

      On top of that, I will probably also need to get bindings together to use it from Lua, either the serialization data directly, or just have a way for Lua to save chunks of memory somehow, that way scripts can save things if they need. Perhaps I could even find a pre-canned Json library for Lua that I could include, that would allow for generating lua saves from Lua, and then just use some API to save it to disk.

      Next steps

      I’m going to keep including these next steps sections even if I keep rehashing the same crap every time. it helps me keep my duckies in a row in terms of what is next, and it’s nice to be able to see how close I am to having something usable when I’m slogging through saving/loading nonsense.

      Next steps are to finish up the save/load junk, and then I’ll basically be done with the first 0.0.1 milestone. Next up is miniaudio audio playback, likely using low level API so I can implement my own stuff on top. not that I need to spend the time implementing my own stuff on top…

      other than that, multithreaded loading of things I think is high desire, currently my whole update thread stops to load things, which means large time spend lagging out. Render thread keeps going but no processing happens there, so it basically looks frozen and is frozen. Probably going to need to look into the future/promise types that are C++11/whatever for threading. Then basically just not render/use those assets until they are loaded in. Yes this means that assets that are not loaded at the time they are needed will be invisible and pop in, I might need to implement some kind of preloading system to allow loading crap on a loading screen or with a loading bar, or background pre-loading stuff for nearby areas to load them before they are visible or needed.

      Test games/testing the engine

      After the audio stuff is done, I think it’ll be a good idea to implement a simple toy game to prove out that the lua bindings work, and everything works. I think my plan for that is likely to be a breakout clone, just because I’ve done those before, the logic is minimal, and the physics can be fairly simple.

      I also technically have bullet physics already “integrated” but I haven’t actually tested that, or implemented the lua bindings to create rigidbody components for entities, so that as well as save/load for the rigidbody component will be needed. Then a different test game will be needed, likely i’ll go for some sort of sandbox-y type thing or something where you walk a player character around and can throw things and bump into things. Just to make sure that the physics of things all works as expected.

      Once those basic tests are complete, I think it can be time to actually try to go implement a game. the engine would be mostly in a usable state hopefully by that point, maybe with some UI work to be done, I’m still not decided on if I want to finish implementing my own UI elements as originally planned, or to proceed with using the nuklear library, although I’m not sure nuklear is set up to be used with an entity/component system like I have.

      I’ve gotten a few ideas/plans together for what I would want my first game or games to be in engine, but of course I keep switching around what I would want to do, between a basic FPS type campaign game, to a horror game, to something else entirely. I think for starting out I would want minimal effort dialog and/or just no dialog options/responses, and no quest systems, that would let me prove out and thoroughly test the basic features before moving on to implementing further elements that would not be able to be thoroughly tested until later. Likely i would add an achievement system before a branching dialog and quest systems, so the achievement system could be tacked on to an existing campaign style FPS game I think.

      Or alternatively, I could just jump around between prototypes, slowly building up a library of 3d assets and scripts that could be re-used in other projects. hard to say.

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      Time again for another update.

      First I wanted to show off the Unicode text rendering, since it took me ages to figure out how to store and render Unicode. I’ve yet to fully test unicode input. My Japanese keyboard input just defaults to Alpha-numeric. The chinese keyboard input sort of works, but I got a crash from trying to input a couple things with it, I guess I need to work on getting test automation set up for this thing since it likes to crash so often and so randomly.
      Screemshoot_02-15-2021_170704.png
      One of the reasons that Unicode rendering took so long, is that it’s impossible to pre-load all of the characters that could be used, so I needed to figure out how to load them on the fly. I still need to work out how to dynamically load extra fonts if needed, currently rendering is limited to the characters supported by the current font. I also should probably figure out how to unload characters if they haven’t been used for a while, since GPUs do tend to have a memory limit.

      On to what’s new. I’ve started working on a profiler to help measure performance for the rendering and update threads, this was prompted by noticing how much of a stutter happened every time a screenshot was taken, and realizing that I may need to still be careful with how things are loaded, possibly even loading the images to the GPU in DXT format.
      The profiler I made basically tracks the timestamp of each frame, as well as the deltaTime with the last frame to a couple really long arrays. Then a simple console command can be run to output that data as CSV.
      Nebula3_profile.PNG
      I haven’t quite figured out how to graph it to make the most sense yet, on the left you see both the frame timestamp and the deltaTime graphed on the same graph, with the x axis being just what cell it was in. This actually makes more sense to me, since a screenshot was taken in the middle of the capture, so big drop in frame performance was seen, which can be seen by the large disconnect in the recorded frame time.

      On the right we see just the deltaTime being measured, which doesn’t seem to make as much sense as I thought it would, I would have expected to see a large spike in that as well, but I don’t, I just see a large gap in the frame timestamp. I might need to research this more to see why that would be, or maybe there’s an error with how the graph is done.

      Edit: found the spot with the discrepancy, I’m confused on what could cause this:
      Capture.PNG
      The deltaTime on the right doesn’t match with the wide variance in the timestamp on the left. So that’s fun.
      I have a theory it could be a bug related to threading, I’ll probably have to add either locks or make it export that from the render thread, since in this case it was exported from the update thread, not the render thread.

      In the future I hope to be able to show a realtime graph of performance as part of the UI in engine, but I think this will do for now, even if it is a little bit janky. It works great for all the Power Point presentations I’m sure are in the future of this engine!

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      I did some more lua bindings and added some console commands to my game engine, however that’s a bit less than exciting and I’m a bit less than excited about that.
      So Instead of doing a lot of work on that and making good progress, I decided to forget about the rigorous schedule I had for that, and pick up and old project I had started in Godot.

      I also don’t have much to mention on this other godot project, I spent most of a day going through some asset packs I have trying to find assets to help with the game.
      It’s planned to be a mobile idle type game, where you have units that attack a boss, and the boss gradually gets higher and higher level, so your units needs to also get higher and higher level.

      I do have a basic mockup of what it will look like for now:
      Capture.PNG

      I have yet to get any boss art made, and I’m planning to use some art from some asset packs I have for the units to make things simpler.
      I’m hoping to do pixel art for the bosses, but I’m not used to doing pixel art at the size that I want the boss to be, so I might need to get creative. I’m a bit more used to making 16x16 or 32x32 pixel art.

      My main goal for this game is to learn more about Godot in preparation for Godot 4.0, at which point I may just drop my own game engine entirely and switch to Godot. I specifically want to learn more about customizing the look and feel of the UI, as well as learn about saving and loading save games.

      I’m also expecting to end up missing Gruedorf next week, I’ll probably post an update the week after, and hopefully have something significant.

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      I had written a massive update about choosing an audio library and all that, but then Windows update ate it, so instead I’ll write about the other half of what I was going to write, and save the audio stuff for some other time, like when I’m actually at that point of the project.

      I’m currently working on the rendering stuff, the way my engine works is there’s a Rendering thread, and an Update thread, and they need some way to synchronize between them.
      I had read at some point a series of articles on making a multithreaded renderloop, which I’ve been referencing and can be found here. This is the second entry, but it has the most exciting diagrams of what is going on, as well as discussions on how to resolve some issues with it, related to jitter, or a lack of smoothness caused by one thread going significantly faster or slower than the other, and frames being skipped over.

      The reason I’m going with this method is because I need a way to basically take a snapshot of the state of everything, and then chunk it into the render thread, if I use a query like I sort of have been doing right now, there is the possibility for the update thread to remove nodes while the render thread is trying to render them, which could be the case on some of the unexpected crashes I’ve had some trouble resolving and reproducing.

      So to avoid issues with my update thread changing/removing entities while the render thread is rendering them, I’m creating a RenderState class, which will basically hold a set of vectors, one for shared pointers to all opaque 3d objects, and one for all transparent 3d objects, the opaque objects will be sorted front to back, and the transparent 3d objects that require blending will be sorted back to front.

      This sort is done to optimize for the corresponding shaders, while still allowing transparent objects to be drawn in the proper order.

      Then the rendering thread selects a render state that is updated from the update thread most recently, and renders that.

      I’m planning to use a partial deferred renderer, where the opaque objects get rendered through a deferred pipeline, allowing them to be lit with a ton of lights, while the objects requiring transparency are rendered using a forward renderer, I believe this would allow me to also use deferred decals on all of the opaque objects, I’m sure a simple quad mesh decal will be sufficient for objects requiring transparency for now.

      This whole rendering plan is subject to change of course, I’ve done a bit of research on Global Illumination and I suspect I’ll have to basically completely redo the whole renderer in order to support global illumination, but I have a deferred renderer that sort of handles PBR already working, only issues are it doesn’t do any IBL (Image Based Lighting) or reflections yet.
      Gonna work with what I already have for now and perhaps just scrap what I have now in favor of something I create later that can do Global Illumination, I’m eyeing some form of Voxel Cone Tracing, just haven’t figured out if it works well for transparent objects or not, most examples don’t seem to have much in the way of transparency, so I’m hopeful but unsure of how to handle transparency with Global illumination. Who knew rendering could be so painful.

      Hopefully will be able to have something spewing triangles to the screen within a week or few so I can provide some more interesting screenshots.

      posted in Gruedorf
      C
      Coolcoder360

    Latest posts made by Coolcoder360

    • RE: Coolcoder360's Devlog/updates thread

      Been a long time for updates, I’ve gone onto several other games projects since my last few posts, and while those are fun I’m actually here to talk about something slightly more boring but possibly useful enough to share the code/pdf!

      For work I end up taking a lot of notes in notebooks, but one of my peeves about that is I often end up with so many notes that I burn through notebooks fast.
      Fast enough that I’ve decided I’m going to just print and bind my own damn notebooks (Some of the ones my wife got me on some sale deal lately are smaller than normal, so I burn through one notebook in about 2-3 weeks, they came as a pack of like 10 or so little notebooks, but it’s kind of bothersome to have to swap notebooks that often because it means I might have to reference something across multiple little notebooks.

      Part of having a notebook of course is having lined paper to print onto the copy paper in order to have some lines to write on, if I don’t do that my writing will warp all over the page.

      You can find resources for printing lined paper all over the place, but the slight issue I have is that usually they’re meant for printing onto a solid 8.5x11 inch sheet of paper, which isn’t conducive to binding together into a notebook.
      What I want is to basically print something sideways onto an 8.5x11 sheet, so that I can just fold it in half, stack a bunch together, and staple them together into a notebook segment like you might see in one of those fancy schmancy traveler’s notebooks.

      So to do this, I decided I may as well use LaTeX, it’s a tool I’ve used on and off over the past 10 or so years to make various pdfs of stuff.
      I found this resource for how to make lined paper using LaTeX and tikz: https://michaelgoerz.net/notes//printable-paper-with-latex-and-tikz/

      It’s a good resource, and it got me 99% of the way there!
      What I did was I took his college ruled letter size page: pdf download, tex source
      And then copied out the college ruling, and then turned it sideways to landscape, added little date lines at the top left and right sides of the sheet of paper, and then duplicated all that to be on a second page too (because when printing multiple copies, a printer does not want to duplex print the same document onto each side of the page, for whatever reason when test printing it decided to just spawn a new page entirely for each copy of a 1-page document. Yeah I guess that makes sense when you normally print multiple copies of a document, but that means we need to have two identical pages in our pdf in order to print it properly)

      So here’s the code:

      \documentclass[letterpaper, 10pt,landscape]{article} %for letter size paper
      %215.mm x 279.4mm
      \usepackage{tikz}
      
      \begin{document}
      \pagestyle{empty}
      
      %page 1
      \begin{tikzpicture}[remember picture, overlay]
      
      \tikzset{normal lines/.style={gray, very thin}}
      
      %draw date lines
      
      \node at (current page.south west){
          \begin{tikzpicture}[remember picture, overlay]
      
              %left side date
           \draw[style=normal lines] (0.15in,8.0in)--(0.55in,8.0in);
           \draw[style=normal lines] (0.65in,8.0in)--(1.05in,8.0in);
           \draw[style=normal lines] (1.15in,8.0in)--(1.55in,8.0in);
      
           %right side date
           \draw[style=normal lines] (9.45in,8.0in)--(9.85in,8.0in);
           \draw[style=normal lines] (9.95in,8.0in)--(10.35in,8.0in);
           \draw[style=normal lines] (10.45in,8.0in)--(10.85in,8.0in);
              \foreach \y in {0.71,1.41,...,19.81}
              \draw[style=normal lines](0,\y)--(11in, \y);
          %\draw[style=normal lines] (1.25in,0)--(1.25in,11in);
          \end{tikzpicture}
      };
      \end{tikzpicture}
      
      \pagebreak
      
      %page 2
      \begin{tikzpicture}[remember picture, overlay]
      
      \tikzset{normal lines/.style={gray, very thin}}
      
      %draw date lines
      
      \node at (current page.south west){
          \begin{tikzpicture}[remember picture, overlay]
      
              %left side date
           \draw[style=normal lines] (0.15in,8.0in)--(0.55in,8.0in);
           \draw[style=normal lines] (0.65in,8.0in)--(1.05in,8.0in);
           \draw[style=normal lines] (1.15in,8.0in)--(1.55in,8.0in);
      
           %right side date
           \draw[style=normal lines] (9.45in,8.0in)--(9.85in,8.0in);
           \draw[style=normal lines] (9.95in,8.0in)--(10.35in,8.0in);
           \draw[style=normal lines] (10.45in,8.0in)--(10.85in,8.0in);
              \foreach \y in {0.71,1.41,...,19.81}
              \draw[style=normal lines](0,\y)--(11in, \y);
          %\draw[style=normal lines] (1.25in,0)--(1.25in,11in);
          \end{tikzpicture}
      };
      \end{tikzpicture}
      
      \end{document}
      
      

      Run that bit through pdflatex and you get two pages that look like this (can’t upload the pdf because of reasons…)
      3253dbcb-6bba-47e2-96a0-233d03555280-image.png

      Print them duplex, flipping on the short side (since this is landscape) and then presto, you got a double sided sheet with lines that you can print a bunch of and then fold and staple to make your own notebooks.

      I haven’t run all the numbers here on cost savings but I think it’s safe to say that when you get 1500 sheets of copy paper off amazon for $23 it’s going to be cheaper to make 1500x4 pages of notebook paper (remember we’re talking the 8.5x6.5 sheet from folding the 8.5x11 in half, roughly equivalent perhaps to an A5?) than it is to buy that many pre-made refills of a notebook.
      In fact some of the inserts I’ve finding for traveler’s are even narrower than these, running 8.25x4.25, so this may even be bigger sheets of paper!

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      Some more progress on my plugin, moving some stuff out to a singleton to provide a better API where a game script can call into and then retrieve the right icon for an action.

      Also adding a little “tutorial” prompt sort of thing:
      b51a2cde-fbbb-4888-af57-4928b0db504c-image.png
      Displays at the bottom right and disappears (not fade, just pop-in and pop-out directly with no transition right now) after a few seconds.
      Might change that up to tween up from bottom of the screen or something like that.
      But seems useful to be able to provide a way to just call controls.popPrompt("move_forward") and then the little pop up will just go, built-in, with the only thing needed to do is map move_forward to a default key/control and then give a translation file for translating move_forward. Which I might change to say “Move Forward” rather than just “Forward”. Given this silly example which doesn’t seem to have correct/proper english.

      Other than that I think things are going well with this, not doing full joystick detection yet to remap things, but I think it should be able to detect whether a joystick/controller is being used vs if a keyboard/mouse is used.
      Then the trick is to add controller support to the methods getIcon(event) and getBestIcon(action) since the getIcon(event) takes an InputEvent to give an icon for (useful for the full remapping menu to have an icon for each event) and then the getBestIcon(action) would use the controller vs keyboard detection to show the right icon for that action based on which input they’re using, hopefully specific to their controller (which right now I’m not trying to detect too much, I have only 8bitdo controllers so I can’t really test this out too much).

      Once this is all together then I guess it’s a matter of making an game’s menu where the controls remapping menu would go, then adding ability to save out the mapping and ability to load in and reset the mapping, and also a way to restore to defaults. Almost there!

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      New gruedorf time.

      And another new project. Sort of.
      Switching back to Godot for a bit, but I didn’t hit “New Project”! instead I opened an old project and now my new project is creating a Godot addon/plugin that automatically creates a controls menu which allows changing controls bindings.

      The idea is to basically create tools I can reuse in future to implement basic things like controls menu rebinding, maybe settings menus or other such things.

      So far what I have is basically a script that creates a menu list of all the actions that are configured in the inputmap for the project, and then shows an icon next to it for any mapped buttons:
      7f6d7ee9-468b-4511-b31b-d3c1f83f0759-image.png

      Using the Kenney input prompt icons of course, has support for mouse+keyboard, Xbox, PS4, PS5, Switch, Steamdeck, playdate. That’s enough platforms for me for now I think.

      So far I’m only dealing with keyboard inputs, I’ll need to play around with supporting mouse input and then controller input bindings.
      Then I hope to make it so I can select and then choose a new input option, making it play nice with controllers and mouse+keyboard of course.
      I’m also ignoring all the built-in actions right now that start with ui_ because there are a ton of those and they kind of clutter up the list. I’m thinking for right now that people usually don’t want to re-map the buttons that are used to navigate the menus or do text input, so I shouldn’t bother to let those be an option for now.

      I’m also working on compiling Godot from source, once you have the dependencies its actually really easy to do, so that’s been good.
      I found this Godot Build Options Generator which basically generates a custom.py file you can use to make your Godot builds be smaller and have unnecessary modules compiled out of them, for games that might not need all modules (like, if your game is entirely 2d, why bother with 3d file format import/export support, or even 3d support in general?)

      May look into trying to make some Godot Modules myself or other plugins as needed, right now leaning towards plugins that can just be included as part of a project to help get basic building blocks like menus working faster, maybe other features like my own character controllers or similar things like that.

      I do use other character controllers or other plugins from the assetlib from time to time but for some things like character controllers I like to make it myself so I know all the ins and outs of it and how to make it do what I want/need.

      Then maybe I’ll get something put together for an actual game that uses all these plugins, since doing the plugins should make getting a game together faster if it’s just a matter of including all the different plugins to make the boring parts work.

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      Been a while since I did one of these, but I’ve certainly been busy with plenty of new projects.

      Started a bevy+Rust project, trying to learn how to do Wave Function Collapse to do world gen for it, since its winding up to be mostly some sort of roguelike rpg type game.

      I’ve been playing Shattered Pixel Dungeon on my phone, and Nethack again, so being a roguelike fits in with that pattern.

      For the WFC I’ve never done it before, but I did do something similar to it that I called “Wang Tiles” if you scroll back a few years.
      In that case I basically had pre-built hand crafted tiles with edge connectivity, so the algorithm had to follow the edge connectivity constraints in placing those tiles. That worked well enough, especially with using random walk to ensure cross level connectivity.

      The way this WFC will be different, is that instead of hand crafting those tiles, I will simply be generating a sample level/world for it to sample from, then it will generate NxN tiles from that, which then it will figure out overlaps, and then map the tiles together.

      A good example of that in the theory side is this article: https://www.gridbugs.org/wave-function-collapse/ It’s in rust as well, however I’ve noted that the code samples are not complete, so you can’t just crib it from there.

      Specifically the problem I have is that none of these tutorials, descriptions, etc really say what the best data structure is to hold all of the tiles generated, as well as their connectivity.
      That Rust example on gridbugs has tons of example Rust code, but just generalizes this part into adjacency_rules which is some struct with functions implemented on it that they don’t even cover or describe in the article.
      And then the code in github is so large that I can’t make heads or tails of it to find the adjacency rules portion, and seems to be more of a library crate or tool to use to do wfc, and not so much a reference for building your own.

      This other resource: https://www.boristhebrave.com/2020/04/13/wave-function-collapse-explained/ is quite a good description of the logic flow for basic WFC, but it seems to move cover the basic 1x1 tile WFC, and not the NxN WFC, which it refers to as “overlapped” WFC. In that case it has a very simple method for determining/tracking the possible neighbor tiles, using an array of booleans for each possible tile in that slot, anything true is part of the “domain” and is possible to be in that slot.

      I’m attempting the NxN tile method, so its going to be a long process, I think first I need to generate all the NxN tiles as described int he gridbugs article, and then basically compute all the adjacency.
      Then I think you’re supposed to do some entropy calculations and then use that to pick the next tile to place, and once you pick a tile to place you need to propagate down all the possible remaining tiles in the affected tiles, and its a whole freaking thing…

      Going to be a long slog I think, and I don’t even have rendering set up yet to render out the tiles in any way shape or form…

      I’d have started with 1x1 tiles but for what I want to do I’d need to have like, tons of tiles to hold every possible different wall tile in different angles or whatever, and I think at this rate its better to just represent walls as just Wall and then either use one sprite for all of them, or go in after the WFC happens and then map the tileset onto the tiles.
      Plus this way the tiles generated as Wall will also be entirely collision, although that means no diagonals, but I think I’m okay with that…

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      Well update on that, after like 3 days of struggling with nextcloud I’ve finally got that set up with working collabora-code
      That let’s me have basically my own self-hosted “Google drive” or “Office 365” experience, so you can upload, sync, download, edit files online in my own self-hosted cloud.

      That looks effectively like this, you have a main dashboard with apps along the top left (looks similar to like, all the office 365, Desire2Learn school or work hosted solutions doesn’t it?):
      2023-08-23_11-32.png
      And then you can open up docx or other micro$oft files and edit them in browser, supposed can be done live with others as well (untested still, and I guess I must have issues with spellchecker right now…):
      2023-08-23_11-33.png

      So next I’m going to be figuring out how to make sure my pivpn is set up so that these can be access remotely, I have them set up to be just HTTP instead of HTTPS since it wouldn’t work the other way.
      This is my docker-compose file for it (saving here since I need to back it up now that its working, and it took 3 days to figure out):

      version: '3'
      networks:
        nextcloud:
          external: false
      services:
        nextcloud:
          image: lscr.io/linuxserver/nextcloud:latest
          container_name: nextcloud
          environment:
            - PUID=1000
            - PGID=1000
            - TZ=Etc/UTC
          networks:
            - nextcloud
          extra_hosts:
            - "next.cloud:192.168.1.125"
          volumes:
            - /home/nextcloud/data:/data
            - /home/nextcloud/appdata:/config
          ports:
            - 80:80
              #443:443
          restart: unless-stopped
      
        db:
          image: postgres:14
          restart: always
          environment:
            - POSTGRES_USER=<DB_USER>
            - POSTGRES_PASSWORD=<DB_PASSWORD>
            - POSTGRES_DB=<DBNAME>
          networks:
            - nextcloud
          volumes:
            - ./postgres:/var/lib/postgresql/data
      
        collabora-code:
          image: collabora/code:latest
          restart: always
          environment:
            - DOMAIN=next.cloud|192.168.1.125
            - extra_params=--o:ssl.enable=false
          networks:
            - nextcloud
          extra_hosts:
            - "next.cloud:192.168.1.125"
          ports:
            - 9980:9980
          cap_add:
            - MKNOD
      

      NOTE: don’t use this on anything publicly facing, I have HTTPS turned off, its “fine” here because I’m planning to only access it from via a VPN remotely, and not through the public internet.

      Now that that’s all set up I need to make sure my wireguard can let remote machines use the pihole as the DNS server so I can get a locally defined domain to connect to the nextcloud.
      Then its on to setting up a second proxmox node with SSD, migrating this to that, then reimaging the laptop with an SSD in place of the HDD. Got it a 512GB SSD for now, maybe up that at some point but I’m hoping to get a rack server as well at some point. Right now its at 600 GB HDD, so it’ll be a bit of a downgrade but I think SSD will be worth it.

      Right now honestly the browsing of nextcloud isn’t too bad off a HDD.

      In other news of my self-hosting adventure, I also set up gitea.
      That was way easier and faster than Nextcloud and almost too easy.
      That one I haven’t considered ready for production just yet, I’m waiting until I get the second machine up and then I’ll probably look into having gitea pull over all my private repos from gitlab. It looks like that is a thing at least.
      I may have my gitlab stick around and maybe see if I can’t get gitea to mirror changes up to gitlab as well, so I can have a redundant backup of any code projects I want to have.

      The one thing I want to make sure I can do is back up my crap out of these containers, since that right now seems non-trivial to figure out how I get just the files out of the volumes.
      For now I am taking snapshots as necessary to basically save state on the containers, but of course having a way to get full backups out of just the files/data would be good, I don’t want to necessarily have a full image/backup of the machine that is running these things, I just want to have a way to get the file copies out of there and back it up somewhere, don’t really need to have the whole container image with it too.

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      You know its bad when you’re asked to just start a new topic instead of replying on your old gruedorf thread…

      Been busy with a ton of stuff lately, work, games, other work, relaxation, cooking…

      But what I’ve gotten into recently, aside from another new raylib project trying to port OSRIC into a computer game, is looking at trying to self-host things.

      It’s a confusing world but one of the things that I’ve kind of been wanting to do for a while is figure out a file sync system that I could host on my own machines/hardware and have the storage saved locally, with potential cloud backups.

      I’ve been looking at options and services for a little bit now, from cloud hosting providers, cloud storage options, etc and I think I’m finally going to pull the trigger on this, I’ve got an old clunky 11+ year old laptop, and an old dell optiplex 3080 micro that I’ve ordered a power supply for. So that’s at least 2 computers, so I may as well try to do something with them before I get a rack server.

      Browsing the self hosted Lemmy and I found that a lot of people mentioned this thing called ProxMox. This is basically a fancy enterprise level tool for administrating virtualized servers. It lets you have clusters of various machines all running the proxmox bare metal software (basically its Debian with extra steps I believe) and then you can get a fancy schmancy web gui that you can control things with:
      2023-08-21_19-07.png

      It also will help install and manage Ceph on all the nodes in your proxmox cluster, which seems neat to me as I’m also interested in that sort of thing, basically letting you replicate data stored in a local “cloud”.

      So far I haven’t done any containers or VMs with it but I think that’s the next step I want to do.
      I’m hopeful to be able to host NextCloud as well so that I can basically have my own synced file storage on my own machine.

      Whenever I need to reimage a machine or take backups, I find I tend to use google drive but I’m too cheap to pay for google drive, and so I have like two google accounts that are basically running out of storage. This way I could store all of the important stuff locally and then potentially back it all up to backblaze.

      Anyway I guess I’m off to figure out how to run some containers in here and see if I can get docker+docker-compose working. if I can get those working in a container, I’ll be able to start hosting stuff like the Nextcloud, etc. Only weird thing there is I’ll be using containers inside of containers. Not sure if that’s necessary, but the containers are faster to run than VMs and I’m not sure if I want to need to go update+configure all the containers in proxmox directly, seems easier to have a docker compose file that defines the services and everything needed.

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      Time again for another update I guess, not much to report but I’ve been doing some good rework to make just the Texture loading for now be able to happen on a different thread from the update thread or the rendering thread.

      So for that I have a threadpool that I think I yoinked from somewhere, which let’s me basically queue up functions or lambdas to be executed in the pool of threads. I can also configure how many threads are going to be in the pool, which I currently have set to 3.

      Then I also found I needed a way to reference the future Texture that will be spat back from the thread once it’s loaded, so obviously I looked at std::future.

      And then found that std::future doesn’t currently have a way to check if the value is ready without waiting for it, that’s an std::future experimental feature, since the std::future valid (or shared_future, for what I would use this for) only checks if the future is a valid future, not if the value/data was set.

      So i rolled my own templated Future Class to simply have a way to set or get data from it, as well as tell if the data has been set or not with an isReady().
      This means now all my std::shared_ptr<Texture> will need to become std::shared_ptr<Future<Texture>> so that’s quite a bit of refactoring, which I think is mostly done now.

      One gotcha with this though, is I didn’t want my Future’s getData() to return the value, since that would be a lot of copying, so now instead of being T getData() it’s T* getData(), but that means now I have to be careful that the Future doesn’t get decontructed when the data is still referenced somewhere. This is a real problem because right now the Texture data is being passed via standard pointer like this to the Render thread, so there is in fact a possibility of segfaulting here.

      I’ll probably look into how to wrap that, maybe my Future will hold the Texture as a std::shared_ptr<Texture> itself and return a std::shared_ptr<Texture> from getData instead of Texture*, that would likely solve the issue because then the Future<Texture> only holds a reference to the Texture that will clean itself once all other references are destructed, so it can stay in memory until after the rendering thread is done with it and then once it’s cleared out of the Update thread and the Rendering thread it’ll delete itself instead of leaking or becoming an invalid pointer that is used in the Render Thread.

      That’s the main scoop for now I think, good progress though since most of the errors of switching the TextureLoader to return std::shared_ptr<Future<Texture>> are cleared up now and the getResource functions for that will now toss a lambda into the threadpool. I think the jury is still out on whether or not it’ll all actually work but considering that I already use a similar mechanism to the threadpool for my workqueue stuff, which is actively used, I think the lambdas and threadpool and everything should work, it’s only a little issue with that getData() returning a raw pointer and not a shared pointer and hopefully that’ll mean that now I won’t be bogged down as much doing Texture Loading.

      I’ll need to do a lot more of this in the future I think, although I realized that I may not need to do this to all of my types, but it’ll probably help for anything that is large enough since I suspect Disk reading all needs to be dumped to a different thread.
      And uh, actually I just remembered I need to re-check what I put into the lambda, I need to make sure that the disk reading part is inside the lambda, I think I left it out in front of the lambda portion…

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      Wow I’m trying to make a new gruedorf and it’s been so long that I got asked to make a new one because this topic was so old…

      Decided from some discussion in the discord to do some smaller godot projects just to keep the creativity/learning/whatever going, rather than biting off a bigger project than I can chew and continuously starting new things (looking at my VR project I had).

      So I made a very simple/basic Sokoban game in Godot. it’s not really finished but it has some of the basics. Blocks that move and can block the player (I used the physics system to move them, which is a bit troublesome/error prone for a sokoban, I’m thinking I should change that if I go to a full/proper version with this kind of concept.) And it had a winning screen, multiple levels, and a main menu, that’s it.

      I also have gotten back into working on my engine a bit now, but I think I’ve come to the conclusion that I need to work on making it crash less as a priority, so I’m going to pause on the Nuklear UI under the assumption that it’s causing the crashing, I’m going to work on finishing the last render thread vs update thread splitting I needed to do to ensure nothing crashes there, and then I"m likely to implement my own UI components at least temporarily until I can either confirm that Nuklear is or isn’t crashing things, or figure out how to get Nuklear to not crash.

      Fundamentally I have a mechanism right now to let entities with the right script setup to get text input for the console, so I just need to add a way for UI items to get click events, and then in theory I should be able to just implement UIs fully in lua scripts, with just rendering stuff via textures or other fun mechanisms. So I think that should be enough to let me cobble together a UI from lua if I can just have a way for the scripts to get mouse clicks and text inputs. The look of it may not be super flashy yet since I have no good way to really do animations at all, maybe I’d find a way to cobble together a button press animation for buttons, but for now I think making good UI is not on the top of my list, I just need to be able to make a UI, that way I can have an actual editor somehow. might be a bit funky as far as setup/usability goes but I have hopes that it’ll work out.

      Really all I need an editor to be able to do for now is let me place objects at locations, modify those objects, attach scripts, and add other components.
      Then also have some buttons to let me save out a scene and the data and then at some point figure out how to have it all get packaged up for an actual end game, and then figure out how to have the game play in editor.

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      Engine progress again

      I’m back at in on the UI stuff for my game engine.

      My september jam didn’t get very far, will probably pick it up again at some point, but I’ve been distracted by VR stuff again, and interested in potentially making my engine have OpenXR support sooner than planned, but of course I’ll need a working editor first, so I’m working on the UI pieces.

      2022-10-09_14-38.png
      I added a combo box and a Text box to my UI widgets, I’m still trying to figure some things for the text box, since for some reason it isn’t working, but the combo box operates well as a dropdown.

      And here’s an example of the problem, using the same input callback, my own console that I rolled myself captures every character input, but for some reason the Nuklear UI textbox only gets every 3rd or 4th character, and its unreliable which it gets.

      2022-10-09_14-44.png

      Once I have those widgets all working properly I think it’ll be time to get an actual editor of sorts together, get model loading going, and then get onto the level saving/loading and asset packaging pieces.

      Oh and I just noticed that if I sit in the engine long enough, the stupid thing segfaults.
      My other project was to learn Vulkan in Rust, which I just might pick up instead of this engine since I’m running into so many memory issues.
      Like I have no problem debugging mem issues, but it sure seems like I might have a higher chance of making a working engine if I go that route instead of this. But that would be another complete rewrite, and I’ve been enjoying this iteration. Not sure I feel like completely re-writing and starting from scratch in Rust, so we’ll see.

      posted in Gruedorf
      C
      Coolcoder360
    • RE: Coolcoder360's Devlog/updates thread

      Tada, new project. again.
      This time I’m working on an arpg first person dungeon crawler maybe open world type game. Something in the vein of Ultima Underworld.
      Something with a 3d first person view but with plenty of UI stuff chonked next to it, like this (from Ultima Underworld):
      screenshot of Ultima Underworld

      The way I see it, this screen has a few basic parts:

      • a set of action buttons on the left
      • the 3d first person view with a compass, some animated aligator/dragons and enemy health meter gargoyle face
      • inventory and equipment menu with health meters and a toggle to show stats.
      • a text log that let’s you read text of what you’re investigating or interacting with.

      So I have a quick mock-up I threw together in Godot:
      2022-08-31_23-20.png

      I’m not quite there yet, I’m still figuring out what screen resolution I like, aspect ratios, UI layout, etc etc.
      But I have:

      • Action buttons on the left
        • Look/examine
        • Interact
        • Talk/Speak
        • Attack
        • Save/Load (the quill works great if I have the caption next to it, I think a floppy disk looks better if there is not, maybe will reuse quill for a map/quest log)
      • 3d viewport with first person view
      • some type of tabbed GUI on the right for eventual inventory, stats tracking, health/mp/whatever
      • bottom area I plan to also add a text log so I can have shitty programmer art that looks like garbage but can still determine what it is.

      For now I actually don’t have mouselook at all, I decided to try to go “old school” and ripped out mouselook in favor of letting the user click around on things, and they can use WASD to move forward and back, strafe/side step left and right, and then Q to rotate left and E to rotate right. I think that works out slightly better to let the user click on/interact with specific things in a scene, and hopefully will give it more of an older school vibe.

      One thing I don’t know if I"ll implement is that Ultima Underworld does implement turning if your mouse is near the edges of the 3d viewport, that might also be worthwhile to implement so I may do that too, we’ll see.

      I think next order of business is figure out world loading, kind of the menu flow from main menu, gameplay, and basic player save/load, then I"ll work out the stats/combat, and inventory/equipment pieces.

      I think in the end I want to implement basic dialogue, inventory, and maybe a quest system, along with a stat based arpg system setup.

      For style I know I want it to have crunchy pixels and I picked out a few different palettes from Lospec, so I’m hoping that if I limit myself to the same few palettes it’ll look somewhat okay, but if not then I guess it’ll probably be fine. So far I have one palette picked out for UI stuff, and one that I"m using to draw up some equipment in libresprite.
      Here is some of that equipment textures/sprites work I did:
      2022-08-31_23-36.png

      I think it would be cool to model some of it in 3d and then just map pixel art onto it as textures, but I might also just go with 2d sprites for some of it. I think monsters/creatures makes sense to be 2d sprites but it might depend on what it is.

      posted in Gruedorf
      C
      Coolcoder360