Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#1198 closed enhancement (fixed)

[PATCH] Add "Skirmish" map type

Reported by: O.Davoodi Owned by: sanderd17
Priority: Should Have Milestone: Alpha 15
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

Discussion here:http://www.wildfiregames.com/forum/index.php?showtopic=15756&st=20

A map similar to scenarios. Difference is that Players can choose their faction, team and if they like, their start location (the latter based on the preexisting "start location" entities). If they didn't choose their start location, it is randomly chosen. Game engine then creates the starting entities (better to use the scheme that is used in random maps).

Attachments (2)

skirmish.zip (269.9 KB ) - added by sanderd17 11 years ago.
A skirmish version of the Acropolis map
skirmish.diff (33.0 KB ) - added by sanderd17 11 years ago.

Download all attachments as: .zip

Change History (17)

comment:1 by michael, 12 years ago

Scenario: Created in Atlas with locked starting positions, civs, resources, teams, etc. Basically custom scenarios as they are now.

Skirmish: The new type of map we want to introduce here. Also created in Atlas, but starting positions, civs, and resources are customizable by the players/host. One or more of these things can be locked by the designer (for instance, 2 players may be locked as Persians, while other players have the option of choosing their civ). These are essentially like hand-crafted random maps, like the maps found in Warcraft 3 or Starcraft 2. A good balance between the scenario design of custom scenarios and the player options of random maps.

Random Map: Random map scripts as they are now.

Last edited 12 years ago by michael (previous) (diff)

comment:2 by michael, 12 years ago

We can use the existing "Settlement" object in Atlas as the generic "starting point" object the designer can place on the map. This will not show up in-game.

comment:3 by Philip Taylor, 12 years ago

Might be better for "starting point" objects to be as large as the whole starting town, so the map designer can make sure they've left enough free space.

For implementation: Probably the cleanest approach would be for the starting point objects to have some kind of SkirmishStartingPoint scripted component, which listens for some kind of OnGameStarted message and then creates a load of buildings (based on its owner's civ) and deletes itself. This wouldn't reuse the RMS code, since the RMS architecture isn't designed to support loading and editing a map and would be messy to integrate with the game startup code and with Atlas etc, I think.

Maybe the component could actually be like

<SkirmishStartingPoint>
  <Layout>small</Layout>
  <Slot0 x="0.0" z="0.0"/>
  <Slot1 x="10.0" z="0.0"/>
  <Slot2 x="14.0" z="0.0"/>
  <Slot3 x="10.0" z="4.0"/>
  <Slot4 x="14.0" z="4.0"/>
</SkirmishStartingPoint>

and the civ JSON file could be like

"skirmishBuildings": {
  "small": [ "structures/rome_civil_centre", "structures/rome_house", "structures/rome_house", "structures/rome_house", "structures/rome_house" ],
  "large": [...],
  "eyecandy": [ "other/rome_crucifix" ],
  ...
}

Then we could have several different types of entity with SkirmishStartingPoint, so one map might contain a "small" starting point for each player, and another might have a "large" one, and another might have a "large" one with a different building slot layout (e.g. long and narrow to fit in a valley), and maps could also add some player-civ-specific eyecandy around the map using the same mechanism.

comment:4 by Markus, 11 years ago

Keywords: skirmish, map → skirmish map

comment:5 by sanderd17, 11 years ago

Owner: set to sanderd17
Status: newassigned

I have quickly made a prototype patch for this.

For this patch, skirmish maps should be placed under maps/skirmish (you can extract the included acropolis map there).

Skirmish maps are made with generic entities that are replaced with the real models when the game starts. In Atlas, the generic models are placed in the "skirmish" directory, and have the athenian variants as visible actor (of course, these get replaced when a real game starts, or even when the atlas simulation is started).

I've included generic entities for the CC, female support units, basic ranged and melee infantry, and a basic cavalry unit. Other generic entities can be added, and for some civilisations, the generic entities can be made to be removed when you don't like those (e.g. spartans don't have walls, so if there would be a generic wall entity, and the player does choose a skirmish maps with walls as a spartan player, he won't get those walls)

The only problem (i.e. bug, not lacking feature) with this is that it expects maps to be stored in maps/skirmish, while atlas saves everything in maps/scenarios.

comment:6 by sanderd17, 11 years ago

Keywords: patch added; skirmish map removed
Milestone: BacklogAlpha 15
Summary: Add "Skirmish" map type[PATCH] Add "Skirmish" map type

comment:7 by wraitii, 11 years ago

Some discussion comments (I haven't tried the patch). -We should replace the Athenian props with very basic blocky models with the name written over them (ie a big gray rectangle marked "Civil Center" for the Civil Center) or something along those lines. -It might be cool if you could add your own generic entities in Atlas, I don't know how you handled it but imo it could be interesting to store it directly in the map file, and there would be default ones saved somewhere else. -I think it makes sense to have a separate folder since it's not a scenario nor a RM.

comment:8 by sanderd17, 11 years ago

From IRC:

15:48 < leper> from the duplication of all the scenario code there

15:49 < leper> (world.cpp, mapreader.cpp) wouldn't it be better to do the same as with scenarios?

15:50 < leper> as it is one, just with a few special entities and not something completely different like an rms?

15:51 < leper> also (not related to your patch, but the mapPreviews could be split up by map type to allow for the same map name)

My answer: there are some differences (loading path, settings origin) in the world.cpp part. I agree there is more duplication in the mapreader.cpp, but there was also more duplication between the scenarios and the random maps there. That said, I'll probably try to merge those.

Last edited 11 years ago by sanderd17 (previous) (diff)

comment:9 by sanderd17, 11 years ago

fixed that code duplication in world.cpp and mapreader.cpp. I haven't looked into the mapPreviews yet.

by sanderd17, 11 years ago

Attachment: skirmish.zip added

A skirmish version of the Acropolis map

comment:10 by sanderd17, 11 years ago

I cleaned up the code in some places (and added a warning when map designers place a skirmish entity that's owned by gaia).

I also added some more example templates. You have now the default_wall_... templates, which are walls that will be there for every civ, except spartans. And the iber_wall_... templates. Those are walls that only stay in place when the player chooses the Iberian faction.

The map is also updated to show those Iberian walls (i.e. if you play a game with this map as iberian, you'll have walls, if you play on this map as any other civ, you won't have walls).

I plan to keep this naming convention, as it looks to be a good one:

  • default_... means it will be available for all civs (except for those who don't have that entity)
  • iber_..., spart_... etc. means that the entity will only stay for the civ mentioned in the name. The special buildings will mostly have these names.

by sanderd17, 11 years ago

Attachment: skirmish.diff added

comment:11 by leper, 11 years ago

Component: Core engineUI & Simulation
Keywords: review added
Type: defectenhancement

comment:12 by historic_bruno, 11 years ago

Sorry for the lack of obvious updates during this patch review. There were actually a lot of changes tied into skirmish maps that were convenient to make at the same time:

  • Atlas load/save dialog rewrite (#631, #889) - now uses custom dialogs with VFS/mod support, instead of showing native file dialogs. Scenarios and skirmishes are shown on separate tabs.
  • Map load/save supports arbitrary paths and subdirectories - nice for organization and allows saving skirmish maps in maps/skirmishes, changed a lot of game setup logic (it's surprising how many places load maps in our codebase).
  • Player settings defaults in Atlas (#1872) - for skirmish maps this lets you unset the civ, but it's useful for all maps. Each setting has a checkbox that enables it, if it's unchecked, it will not be written in the map settings.

It took a while to implement and test all of that. There is one minor bug remaining that I know about, but I think committing today is possible.

comment:13 by ben, 11 years ago

Resolution: fixed
Status: assignedclosed

In 13938:

Implements skirmish maps, based on patch by sanderd17, fixes #1198. Skirmish maps are like scenarios, except the player can choose their civ during match setup. To create a skirmish map: place some skirmish entities for each player in Atlas (see templates/skirmish/* for examples), uncheck the player's civ in Atlas' player panel if desired, and save in the maps/skirmishes directory. The map will appear in match setup under the "Skirmish" match type.
Implements custom, VFS-based map load/save dialogs for Atlas (replaces broken native file dialogs), fixes #631, #889.
Fixes map loading/saving to handle arbitrary subdirectories for better organization.
Adds default settings to Atlas player panel, fixes #1872. Each setting now has a checkbox to choose whether it should be saved with the map (avoids writing lots of useless default data for each map).
Adds map preview setting to Atlas, refs #1745.
Cleans up and simplifies some duplicate code.
Fixes optional serialization performance test.

comment:14 by historic_bruno, 11 years ago

Keywords: review removed

comment:15 by leper, 11 years ago

In 13947:

Remove civ code hardcoding from SkirmishReplacer component. Refs #1198.

Note: See TracTickets for help on using tickets.