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
  • 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
    A 19 anni ero convinto che di lì a poco sarei partito per un tour mondiale con la mia band hard rock.A 24 rispondevo alle chiamate in un call centre.Wat de fak is andato storto in quei fatidici 5 anni?
  • 🧵👇

    Uncategorized
    2
    0 Votes
    2 Posts
    0 Views
    Certo, resta da capire perché, con questi sponsorhttps://www.python.org/psf/sponsors/abbia un budget annuale di 5 milioni di USD, perché 750 k facciano quindi tanta differenza, e perché questi li sponsorizzino malgrado non abbiano un sistema di protezione della supply-chain e dei pacchetti del repo principale.È vero che se riuscissero a fare quei soldi con le donazioni dei singoli avrebbero gli stessi soldi e meno padroni.Ricordo che il FOSS è gratis ma molto costoso.Quindi donate, quanto potete.
  • 0 Votes
    1 Posts
    0 Views
    La targa per Giuseppe Pinelli è stata vandalizzata per la sesta volta@milano È stata vandalizzata per la sesta volta la targa in ricordo di Giuseppe Pinelli, ferroviere e attivista anarchico morto il 15 dicembre 1969 nei locali della questura di Milano. La targa è posizionata in piazzale Segesta, a San Siro, non lontano dalla sua abitazione.da https://www.milanotoday.it/politica/vandalizzata-targa-pinelli-ottobre-2025.htmlAggiungo un'altra foto, che nell'articolo non compare, di un cartello apparso questa estate "tra una vandalizzazione e l'altra" che riporto testualmente:"Giuseppe Pinelli: assassinato e vilipeso. Il Cippo in Piazzale Segesta, in memoria di Giuseppe Pinelli, partigiano-ferroviere-anarchico, ancora una volta è stato vandalizzato per mano della topaia fascista, avvalendosi delle coperture del governo di destra.Un governo che vuole riscrivere la storia e che utilizza il Decreto "Insicurezza" per reprimere le lotte rivendicative di lavoratori, studenti e movimenti vari.Una legge bocciata anche dalla Corte di Cassazione, ma l'attuale governo, come già nel ventennio fascista, risponde: "Ce ne freghiamo".
  • 0 Votes
    1 Posts
    0 Views
    I made a couple of points where #Linux excels over #Windowshttps://youtu.be/pkvTIrKRLas