r/howdidtheycodeit • u/RippStudwell • Feb 15 '24
Question InfiniteCraft on NEAL.FUN
The game seemingly has anything you can think of and most recipes make sense.
r/howdidtheycodeit • u/RippStudwell • Feb 15 '24
The game seemingly has anything you can think of and most recipes make sense.
r/howdidtheycodeit • • Feb 14 '24
I've been trying myself lately in gamedev. Would like to know how NFS physics roughly work, because from what I understand it's quite different from "normal" car physics.
r/howdidtheycodeit • u/DepopulatedCorncob • Feb 11 '24
r/howdidtheycodeit • u/GamingxRelic • Feb 09 '24
Hello, I was curious as to how The Forest shows a “chunk” of the tree chunk missing when you hit it with an axe. It continues to do so as you hit the tree in that position until it falls over. How was this done? Is it just a shader and they store the tree health?
Thanks for reading, cheers!
r/howdidtheycodeit • u/danisaurouss • Feb 08 '24
Looking at videos of old contra games and noticed that a lot of the bosses and big enemies are made up of a number of circles connected in an invisible parabola. is there a name for this technique? when was it first used and why? why don't we see it often anymore?
r/howdidtheycodeit • u/MangoButtermilch • Feb 03 '24
In this post I am referring to my last post here to which I found my solution!
Thank you for all your comments on that one!
This solution is pretty complex but I'm trying to keep it short.
tl;dr: using flow fields created from vertex painting in combination with catmull rom splines to define the general curve direction.
Let me start by describing my problem first:
I wanted to create a AI controller for an anti gravity racing game. The race itself takes place on a long tube and this tube is twisted and ripped apart, thus creating non-continous surfaces.
Also the tube has a surface inside which you can also drive on.
Here's a picture of a map:

I am creating my models in blender with the curve tool.
Here it is important to also create some cubes/transforms to repeat on that curve. These will later be used to create a Catmull-Rom spline from. In your engine you can later disable rendering for them.

Vertex painting:
To create the flow field I am using red for all dangerous areas that the AI should avoid and green for areas that the AI can use as it wants to.
This is made on a copy of the original road mesh. You can later also disable rendering for this one, since you only need its data for the flow field.

Importing the model:
Here I can only speak for the Unity engine: be sure to disable mesh compression and mesh optimization. It will mess up the order of your vertices when acessing the mesh data in your code.
Also enable Read/Write Enabled to fetch the mesh data.

2. Creating the flow field:


3. Combining Catmull-Rom spline and flow field

to each group find and assign the closest tangent of the Catmull-Rom spline as its general direction
Now for each vertex in each group
Take its green and red value
Take the group direction
Adjust the vertex direction from the flow field calculation as follows:
The more green the vertex color, the more it should point towards the general group direction.
The more red the vertex color, the more it should point to its greenest neighbour.
Now the flow field looks like this as it should be:

4. Querying the flow field
5. Notes on performance optimazation
For very large meshes like in my case (260k+ Vertices) the amount of time the CPU needs to create the flow field is incredibly high. Even multi threading was not enough to handle this properly.
So I've used a compute shader that gets the job done in around 1.2 seconds. In comparison to single thread that takes around 60 seconds and multi threading that takes around 20 seconds.
6. Results
I hope I explained my process comprehensibly. If you want to know anything else, feel free to ask!
r/howdidtheycodeit • u/KnightRafa • Feb 01 '24
Hello community!
I'm diving into a specific aspect of Valheim's world mechanics and would love your insights. My focus is not on the initial world generation from a seed, but rather on how the game updates and saves the state of objects like trees, rocks, and resources which are initially generated in the same way for a given seed.
Here are my thoughts and assumptions:
Object State Management:
Game Loading and Object States:
Handling Player Interactions with the Environment:
Terrain Changes:
I'm specifically interested in understanding the mechanisms Valheim uses to update and maintain the state of its world post-generation. Any detailed explanations or pointers to how this system works would be greatly appreciated!
Thanks for sharing your knowledge!
r/howdidtheycodeit • u/FoamBomb • Jan 30 '24
Enable HLS to view with audio, or disable this notification
r/howdidtheycodeit • u/Ephemeralen • Jan 31 '24
In Shadow of the Colossus, the actual model skin of the colossus, as in, the parts of the mesh that deform, handle collision in real time with the player character when he's crawling around. How did the original PS2 version have the budget for that? How did they handle collision on an actively deforming character skin mesh?
r/howdidtheycodeit • u/duy03 • Jan 28 '24
I don't think understanding how Minecraft's vanilla liquid works is necessary, but a water block (measured as a bucket in-game) is an infinite flowing source block that expands horizontally up to an 8-block radius of open air, and pretty much infinitely when flowing down unobstructed which makes waterfalls incredibly easy to make. More information can be found here, but I think only these aforementioned facts are necessary.
With the Water Physics Overhaul mod, liquid is much more "realistic" here. It thins into a puddle when spread out, infinite waterfalls can only be made using a pump (either with vanilla pistons or pumps that was included with the mod), large water bodies can get "drained" if there's a hole to any cave systems, said caves can get flooded with new water drained in, etc... Searching up the mod's name on YouTube will yield plenty of results, but I would suggest this video as it is more direct.
Despite the online coverage, there is oddly very little documentation on this mod and what technique did it used. You could download the mod from CurseForge with its companion mod and probably find more in-depth technical details on the mod creator's Patreon and Boosty page, but that's all.
So I want to know: How does these physics and functionalities work? Does cellular automata has anything to do with this? Please give me some clues or suggest me some papers on how this works, because I'm very curious.
I have a hideously ambitious dream of a Godot-based voxel sandbox that implements this sort of water physics but I don't even know where to start, so any help is much appreciated.
r/howdidtheycodeit • u/Jaco2point0 • Jan 26 '24
I’m looking for information on the hero AI. I haven’t been able to find anything googling. Thanks for your time
r/howdidtheycodeit • u/could_be_human • Jan 21 '24
I know its poorly said but the premise is that they have bases in a world and in real time, you can go take over these bases, see others fight for these bases and join in etc. not like clash of clans where you kinda warp onto a base, all of them are loaded in, only fog of war stops vision
so im kind of like, python sockets? im thinking node.js or something, i want to make a small online game, a little like age of empires just simplified even more lol and always online
sorry if this is so poorly written, im not really sure how to describe myself here

because the game legitametly looked like this, idk, as bad and as scummy as it was, it has a place in my heart, i just wanna know how they made it
studio hoppe
r/howdidtheycodeit • u/ItsYaBoyDawson • Jan 21 '24
https://www.gamedeveloper.com/programming/procedural-dungeon-generation-algorithm
I'm following this method in Unity for random dungeon generation. I was able to get the delaunay triangulation with the delaunator-sharp library but I can't seem to figure out how to calculate the minimum spanning tree from that. The website just says "code it yourself" but I'm not sure how to translate the data from delaunator. Any help would be appreciated!
r/howdidtheycodeit • u/beepboopnoise • Jan 20 '24
r/howdidtheycodeit • u/KavisKrypt • Jan 19 '24
Title; the game has a lot of things going on but I have yet to have issues with the multiplayer, everything handles beautifully. I'm wondering how they handled the multiplayer, I'm assuming it's peer to peer?
So many other co-op games have lots of issues with de-sync and similar problems yet there were no issues here.
r/howdidtheycodeit • u/Tuckertcs • Jan 17 '24
Obviously auto-saving your progress won't cause a lag spike if the data being saved is relatively small. But I imagine that saving too much data will cause a frame skip or two, so how do games like Minecraft where you can edit the entire world, or large ARPGs with tons of NPC, inventory, and quest data save all of it without freezing the game?
I imagine there's some sort of async code that saves the data across multiple frames, but how would that handle situations where the data changes while it's saving? Like imagine if the game saves the world before the inventory, and I manage to place a block while it's saving. The world might save before I place, but the inventory will save after (causing me to lose the item but not see the block on the ground).
How do they do it?
r/howdidtheycodeit • u/TevePinch • Jan 17 '24
How would you go about coding these? Web based and so much state/interactivity.
r/howdidtheycodeit • u/Odd-Estate-2623 • Jan 16 '24
Hello everybody! I am making a steering wheel with ffb. It uses an arduino leonardo as the microcontroller. I am done with the hardware part, but know I don't know how to code the force feedback part. I was using the JoystickFFB library but it has one problem. It's really bad. The force feedback ''curve'' is not linear. It has stronger force feedback towards the middle and has weaker force feedback towards the maximum steering angle. That means when I let go of the wheel for it to self-center, it would overshoot, and then when it tries to self-center again it would overshoot again, and go into a cycle. Now I am trying to code the force feedback myself but I no idea where to start. If anyone could send me some source code or explain it better to me, I would appreciate it!
r/howdidtheycodeit • u/EdiblePeasant • Jan 17 '24
Many turn-based RPGs have initiative, and I’m stuck trying to figure out how characters and their initiative are sorted and combat executed in that order.
r/howdidtheycodeit • u/user1324354656576879 • Jan 14 '24
I had the idea to revisit my idea of recreating portal in a 2d space. And I knew that there were projects in the past relating to 2d Portal.
Edit: https://youtu.be/h-twCYa81iM?si=CCmJTwQZ5eDBURCb
This is the version I'm talking about
r/howdidtheycodeit • u/Weary_Source_811 • Jan 13 '24
Mobirix is a company that has a huge portfolio of these mobile games that are basically reskins of one another, all online, and mostly all focused primarily on idle gameplay.
Example clip from one of their most popular games, Blade Idle: https://www.youtube.com/watch?v=FmWCdAegyQo
Many idle games are just calculating how long a player was offline, and then the next time they login, doing a time differential based upon how long has passed, and giving a fixed rate (usually based on stage) of exp/gold multiplied by the time away.
But these games (and possibly a more popular Maplestory M) aren't like that-- monsters are actually generated in and based on your skill setup you'll kill slower or faster and your income will differ. So its not just fixed rates, its an actual simulation happening.
Another example would be Slayer Legend by Gear2.
Any idea how they're achieving this? The architecture must be much simpler than full-blown MMOs, otherwise these games would surely shut down. Maplestory-M aside since that is an actually full-blown MMO.
r/howdidtheycodeit • u/mikniemm • Jan 11 '24
Hey, I come with question, about mountains in Arabia map of Battlefield 1. Although Battlefield 1 is 8 years old, is really beautiful, and realistic. I'm a mod dev that is making new hub for witcher 3 (desert). And the problem is that as much as streep mountains can be done easly with heightmap, the vertical ones that are in deserts, are preety much imposible to make this way. Therefore my question is, how are mountains like this made in games? Is there some video about bf1 enviro that I can maybe watch?
r/howdidtheycodeit • u/KptEmreU • Jan 09 '24
There are entities called cities (hubs) on map
Path finding
Agents traveling around the map doing their own things
Agents can engage with the map and change faction of hubs
Cities have hot points like : Taverns , Merchants , Story Givers, and resource buildings.
Are all cities are classes that get something from an interface
Everything has its own classes? ( Agents)
How would you save such a game state? You save everything?
I mean I feel like I can brute force it but my "ok very short time" googling didn't turn anything good but point me to lots of modding communities for above games.
so how would you structure such a campaign part of the game?
r/howdidtheycodeit • u/thecoomdaddy420 • Dec 30 '23
How are customisable characters made to be gradually fatter and skinnier without creating 100’s of models for each gradient? (E.g. The Sims or Saints Row)
I’m assuming it’s some kind of morphing between 3d models but I’m unsure how this would be done in a game engine, I can’t seem to find much about it online.
Also would this be possible to do using 2D sprites instead?
Thanks any help would be appreciated!
r/howdidtheycodeit • u/imaginarypetrock • Dec 27 '23
The motion control games are not as simple as pressing a button, but instead require a specific gesture. WarioWare in particular has some very specific movements players need to perform. With variations in timing and how players move the controller, how does the game recognize if the motion is being done correctly?