Opened 18 years ago

Closed 13 years ago

Last modified 6 years ago

#6 closed enhancement (fixed)

Random Map Scripting

Reported by: Stuart Walpole Owned by: historic_bruno
Priority: Must Have Milestone: Alpha 5
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by elexis)

  • Integrate rmgen with engine, so random map based on session config can be generated on the fly.
  • Accept parameters so that random maps can be generated based on host's settings (eg number of players, their civilisations, desired number of territories, if any, size of starting force (eg prebuilt base or "Nomad", number of starting units), etc).
  • Fundamental commands:
  • Set terrain textures
  • Define elevation
  • Area definition (for territories)
  • Objects in territories (resources, settlements)
  • Water height (This is just height 0 in RMS, but maybe we can make it customizable)

Change History (15)

comment:1 by Matei, 18 years ago

Description: modified (diff)

comment:2 by Jan Wassenberg, 16 years ago

Description: modified (diff)

comment:3 by (none), 14 years ago

Milestone: Multiplayer Demo

Milestone Multiplayer Demo deleted

comment:4 by Andrew, 14 years ago

Milestone: Backlog

comment:5 by historic_bruno, 13 years ago

Work in progress, the map generator will likely be implemented in JavaScript. See discussion here.

comment:6 by Kieran P, 13 years ago

Milestone: BacklogAlpha 4

comment:7 by Kieran P, 13 years ago

Type: taskenhancement

comment:8 by Kieran P, 13 years ago

Milestone: Alpha 4Alpha 5

comment:9 by historic_bruno, 13 years ago

Owner: set to historic_bruno

comment:10 by historic_bruno, 13 years ago

Implementation is almost finished for points 1 & 2, which are most important IMO. We can probably add new tickets to address the finer points afterward.

comment:11 by ben, 13 years ago

Resolution: fixed
Status: newclosed

(In [9096]) Implements random map system, fixes #6. Includes default library "rmgen" w/ API based on rmgen tool. Modifies rmgen scripts Cantabrian Highlands, Neareastern Badlands, and Latium. Old map support dropped from MapReader. Fixes a few bugs in existing game setup and initialization scripts.

comment:12 by elexis, 7 years ago

In 19721:

Complete the move of random number helper functions from the random map library (rP9096, refs #6) to globalscripts.

Differential Revision: https://code.wildfiregames.com/D596
Patch By: bb

rP19109 introduced pickRandom and its petra chat application,
rP19270 used the randFloat function more often, introduced randBool and randIntInclusive/Exclusive

to replace randInt (whose behavior and argument meaning depended on the number of arguments) calls in the GUI and simulation,

rP19305 changed randInt to pickRandom for random maps,
rP19355 introduced randBool with a probability and replaced deprecated randInt calls for random maps,
rP19443 replaced randInt calls with randIntInclusive/Exclusive for random maps except the Unknown,
rP19464 removed optional arguments of randFloat,
this commit replaces the remaining occurances in the Unknown maps,
thus fixes #4326 (old patch from refs #3102).

comment:13 by elexis, 6 years ago

Description: modified (diff)

In r2293 by matei:
Initial stub of RM Generator. This will gradually get updated with the algorithms from the ASCII generator.

In r9219 by ben:
Remove rmgen tool.
Log error description when sound engine fails (instead of cryptic LibError? code).

comment:14 by elexis, 6 years ago

In 20904:

Delete BaseHeight property from random map JSON files and rmgen library, refs #6, #4973, r8494, r9096.
The height is only a concern to the random map script, not the rmgen library, nor the gamesetup, nor the simulation.

Reveals the actual initial elevation to the random map script author without looking up the JSON file.
Group and rename all height constants of random maps below the template names.
Rename waterHeight to heightSeaGround to prevent confusion with the actual waterlevel.
Remove useless paintTerrainBasedOnHeight calls on African Plains and Polar Sea.

comment:15 by elexis, 6 years ago

In 21283:

Let SimpleObject also avoid other SimpleObjects within the same SimpleGroup following rP9096, refs #6.

Fixes unreachable small stone mines inside large stone mines.
Fixes #4338.

Differential Revision: https://code.wildfiregames.com/D189
Credit rapidelectron for working out the two main issues (refs rP20396) and providing a similar patch.

Note: See TracTickets for help on using tickets.