Skip to content

Procedural Generation

Mxflare edited this page Mar 10, 2022 · 11 revisions

Map Procedural Generation:

What to Program:

Star System Map:

The star system map is randomized for each players game. This is done to make players game feel unique while also have them have a similar experience. The map is determined by the star systems. When starting the game By looking over the 6 star systems (5 highlighted in [https://github.com/Hexrin/Voidsinger/wiki/Star-System-Types](Star system types) as well as the basic one implemented in the game already). Here's how procedural generation would work with star system spawning Events needed to happen:

  1. When starting the game your star system map will have between 30-40 star systems. This number is randomized.
  2. Once the set number of star systems is determined, then the specific star systems are picked. Tiers are the main way star systems differentiate with difficulty. Tiers are set between 1-10.
  3. There cannot be less then 2 of each tier on each map and no more then 4 of each tier in the map. All star systems together must add up to a minimum of 30 star systems. (Expectations: Tier one must have four star systems on the map, Tier ten must have 2 and no more, and finally space worm which can only spawn one).
  4. Once star system quantity and tier have been determined star systems events (See star system types 1-4) start to be determined. Between the four star system event of asteroid field, dark nebula, cold nebula, and hot nebula only 2 events can spawn at a time. Meaning that at maximum the events can spawn in 16 star systems.

Simple Recap:

  1. 30-40 star systems per individual game
  2. Star systems are determined by difficulty tiers separated by one through ten
  3. There cannot be more then 4 of one specific tier and no less then 2
  4. There are different ways events spawn in.

Star Systems Generation

Here is what each star system must have in order to be considered a star system: 1.Enemy Ships 2. Asteroid ships 3. 12.5% Chance of a shop 4. Events

Enemy Ships

Enemy Ships are determined by tiers: The star system tiers are the difficulty levels. Both quantity and quality of ships is listed below: (quality refers to the ships designs difficulty). Enemy Ship/Asteroid spawning rules Ranges can be changed. For reference of what ships will spawn where

Asteroids

Asteroids are a key way to extract pixels Asteroids are a stationary ship that are used in "combat", but its really a way to extract them. To see the different ranges of how many asteroids can spawn in each star system see the link above in Enemy Ships.

The only outlier for asteroids is the asteroid field event for more information on what that is see:Star System Types and Events (See Asteroid Field) In the asteroid field since star system tier does not affect the tier, here's how asteroid spawns work:

  • Difficulty isn't affected
  • There is a range of 8-13 Asteroids per asteroid field event
  • There are no enemy ships in enemy ship.

Shops:

While shops are still considered a starship their spawning is not a range its a percentage. There is a 12.5% chance of a shop spawning in any given star system THAT DOESN'T HAVE AN EVENT GOING ON for more information on what a shop see:Shop Functionality

Procedural Generation Rules:

Procedural Generation is generally based on ranges. The only reason is based on percentage chance would be the implementation of the shop. Follow the ranges and each range should have the same percentage of spawning for example if a star ship in tier one has a spawn rate of with 8, 9, or 10 then the range is 8-10. (meaning that to get 8 star ships in a star system there would be a 33% chance).

Clone this wiki locally