New answers tagged

3

It depends GLFW is just a wrapper around the Windows API calls, so whether you create a window using GLFW or create one using the API, the same calls are ultimately being made. However, a wrapper such as GLFW can be expected to be robust, to do error-checking, to select optimal formats, and so on, which you may not do if you just wrote the code yourself. ...


0

OK well eventually I think i found the answer (I was WAY off when I originally wrote the question). As I think Vaillancourt was alluding to in the comments above, I wrongly thought the only way to RayCast in box2d was via the b2Fixture class. There is in fact a RayCast function on b2World also. Trying this World RayCast instead brought out a new problem ...


1

The results are not what you expect, but they are not wrong. It’s just that for a given orientation there are at least two “paths” through Euler angles that lead there. For instance, the identity quaternion is trivially converted to Euler angles [0,0,0]. But doing three 180-degree rotations around each axis leaves you in the same orientation, too. That ...


1

I'll not cover what has already been said it the other answer as it's good advice (#pragma once should be the first thing seen in each of your own .h files; in headers, include what the header actually uses, forward declare what it only tell it uses (e.g. only used as pointers) and include in the cpp [note that there is some debate about it, and I think ...


1

My suggestion is to Use include guards on your .h files Move necessary #include directives to these .h files A .h file is an interface to describe some other compiled binary file. If I want to include Guy.h in LevelManager.cpp, I shouldn't have to comb through Guy.h to see which other #includes I need to add to LevelManager.cpp to get Guy.h to not need ...


4

First of all, you dont have breaks in your switch statement, that means that if your random number is for example 1, after substrating the speed value from the position, the program will keep running inside the switch statement executing the case 2 and 3, so the case 3 will be always executed, making the object move to the bottom and the case 1 will be more ...


1

Yes. Your program is waiting for the user to give their input before continuing. The workaround to this is to use asynchronous input. An example of this in GLFW is to use something like this: // Set the callback glfwSetKeyCallback(g_odin.windowManager.g_window, key_callback); // The function that gets called on key events void key_callback(GLFWwindow* ...


0

I fixed this by switching from the latest github code to the release code. When I posted this question I didn't realize I was using the latest github code.


0

I fixed this by switching from the latest github code to the release code. When I posted this question I didn't realize I was using the latest github code.


1

Setting mass for static ground to 0 var groundRigidBodyCI = new bullet.Bt.RigidBodyConstructionInfo(0.0, groundMotionState, cast groundShape, new bullet.Bt.Vector3(0, 0, 0)); and enabling fallShape.calculateLocalInertia(1, fallInertia); worked for me!


1

Not sure if you got this, but I worked it out pretty sure... The goal is they're trying to make the existing ones in SkeletalMeshMerge.h editable on the blueprint side, so basically going into that file I could see what the arrays were. So you want the FSkelMeshMergeSectionMapping_BP to contain int32's: USTRUCT(BlueprintType) struct MULTIPLAYERARENA_API ...


1

Is copying the file too much to expect from users who want to switch computers? Not really. Well, it could be for younger less tech savvy players. Regardless, you want to make it easy. The user might not know what files to copy or where to find them. Have an export and import feature. If I understand correctly, this is not only for the world, but also for ...


1

Well I'd say that every time you calculate your velocity, you should add your drag to it. Framerate independency is hard to achieve in Unreal, given its reliance on ticking components. So long as you use deltaTime every time you're calculating anything, you should be fine. Force = Mass * Acceleration. Acceleration = DragForce / ObjectMass Velocity = ...


0

I havent found an answer but I found a workaround. I moved the code in the UObject that starts the timer to my GameInstance and everything works as it should. I have no idea why I couldn't do this in the UObject but this is probably better design wise anyway as the API shouldn't have to worry about timers and such.


5

This depends on how good the compiler is at optimizing the code. I'm inclined to say it is good if not very good. However, if you want to be sure, you got to do the experiment. Measure both versions with a profiler and see what comes up on top. Your job is not to optimize code, it is to make a system (a game in this case). If you go ahead and do that, and ...


1

Well I kind of figured it out, but thought I can post here for any comments in case I am doing anything wrong. Also this might help someone who reads this with same problem. Basically, I had created the custom trace as mentioned, but I didn't really know how to access it in code. After hours of reading I found you must go to your projects DefaultEngine.ini ...


1

Pombal gives a very good answer, but I'd just like to add a note to it. Like your textures, sounds, and other game-related data, strings are also a resource. Lots of game engines allow you to load and unload resources in groups... that is, you can have a global group (this stuff is alive for the duration of a play session), and then more specific groups ...


2

To address your initial concern, unless you are targeting older generation consoles or embedded devices, you probably don't need to worry about fragmentation. With that said, one way you can address the problem is to have a dedicated memory pool for strings which are then interned. With string interning in C, you create a hash table where the keys are ids ...


1

One possibility would be for the server to enumerate the content it needs to send at the time the download is initiated, and start by sending the player an estimate of the total download size. Ie. "User A is logging in, in game state B. That means I need to send them map X and assets Y and Z. Altogether that makes ## MB of data, so I'll tell them to expect ...


3

You'll need some persistent state and a frame counter passed in: float lightning(lightningState* state, uint64 frame){ if(!state->enabled) return 0.0f; if(frame - state->lastStart < state->flashDuration) // during flash return 1.0f; //can also have a decreasing function here based on the difference if(frame - state-...


Top 50 recent answers are included