• Aceticon@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    13
    ·
    6 days ago

    I’ve been working on a survival/RTS game and it’s funny that even though the game development framework I’m using (Unity) tends to push you to put most of the code on the visual objects level and that was my original approach, over time I’ve figured out the whole code is way cleaner and works better (in other words, the best architeture for that software) when almost all of the game is really just a Data layer being manipulated by the player and a separated View layer for the players to visualized it in a nice way - basically a Model-View Controller Architecture, same as you’ll find in systems were a server-side application has web and/or smart app UIs.

    That said, I have the impression that something like an FPS is a lot less data-driven than an RTS because things like the 3D models that make up the world are a lot more important for data decisions (has the bullet hit an object, can the player move to this position). You can still say that stuff is data (3D models are data, specifically collections of vertices in 3D space with some additional information attached), but model data is generally way more visualization-oriented than what one could metaphorically call a “database”.

      • Aceticon@lemmy.dbzer0.com
        link
        fedilink
        English
        arrow-up
        3
        ·
        5 days ago

        Whilst composition over inheritance is indeed the way to go (and if you read the original Design Patterns book, it’s part of the things they talk about in the beginning well before they go into patterns), ECS just distributes the data all over the place which tends to create bugs due to implicit dependencies that are not very visible because things are distributed (so when you change something, other stuff elsewhere might break).

        The point of ECS is performance with large numbers of similar entities, rather than being a good architecture in software engineering terms (i.e. resilent to bugs, not brittle when changed, easy to understand as whole and so on).

        My impression, having come from totally different areas of software development (server-side, web, smartphone apps, desktop apps) is that Game Development isn’t all that sophisticated in the terms of Software Architectures, maybe because it’s too close to the metal, too concerned with performance and mainly the playground of young devs who, frankly, lack the experience to have reached the level of being aware of software development as a process and how to design and develop software in such a way as to improve the outcomes of that process.