my wife is enamoured with an extremely complex politics/government/war simulator (a "grand strategy game" for those in the know) called europa universalis V (as the name suggests, it is the Vth game in the series). prior to this, she was obsessed with a rather similar game by the name of europa universalis IV.
in these games, you play as a country or country-adjacent entity in the early 1300s and lead it to prosperity/ruin over the course of centuries. you play as, say, italy, and every other country on the planet is played by an AI.
the game simulates some events hourly (army movements, i think?), daily (i don't know, i've never played them before), and monthly. almost all events occur monthly, on the first day of the month.
no, the game does not account for leap years. no, there isn't a day/night cycle. no, there are no time zones in these games. no, a game set in 1337 should not have time zones.
anyway.
Lynnesbian
in reply to Lynnesbian • • •Sensitive content
on the first day of every simulated month, the game freezes for several seconds as the poor beleaguered AMD ryzen Z1 extreme calculates trade routes, diplomatic agreements, declarations of war, treaties, spy movements, economic downturns, et cetera.
europa universalis was originally a board game. paradox's first game in the series, titled -- and you're not gonna believe this -- europa universalis, went far beyond what the board game could achieve by making the simulation vastly more complex and adding dozens (idk how many, again, i haven't played it) of computer-controlled opponents.
with each sequel, the games got more complicated, and EU5 simulates such a dizzying array of factors that i'm frankly shocked that it runs somewhat acceptably on a handheld computer.
even more impressively, the AI manages to put up some resistance. i've been told that the AI "sucks" and "is shit at the game", but the person who told me that has played EU4 for nearly seven thousand hours. so. there is a distinct possibility that they're just really good at the game.
Europa Universalis
BoardGameGeekLynnesbian
in reply to Lynnesbian • • •Sensitive content
paradox games gave an incredible presentation (slides available as a PDF) at a conference two years ago where they talked about how their engine has evolved over time. they showed that previous games would spend ≥80% of their time waiting on The Gigathread to simulate almost everything, and how each further game added more explicit parallelism. they would realise "oh, the spy calculations don't need to read or write the economy data, so they can run in parallel".
all of this information was stored exclusively in the minds of the dev team. new devs would spend a few months learning by trial and error while a senior dev told them what would and wouldn't work.
some of paradox's new games tried different approaches. victoria 3 (2022) did something different to crusader kings 3 (2020). eventually, through experimenting by building entire goddamn video games, paradox discovered their strategy for the future of multithreading, described on page 68 and onwards of the PDF: what if each task -- the spy checks, the goods market, the diplomacy -- knew which resources it needed, and whether it would need read or write access to those resources? that way, rather than the developers adding ad-hoc parallel tasks here and there, the game engine itself could automatically discover which tasks could be run in parallel!
the presentation ends there. two years later, EU5 has been released. a developer claims the game scales evenly up to at least 32 cores (!). this is a feat of engineering. games released only a few years ago could scale up to only six or eight cores before benefits diminished drastically.
- YouTube
www.youtube.comLynnesbian
in reply to Lynnesbian • • •now, i'm not that interested in europa universalis V as a game. it doesn't really appeal to me. that's not to say it's bad (it's very very good), just that it's not for me.
i'm interested in europa universalis V as a program. i NEED to know how they pulled this off. i NEED to watch a two hour talk about this. what they've done is a borderline miracle and i need to know the details.
so if anyone at paradox is reading this: PLEASE give another presentation about multithreading in paradox games!!! or at least make a dev diary post about it!
Lynnesbian
in reply to Lynnesbian • • •we don't know for certain that the "every task knows its requirements" approach is how they did it, but i mean... i'm almost certain that's what they've done.
but i need to know for certain. and i need to know how. and how long it took. and what the challenges where. etc etc
Lynnesbian
in reply to Lynnesbian • • •your Intel® Core™ i5-12600 when Europa Universalis 5 asks the NT kernel to push eight thousand transparently compressed text files through windows defender so it can parse them in serial
#eu5
vae
in reply to Lynnesbian • • •Lynnesbian
in reply to vae • • •@vae you're right, bevy does do that, however, you have to write your game using the ECS paradigm. EU5 builds on literal decades of clausewitz engine games -- not just EU4, but CK3 and vicky 3 and HoI4 etc etc.
using ECS would mean a complete rewrite, throwing almost everything out the window. given how long it took them to make EU5 (and how many issues it's had on launch...), i don't think something like that was ever in the cards.
besides, it'd likely mean throwing out (or at the very least entirely redesigning) their paradox scripting language. this would be bad for the same reason that bethesda moving away from their janky modding setup to unreal engine 5 would be bad
software architectural pattern used in video game development, with entities composed from components of data, and with systems which operate on entities' components
Contributors to Wikimedia projects (Wikimedia Foundation, Inc.)