Opened 13 years ago

Closed 8 years ago

Last modified 19 months 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 Changed 13 years ago by Matei

Description: modified (diff)

comment:2 Changed 12 years ago by Jan Wassenberg

Description: modified (diff)

comment:3 Changed 9 years ago by (none)

Milestone: Multiplayer Demo

Milestone Multiplayer Demo deleted

comment:4 Changed 9 years ago by Andrew

Milestone: Backlog

comment:5 Changed 9 years ago by historic_bruno

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

comment:6 Changed 9 years ago by Kieran P

Milestone: BacklogAlpha 4

comment:7 Changed 9 years ago by Kieran P

Type: taskenhancement

comment:8 Changed 9 years ago by Kieran P

Milestone: Alpha 4Alpha 5

comment:9 Changed 8 years ago by historic_bruno

Owner: set to historic_bruno

comment:10 Changed 8 years ago by historic_bruno

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 Changed 8 years ago by ben

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 Changed 2 years ago by elexis

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 Changed 2 years ago by elexis

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 Changed 20 months ago by elexis

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 Changed 19 months ago by elexis

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.