Skip to content

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone

Current design decisions for my game engine:

Uncategorized
85 1 0
  • The refactor being: First I had a global buffer of materials with albedo color, roughness, metallic, bindless texture indices etc that's always bound to every shader and I pass a material ID via push constants with each object. But not every material is PBR, there's going to be custom shaders using different data. So now the global buffer is an array of pointers to material buffers of different types, and I send an additional material type index via push constants as well.

    Update:
    - Proper dynamic point lights based on nodes (previously the light was just hardcoded in the fragment shader)
    - Billboard shader
    - Badly drawn icons for point lights in the editor using billboard shader
    - Icons have the color of the light

  • Update:
    - Proper dynamic point lights based on nodes (previously the light was just hardcoded in the fragment shader)
    - Billboard shader
    - Badly drawn icons for point lights in the editor using billboard shader
    - Icons have the color of the light

    Update: KTX2 texture support. Smaller VRAM usage due to GPU block encoding, much faster loading times since I also downscaled some textures, and much better looking textures from afar due to mimapping that comes for free (the toktx tool I use to convert to ktx can automatically generate them).

    Conversion to KTX isn't automated yet, but I hope to do that as part of the import process in the future.

    Again mostly copied from the old engine and slightly adjusted

  • Update: KTX2 texture support. Smaller VRAM usage due to GPU block encoding, much faster loading times since I also downscaled some textures, and much better looking textures from afar due to mimapping that comes for free (the toktx tool I use to convert to ktx can automatically generate them).

    Conversion to KTX isn't automated yet, but I hope to do that as part of the import process in the future.

    Again mostly copied from the old engine and slightly adjusted

    The temptation to rush ahead and implement the the fun stuff is real :§ But before that I really gotta make a proof of concept at least for a core architectural system.

    In Godot you have individual .tres / .tscn files for custom resources and scenes. I want to instead use a single SQL database for everything (or at very least for resources like items etc., but ideally also for whole scene hierarchies). That idea needs testing.

  • The temptation to rush ahead and implement the the fun stuff is real :§ But before that I really gotta make a proof of concept at least for a core architectural system.

    In Godot you have individual .tres / .tscn files for custom resources and scenes. I want to instead use a single SQL database for everything (or at very least for resources like items etc., but ideally also for whole scene hierarchies). That idea needs testing.

    Mods would then just be collections of insert / update statements. Upside is you could very easily modify the whole game based on complex parameters, like dimming all light sources in dungeons or changing the stats city guards based on the economic status of the town they're posted in calculated by the wealth of local shopkeepers, in a single SQL statement. No need to touch hundreds of files.

  • Mods would then just be collections of insert / update statements. Upside is you could very easily modify the whole game based on complex parameters, like dimming all light sources in dungeons or changing the stats city guards based on the economic status of the town they're posted in calculated by the wealth of local shopkeepers, in a single SQL statement. No need to touch hundreds of files.

    Downside is I'm lazy and only want to maintain a single source of truth regarding data structure, so I'm experimenting with automatically generating an SQL table for every data class in my game by analyzing source code (with annotations). Let's see how that goes!

  • Downside is I'm lazy and only want to maintain a single source of truth regarding data structure, so I'm experimenting with automatically generating an SQL table for every data class in my game by analyzing source code (with annotations). Let's see how that goes!

    Testing it by making a tiny text-based RPG in a separate project first. Depending on how much fun that is it will either stay a tech demo or become something to practice writing as well. Could be like a demo to put on itch to give a preview of the world and its characters.

  • Testing it by making a tiny text-based RPG in a separate project first. Depending on how much fun that is it will either stay a tech demo or become something to practice writing as well. Could be like a demo to put on itch to give a preview of the world and its characters.

    Slowly hacking away at prototyping a data resource system that's backed by sqlite. Not really sure what I'm doing...

    Currently I have C++ classes representing data which have an equivalent table in the database. The classes have a static getter taking the ID as input. This does a select statememt on the DB, creates an instance of the class, puts it into a pool, and returns a handle to get a reference to the instance.

  • Slowly hacking away at prototyping a data resource system that's backed by sqlite. Not really sure what I'm doing...

    Currently I have C++ classes representing data which have an equivalent table in the database. The classes have a static getter taking the ID as input. This does a select statememt on the DB, creates an instance of the class, puts it into a pool, and returns a handle to get a reference to the instance.

    I'm wondering how to handle relations between classes / tables. E.g. Actors have an inventory of Items. I know how to represent this on the DB, but on the C++ side I need to replace the foreign keys and utility tables for many-to-many relations with arrays of handles / pointers etc. But how much do I want to load into memory? Loading an actor shouldn't always load all items in their inventory and everything those items have relations to, not until actually needed.

  • I'm wondering how to handle relations between classes / tables. E.g. Actors have an inventory of Items. I know how to represent this on the DB, but on the C++ side I need to replace the foreign keys and utility tables for many-to-many relations with arrays of handles / pointers etc. But how much do I want to load into memory? Loading an actor shouldn't always load all items in their inventory and everything those items have relations to, not until actually needed.

    So I guess I'll use getter methods which query the DB on the first time, and later just directly return the already loaded data. The database will not change during runtime of the game so it seems reasonable.

    But it WILL change when using the editor... hmm...

    Wondering if it'd be reasonable to skip the C++ class instances entirely and query the DB every time any data gets accessed using helper functions 🤔

  • So I guess I'll use getter methods which query the DB on the first time, and later just directly return the already loaded data. The database will not change during runtime of the game so it seems reasonable.

    But it WILL change when using the editor... hmm...

    Wondering if it'd be reasonable to skip the C++ class instances entirely and query the DB every time any data gets accessed using helper functions 🤔

    Whatever approach I end up using I think it's gonna involve a lot of magic code generation to make it palatable. Adding new resource types must be a breeze and not involve 15 different boilerplate steps

  • Whatever approach I end up using I think it's gonna involve a lot of magic code generation to make it palatable. Adding new resource types must be a breeze and not involve 15 different boilerplate steps

    Ok scratch that last idea about always querying the DB, it'd be way too slow.

    Now thinking about the almost opposite idea: When the app starts, load _everything_ into memory. Not assets of course, but all the plain data like stats and positions of nodes and such which is nothing in comparison to a few 4k textures. I think that's how Skyrim works actually.

  • Ok scratch that last idea about always querying the DB, it'd be way too slow.

    Now thinking about the almost opposite idea: When the app starts, load _everything_ into memory. Not assets of course, but all the plain data like stats and positions of nodes and such which is nothing in comparison to a few 4k textures. I think that's how Skyrim works actually.

    Ok this might actually be going somewhere :) Just had to overcome the mental hurdle of thinking the database schema needs to be generateable from source code / at compile time. Instead of annotations (which aren't as powerful as I hoped) I just explicitely register classes and properties during initialization, similar to how Godot does it, and from that I can generate the schema at startup. I guess I would have needed to do something like that anyway for editor and scripting language interop.

  • Ok this might actually be going somewhere :) Just had to overcome the mental hurdle of thinking the database schema needs to be generateable from source code / at compile time. Instead of annotations (which aren't as powerful as I hoped) I just explicitely register classes and properties during initialization, similar to how Godot does it, and from that I can generate the schema at startup. I guess I would have needed to do something like that anyway for editor and scripting language interop.

    I want to emphasize that is a wonderful gift to humanity. Not only is it a highly competent leightweight 2D and 3D engine, with it being open source you can inspect, learn from, and get inspired by its code. It's easier than ever to roll your own hobby engine since when in doubt you can just check how this production ready engine does things.

    Godot's architecture seems quite sound and well organized from what I can tell so it sets a good example.

  • Oblomovundefined Oblomov shared this topic on

Gli ultimi otto messaggi ricevuti dalla Federazione
Post suggeriti
  • 0 Votes
    1 Posts
    0 Views
    Viaggiatori, è quasi tutto pronto per il mio viaggio a La Gomera (isole Canarie).Durante il viaggio cercherò di postare foto e pensieri, si Pixelfed, e sul neonato gruppo "Viaggi e Foto" su #Feddit (https://www.feddit.it/c/viaggi).Ogni giorno scriverò qualcosa, Nun mini blog del giorno, anche sulla sezione dedicata del mio sito:https://simoneviaggiatore.wordpress.com/la-gomera/Restiamo in contatto! 🙂#diariogomera @Viaggi #viaggio #canarie
  • 0 Votes
    1 Posts
    0 Views
    I made a couple of points where #Linux excels over #Windowshttps://youtu.be/pkvTIrKRLas
  • 0 Votes
    1 Posts
    0 Views
    The Supercon 2025 Badge is Built to be CustomizedFor anyone who’s joined us for previous years, you’ll know that badge hacking and modification are core to the Hackaday Supercon experience. While you’re of course free to leave the badge completely stock, we encourage attendees to tear it apart, learn how it works, and (hopefully) rebuild it into something unique. There are even prizes for the best hacks.As such, every decision about the badge’s hardware and software is made with hackability in mind. It’s why we always try to add an expansion port to the badge and, in recent years, have leaned into MicroPython to make it easier for attendees to modify the code.But one thing that’s been largely missing in previous badges is aesthetic customization. Sure, you could strip out the firmware and write something entirely new, or hang some oddball peripheral off the side of the thing, but ultimately it still looked like the badge we gave you at the door. That’s because, at the end of the day, the badges are just PCBs. Short of designing your own enclosure (which has certainly been done), every badge looks the same. That is, until now.This year’s badge is unique among Supercon badges because it isn’t just a PCB. It’s actually a stack-up of two PCBs! That might not sound like much of a distinction, but in this case, the front board has no electrical function — its only purpose is to hold the keyboard membrane against the dome switches on the rear PCB. The only reason we made it out of a PCB in the first place is that it was convenient and cheap at the scale we needed. But if those weren’t concerns, it could just as easily have been 3D-printed or cut out with a laser or a CNC router.While the necessities of running two hacker cons on opposite sides of the planet within a couple of months of each other meant we needed to think at scale, attendees are free to do whatever they want between now and when they get their badges on Friday. Want to carve a front panel out of aluminum on your CNC? Awesome. Perhaps laser-cut some thin plywood and give it a nice stain for that old-school look? We love it. Want to see what that fancy multi-material 3D printer you’ve got is capable of? So do we.Hailing frequencies open, Captain.Some Assembly RequiredWant to make the 2025 Hackaday Supercon badge your own? Just head over to the “hardware/mechanicals_and_models” directory in the badge’s GitHub repository and you’ll find STEP, DXF, and SVG versions of the front panel. We’re eager to see some wild and wonderful front panels, but there are a few things to keep in mind:Spacing between the rear and front boards should be approximately 2 mm.The area around the keyboard should be roughly PCB thickness (~1.7 mm) for optimal typing.You’ll need to provide hardware (M3 nuts/bolts work well) to attach the front panel to the badge.If you’ve got other questions or need some assistance, leave a comment below or check in on the #badge-hacking channel in the Hackaday Discord server. See you at Supercon!hackaday.com/2025/10/27/the-su…
  • 0 Votes
    3 Posts
    0 Views
    @snow Infatti, è così. Era di quei ragni col corpo come la punta di una biro e zampe lunghissime e sottili.