Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 09 Jan 2007
Offline Last Active Jun 29 2015 07:31 PM

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

Posted by tom_mai78101 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 tom_mai78101 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 tom_mai78101 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 tom_mai78101 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 tom_mai78101 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 tom_mai78101 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 tom_mai78101 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 tom_mai78101 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 tom_mai78101 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 tom_mai78101 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 tom_mai78101 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   71 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 tom_mai78101 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 tom_mai78101 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.

#5100057 Eclipse: How do you start stepping into/over like how Visual Studio does it i...

Posted by tom_mai78101 on 09 October 2013 - 08:49 PM

In Visual Studio, when you press the Step Into (F11), or Step Over (F10), the compiler automatically builds the program, before stopping at the first line of code, whether it's written in C++ or assembly. It is sometimes useful when it comes to getting to know unfamiliar code in C++, where the main function might be obscured somewhere in the code, and it's hard to find.


I wanted to do the same thing with Eclipse. I wanted it to automatically start the JVM before stopping at the first line of Java code, just like what I explained for Visual Studio above.


Is this possible to do? Are there any methods of invoking such actions?

#5099517 Quaternions: Can you multiply it with vertices, so that the vertices can be a...

Posted by tom_mai78101 on 08 October 2013 - 05:19 AM

Thanks, everyone. And yeah, guess I can step it up.