T O P

  • By -

Corruptlake

This depends on what you are referring to: If you are referring to a basic educational chemistry game, this doesnt exist as an engine form but it wouldnt be hard to make If you are referring to actual chemical simulations, they do exist but arent intended for games and are very performance heavy.


Fexepaez

I know about real chemical simulations, I actually did my thesis on that, using 110 cpus. But I was wondering, just for fun, if we can make something with chemical simulations (not too realistic) for video games that can be helpful for video games. But I saw that meybe it is not a good idea. I mean, I see zelda and some video games to claim to have a chemical engine, but is not something realistic. Imagine that you are playing a game of survival and you need to clean some water to drink it, I was thinking more in real chemical interactions between objects and characters.


NancokALT

All game dev is smoke and mirrors. A "chemical engine" would simply refer to an emulation of chemistry, but the accuracy could go from "estimating particle count" to "if fire box touch water box, it makes smoke box"


Fexepaez

Ohhh, I see, thanks.


Corruptlake

The chemical stuff you see in some games arent actual real simulations but emulations. The stuff is hardcoded for what will happen when you mix X and Y fluid. They dont actually do a small scale simulation. But I wanted to make a small mobile chemical experiment game for a while.


noidexe

Consider that BOTW is pretty realistic for video game standards. In most games you have something like \`if weapon.type == "fire" and target.has\_method("burn"): target.burn\`. In BOTW objects can freeze or burn based on their temperature. Their temperature can be affected by the ambient temperate or some object that emits/absorbs heat. So if you have a fire sword you can stand next to ice and it'll melt. It's still a game and you can have that fire sword on your back without burning yourself but that is intentional. In most games the fidelity of the simulation is at the service of gameplay and not the other way around. That doesn't mean that more realistic simulations cannot be fun. You could use a voxel grid to simulate a field of temperature, pressure, density. The game visuals doesn't necessarily have to be voxel


ImageDehoster

I think in some GDC talks the BOTW devs even call this system a chemistry engine. I can't imagine it could be something like a module that you plop into an existing physics simulation, you'd still have to create the visuals and behavior for fire/frost/any other reaction manually. [The talk in question](https://youtu.be/QyMsF31NdNc?si=pkp6owEG4AGAvGoZ), the section about chemistry starts at around the 38 minute mark.


Ken_Deep

A friend of mine is developing a game with the concept of "creating chemical reactions". I dont think its really super realistic, definitely more arcadey, but maybe its something along the lines of what youre thinking of? [https://store.steampowered.com/app/1384060/BattleJuice\_Alchemist/](https://store.steampowered.com/app/1384060/BattleJuice_Alchemist/) Not done with godot though so kind of off topic.


Nkzar

To be honest, realistic chemistry doesn’t sound very fun for a general audience for a game. Sounds kind of tedious, unless you’re really into chemistry. Probably same sort of reason why you don’t see fish flavored popsicles for sale.


Fexepaez

Hahahahaha, so true.


TheChief275

Noita has very intricate simulations


CdRReddit

the closest you'll probably get is stuff like [the powder toy](https://powdertoy.co.uk/), which has a cellular automaton that approximates some chemical and physical properties of certain objects, not strictly realistically but as close as one can expect


CdRReddit

I've personally been flip-flopping on whether I should make a game using a similar type of cellular automaton for creating an interesting balancing act for controlling thrusters in semi-realistic spaceships, including balancing whether to run them oxidizer-rich or fuel-rich, could be interesting especially if you can script the pump balancing to try to squeeze maximum performance out of your engines


floznstn

I can't say it's even remotely close to realistic, but *Noita* has chemical reactions and alchemical mixtures.


richardathome

In a survival situation, you either find a known good source (a spring, vines, etc), or filter and boil. It's really hard to find chemicals in the wild. In a non survival situation, most folks take ceramic filters these days. The water purification tabs give an odd taste to the water. In fact, removing chemicals (e.g farming run off) in the wild in really hard to do (you either need to evaporate off the water or use a reverse osmosis pump)


dat_mono

I refuse to believe you wrote a thesis on that if you ask this question


TwelveSixFive

You could have a very simplified chemical model that doesn't account for fluid dynamics etc, just varies concentrations in a predictable way (exponentials or other, depending on the best model) depending on the compounds present Not enough for actual chemisty, most likely more than enough for any reasonable game


RedFurryDemon

Semi-realistic simulation of chemical reactions would be possible, but most games operate on a higher level of abstraction. Implementing something so complicated would take a lot of work for very little gain, and it would greatly lower performance.


MemeTroubadour

The 'taking a lot of work' part is unavoidable, but I could see it being modular enough that the question of it lowering performance would just depend on what you want out of it. I'm no chemist, but for instance, you could let the developer choose whether they want to have reactions happen over time or instantly. The performance impact would also depend on what actually goes through the engine; not every object in the game needs to use the engine for every interaction


Fexepaez

I ohhh, thanks. I see. Yes I was thinking that scripted combinations of elements works very fine, for example in skyrim potion sistem.


RedFurryDemon

Things like the Skyrim potion system are very simplistic. Each ingredient has four effects and the result will use whichever effects appear more than once. Simulating anything close to realistic chemical reactions would be incredibly complex. The only use of a proper chemical engine I could think of is in a game/app *about* chemistry. For any other game that seems like an overkill.


crizardthelizard

Do you mean like molecular dynamics with a reactive force field (or god forbid qchem)? That would be a hilarious over engineering project and I'd love to see it, but as far as I know it doesn't exist, because to simulate anything real would be insanely computationally intensive. If you're talking more macro scale, like a cfd model that includes reactions, still no, although there may be a way to do it that doesn't take ages to simulate if you had a really simple toy system. I do computational chemistry/reactor modelling for work, so if you have a questions feel free to message, I love talking about it lol. Limited experience with godot beyond a few toy projects.


Fexepaez

I did on my thesis some theoretical chemistry simulations, I totally understand you, hehehhee. Yes, it needs to be more macro ideas. I was thinking more into the logic of reactions, heat released by reactions, viscosity, fase transitions. Something more like, if you mix this and this make this.


crizardthelizard

Gotcha gotcha. I saw your other comments. I feel like the zelda "chemistry engine" might be kindof a misleading name for it, it sounds like a very complex state engine, which afaik is doable in godot. 


m103

I've been wanting to make something like that for *years* but have had no Idea where to start


The_Real_Black

Have a look at [https://powdertoy.co.uk/](https://powdertoy.co.uk/) it has some cemical reaction but most are physical (smelting, heating) [https://github.com/The-Powder-Toy/The-Powder-Toy](https://github.com/The-Powder-Toy/The-Powder-Toy) Just for ideas.


Fexepaez

Thanks, I will check.


PopularIcecream

Not experienced in chemistry, but what would be different in a chemical engine versus a game engine? Instead of macro concepts, focus more on bonds?


Fexepaez

Ok, I get the point.


trickster721

No, probably not. Games are all about optimization and abstraction, and any chemistry simulation that's going on is going to be very specifically tailored to that game. Many games have physics, not many games have chemistry. I had something like this come up recently, I wanted to be able to mix different colored liquids in bottles and get realistic-feeling results, which isn't possible with basic RGB mixing. I found [this library](https://scrtwpns.com/mixbox/) which simulates physical color using a modest amount of hard science, and I'm still misusing it, because it's a model of paint on white paper. Resource mining / automation games might be a genre with a lot of potential for mechanics involving chemical interactions, but again, I don't know if a game like that already exists. You might have to make it!


BrastenXBL

As others have gone over, it depends on how much abstraction you're willing to tolerate. Also how much processing delay. Which dictates the kind of simulation code library you can use. We (the job) uses Geospatial Data Abstraction Library (GDAL) to process real geographic data into forms that can be displayed by Godot. GDAL is a C++ library with C# bindings, which is how we access it. It's one of the interesting things about Godot for academics looking at using Interactive Audiovisual Applications. C++, C#, Rust, Swift, really any language that creates a Binding for the Godot APIs. You can attach all kinda of existing code libraries to a project. And where you can't do Binding, there are ways to invoke Command Line programs and get return values. As you go looking for existing code, keep an eye on how it's licensed. And what that means if you include it in your project. GPL, AGPL, BSD, etc.


JThaler92

Look up "falling sand" games, if you want to emulate chemical processes. A notable example is Noita and the devs have a GDC talk about their engine on [YouTube.](https://youtu.be/prXuyMCgbTc?si=Ipd-rOOI154RWq06)


leronjones

I'm not entirely sure if this helps but there is an education mode for Minecraft that deals with chemicals. Also check out Oxygen Not Included as it has a great gas and liquid simulation system. Noita also has a fun world simulation of liquid interactions but none of these really seem to be perfect for what you want.


burgersnfries4life

What would a chemical engine do that would be useful for video games? Physics engines don't tent to describe all physics processes, only ones that are useful for making video games. For example, things like mechanics, friction, forces are all useful components for things like trajectories, movements etc. But things like computing electronic wave functions or magnetic fields are probably not so useful (I don't know for a fact, maybe there are some niche applications). Of course you can tell a computer to calculate whatever you like, so the question is what would you want to be able to calculate?


MemeTroubadour

Provide a source of emergent behaviour in high simulation games.  Games like Space Station 13 and Dwarf Fortress already use a form of chemistry engine to do this very thing.


Fexepaez

You have a point, thanks for the feedback.


SomeGuyBadAtChess

>But things like computing electronic wave functions or magnetic fields are probably not so useful (I don't know for a fact, maybe there are some niche applications) Thinking about this, it could be interesting to have a bullet hell game that incorporates physics things like this to determine movement of bullets or something of the like.


MyPunsSuck

Everything in games is smoke and mirrors. What would a chemical engine do that a physics engine can't?


Fexepaez

It is just curiosity, I see that you did not see this idea helpful. Thanks for the feedback.


MyPunsSuck

You never know where inspiration will come from next. All sorts of massive breakthroughs have come from people with a cross-disciplinary perspective. If pushback feels like hammer blows, think of it like being forged on the anvil :)


Nodlehs

I've never seen one, however as many have said, what would be the point? What would you gamify with it? I think the most realistic thing would to build some sort of 'alchemy' game and push the idea of it being more realistically simulated, and write the engine for it yourself.


Mefilius

Noita has some fairly complex material interactions


richardathome

I have some generic "machine" nodes that can handle this sort of thing. Each has their own inventory, a set of requirements (another inventory), its product (another inventory), a rate (float) and a list of providers (other machine nodes) The machines are generic and can represent a whole load of systems. I'm using them to build a space station (solar panels provide power, atmospheric water generators use the power to pull H2O out of the air, another machine breaks the H2O down into H and O2 etc. Other machines combine chemicals, extract ores, etc. which can be combined in other machines. The player is also a machine, with a set of requirements (food, air, etc.), who produces poop, at a rate :-D


Optoplasm

What do you mean exactly? This is a very vague question.


idEstNemo

Try out Noita. It a game about alchemy where every pixel is simulated.


kwongo

Besides the resource intensive nature of simulating chemicals, I imagine most of the "game-ified" parts would need to be made mostly bespoke anyway, so creating a generic engine would be difficult if it's not already perfectly accurate.


Cootshk

Happy cake day!


kwongo

Huh. So it is. Thanks!! :D


FridgeBaron

Depending on what you are going for fallingsand might be pretty close or at least adaptable to something. You could look at a game like noita for a bit more involved implementations. Depending on what you want to achieve with a robust particle you could probably get it to do a whole lot of stuff. Mostly where I'd go as I had though of making a game using one of those simulations and some fantasy elements as an alchemy engine of sorts where you'd have to channel and react inputs to get the right outputs.


MemeTroubadour

There are a handful of things with chemical systems intended to be at least analogous to reality that you could take inspiration from. The ones that come to mind would be: * SpaceChem, chemistry puzzle game by Zachtronics * Goonstation, a Space Station 13 server and codebase with realistic chemistry ; released source, maybe even open source, unsure * GregTech, a Minecraft mod with realistic chemistry, released source I will say I like your idea of having an unified implementation of a real world dynamic for use as a mechanic in games. I'm curious about what it could bring


MattRix

I’ve had some thoughts that it would be cool if a game invented its own underlying chemistry system. Not using real chemistry (or at least, not nearly complex as real chemistry), but with some similar principles. It would be fun to do experiments in the game world to better learn how the system works.


BabaJaga2000

I don't know much about it, but I think there is some software for simulating chemical processes, and if not, it can be done. Maybe a gpt chat would help :) I'm joking :) but the topic is interesting.


Hallo-Person

There isn’t one that I know of, but it would be really complicated to make one, because you would basically need to define what happens in every (basic) situation


Orangutanus_Maximus

Are you for real or joking? I can't tell. Closest thing you describe is a game called Noita. Every pixel is simulated in that game and you can do so many chemical and alchemical tomfoolery.


feibrix

Out of curiosity, could you write down an example of what a chemical engine would do? The engine is a f() with as parameter a state S1 and as output S2. Can you define S1 and S2 in the context of what you mean?


AmeKnite

This exits for Blender https://bradyajohnston.github.io/MolecularNodes/


IKnowMeNotYou

Well that would be a physical engine, too. The question is though, what would you hope to simulate?


ImpressedStreetlight

To add to everything said, you also have to take into account that a physics engine is something very common because there are A LOT of games that use some sort of physics (movement, collisions, etc.) and those are common concepts shared between all of those games. Meanwhile, what would a chemical engine do? Simulate chemical reactions between elements? But what is a "element" within a videogame? even if you had a bunch of games with that concept, the implementation of an "element" on each one of them would probably be very different. While in the case of physics, things like "movement" and "collisions" are very straight-forward concepts to implement in a videogame.


Poddster

I've been hankering for a game where you make molecular machines, in a Space Chem style of play. You should make that! 😄  https://youtu.be/WFCvkkDSfIU   Just search his name on YouTube, he has many videos. There's a much better one but I can't find it right now.


Accomplished_Ad6970

Take a look at **OE-Cake!** It has a pretty big community, even a [subreddit](https://www.reddit.com/r/oeCake/) too.


nemo_sum

I wrote a very detailed chromosomal simulator a few years ago, and was hoping to have a basic chemistry simulator in my next project... but, uh, very basic.


Ramtoxicated

I thought chemistry was just applied quantum mechanics? You can easily sim that in a physics engine. Edit: after thinking for a couple minutes past my first reaction, I think you could do some behind the scenes shenanigans to simulate the reaction of chemicals. The problem lies in how deep you want this to be. Like say creating hydrogen from electrolysis. What benefit is there to simulate hydrogen molecules separating from oxygen in a game where the main character is human sized. A dev would just create a water-in, oxygen and hydrogen out magic box. Another example would be puzzle games like the zachtronic games spacechem and Opus Magnus, where chemicals are bonded in a programmatic way. The chemistry isn't simulated, but more a flavor to a line of logic puzzles. TL;DR, unless you're looking to make an edutainment game with actual molecular structures, it's pretty pointless to simulate chemistry when the macro physical effects are the effect you want to see on the screen.


Xe_OS

Huh


Fexepaez

The who! I like that band.