Recent content by twoski

  1. twoski

    I Getting Points Inside Of A Polygon

    I have read about one approach where you draw a ray from a given point to the right then count how many times it collides with a polygon edge. If the number is odd, it's inside. If it's even, it's outside. The issue with this approach, i think, is that it wouldn't be any faster than my current...
  2. twoski

    I Getting Points Inside Of A Polygon

    Let's say we have a somewhat complex polygon shape. We know the list of 2d vectors that make up its border loop. Now let's say i want to create a list of points within this polygon. Currently i am using ray traces to create a grid of points that fall within the polygon. I'm certain there is...
  3. twoski

    I Creating a fair playing field for an odd number of players

    I'm more concerned with players being able to steal other player's resources. For example, the 2 middle guys will have a more aggressive situation since their resources are pretty close together and thus, those provinces will be high value to them. Other guys might have an easier time since...
  4. twoski

    I Creating a fair playing field for an odd number of players

    And here is a potential 10 player layout. Not sure if the resource positions are totally fair though.
  5. twoski

    I Creating a fair playing field for an odd number of players

    Well, unfortunately there's a lack of knowledge as to which player is being placed at which location. For all intents and purposes, it's considered random assignment. So we need to always account for all players and ensure they all have a fair start, which makes it difficult. After much...
  6. twoski

    I Creating a fair playing field for an odd number of players

    Hello guys, i have a unique problem to solve. Let's imagine you're playing a board game similar to Risk. The game can be played by anywhere from 2 to 22 players, and the game board will be resized accordingly based on the number of players. The board also wraps, so edge provinces connect to the...
  7. twoski

    How to Generate Semi-Organic Shapes for a 2D Map Generator in Dominions Game?

    Made some progress. Using bezier splines for province edges has given them a much more natural look. I need to add more bezier knots on the edges that are larger i think. Promising results so far though.
  8. twoski

    Vector projection to other vector

    Sorry that's not a great picture. A and B are 2 vectors in a 3d Space. I want to project Vector B to Vector A in a given direction, ie. Normalized Vector C.
  9. twoski

    Vector projection to other vector

    Let's say i have 2 arbitrary vectors in a 3d space. I want to project Vector A to Vector B using a specified normal. edit: better image A is green, B is red, C is red arrow. Blue is result. In this case, i want to project green vector to red vector in the red direction. This would give me...
  10. twoski

    How to Generate Semi-Organic Shapes for a 2D Map Generator in Dominions Game?

    Ah yes, that worked nicely. A few corner cases to work on and it'll be functional. Next thing to work on: Currently the polygons are very basic. I want to introduce some variance to their edges, with the goal being to create some more organic-looking shapes. Take, for example, this...
  11. twoski

    How to Generate Semi-Organic Shapes for a 2D Map Generator in Dominions Game?

    Okay, so it turns out the simplest approach was this: The center of each triangle formed by node connections becomes an anchor point for the polygons being drawn around the nodes. It works well except now i need an algorithm to sort these points in order to create a polygon which may or may...
  12. twoski

    How to Generate Semi-Organic Shapes for a 2D Map Generator in Dominions Game?

    The red squares are the big circles, the yellow squares represent the 8 potential connections that the big circle can have. In that example image, the leftmost province has 8 connections. The top left and bottom right province have a diagonal connection which means the top right cannot have any...
  13. twoski

    How to Generate Semi-Organic Shapes for a 2D Map Generator in Dominions Game?

    I'm afraid i don't see how this logic would remove the gaps. Assuming that you're using the connection center when constructing triangles... In situations where a province has no diagonal you can see the issue.
  14. twoski

    How to Generate Semi-Organic Shapes for a 2D Map Generator in Dominions Game?

    I'm using Unity with C# since it has built in UI stuff, and making interactive things with unity is much easier. The large circles denote provinces (ie. the center of a province) and the small circles (with their colored line) denote a connection between 2 province nodes. My first attempt at...
  15. twoski

    How to Generate Semi-Organic Shapes for a 2D Map Generator in Dominions Game?

    Hello, I am working on a map generator for a game called Dominions. I plan to make it open source once it's functional. Maps in this game typically wrap vertically and horizontally, so the generator must create maps that seamlessly wrap on the X and Y axis. Typically (for even player counts)...
Back
Top