Opened 7 years ago
Last modified 3 years ago
#4387 closed enhancement
[PATCH] Implement Single-Player (SP) campaigns — at Initial Version
Reported by: | wraitii | Owned by: | wraitii |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 25 |
Component: | UI – Miscellaneous | Keywords: | patch |
Cc: | Patch: |
Description
Single players campaigns are one of the features we recently felt would be interesting to have for Part A. I have done some work on a github branch, and arrived to something usable, so I'm creating this ticket to get some comments (not necessarily a formal review yet).
Github branch: https://github.com/wraitii/0ad/tree/campaignMode For a readable clean diff, see attached patch, my branch is full of reversions and experiments.
Features are explained in detail in this post https://wildfiregames.com/forum/index.php?/topic/21369-single-player-campaigns/ Also refs #3049.
Basically: -adds a "campaigns" folder to public, with .json files specifying campaigns. -adds necessary GUI files, with a point of separating the interface logic (respectively in simple_campaign and simple_setup) so that this can be easily modded and we can provide several versions for campaigns to choose from -adds a "campaignsaves" folder to the user directory, saving campaign files as JSON -Hooks to session.js/summary.js/GuiInterface to send game data to the campaign state at the end of the game if necessary. -Provides campaign data to games at the start through a custom (and currently very ugly) gameosetup.
Overall the architecture is relatively simple. I'm only implementing simple lists for now. Also so far only scenarios are supported.
Design questions: -should maps only be supported in "maps/campaigns"? -it's slightly annoying that images have to be in art/textures/ui for sprites. -features?
As example, a fake "example" campaign is provided and I added a "tutorial" campaign but it's kind of empty.