Author Topic: XCOM Inspired Fantasy Game  (Read 170937 times)

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #285 on: June 10, 2020, 08:33:37 pm »
There were not many other jobs in the city of Serpukhov, which traditionally produced equipment for the Soviet submarines. And the company I worked for has spun-off from the Ratep military factory. In fact all jobs in Russia are either in the military or in the gas/oil sector. I've also worked at the mass spam company, but since IT got weaponized, their services were used not for ads, but for the blatant propaganda spam.


But you agree to work for them but still refuse to follow their standards. I do not understand this part. Writing code for them is couple of magnitude more important than language of comments. I would understand opposite, write comments but refuse to work with them.


Had I not bribed some officials to escape, I would have already got 10 or more years in jail or a nuthouse (they believe it is insanity when a citizen of Russia refuses to speak Russian out of the spite). There are several crime cases against me in Russia, which issued international arrest warrant on my head. That is how I got into Ukraine, and one of the reasons I've changed my name to distance myself from other Russians. Obviously Russians find it insulting, when somebody refuses to carry a Russian name.

My point was that in USSR you could even had chance to flee Russia. Yes Putin's Russia is Authoritarian state but not Totalitarian state (at least not in same degree as USSR or current N. Korea). And if you want find place to flee you should check Poland as current government is rabid on Putin (even if its not beneficial in long term for them). Alternate Lithuania or Latvia as they existences depend on being against Russia but still have connection that you will have lot easier to blend in.

WW2 started when USSR began the military buildup proceeding on their plan to conquer Europe. Additionally helping the destruction of Weimar Germany. I.e. long before the actual war. And WW2 is just a follow up to the WW1, which too began not without a Russian help. Without WW1 there would have never been Hitler, who was literally created by that war, or the USSR, too the product of WW1. So everything can be tracked back to the Tsar Nicholas, or more precisely to the slavish population of Russian serfs (крепостные крестьяне), who failed to get their freedom and were used as a cannon fodder in a nonsensical war used to entertain the elites playing "The Great Game", as they called it.

If we go this deep for "fault" then Germany have bigger as they fund Communists to withdraw Russia from WW1. Thank God that Poland defeat Communist in '20 other wise this contamination would spreed lot earlier.
Aside WW1 was not Russian fault as many other countries have stake to win in it.

My Russian compatriots love blaming others, but they get angry when somebody points at them. It is easy to accuse say Stalin of building the Gulag system and executing millions, but we have to admit it was not Stalin who wrote all these millions of false reports (bribes and reports, usually anonymous, were used to get rid off people standing in the way), and it was not Stalin who did actual executions and guarded the concentration camps. It were the common people, these same serfs, who under the Tsar Nicholas did the WW1. In fact, Russians gained freedom of movement only in 1974. Before that they were attached to the kolhkhoz and factory as a property, and were completely okay with it. Compare to African-Americans, who did multiple revolts against the slavery and mistreatment.

Again what country do not like blame others? For Poles this is always Russian or German fault.
An this is true that no totalitarianism can stand without people who execute orders and you can find people like this in every community.
And you should never compare USA to USSR, even when true racism reign in America, black had better than soviet citizens, example could be wen last time USA stave to death whole country? USSR did it. You cannot revolt if govermet send tanks against you.


So yeah. I don't want to be a part of Russia and I don't want to speak Russian. They can jail me. They can kill me. But I will still refuse to accept their BS. I refuse to live in the parody of a society they build.

I understand hating current government or previous one, but hating every thing? You probably hate it more than I even I could find more reason to do it.

And if you really want insult Russia you should become Polish citizen as this is only country that really occupy Moscow (if you include Napoleon then Poles did it two times as they where with him too).

Offline NancyGold

  • Colonel
  • ****
  • Posts: 186
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #286 on: June 10, 2020, 10:45:39 pm »
But you agree to work for them but still refuse to follow their standards. I do not understand this part. Writing code for them is couple of magnitude more important than language of comments. I would understand opposite, write comments but refuse to work with them.
I had to work somewhere. And the language is actually very important in maintaining social coherence, and crystallize the nation. Without the language and the culture built on top of it, the Russian nation will melt down and evaporate like ice under the summer sun. In fact I think language is the most important factor holding the Russian nation together. It is hard for people to grasp the importance of their language, since it is always there, taken for granted. Language is not like these Gulag guards, yet it serves the same purpose - keeping Russians locked in. If we consider the theory of our Universe's structure being self-similar, then the language+culture pair would be very similar to the force of gravity. It is decentralized, having no distinct center, beside the center of mass, and yet it self-organizes the agents affected by it. And in fact the language and the culture are the functions of gravity (they are obviously shaped by the spatial locality).

So if one wants to destroy Russia or to get out of its control, that individual will have to speak a different language. And fortunately Russia is not (yet) a blackhole, so it is possible.

I understand hating current government or previous one, but hating every thing? You probably hate it more than I even I could find more reason to do it.
Government is just the function of its citizens and their culture (if we apply the above gravity metaphor). I don't hate the Russian government. I don't really have any hate anymore. Hating Russia is like hating the gravity force expressed by some space body - an exercise in futility. Without that cultural cementing force it would have been very easy to overthrow the Moscow government. To start a revolution in Russia one needs just one thing: cut off the gas and oil from Moscow. To do that you need just a few thousand troops. Then suddenly all the profits will remain in the regions, and Moscow will have no money to support any army. And in fact no way to keep people enslaved (riot police usually comes from distant regions, since people wont be beating their relatives into submission). But no, Russians will cope with everything, being dirt poor in the richest country on Earth. And if you start talking with Russians about revolution, they will only report you to security agencies. That is like a law of physics.

And if you really want insult Russia you should become Polish citizen as this is only country that really occupy Moscow (if you include Napoleon then Poles did it two times as they where with him too).
I will likely try getting into Britain or Ireland. Since I speak English and England has many opportunities in the IT sector. I doubt Poland needs any programmers. Then again, I'm completely ignorant about the economy of Poland. But I know for sure the last thing Poland and Poles want is the Russian gas pipeline being blown up by revolutionaries. Ukraine wants it even less, since the major part of the Ukrainian budget income comes from the gas transfer revenue. From the economical standpoint, Ukraine is the integral part of modern Russia (culturally it is too a Russian satellite). Yet it wants to maintain the relative independence to get that revenue. If Russians annex Ukraine, all the EU money will go to Moscow. TLDR: if I manage get a refugee status in Poland, and then write on the Internet something like "Freedom for Siberia! Now is the time to take down that motherf&&king pipe", there is a high chance Poland will extradite me to Russia the next day.
« Last Edit: June 10, 2020, 10:49:11 pm by NashGold »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #287 on: June 11, 2020, 01:25:05 am »
I had to work somewhere. And the language is actually very important in maintaining social coherence, (...)
So if one wants to destroy Russia or to get out of its control, that individual will have to speak a different language. And fortunately Russia is not (yet) a blackhole, so it is possible.


Then your goal is not finding job but to destroy Russian, then is very hard not to expect to Russia strike back. Probably no country would allow it, if it would allow it soon be case to exists, France or Sweden are on road to it.
And some way your words prove Putin right, if he want to Russia exists he need enforce with full might unity of langrage.

Government is just the function of its citizens and their culture (if we apply the above gravity metaphor). I don't hate the Russian government. I don't really have any hate anymore. Hating Russia is like hating the gravity force expressed by some space body - an exercise in futility. Without that cultural cementing force it would have been very easy to overthrow the Moscow government. To start a revolution in Russia one needs just one thing: cut off the gas and oil from Moscow. To do that you need just a few thousand troops. Then suddenly all the profits will remain in the regions, and Moscow will have no money to support any army. And in fact no way to keep people enslaved (riot police usually comes from distant regions, since people wont be beating their relatives into submission). But no, Russians will cope with everything, being dirt poor in the richest country on Earth. And if you start talking with Russians about revolution, they will only report you to security agencies. That is like a law of physics.


Government is more a feedback loop, I saw enough examples as bad government can corrode whole society and opposite can happen too. Look on current USA, this can go in any way, one person making one correct decision could define next 100 years of it. No society is unified, all have some subgroups, and depending on circumstances everything could go upside down.

And again if your target is destroying Russia then why is strange that they report you? Name any opposing fraction to Putin that would like destruction of its own country?

I will likely try getting into Britain or Ireland. Since I speak English and England has many opportunities in the IT sector. I doubt Poland needs any programmers. Then again, I'm completely ignorant about the economy of Poland. But I know for sure the last thing Poland and Poles want is the Russian gas pipeline being blown up by revolutionaries. Ukraine wants it even less, since the major part of the Ukrainian budget income comes from the gas transfer revenue. From the economical standpoint, Ukraine is the integral part of modern Russia (culturally it is too a Russian satellite). Yet it wants to maintain the relative independence to get that revenue. If Russians annex Ukraine, all the EU money will go to Moscow. TLDR: if I manage get a refugee status in Poland, and then write on the Internet something like "Freedom for Siberia! Now is the time to take down that motherf&&king pipe", there is a high chance Poland will extradite me to Russia the next day.
Why any county would allow continuation of your crusade against Russia? And even if it will be moral? How many would die in this next revolution? Revolution have bad habit of eating its own children.

Offline NancyGold

  • Colonel
  • ****
  • Posts: 186
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #288 on: June 23, 2020, 10:27:59 pm »
Government is more a feedback loop, I saw enough examples as bad government can corrode whole society and opposite can happen too. Look on current USA, this can go in any way, one person making one correct decision could define next 100 years of it. No society is unified, all have some subgroups, and depending on circumstances everything could go upside down.
But government still needs a strong and integrated nation to regenerate itself reliably over time. Russia had several revolutions, but each time it moved to the same core, surviving both the complete change of its elites in 1917 and the total economic collapse of the USSR. No matter the Tsar or Stalin, Russia will remain Russia. Just like if you turn the planet Earth into dust, that dust will accrete back to create the planet (although likely very damaged), unless it gets velocities larger enough to escape the synergistic gravitation of all other dust particles. On the contrary, Roman Empire got disintegrated, and its language went extinct. So government is more of the function of what there is under it.

If you're a single person on an uninhabited island, then you're both the king and the people there, but surprisingly not much you can do. I.e. if Bill Gates gets onto an uninhabited island, he wont create Microsoft. If he gets on an island with some uneducated aborigines, there wont be a Microsoft either. To create Microsoft, Bill Gates needs a large, healthy and educated nation with a lot of resources and developed technologies. I.e. Bill Gates is the function of the nation, which itself is a function of the environment it has, which is, well, first of all shaped by that force called gravity.

Anyway I still keep thinking about the proper way to implement leaders/officers in the game, what makes people loyal and breaks loyalty. I.e. why for example Putin's officers wont just kill him, and wont start a war between each other. What truly stops these generals? How does the loyalty arise?

In addition there is a question about how to make AI challenging. There are a few possibilities.
1. Non-cheating AI. That AI just doesn't cheat and start with the same resources as player. Hard to implement and not very exciting.
2. Rubber band AI. Cheats by having its income to be a multiple of player's income. So the more money player makes, the more money the AI makes. Such AI will always be on match with the player, no matter how quickly player acts to capture resources. The AI will be annoying, since no matter what player does, it will still come back, and will be treading on the tail. The game will likely turn into some strange meta, where player will try acting with low income to avoid turning AI into powerful opponent. Player basically plays against itself.
3. AI gets stronger with time to the point of being impossible to beat (original XCOM AI). Such AI  will pose ominous challenge for inexperience players, yet will be boring for advanced players, who can managed to get far ahead of time. And the speed with which AI gets stronger is something hard to balance. It quickly gets from easy to impossible. I.e. that is just a game with a time limit, where player can move time back with bonuses. Original Civilization also had similar AI, varying its speed with difficulty, but modern remake uses a non-cheating AI, which can still beat novice players: https://techcrunch.com/2016/12/06/aragos-ai-can-now-beat-some-human-players-at-complex-civ-strategy-games/
4. Stupid AI. Starts with a lot of resources, but doesn't care to use them, instead attacking player with small manageable forces. Typical for most video games. I.e. if all monsters on the Doom map will suddenly go after the player, there will be no chance to survive. But monsters are too stupid to cooperate, so player can kill them one by one. Sad story. Later games like Quake Team Arena tried to make non-cheating bots, which were far less exciting than bullying the clueless Doom monsters.
5. Trigger-based AI. The AI reacts to player actions with unpredictable cheating, possibly random. I.e. if player moves near AI city, the otherwise docile AI will respond with full force of dishonestly earned resources. Pioneered in Doom games, with trigger sectors, unleashing monsters.

Ideally single player AI should react to player's advances and try to disturb them. So I will likely go with a trigger based AI influenced by the difficulty level and random dice roll. Such AI can have almost unlimited resources and act unpredictable, or according to some narrative. Although I still plan to bind AI resources to the actual income, just provide with larger starting resources. I.e. no gold will be materialized out of nothing.

Offline NancyGold

  • Colonel
  • ****
  • Posts: 186
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #289 on: June 26, 2020, 09:23:07 pm »
Proceeding with implementing the city plundering. When the city has not enough mercs to defend itself, but still has some population (expressed as wealth/taxpayers), city streets will be replaced with actual civilians. These are very weak units, but would still be a nuisance. I also think implementing mechanics of punishing players for killing them. Similar to how in Vagrant Story killing civilians in some missions led to these missions being lost.

Maybe something like metropolia sending a ship with knights to end the carnage. Not children sprites, because I'm too lazy to draw them and it will create some controversies. Still in real life wars and propaganda children victims play some non small role. And children were frequently used for  service roles, cannon fodder and last resort reserve. And it is still a thing even in modern world: https://en.wikipedia.org/wiki/Child_slavery#Child_soldiers

Anyway, I already had a male sprite, and so I had to finish the female sprite. Animations are not very polished but should do for now. Proper approach would be hiring a professional artist, instead of doing animations myself, but I have no access to crowd funding or any funding at all, and I think professional animation would require more frames of animation, and that will also require implementing actual resource management.

Currently all sprites are loaded into memory and never freed after that. Some sprites are also generated dynamically, so it would require some refactoring. In addition, resource system implies special archive format for fast loading from HDD, since many people still dont have SSDs. In fact, the recent Command & Conquer remaster was criticized for not accommodating for SSDs.


Offline NancyGold

  • Colonel
  • ****
  • Posts: 186
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #290 on: June 30, 2020, 02:46:21 pm »
Had to rethink explosions. The original XCOM (which I use a starting point for everything), had some very obscure explosion mechanics. You never knew if that explosion will clear the wall or damage the UFO.

Now I want to make it simpler: all fragile items in some range will get destroyed, while fragile tiles will get cleared. In addition throwing a bomb on top of a castle wall will turn that wall into rubble, which will fall out if there is free space near it. That way cannon shots would gradually turn castle walls into rubble. In addition the explosion is sending units around it flying a few tiles back.

Now compared to XCOM I don't have squaddies with firearms determining their capabilities, but instead monster types doing that. Although there are stuff like grenade flasks and health potions, weapons humanoids have mostly determine their attack and damage. But I find these annoying to use, since player will have to manually resupply them after every battle, and that was a big part of the original XCOM - ordering enough grenades. So in my case goblin gets just 5 grenades, it can throw during the day, and such ammunition auto-resupplies each word turn, just like health.

I havent yet added the general rock-paper-scissors damage/armor system. It probably should be added, because it will help further differentiating different units and items. I.e. if a dragon uses fire as a weapon, it must have some inborn resistance to fire. As of now there are only undeads, which are resistant to non-blessed attacks. Yet they also do more damage to non-blessed units and have higher to-hit chance against them. So resistance system is not that simple, since on has to decide how and where it will apply.

Still a lot of work to do. And I haven't even decided on the story, beside that the player should start the game without a city and arrive at a neutral port city. The story is not really that important for a strategy game, as opposed to the victory condition, which can even be made random. IIRC, The Sims had such system, where victory condition was based of the randomly generated character's personality. And such approach actually nicely suits strategy games, especially multiplayer ones, where player has to guess what goals pursue other players. Same way it will fit nicely with a narrative based AI. And if you think about it, the original XCOM already had asymmetric game sides, where the player and the AI controlled aliens had different goals. On the other hand, Apocalypse didn't had a narrative AI, but instead had a rubber-band AI, where the quicker the player advances, the harder the AI hits.

Offline NancyGold

  • Colonel
  • ****
  • Posts: 186
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #291 on: July 05, 2020, 04:42:00 pm »
Currently I'm working on a little voxel utility which I plan use for few dynamic effects, like say tiles breaking apart in explosion. These cannot be drawn manually, especially not in a singe dev project.


Offline NancyGold

  • Colonel
  • ****
  • Posts: 186
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #292 on: July 08, 2020, 08:45:22 pm »
A nice video explaining that to have uniform non squares or hexes cells one will need to use hyperbolic space. Dunno if there are many tactics games in such space. But the author of that video even made a Marble Madness style game completely with 3d fractals.


Offline NancyGold

  • Colonel
  • ****
  • Posts: 186
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #293 on: July 08, 2020, 09:36:56 pm »
I still keep working on the voxel utility. Basically I'm redoing Photoshop, but with voxels. The editing functionality will be very similar and one could as well edit 2d images with, yet there will be a way to apply filters in 3d. Hope it could also be useful to OpenXCOM modders, since it is much easier to edit and paint voxel than to edit 2d sprites (if you have the editor lol). If I manage to optimize it to show 1000x1000x1000 cubes, one could even map the whole XCOM site into voxel space. And then do stuff like bullets making actual holes in objects.

There is the bare minimum functionality to make it useful for my purposes (i.e. any voxel animation makes layers mandatory), and I will have to transfer the core rendering code into C/C++, since Symta still has no unboxed floats and I need every single voxel out of it. Probably should even use GPU (but I have none :-\ ). UI will remain in Symta.

« Last Edit: July 08, 2020, 09:38:58 pm by NashGold »

Offline NancyGold

  • Colonel
  • ****
  • Posts: 186
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #294 on: July 09, 2020, 11:04:35 pm »
Rewriting the code to C/C++ without any optimizations instantly allowed working with 256x256x256 cubes. Although I had to fix a nasty bug with floating points -0.0 behaving differently in edge cases due to -fast-math compiler keyword. I'm sure I can boost that to 512x512x512 cubes with basic optimizations and multithreading. Still not enough to draw a full XCOM map where every pixel corresponds to actual voxel. The target size 1024x1024x1024 will require actual GPU rendering.

Modern GPUs apparently can execute C/C++ with some limitations. A huge leap from the basic DirectX assembly shaders I remember being used in games like Morrowind. But shaders are still not very portable.

Then again, if I implement optimization structure, like octree, I can reduce Z dimension, since XCOM has just 4 height maps and each tile is 16 pixels high, only around 1280x1280x80 voxels are needed to draw full XCOM map.

Offline NancyGold

  • Colonel
  • ****
  • Posts: 186
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #295 on: July 10, 2020, 08:37:39 pm »
Things one learns: voxels actually do look like cubes, if you render them at resolution higher than a pixel. For some reason I believed the will look like pixels, but that is the case only when one projects them as pixels, when rendering like trinagles. And one needs to render them at higher res to precisely edit them. But triangle-style rendering for voxels has a lot of quirks:
1. One has to sort voxels by distance from camera.
2. The one draws them upscaled based of Z.
3. If several voxels project to the same screen pixel, one just blends them.
That was very inefficient but it worked for small scale models.

Alternatively one can convert voxels to triangles. And that actually works well for sparse scenes. But the conversion process is very expensive, and one cant modify the model after conversion - polygons are surprisingly hard to mutate. Although if one doesn't do large modifications, then space can be broke into parts, which are much faster to convert  to render into triangles, after being modified. I personally just raytrace them like spheres, since raytracing allows sampling very large, potentially infinite constructs. One guy even made a complete video game base of infinite fractals: https://www.youtube.com/watch?v=9U0XVdvQwAI

There fractals are mutates them with time and it acts like complex a course to navigate. Think Marble Madness + Monkey Ball on speeds.

Anyway, I have already mentioned that XCOM Apocalypse had all objects internally made out of voxels, so projectiles move with great precision
https://www.terrygreer.com/xcomapocalyse.html
Quote
Tiles were complex data structures. Each one also had a reference to line of sight definition – this was a simple 4x4x4 grid – a sort 3d texture – where each cell was either solid or empty. There were a relatively small number of these solid line of sight definitions, but enough to approximate the 3D shape of any shape of tile created. This meant that the world was effectively broken into a 3d voxel grid where weapon fire could be accurately ray-traced. It was a ball ache to set up initially, as every tile had to have a line of sight definition assigned, but really made life easy later on as collision in game then became automatically generated from the map editor.

It was a genius approach, especially in the years before decent 3d raytracing – and one of the key identifying features of an xcom game. Players always loved being able to snipe enemy forces from right across the map through a couple of windows or blown open walls. It’s also a technique which I think useful to reinvent for use in conjunction with true 3D worlds and can think of lots of good mechanics you could use them for.

Obviously I plan to integrate that voxel engine with Spell of Mastery. Just because it opens so many possibility on both visual effects and gameplay sides. But it is unlikely I will use complex projectile raycasting, since I want player being easily able to guess where unit can shot. The game does use simple raycasting already and it was real pain to make remotely intuitive. Yet I need robust large scale voxel modifications to produce stuff like tiles breaking apart or just for site map transformation.


Offline NancyGold

  • Colonel
  • ****
  • Posts: 186
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #296 on: July 11, 2020, 12:05:24 am »
Suddenly the problem of working with real world sized voxel 1024x1024x1024 models has solved itself after a refactoring. I've just detached the render size from the object size, and rendering even very large voxel objects at low resolutions is fast enough even without any optimization structures or any space coherence. As long as one has enough memory. I can still zoom in and edit parts of the model. But better ideas would be cutting piece out into separate layers which can be edited much faster than the whole model.

Editing still takes some time. Because it is, well, a frigging 1,073,741,824 cubes processed in software on an old CPU. I store just color, but 4 gigabytes is a lot of memory to process. Literally impossible to work with on a 32-bit machine without swapping parts of the grid.

Hope soon I will be able to load in XCOM maps with voxels instead of pixels. Unfortunately people have apparently lost the upscaled XCOM graphics: https://openxcom.org/forum/index.php/topic,892.0.html I've planned to use to autogenerate voxel tiles.

The figure on the screenshot is actually made out of a billion voxels.

« Last Edit: July 11, 2020, 12:08:59 am by NashGold »

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #297 on: July 11, 2020, 12:28:44 am »
What exactly data structure you use for this voxels? It is a colossal vector? or something else?

Offline NancyGold

  • Colonel
  • ****
  • Posts: 186
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #298 on: July 11, 2020, 01:33:20 am »
What exactly data structure you use for this voxels? It is a colossal vector? or something else?

As of now it just
Code: [Select]
typedef struct {
  uint32_t w; // width
  uint32_t h; // height
  uint32_t d; // depth
  uint32_t wh; // width*height

  uint32_t flags; //flags describing the vfx
  uint32_t data[]; //w*h*d voxels
} vfx_t;

Obviously `data` are not even sub-divided into smaller cubes, so each new Y or Z triggers a page fault.

Here is the first ever (to my knowledge) attempt to render the XCOM flowerbed tile in voxels:


will be some time till it gets to work that properly to render the whole map.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: XCOM Inspired Fantasy Game
« Reply #299 on: July 11, 2020, 01:22:29 pm »
As of now it just
Code: [Select]
typedef struct {
  uint32_t w; // width
  uint32_t h; // height
  uint32_t d; // depth
  uint32_t wh; // width*height

  uint32_t flags; //flags describing the vfx
  uint32_t data[]; //w*h*d voxels
} vfx_t;

Obviously `data` are not even sub-divided into smaller cubes, so each new Y or Z triggers a page fault.

Getting faster will be hard but not impossible, in C++20 they add some interesting tools that could allow speed increase:
https://www.youtube.com/watch?v=j9tlJAqMV7U
If you can't use new compiler then you can partially use this technique by prefetching memory two step ahead, some thing like:
Code: [Select]
for (int n = 0; n < X; ++n)
{
    _mm_prefetch(pos(n + 2));
    process(pos(n));
}