Author Topic: Campaigns (yes, campaigns)  (Read 2906 times)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Campaigns (yes, campaigns)
« on: 21 October 2010, 00:12:12 »
Amazingly, when I curiously went to see when campaigns (aka: extended scenarios) could become a reality in GAE, I was surprised to see that one of the most requested features was not even in the tracker!

Now, to define a campaign, I refer to a string of scenarios that must be played in order, usually telling a story. For example, The series of 5 scenarios in Military, the End of Morning series, is technically a campaign, though there's no way to keep them in order, and a true campaign would work as though it were 5 scenarios moulded into one. This would be beneficial for GAE, and would most likely be done by an extra folder. For example, from the scenarios directory, we might have a new scenario category (ie: campaigns).
Sample code for the campaign XML:
Code: [Select]
./scenarios/campaigns/my_campaign/my_campaign.xmlThe XML file would describe a few simple settings, primarily the scenarios that have to be played (possibly other things, such as the action for when the player dies, whether to restart the current scenario or reset from scenario 1). From there, there would be a folder for each scenario, which would just be a normal scenario folder. When you finish the scenario, you'd "unlock" the next one. Security isn't a deal at all, and for simplicity and testing purposes, the "location" in each scenario could be stored in a separate ini, etc;
Sample code for scenario paths:
Code: [Select]
./scenarios/campaigns/my_campaign/my_campaign.xml
                                 /scenario1/scenario1.xml
                                 /scenario2/scenario2.xml
                                 etc...

This method for a campaign would ensure that as little changes as possible would be necessary, and, more importantly, remind everyone of a common feature request that has been nearly forgotten about! :)
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Campaigns (yes, campaigns)
« Reply #1 on: 21 October 2010, 00:45:47 »
Actually, there is no need for another directory level.  This is largely why the 'categories' were added, so a campaign folder will simply be a 'category' folder. It will of course need an XML, but the existence of such a file (or not) will dictate whether the category is actually a campaign.

Ticket #239.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Campaigns (yes, campaigns)
« Reply #2 on: 21 October 2010, 01:14:46 »
Actually, there is no need for another directory level.  This is largely why the 'categories' were added, so a campaign folder will simply be a 'category' folder. It will of course need an XML, but the existence of such a file (or not) will dictate whether the category is actually a campaign.

Ticket #239.

Hmm, good idea!

-looks up the ticket-

Milestone: 0.5

...... :(
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Campaigns (yes, campaigns)
« Reply #3 on: 21 October 2010, 01:43:34 »
Sorry, but there's too much on 0.4 already...  Some stuff may get shuffled around yet, but this one will take a bit of work, so unless someone else wants to take a crack at it, it'll have to wait.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Campaigns (yes, campaigns)
« Reply #4 on: 21 October 2010, 03:52:30 »
Oh wow, I wasn't expecting this to be anything short of, say, .6 or so.  Pleasant surprise. :) Too bad there's no way I'll be able to finish what I'm already working on and learn Lua between now and then. :look:

wyvern

  • Guest
Re: Campaigns (yes, campaigns)
« Reply #5 on: 21 October 2010, 20:43:05 »
Couldn't this be partially achieved by making a campaign folder, like the scenario one that would contain say 3 scenarios, yet to play the next scenario you'd have to unlock it by playing the first scenario, I hope this made sense :|

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Campaigns (yes, campaigns)
« Reply #6 on: 21 October 2010, 20:49:31 »
Couldn't this be partially achieved by making a campaign folder, like the scenario one that would contain say 3 scenarios, yet to play the next scenario you'd have to unlock it by playing the first scenario, I hope this made sense :|
Well, there'd have to be an XML to at LEAST tell that the campaign is indeed a campaign, as well as to tell the order of the scenarios.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

ChupaReaper

  • Guest
Re: Campaigns (yes, campaigns)
« Reply #7 on: 21 October 2010, 23:29:18 »
I strongly support campaigns, it will be quite a while before I start with scenarios in my mod as I've got four factions to finish first! But come then hopefully campaigns will be ready or not far off.

chickenp

  • Guest
Re: Campaigns (yes, campaigns)
« Reply #8 on: 22 October 2010, 13:12:11 »
Hello,

i'm newbie in glest forum, i've only been playing with this engine for 2 weeks but i would like to make a suggestion to the campaign issue, allthough is not a permanent solution, but maybe will help in some way... (sorry the english)

Note: This solution is just a way to achieve some kind of campaign effect without changing the engine source...

someone said on this threat that would be nice to link scenarios, why not do this:

- Create a folder in the engine root called "mycampaign"

- Insert subfolders with your scenarios

- in the default scenarios folder of your engine insert only 1 folder with one scenario (the first scenario)

- In each scenario .xml create winning coinditions and when they are achieved run lua scripting to copy the next scenario from the "mycampaign" folder to the scenarios folders. When the player wins the scenario and returns to the scenarios menu, the next one will be available.

this page has a Lua Script with 4 ways of copying files...

http://www.chipmunkav.com/forums/ShowPost.aspx?PostID=115

hehe dont know if that works, but i see if i give it a try this weekend if it work i will post it here...


Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Campaigns (yes, campaigns)
« Reply #9 on: 22 October 2010, 18:59:52 »
Except that it's not possible to change maps or reset units, change foes, etc; once a scenario has started.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Campaigns (yes, campaigns)
« Reply #10 on: 22 October 2010, 22:21:16 »
this page has a Lua Script with 4 ways of copying files...

http://www.chipmunkav.com/forums/ShowPost.aspx?PostID=115

None of those methods will work in GAE, as the required Lua functions have been disabled for security reasons.

A rather interesting solution you have come up with though, and should be possible with MG.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

chickenp

  • Guest
Re: Campaigns (yes, campaigns)
« Reply #11 on: 26 October 2010, 12:18:54 »
yep...it doesn't work. In that case it has to be done in the engine source (that is what makes sense).

Suggestion:

- Campaign folder with Campaign XML, where are all the links to the scenarios (Subfolders inside the Campaign Folder)
- In each link something like "<locked> true </locked>" in order to the engine recognizes the current status of the campaign...
- Campaign menu in the engine source and maybe a briefing room in each scenario...

yman

  • Guest
Re: Campaigns (yes, campaigns)
« Reply #12 on: 5 October 2011, 07:35:08 »
Instead of thinking in terms of campaigns, I think it's better to think in terms of stories. A campaign is essentially a story, only a story can provide a richer experience.

Typically campaigns have branching story lines, and the campaign designer might want to know the exact path taken, or the exact outcome of a specific scenario. This means that it would be a good idea to be able to lose while still moving forward in the story, and that the story line can change depending on exactly what happened during a scenario.

Campaigns typically have stuff happen between scenarios, such as providing a UI to access all kinds of information related to the mission, such as objectives, the story, the situation, intelligence information, or historical background. There could be a presentation of a story, a cutscene, a dialog, etc. I think this should all be supported in order to allow modders to create games that are just as rich and immersive as the big titles. These would be very important story-telling tools.

On the issue of story telling, it would be good to be able to have stuff like dialogues and cutscenes happen within scenarios, updates to mission objective or team membership, ownership of units, and updates to the information regarding the mission.

CruzR

  • Guest
Re: Campaigns (yes, campaigns)
« Reply #13 on: 5 October 2011, 14:02:36 »
Another way to force scenarios to be played in a specific order would be some kind of password/key system written in lua. Whenever you finish one scenario, you get the key for the next scenario. Parts of the key could be generated automatically and contain information about the last game, i.e. how many resources were left from the last game...
An example of how to implement such a system can be found here. It's written in Jass, the scripting language of Warcraft III, but it shouldn't be too difficult to port it to lua. The example probably isn't perfect yet and would need to be optimized for your specific project, but you'll get the idea.

However, it would need the following additional lua functionality to make such a system work:
(click to show/hide)

yman

  • Guest
Re: Campaigns (yes, campaigns)
« Reply #14 on: 5 October 2011, 16:23:49 »
Another way to force scenarios to be played in a specific order would be some kind of password/key system written in lua. Whenever you finish one scenario, you get the key for the next scenario. Parts of the key could be generated automatically and contain information about the last game, i.e. how many resources were left from the last game...
An example of how to implement such a system can be found here. It's written in Jass, the scripting language of Warcraft III, but it shouldn't be too difficult to port it to lua. The example probably isn't perfect yet and would need to be optimized for your specific project, but you'll get the idea.

However, it would need the following additional lua functionality to make such a system work:
(click to show/hide)

It would be much better to implement a system where the user doesn't see any of that. I'm thinking that perhaps a campaign should be thought of as a complete game that is implemented using a scripting language, but I don't know enough to get that technical.

Anyway, just for fun I'm thinking of a story that would be interesting to implement as an RTS/RTT campaign (totally from my imagination):
Japan is in a civil war as multiple Feudal Lords are fighting to take control of the country and become emperor. There are also many Feudal Lords who are trying to stay out of it, or who want to remain independent and are trying to stop anyone from becoming emperor. You belong to such an alliance of independent Lords. The Lord against whom you are fighting is Lord Yuu, and he's beating you. That's when Lord Itachi (I'm just pulling names out of a hat), one of Lord Yuu's strongest subordinates, secretly sends you a message: Lord Yuu has kidnapped Lord Itachi's daughter and is using her as a hostage to force Lord Itachi to serve him. If you rescue Lord Itachi's daughter he will generously reward you and switch to your side, which will completely turn the tables on Lord Yuu, but if any harm comes to her, Lord Itachi will come after you with a vengeance. Just accepting the offer is risky as you would have to divert vital forces away from the battlefield, and the chances of success aren't good since she is heavily guarded. Will you take the risk? If you do and succeed you get a big break and can finally go on the offensive, but should the princess die, Lord Itachi, who has been holding back as much as he could, might now turn his full force personally against you, making the war even more desperate, or he might first turn on Lord Yuu and come after you once Lord Yuu is defeated. Even that possibility isn't very appealing, as your forces are severely weakened and you would have almost as much of a hard time against Lord Itachi as you did against Lord Yuu, not to mention that since Lord Itachi would be an independant Lord like yourself, and since he would be part of the alliance that defeated Lord Yuu, your allies might not even stand with you.

How about implementing that story as a campaign? Obviously the story I wrote focuses on one scenario within the campaign, but the scenario is only interesting because of the consequences it will have on the campaign, both from the choices you make and the success or failure of the mission. Whether you accept Lord Itachi's request or not, whether you rescue the princess, fail to rescue her (can't reach her or she gets recaptured), or get her killed, all these outcomes will still move the story forward, but each would move it forward along a different path.

This is a scenario and campaign I would like to play.
« Last Edit: 5 October 2011, 16:30:06 by yman »

CruzR

  • Guest
Re: Campaigns (yes, campaigns)
« Reply #15 on: 5 October 2011, 20:11:32 »
Another way to force scenarios to be played in a specific order would be some kind of password/key system written in lua. Whenever you finish one scenario, you get the key for the next scenario. Parts of the key could be generated automatically and contain information about the last game, i.e. how many resources were left from the last game...
An example of how to implement such a system can be found here. It's written in Jass, the scripting language of Warcraft III, but it shouldn't be too difficult to port it to lua. The example probably isn't perfect yet and would need to be optimized for your specific project, but you'll get the idea.

However, it would need the following additional lua functionality to make such a system work:
(click to show/hide)

It would be much better to implement a system where the user doesn't see any of that. I'm thinking that perhaps a campaign should be thought of as a complete game that is implemented using a scripting language, but I don't know enough to get that technical.

This was only thought to be a quick fix, not the final solution for the problem, because I guess adding a new event-type and a new lua function would be much less work than hardcoding campaigns mode into the engine. Of course, as soon as the devs will have implemented a real campaigns mode, this fix would become obsolete.