Generating and Retrieving Random Results Without AI

Article written by Impeached
Published on 10-23-2008; updated on 08-17-2014
Tags:

Article Downloads:
» Example Scenario

Retrieving Random Results Without AI

Ever wanted to get a random result in a multiplayer scenario, or want random results without using a custom AI? Then you need look no further than here. There is a way to get a random choice out of predefined results that is infinitely re-usable.

This is a technique discovered by Nixck a few years ago. Simply obey the following instructions (note: this will only show you how to choose from eight possible results, but changing to more is simple):

  1. Place five transports in a layout similar to the image seen below. Make sure no player units are able to see the transports and never will be able to see them.

    Transport Layout

    Transport Layout

  2. Create a trigger which will, at the start, change the transports to gaia.
  3. Create a trigger which will start your random choice: it will create a gaia unit beside the middle transport (note, in the screenshot in step 1, there is a tile of shallow to the left. Create it here). After creating the unit, the trigger will task that unit to the adjacent transport and unload the transport under itself.
  4. Detect where the unit lands, then do step #3 for the corresponding transport, as in the image seen below.

    Unit Detection

    Unit Detection

  5. Once it has landed in one of the outer shallows spots, you can determine which choice has been picked and it will have been picked randomly.

Here is an example scenario. It also contains a count of how many times each possible result has been chosen, for your viewing pleasure.

Do you want to comment on this article? Thank the author? Tribute resources for its improvement? Raze it to the ground?

Come by and visit its thread in the University Forum!