Campaign.

Campaign.

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Campaign.

Post by Argh »

Ok, people. I've gotten World Builder somewhere, I'll continue to work with it a bit. Whilst I'm doing that, I wanted to bring up the issue of having a campaign within Spring.

Basically, there are major problems, unless we have a separate application that will load up new maps, which presumably will use LUA and an AI to give players a major challenge. Why a separate app? Well, something has to launch the game engine, because so far as I know, Spring doesn't allow switching out maps within itself. Using LUA, we could record a win/loss state in the Infolog easily enough, and this theoretical application could read that state, and unlock the next mission if the state was true.

Therefore, I'd like to propose that it'd be a good idea for somebody to start building one. We already have pretty much everything else we need- LUA for placement of objects, LUA that can move stuff around, LUA that can play sounds, such as dialog, or show people text descriptions of the mission, LUA that can check to see if something's dead ("Wow, Timmy, you sure did a good job, destroying that practice robot! Let's move on to the next mission!")...

Why am I having this discussion here? Well, because I think that it'd be nice if, say, we developed a common format, and used common LUA to do a lot of things. I think that I could make a crude single-player "mission" fairly easily- the hard part, frankly, is figuring out how to go from crude stuff ("if Objective A still alive, and timer > blah then mission = fail") to elegant stuff ("escort some trucks here, then fight off an ambush at the fort you escorted them to, then pursue their Mysterious Leader to their base and defeat them"), etc.

Moreover, I think that if we can get in gear this way, then it's quite likely somebody will find the time to write a nice generic campaign application, preferably that we can skin and add sounds to.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Campaign.

Post by AF »

Unless licho develops this or some other dev with figners in the CA pie, I shall do it in AFLobby or at lest provide as many tools to implement it as an extension. I'm headed in those directions as it is anyway.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Campaign.

Post by Forboding Angel »

^^ Both is very good news.

I want to be able to implement missions... BADLY... However, it seems as though Argh, myself and select few others are the only ones that care about it. THis makes me sad {:<(

I would especially like to be able to run true co-op miltiplayer missions... That would be pimp.
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Re: Campaign.

Post by Nemo »

I think the only technical problem is the fact that you can't enforce the map (as far as I know), so if you distribute a package that has a mod, some maps, and some missions, you can't force it to start using a specific map (the player has to choose it atm).

But yeah. a nice mission front-end is the big wishlist item. with stuff like a mission list, unlockable missions to enforce progression, locking the player to a specific team/start location, a nice "briefing" screen (although this can technically be done ingame, it'd be nice if we could have a little blurb about the mission before the game is launched).
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: Campaign.

Post by SinbadEV »

First of all I would like to indicate that I am marginally interested in learning how to develop scenario scripts and wholeheartedly support "multiple player scripts" and really hope we can get that soon.
My understanding is that a text file can be passed to the spring executable that contains the map and a lua-start script... if this is the case I would recommend we develop a few scenarios and just start them with a batch file... I mean I've yet to see more then just the 2 examples included with the installer... why bother creating a whole management program until we have something to manage with it.

Anyways, I started a thread on this and when I get my first script finished I was planning on investigating how to actually write the script...

I put it here while I'm working on it... but then I got bored of it.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Campaign.

Post by AF »

Can someone detail what's needed and how the missions would be started at the commandline? I might be able to put together something simple at least for the weekend
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Campaign.

Post by Argh »

Well, hmm. I'm not sure how we go about giving Spring a command-line argument to run a given startscript, which clearly is what we need to do :oops:

And, of course, there is the issue of what may be broken with the current mission scripts <looks them over>

They're pretty much junk, I'm afraid. Going to take a bit of going, to get them workable. Lastly, other than blowing up all of the bad guys, there doesn't seem to be a way to cause victory conditions to occur (i.e., "game over", preferably "you won / lost").

Sooo... first challenge is to get Spring to load a given startscript. Second challenge is to figure out a way of triggering victory conditions and then providing a way to exit the sim. Third challenge is to provide a way to then record and act on the current tally of victories and losses. Fourth challenge is to provide a way to present all of this to players in a pleasing way. I'm thinking that an ideal Campaign software probably uses bitmapped graphics, where game designers can specify the button graphics they wanna use, etc., and some sound support, so if we wanna have voiceovers or whatever, we can do that.

Other than the challenge of getting a startscript to run from the command-line (which is probably easy, I just haven't ever tried it), I think all of this should be pretty easy- for victory conditions, if nothing else we could use LUA to suddenly give all of the enemy Units to the player, triggering a win condition (I think that'll work...).
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Campaign.

Post by AF »

Trepan once recommended using lua gadgets and mod mutators to implement them, which would seem to be best since lua would then be able to do cut scenes and UI additions without having to be included in the main file and checked at every single load.

But if I'm going to do anythign I need a requirement specification that isn't a paragraph of high level concepts that require me to know as much as you do. Nice simple statements in bullet points followed by a paragraph showing any needed details or explanations. I shouldn't have to learn how to make missions, just how to load them programatically.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Campaign.

Post by Argh »

Personally, I think loading them through a Gadget's a waste of time. There's no good way to create the output necessary to track users.

Ok... in terms of specifications, lemme think this one through for a few hours, I'll get back with a detailed set of business rules. I'm working on a cityscape for World Builder at the moment, and my first skyscraper's all skinned and ready for me to code and test...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Campaign.

Post by AF »

Get me a bare minimum of whats needed, aka mission name and how to start the mission, then I'll figure out a second revision based on a more detailed spec.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Campaign.

Post by Argh »

Well... hrmph.

There are no command-line options to force a given map or startscript. So, it's down to forcing a map to get loaded, then loading the LUA directly. More when I've gotten some rest.
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Re: Campaign.

Post by Peet »

Argh wrote:Well... hrmph.

There are no command-line options to force a given map or startscript.
Hahahahaha.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: Campaign.

Post by SinbadEV »

Argh wrote:Well... hrmph.

There are no command-line options to force a given map or startscript. So, it's down to forcing a map to get loaded, then loading the LUA directly. More when I've gotten some rest.
Wait... what? I could have sworn that if you put a start script (text file) as the first command line option of spring.exe it would execute with that text file. I know that the contents of this text file would specify the map, mod and number of players and player names... well pretty much everything that the lobby lets you pick... can be read from this text file. So having a special Map with the scenario script built into it would work.

I had understood that this start-script text file could contain a lua-script to run as well but I could be mistaken. I would suggest we get someone familiar with the part of the code that parses them to comment.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Campaign.

Post by Argh »

So, how does it work? I couldn't find any documentation of this anywhere :P

And it's pretty much all we need here. The rest is really easy- the application would select the map, the campaign "mission" is run as the startscript from the application via a command-line argument, the engine executes, if victory conditions are met (all LUA there), then a special string is output to infolog.txt, which is read by the application (preferably automatically, but for a demo, just a manual update that checks a file). Not super-complicated stuff, here. We just need to:

A. Have an application that does that, per "mission".

B. It needs to read from a campaign "script" that allows users to select a side, and select a mission, which would then trigger events- a briefing of some kind. Not necessary for an early demo, but that's the goal.

C. And then all we need are some missions worth playing. Gee, I wonder what I could do with World Builder, and a few pieces of LUA? Making simple missions will be a piece of cake, if I can figure out how to set up some simple victory conditions that aren't just "kill 'em all", then we're in business.
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Campaign.

Post by lurker »

Why would you make a program read the infolog instead of using the autohost interface?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Campaign.

Post by Argh »

It doesn't have to. I just think that it would be very simple to just look for a matching string there.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: Campaign.

Post by SinbadEV »

If you can't figure out any win conditions if you just have an enemy commander and switch it to the neutral team wouldn't that qualify as a win as well?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Campaign.

Post by Argh »

Yeah, that's pretty much what I was going to do. It beats self-d'ing them every time. The real trouble's going to be figuring out the logic for victory conditions, and setting up objectives that are more interesting than just shoot 'em ups. But I'll worry about that later, I just want to try and set up some simple stuff for P.U.R.E.'s next release, using World Builder code to do some procedural stuff that I have some ideas about.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Campaign.

Post by AF »

So nice and clear, how do I start a mission from a command line? Specifying the map etc I can sort out some external config for deifning campaigns etc, but I need to know the specifics and preferred way of actually starting them. Is it a tag in the script.txt? A command line parameter?

Until someone can clearly state the preferred method fo doing it ncie and clearly, this is as far as I can go. My hands are tied and the path ahead is blocked by a tiny missing piece of technical information. Until someone fills in this gap I'm off to do GUI work.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: Campaign.

Post by SinbadEV »

Potential Goals:

Build # unit X
Build X at position Y
Kill # X
Capture X
Move unit X to position Y
Keeps unit X (or # unit Xs) in position Y for time Z
Do any of these things in a given time limit
Gain X of a Resource
Destroy all enemy units within a certain distance of Y
Capture Unit X and bring it to position X

these could be broken down into simple rules:

is UNITID in position Y
does the player own # of a specific unit type
does the opponent own a specific unit?
is UNITID still alive
etc.

or were you looking for implementation?

anyways, I still say we should actually MAKE a working script before we start trying to implement a way to load them. I remember one of the updates mentioning that LUA could now write to a file in it's own directory... could use that to pass end conditions to the next execution.
Post Reply

Return to “Lua Scripts”