Hot answers tagged

10

I see this question has a number of close votes for being too broad or opinion-based, but I think a reasonably sourced overview can be provided within the scope of a StackExchange answer - I'll take a stab at that here. Sid Meier talked about this problem in his 2010 GDC Talk "The Psychology of Game Design (Everything you know is wrong)" (this gave me an ...


6

There are good points in DMGregory's answer. I especially like the one where a win/loss is split into multiple minor wins/losses, which is taken from slot machines - when in doubt copy slot machines, because they're the ultimate game where (almost) all players lose, yet so many continue to play. Let's add some more points: Use gamedesign to allow ...


3

I guess what you're looking for is what's called "Worley's Noise". https://aftbit.com/cell-noise-2/ It's very similar to what you're already doing. But instead of placing the points at the corners of the grid and moving them around, you place one (or more) points within each cell at random. When you want to find the closest point to a point P, you find ...


2

I have solved this exact problem for my master's thesis over a year ago and have already talked about it here. Yesterday, I released an open source program with my multi-channel distance field construction algorithm, msdfgen, which you can try out right now. It is available on GitHub: https://github.com/Chlumsky/msdfgen If you are interested in how it ...


2

Here is something that just popped into my mind: Have you seen the simulation of 3-body system? The two fighting ships can be two of the bodies, and a 3rd (invisible) body is there to create the chaos. Take a look at this video to get a feeling what it's going to look like in practice: https://www.youtube.com/watch?v=VX9IdCnNWJI Also since you are not ...


2

Is this what you want? As for finding the closest food stack, calculating the center of the swarm and using a simple A* algorithm to search all other food stack from the lowest minimum distance to the highest works, or even just a lookup table to map food stacks with their nearest neighbours (Only works if your food stacks are static and regrow). EDIT To ...


2

When i is 0 you copy the row 0 into the row 1, then i is 1 and you copy the row 1 into the row 2, etc. The problem is that when you copy the row 1, it has already been overriden. You probably also have a problem when i = HEIGHT because i+1 is out of bounds. The solution would be to iterate from the bottom row to the top row (from HEIGHT-1 to 1): for (i = ...


2

Assuming your matrix multiplication follows the convention... M * v = (T * R * S) * v (where M is your composed matrix, T is a Translation matrix, R rotation, S scale, and v is a vector you want to transform using the matrix) ...then you can normalize the first three columns of the matrix to get just the T * R part. If you use the opposite matrix ...


2

Create an isochrone map (https://en.wikipedia.org/wiki/Isochrone_map), get a polygon of all the points accessible within N units of time. An isochrone map basically looks like this (3 isochrones are represented in this example): Let's just focus on the red one, which takes a center point and a time (or a distance). Based on this time/distance limit, the ...


1

You could use a hashtable with a key which consists of both the x-coordinate and y-coordinate. Finding the tile at a specific coordinate is then a constant-time operation. When you want to cache the "outline", you could store it in another hashtable. Whenever a node is added, follow this algorithm: the new node is removed from the "outline" hashtable for ...


1

A lot of great stuff covered in the other answers. Here's my take on (the perception of) win/loss probabilities. In the case of PvP, consider different ways to track & show win loss scores either directly or in some sort of cooked format (I.E. player rank). Specific examples: Puzzle Pirates ranks player performance relative to all of the other players ...



Only top voted, non community-wiki answers of a minimum length are eligible