Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 09 Jan 2007
Offline Last Active Yesterday, 03:32 PM

#5309884 Porting a physics engine: What do these variables stand for?

Posted by on 07 September 2016 - 05:49 PM

I'm currently porting / learning C++ code of a lightweight physics engine over to a C code variant engine. The lightweight physics engine is qu3e, written by Randy Gaul.

Source code


While porting the code over, I spot a few things that I'm confused about. Given that there are no comments that explain what these variables are for, and doesn't say what their meanings are, I am asking for help to explain the meaning and intentions for these variables.




Here's one.


I know Feature Pairs in a physics engine refers to "The closest pair of features (edge or vertex)". So I am confused about what

inR, inI, outR, and outI

stands for. What do these 4 variables have to do with Feature Pairs?




This is another one.


In this context, I know this struct is referred to as the Axis-Aligned Bounding Box struct, or AABB. Even with that in mind, I still have no idea what the


variable represents in the AABBes. Is there something important about the letter "e", as in, it could be some mathematical constant? Or is it energy?

#5304198 Ide For Linux

Posted by on 05 August 2016 - 07:42 AM

Windows 10 with Bash user here. I recommend Eclipse + GCC over vim, Emacs for Linux.


Reasons are:

  • You want to be able to view variables quickly without having to type gdb and use p to view them.
  • You want to be able to utilize makefiles very fast.
  • Cross-platform development is a breeze in the latest editions of Eclipse. I'm using Eclipse Neon right now for an embedded cross-platform device.   
  • Eclipse is able to customize your toolchains in a neat, tidy, and orderly fashion. I'm using a MinGW toolchain and it's very quick to setup.
  • All of your source files are accessible directly through the Project Explorer.
  • You can run your own custom external programs to help you with your task. For me, I have set up Explorer.exe to open up my project file and designated selected folder directories through Eclipse.
  • It is able to quickly disassemble your project source codes.
  • Just like the main suite of Visual Studio editions, Eclipse is packed and is a heavyweight contender.
  • It comes with an auto-update installer that updates the main branch of your Eclipse IDE to the latest edition.
  • Has a huge community of developers working and maintaining the Eclipse IDE and other things.
  • When you able to use Eclipse effectively, you are able to work with other IDEs (even Visual Studio), as they are designed in a similar fashion for configuring your toolchains.

Reasons why not are:

  • It has a gradually gentle learning curve you need to get used to, particularly with the UI and the shortcuts.
  • It requires Java Runtime Environment, since Eclipse is built upon Java first before expanding to other programming languages.
  • You need to know what and where to configure your toolchains. StackOverflow and Google will help you, but you won't be able to do it yourself alone.

#5236435 (Picture) C#: Can anyone explain how this is possible? IF statement is false,...

Posted by on 23 June 2015 - 03:09 PM

I noticed it's a UnityVS project. The debugger is not 100% trustworthy in that case... Maybe add some Debug.Log calls and double check that Unity is executing the latest version of that code?

Ok I guess. I've reported this error to the UnityVS team. I was told this is a possible race condition, where the variables are not refreshed/updated long enough while the debugger is attached to Unity running on different threads. Maybe it's a rare corner case scenario, who knows?

#5233504 What should I do now that I implemented a game mechanic that is not popular a...

Posted by on 08 June 2015 - 04:14 AM

Thanks again. I am currently back at my planning and designing stages to try and it might take awhile to fix the overall issue. 

#5233359 What should I do now that I implemented a game mechanic that is not popular a...

Posted by on 07 June 2015 - 09:38 AM

Thank you everyone. By the looks of it, I am really doing something wrong here, possibly even forgetting the whole point of making my game with a critical mindset.

Good thing I asked for advice about this when it is in its early stages.

#5233142 What should I do now that I implemented a game mechanic that is not popular a...

Posted by on 06 June 2015 - 08:51 AM

The question is formulated so abstract that its near impossible to answer.
Who knows if they just need some time to adapt, if they dont hate the new mechanic but dont know how to explain that and there is just some quirk you need to fix, if its just a few complainers and the silent majority likes it, or if its really bad?


You're right. I didn't realize the question is abstract.


The game mechanic I made involves "friendly fire". This means that entities that fire projectiles will affect whatever gets hit by it. For me, it makes realistic gameplay, it makes game development easier to work with, and it makes the game challenging to play. However, players are not enjoying it and they are suffering from the side effects because of it. For instance, "friendly fire" kills their owned entities if placed in such a way that projectiles hit themselves. "Friendly fire" can also cause the loss of a game round for the fact that it kills off their king entity if the king gets hit a few times.


The two sides to this are groups with almost equal numbers. I can tell because we're a pretty big class. One side insists that "friendly fire" creates necessary challenges for the game to be satisfying, while the other side insists that "friendly fire" causes the game to be "unintuitive", "unenjoyable", and "downright stupid" for the fact that player-owned entities can be killed off without knowing it.


I build "friendly fire" because without it, it is getting way too difficult to develop the game. I would rather have "friendly fire" than "unplayable lag", which is what the old game mechanic suffers from, and I need to remove that because of the lag.

#5147841 Do you have any tips to share on making/creating a level editor?

Posted by on 18 April 2014 - 03:06 AM

Understood. smile.png


I got my own custom level editor finished, with the main features, "New", "Save", and "Open", done. Even though I started working on the editor with a different set of rendering pipeline down the road, I used what I learned from here to create it. biggrin.png  It's a wonderful experience, and I'll probably share it on the Developer's Journal.

#5134934 This is what atan2() does if given two Vector2D points on 2D plane?

Posted by on 26 February 2014 - 09:13 PM

My mind cracked into place. Now, it is obvious to me.

Thank you for all of your time. Problem solved.

#5134120 Is that a ordinary way to develop console game on PC?

Posted by on 24 February 2014 - 09:42 AM

EDIT: I see that I might be getting incorrect conceptions on this, therefore I'll remove them. I'll leave this post blank and move on.

#5134119 OpenGL ES 2.0: Text from TextView isn't showing up

Posted by on 24 February 2014 - 09:28 AM

Okay, for the Asus Transformer Pad, I have finally found the cause:


Stack Overflow Q&A tells me that because of the generated bitmap, on some devices, the bitmap size is a power of two, therefore the texture is drawn to the screen. On other devices, such as the tablet, due to its sheer resolution scale, the generated bitmap is not a power of two, therefore it shows up as nothing.


In order to combat this issue, I need to use GL_CLAMP_TO_EDGE or use a source texture from the /res/drawable-noapi folder. The latter prevents Android from density-based scaling from occurring.


Thank you for your time.

#5129640 Before You Graduate From Computer Science: Blog Post by Peter Barrett

Posted by on 07 February 2014 - 11:58 AM

Here is a blog post written by Peter Barrett, who happens to have 1 final year left before he is about to obtain his Computer Science degree.


Link: http://peterbarrett.ie/before-you-graduate-from-computer-science/


I just happened to stumbled upon this blog post of his, and found that it contains good (it's great for me, unknown for others) advices for those of you who are about to graduate with a Computer Science major, or had just graduated, but are unsure of what to do next.


I hope Peter's advices helped you and helped others to follow. Cheers!

#5127166 Memory leaks are always contained inside processes, aren't they?

Posted by on 29 January 2014 - 03:50 AM

My question has been answered in a meaningful way. Thank you all.

#5118519 How to split up pathfinding? How to implement divide-and-conquer on pathfinding?

Posted by on 21 December 2013 - 03:04 AM

Here's an attachment of a ZIP-ed JAR file, containing the current working state of the divide-and-conquer A* pathfinding.


To start, click anywhere in the screen. The pink pixel means the starting node, and the green pixel means the ending node. The background is grayed out, so that the whiter, lighter colors of the path can be displayed easily to the eyes.


Attached File  astar_pixel.zip   16.15KB   72 downloads


One of the paths generated created this path, shown below:




I followed your advice on splitting the screen up into 4 sectors, with each sectors having their portals connecting to each adjacent sectors. I don't know what I've done to get this path. Here's the code for the path above:

	public ArrayList<Node> makePath(Node start, Node goal) {
		System.out.println("Making path from sectors...");
		if (tempPath == null)
			tempPath = new ArrayList<Node>();
		Sector startingSector = findSector(start);
		Sector endingSector = findSector(goal);
		if (startingSector == null || endingSector == null) {
			System.out.println("Something is wrong...");
			return null;
		System.out.println("Calculating different segments of paths from each sectors...");
		System.out.println("The first path...");
		tempPath = createPath(start, startingSector.centerNode);
		System.out.println("The second path...");
		tempPath.addAll(createPath(startingSector.centerNode, endingSector.centerNode));
		System.out.println("The last path...");
		tempPath.addAll(createPath(endingSector.centerNode, goal));
		System.out.println("Paths complete.");
		return tempPath;
	private Sector findSector(Node node) {
		for (Sector sector : sectors) {
			if (sector.boundingBox.hasNode(node))
				return sector;
		return null;

//Box class - the "boundingBox" member is a Box object.

	public boolean hasNode(Node node) {
		int x1 = this.width + this.x;
		int y1 = this.height + this.y;
		if (node.x >= this.x && node.x < x1 && node.y >= this.y && node.y < y1)
			return true;
		return false;

I wanted to ask myself, what else could go wrong?


Java out-of-memory error. There's an infinite loop that for some reasons, the parent of the node is always that same node. (node.parent == node is always true).


So, just to make sure, I did this, in order to stop the infinite loop:

	private ArrayList<Node> recreatePath(Node node) {
		int counter = 0;
		ArrayList<Node> results = new ArrayList<Node>();
		while (node.parent != null) {
			if (node.equals(node.parent)) {
				if (counter > 5)
			node = node.parent;
		System.out.println("Size of path: " + results.size());
		return results;

It might be possible this can cause the weird path in the picture shown above. Got any hints?

#5118483 How to split up pathfinding? How to implement divide-and-conquer on pathfinding?

Posted by on 20 December 2013 - 08:54 PM

May I ask, did you use recursive methods to complete this task?

	public ArrayList<Node> createRecursivePath(Node start, Node goal) {
		Node median = getEstimatedMedianNode(start, goal);
		if (median != null) {
			ArrayList<Node> results1 = createPath(start, median);
			ArrayList<Node> results2 = createPath(median, goal);
			return results1;
		else {
			ArrayList<Node> results = createRecursivePath(start, getEstimatedMedianNode(start, median));
			results.addAll(createRecursivePath(getEstimatedMedianNode(median, goal), goal));
			return results;

I know my recursive skills are bad, but I'm thinking I might be going in the right direction. Somehow...

#5101145 Game Programming Books (C++)

Posted by on 13 October 2013 - 06:46 PM



There are a bunch of questions asking for game programming books. We have compiled a list of recommended books for you, by following the link shown above. The link can be found at the top of the webpage, where the navigation bar is at.