#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)
Change History (17)
comment:2 by , 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 , 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 , 11 years ago
Keywords: | skirmish, map → skirmish map |
---|
comment:5 by , 11 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
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 , 11 years ago
Keywords: | patch added; skirmish map removed |
---|---|
Milestone: | Backlog → Alpha 15 |
Summary: | Add "Skirmish" map type → [PATCH] Add "Skirmish" map type |
comment:7 by , 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 , 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.
comment:9 by , 11 years ago
fixed that code duplication in world.cpp and mapreader.cpp. I haven't looked into the mapPreviews yet.
comment:10 by , 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 , 11 years ago
Attachment: | skirmish.diff added |
---|
comment:11 by , 11 years ago
Component: | Core engine → UI & Simulation |
---|---|
Keywords: | review added |
Type: | defect → enhancement |
comment:12 by , 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:14 by , 11 years ago
Keywords: | review removed |
---|
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.