Tag Info

New answers tagged

0

I came up with a simplistic solution to this a few years ago in a non-realtime context (mesh slicing for 3d printing). Given a plane defined in world coordinates by a point (origin) and a vector (normal). First setup a matrix that transforms your mesh into the coordinate system of the plane. Now do a z-bounds check of all the edges of the mesh (i.e. ...


0

Since you mention voronoi, i'll give my c# voronoi implementation private void Voronoi(int[,] points, int minDelta) { for (int i = 0; i < wid; i++) { for (int j = 0; j < hei; j++) { float minDist = 999999999f; float minDist2 = 999999999f; float minV = 0f; for (int p = 0; p < ...


1

Instead of iterating over all plates, consider only those empty cells that could possibly be filled: namely those that are adjacent to at least one already filled cell. Your algorithm could then become something like this: 1) Keep track of all unfilled cells that have at least one adjacent filled cell. 2) Select one of these unfilled cells. 3) Select one ...


2

You're on the right track. However... Try O(n*m) runtime is typical with something like this. Your implementation is a bit excessive, however. The real question is, What is making your O(n*m) algorithm take so long? Why bother to run through every map cell for each influence? It would be faster to have each starting influence also specify some random ...


0

You could try doing things in reverse. Start with an empty grid and place the boundary walls on the play field. Then define a bunch of wall patterns that you can choose from. ... ie a straight section, an L shape, a C shape etc. Randomly place these on the map testing to make sure you still have a valid map. ie One that is not completely closed off by ...


2

I wouldn't seperate the mountain generation from the general terrain generation but combine them. Today the usual approach to generating landscapes is using 2D or 3D noise functions like perlin or simplex. By combining several amplitudes and octaves you can add both general height (like mountains and valleys) and some detail. You'll probably need to ...


1

The question is, what pattern you want to achieve, and how to randomize the given pattern. You could place fix walls in a grid shape, then fill the rest with walls, and when you place the players, clear enough space for them to start. Then you could start randomizing things: Player starting position. Don't forget to check if the players aren't too close. ...


0

Would you mind sharing your implementation with other interested programmers? I think there are a couple of people interested in a working implementation to play around with, so am I. I know I am "abusing" the answer function, but I do not have enough reputation to comment, sorry.



Top 50 recent answers are included