Paul Z
Reputation
458
Top tag
Next privilege 500 Rep.
Access review queues
3 8
Impact
~6k people reached

• 0 posts edited
• 0 helpful flags
• 12 votes cast

# 30 Actions

 Sep 24 awarded Autobiographer May 30 awarded Yearling Jan 26 awarded Enlightened Jan 26 awarded Nice Answer Oct 31 awarded Scholar Oct 31 accepted Need a better function for transportation efficiency Sep 21 answered Calculate the intersection depth between a rectangle and a right triangle Apr 19 awarded Yearling Aug 15 awarded Nice Answer Jun 21 comment Infinite loop during A* algorithm I'm curious about the line `if (closedList.contains(neighbor))`. Usually in A*, once a cell has entered the closed list, it never ever comes out again. You seem to be taking nodes out of the closed list and traversing them again, which will cause problems. Also as Kylotan mentions below, your estimate is invalid because of your strange `getParentCost` formula. Jun 5 comment Choppy enemy movement What exactly do you mean by "choppy"? Is it swinging wider than you wanted it to? or, too many corners? If you want the course to be smoother, reduce `deltaTime`. But this of course will slow your whole game down, unless you run through this whole calculation more often. Jun 3 answered Which axis-aligned line does an AABB collide with first? May 3 comment Need a better function for transportation efficiency I sure have thought about it. Simulating carter automata has benefits in other areas of the game (specifically, it makes it easier for me to decide that an enemy army is camped out on the road and stealing your iron), but it seems very expensive. I still might go with it though, it does seem to have most of the behavior I'm looking for. May 3 awarded Student May 3 comment Need a better function for transportation efficiency Ok, I think I see what you're getting at. I'm not sure I agree that separating the two concerns can give me the behavior I want, but if you can give a concrete example I'm prepared to be convinced. I've added more explanation in the question in order to describe at a higher level the behavior I'm looking for. May 3 revised Need a better function for transportation efficiency added 270 characters in body May 3 revised Need a better function for transportation efficiency more concreteness May 3 comment Need a better function for transportation efficiency No, the whole point is to have carters included in the formula as well, because carters take labor and there are other things you probably needed that labor for (like, farming). It's supposed to be a balancing act. May 2 asked Need a better function for transportation efficiency May 2 comment Rotate object to face player It's tempting to normalize every vector you come across, but it's not always a good idea. You want to make sure to keep clear the difference between a position and a direction; directions can be safely normalized, but positions should never be. In this case objVec and playerVec are clearly the positions of the respective entities, and should never be normalized.