I’m trying to implement a top-down Zelda-like enemy movement system. Consider a screen of x tiles wide by y tiles tall, each tile being 16x16 pixels. I’m not asking for code here. I’m asking for direction. I’m using Godot, but perhaps the answer isn’t engine specific. Should I use something akin to NavigationAgent2D? Or manual movement? Based on the requirements below what is the best practice for an enemy movement system? Requirements: Enemies can only move in cardinal direction...| Recent Questions - Game Development Stack Exchange
Goal: How can I best simulate headlight beams, in a night-time scenario, in Godot 4? The components I have are all sprite-based - a top-level car sprite, a shadow sprite (that is offset based on time-of-day, and changes), and a lane sprite (the D) that is attached to the car. This is on top of a road-bitmap, that will itself have its darkness/brightness adjusted based on time-of-day. The components: I can think of three ways that might work: Add a new sprite, (toggleable, with adjusted opacit...| Recent Questions - Game Development Stack Exchange
I have this simple scene based on a Control Node and a few containers, note how the UI elements are anchored to the top left of the screen: When I put it into another scene, it looks like this: I tried playing around with the different anchor presets according to the documentation, but it doesn't seem to do anything. How can I make sure that what I'm seeing on my UI scene is what I'm getting when I integrate it in another scene?| Recent Questions - Game Development Stack Exchange
I have looked up ways to calculate DeltaTime in the past, but the 'solutions' seem to have my program be slightly jittery or not move things correctly. As far as I know, you would calculate it by finding the difference in time between the current and previous frame (Is this correct?). I have seen solutions find out DeltaTime with a fixed frame rate, but that is not what I am looking for.| Recent Questions - Game Development Stack Exchange
I'm making a game where players need to spell English words (including American and British English) using a limited set of 8 distinct letters, which can be re-used multiple times. How would I go about choosing those 8 letters to maximize the number of words players can spell? The words can be any length and have repeat letters. Proper names are OK too. I would think that using the four most common vowels (A,E,I,O) and the most common consonants (S,T,R & H - I believe), would yield the most w...| Recent Questions - Game Development Stack Exchange
I have tried to make games in the past, but have been too ambitious and now have no clue what to do next and feel very burnt out. I have tried: SDL2 with C/C++, but I didn't like how its DeltaTime worked or the amount of external libraries you had to install Raylib with C,C++,Rust,etc, but I didn't like how the projects were set up or compiled Creating my own console-based renderer, but that went nowhere SFML2/3 with C/C++, but I didn't like how hard it was to remember how to do things LibGDX...| Recent Questions - Game Development Stack Exchange
In Godot 4.5 beta 6, I have a drag-and-drop situation where the data being moved between nodes is stored using instances of a custom resource. The resource instance is added to a property called data inside a scene called slot.tscn and set to be unique. Multiple slots are then added to the scene tree, and their data instances configured with different values, depending on what data each slot is supposed to hold. When the player drag-and-drops from one slot to another, the resource instances h...| Recent Questions - Game Development Stack Exchange
I’m a beginner developing a 2D game in SDL2 using C with a visual style similar to Geometry Dash (simple shapes, clean high-resolution graphics, not pixel art). I want the game to scale correctly to fullscreen on arbitrary monitor resolutions, keeping graphics crisp and sharp. I’ve found little guidance online about the industry-standard approach for this. I’m unsure whether I should: Use a fixed-size display buffer (a 720p or 1080p texture set to the render target) and scale it to the ...| Recent Questions - Game Development Stack Exchange
I see in noise functions a lot the function "&256" I think it's used to wrap a remainder from 0 again for values larger than 256. Is this what the function does? For example In c++ Int A = B & 256; What happens if I try using for example 300? Does & 128 work to wrap at 128 but 300 doesn't because it is not a binary power of 2? So only &2, &4, &8, &16, &32, &64, &128 ,&256 work to be wrapped but for example &300 doesnt? I understand this is a binary function| Recent Questions - Game Development Stack Exchange
My player is baked entity in subscene while main camera is outside on scene. For some reason system cannot find transform of camera, GameObject was found though. public partial class CameraFollow : SystemBase { Transform PlayerCamera; protected override void OnCreate() { PlayerCamera = GameObject.FindWithTag("MainCamera").transform; } protected override void OnUpdate() { var PlayerPosition = SystemAPI.GetComponentRO<LocalTransform>(SystemAPI.GetSingletonEntity<PlayerTag>()); PlayerCamera.posi...| Recent Questions - Game Development Stack Exchange
I need to know if the Perlin noise code I'm making that will use the hermite curve needs values between 0 to 1 or -1 to 1 in its permutation table or whatever is correct. I read the hermite curve uses values between 0 to 1 but I'm not sure. This means the permutation table is 128 or 256 values between 0 to 1 so they're all floats or doubles. Im asking about the range so the output stays in range because the formula will probably equal very large values if you use values that are larger than i...| Recent Questions - Game Development Stack Exchange
Let's assume the following situation: I have a server, that sends a snapshot of current game state to all the clients at a fixed time. Server is authoritative, all the physic calculations are done on its side. Every client receives a snapshot in a form of data packet that contains: server_timestamp position rotation After receiving the data packet, client stores it in the buffer for the later interpolation. The interpolation is based on the standard linear interpolation rules: x = x0 + (x1 - ...| Recent Questions - Game Development Stack Exchange
The Goal I have a game in Unity which utilizes pixel art. I'm not following the standard rules of pixel art, however. I'm ok with sprites having different sized pixels, pixels rotating, and pixels not aligning with the pixel grid. An example (not my video): https://www.youtube.com/shorts/FCJWPYqV0TI. I'd also like the player to be able to run the game at whatever resolution they want while maintaining the same vertical camera size, i.e. with a wider resolution you'd see more of the world hori...| Recent Questions - Game Development Stack Exchange
I am making a shoot em up game with an aerial view. It’s main gimmick is that, instead of working like a machine-gun, your character throws a boomerang that hit the enemies both on the way there and back. Aside from completing the level, the main goal is to get the highest score. You get score for each enemy defeated and get a bonus for killing multiple targets in a single shoot, encouraging you to make fewer attacks. Now the problem are the bosses. Almost all of them will be single enemies...| Recent Questions - Game Development Stack Exchange
I'm implementing perlin noise in C++. I have a permutation table for the gradients vectors and want to shuffle them with a 2 number hash that has 2 purposes. The hash uses the integer portion of the current X and Z position of the float or double with 1 hash method (possibly Szudzik hashing) and another hash to generate a number used to select which element of a unshuffled permutation table to select (possibly using modulus of a division for any point not equal to zero) but I'm looking for be...| Recent Questions - Game Development Stack Exchange
I've been trying to write code that can run on multiple GL versions, since I mostly only use very basic features, and one of the versions I am targeting is GL ES 2. Since I know you're supposed to initialize GL_TEXTURE_WRAP_R for cube maps (see this for example), I was surprised that this parameter is not available according to the GL ES 2 reference, even though GL ES 2 has explicit support for cube maps. How is this parameter handled then? Is it automatically set to GL_CLAMP_TO_EDGE internal...| Recent Questions - Game Development Stack Exchange
I'm using a shader graph in the Universal Shader Pipeline (URP) to do some post-processing in a ScriptableRenderPass. How do I get the world coordinates of the screen position? I have tried using the View Direction node, set to World: And I have tried the Screen Position node, with either a Transform node or Transformation Matrix node: Neither seems to be working because the colors change as I move the camera around, but I would expect the color to stay the same since the world position of th...| Recent Questions - Game Development Stack Exchange
I am quite new to JSON and I have been having trouble with this data-driven asset manager (not my code). I have been trying to deserialize parameters for my TmxMapLoader object from JSON. It takes the parameters of TmxMapLoader.Parameters type. Here is the Asset.class file that's responsible for deserializing JSON: public class Asset implements Json.Serializable { public Class<?> type; public String path; public AssetLoaderParameters parameters; @Override public void write(Json json) { json.w...| Recent Questions - Game Development Stack Exchange
So I'm adding spherical area lights to my application, and comparing my results with mitsuba, I am getting some differences (left is my approach, right is mitsuba - a pathtraced reference): What I am mainly noticing is that: The specular is way too bright for roughness values over 0.5 The specular shape gets "flat" (Left-mine, Right-mitsuba, noise caused by low sample count): --- I am using the closest point approximation and the normalization term proposed in Real Shading in UE4, that is: (r...| Recent Questions - Game Development Stack Exchange
I've already asked this on the GameMaker forums but had no response so far. I'm making a little Lunar Lander game as my first foray in to GameMaker, I'm wanting to have the ship land and take off again too. I'm new to scripting and programming in general and I'm having trouble with acceleration, in particular with gravity. Basically I need to: Be constantly pulled downwards to simulate gravity up to a maximum speed (terminal velocity) Activate thrusters to accelerate my ship towards its curre...| Recent Questions - Game Development Stack Exchange
I'm trying to count the number of active touches in screen in order to perform an an action in case that there are two touches: auto jumpListener = EventListenerTouchAllAtOnce::create();| Game Development Stack Exchange
I read that the permutation table in classic perlin noise uses values from 0 to 255. I want to know if the quantity of elements can be increased. I think it uses 256 values (0-255). I'm going to make my own table for my own version of the classic algorithm. In the algorithm I want to know if there is 1 of every count of elements like it would be from 0 to 255 if they were all integers in order (not skipping any whole number), basically I want to know if the count of elements in the array is e...| Recent Questions - Game Development Stack Exchange
Consider a scenario where an object's world position is x distance in magnitude away from another object's position, naturally you would just use trig to determine the hypotenuse of the vector between them... is it nearby? WRONG. because the overall mesh, that is drawn relative to that translation offset or position, could be very large. So you might have a giant BlackHole instance which has a world position quite far away from the reference object, but its overall mesh could be nearby, or ev...| Recent Questions - Game Development Stack Exchange
I am currently implementing gizmos in my engine (or rather continuing the implementation I made a year ago). I had implemented a way to choose whether transformations are applied based on local space or global space, which is pretty easy for translation and rotation, but not so much for scale. What I would like to do is apply global space scaling without skewing the axes, ideally without using matrices as extracting scale from a matrix is hard to do right. My solution currently (which does no...| Recent Questions - Game Development Stack Exchange
I have an asset called "Ocean" that contains 100 fish, and one of the prefabs for these fish is called "Dolphin". My game has 100 scenes, and each scene contains 1 different fish from the "Ocean" asset. I know that Unity will include the whole asset "Ocean" in the build because my 100 scenes use all 100 fish in the "Ocean" asset. --- One of the 100 scenes is "THIRD_SCENE" that contains the prefab "Dolphin" mentioned above Suppose that, at the beginning of the game, I only want to load this pa...| Recent Questions - Game Development Stack Exchange
In Godot 4.5 beta 5, I am trying to override the text setter on a Label node. Following the documentation, I did: func _set(what: StringName, _value: Variant) -> bool: if what == &"text": print("Side effect triggered!") return false This sets the Label text as expected. What I don't understand: When I call $Label.text="hello" in a script attached to the parent node, the value is set and the side effect triggers. But when I call text="hello" in a script attached to the Label itself, where I ha...| Recent Questions - Game Development Stack Exchange
I'm working on a mod for 1.7.10 Forge that needs a complex config for the user to set up, but only the "general" category shows up (from Configuration.CATEGORY_GENERAL). This is how stuff's being registered: public class ModGUIConfig extends GuiConfig { public ModGUIConfig(GuiScreen guiScreen) { super(guiScreen, ConfigurationHandler.getConfigElements(), Reference.MOD_ID, true, true, GuiConfig.getAbridgedConfigPath(ConfigurationHandler.getConfiguration().toString())); } } public class Configur...| Recent Questions - Game Development Stack Exchange
I'm writing a gdextension and trying to format a string using an array as one of the parameters. Example: auto angles = godot::Array::make(1.0, 2.0, 3.0); auto s = godot::String("{0} {1}").format(godot::Array::make(1.0, angles)); // Hoping to get something like "1.0 [1.0, 2.0, 3.0]" But running this code throws an error: STRING.format Inner Array size != 2 What is the correct way of formatting a string with an array parameter?| Recent Questions - Game Development Stack Exchange
My player HUD works perfect, but when I move, the monster name moves with me instead of getting attached to the monster. Player has a HUD and I'm using Scene2D.ui to pull it off and works great. I use unit scale, that's why I got 2 camera. One for UI stuff and other for game. public void update(float deltaTime) { // update creatures world.getPlayer().onThink(deltaTime); for (Monster monster : world.getMonsters()) { monster.onThink(deltaTime); } // update camera to the player camera.position.s...| Recent Questions - Game Development Stack Exchange
In my physics engine, I'm using impulses to solve collisions. I'm basing all calculations on these equations: impulse = desired_velocity_change * mass impulse = force * time friction_force <= normal_force * coefficient If an object moves along flat ground (infinite mass), after integration it'll be moving slowly "into" the ground due to gravity. This means that the impulse needed to react to that (given the restitution equals 0) will be the velocity in the direction of the contact normal, mul...| Recent Questions - Game Development Stack Exchange
I am trying to make html5 games to be played on the browser(not offline apps), and I am trying to support the maximum number of platforms, hence I need to know what dimension should I use for the g...| Game Development Stack Exchange
EDIT 2017-05-14 dvb. Issue still active to this very day, see geforce forum link in main question. Note 3: "Stoltverd" has posted a "fix guide" on geforce forum. It has workarounds for non-OpenGL ...| Game Development Stack Exchange
When I set deferred rendering the global fog from the Unity Standard Assets does not work, there is no fog at all. With forward rendering the global fog works. How do I add fog with deferred render...| Game Development Stack Exchange
I'm attempting to copy/modify the MultiplayerShootout project's multiplayer functionality for my own project. I'm running into issues when Player 2 joins a running session though. Finding it very h...| Game Development Stack Exchange
Is it beneficial to use Generate Mipmaps for a texture used in a skybox shader? I need to use tex2Dlod to fix the edge seams issue, and I want to use the highest LOD I can reach in order to get the| Game Development Stack Exchange
I was recently reading about the technology of Ocarina of Time/Majoras Mask and discovered that world collision is done using a single triangle mesh (vertices, normals, etc) for an entire area. The...| Game Development Stack Exchange