TASClient Single Player mode, Missions and Campaigns WIP

TASClient Single Player mode, Missions and Campaigns WIP

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

TASClient Single Player mode, Missions and Campaigns WIP

Post by Satirik »

I've been working on a Single Player mode for TASclient for almost one week, and keep in mind it's still BETA. To launch it directly without using the Single Player button : TASClient -menu

Image

How does it works ? the whole interface is html+css+javascript using the WebBrowser component which use the installed IE version. It works with IE 6 and IE 7 with a resolution 800*600 and more (4/3 -> 16/10, with a wider screen than 16/10 the background image wont take the whole place). Html is here working as the template framework for the lobby. The skin is in default.ssk (spring skin). The lobby open the html file and replace the known [Data] like [MapList].

To communicate between the html and the lobby, you just need to add a link like : <a href="lobby:settings">settings</a> and the lobby will open the settings. If you add an http link it will open it in the default browser. Otherwise if the link is neither a lobby command nor an http link it will just do nothing.

If some of you are interested in making different skin or updating the current one, just tell me and i'll add further information on available [data] and lobby commands.

So there is a skirmish mode which look like springlobby's one, you can choose between fixed pos, random pos and choose in lobby. It supports mod and map options of course.

There is a missions part. With a new mission file. A mission file is a 7zip file (sd7 for spring), it must contains a 'descriptor.tdf' like this one :

[MISSION]
{
Name=Mission3;
Description=Just a test description;
Briefing=You have to to stuff to win other stuff and then stuff appeared.<br>Don't forget to make stuff and protect stuff.;
HtmlBriefing=briefing.html;
IncludeHtml=1;
MapFile=Cooper_Hill_TNM02-V1.smf;
MapHash=E29A584A;
ModFile=BA621.sd7;
ModHash=2056951972;
}

The description will be displayed in the mission list (and can also be displayed in the briefing).You have two different way to display the mission briefing, the default integrated briefing theme, in this case remove the 'HtmlBriefing' and 'IncludeHtml' keys from the descriptor. The second way is the Htmlbriefing, you can add an html page to your mission that will be displayed as the briefing. And the third way is between the two others, you add an html page that will be included in the default theme using a special html file in the skin (IncludeHtml=1;). To start the mission, the lobby will check if you have the exact same mod and map than the ones required by the mission. So you have to provide the map and mod file and hash.

Then if everything is good, it will launch the mission using the script.txt provided in the mission file (so your can control everythings). What is a mission, a mission is not a startscript, but as suggested trepan it's a mutator and everything is done using LuaRules and LuaUI.


There is also a campaign part. A campaign file is a 7zip file (sd7 for spring), and it must contains a 'descriptor.tdf' like this one :

[CAMPAIGN]
{
Name=Campaign1;
Description=OMG THE FIRST CAMPAIGN;
IncludeHtml=1;
Step1=step1.html;
}

How does it work ? When you select a campaign, it shows the 'step1' html file (Here you don't have choice, it must be html, but you can choose the includehtml option). In the step1.html file, you can let the user pick the mission he wants, like mission1 will attack by north, mission 2 by east and mission 3 by west. To let the user pick a mission simply add a link like this one :
<a href="lobby:pickmission:Mission.sd7:step2.html:step4.html">mission 1</a><br/>

The first parameter, is the mission file, which will be handled like a normal mission, except when the mission will end, if the user wins it will open the second parameter, here step2.html, and if he looses it will open the thirst parameter (here step4.html). The lost step is optional (if there is no lost step it will simply go back to the mission briefing to try again).

For now the progress done in a campaign is not saved. But im gonna add 2 other parameters like a savesettings, to save something and get it back even if the lobby is closed, and a addtoscript, to let you add anything you want in the script file for missions. So you can add optional stuff in your briefing.

So this is a WIP, and everything can change, so if you have any suggestions ... go ahead (especialy the modders).

If you have any question on the lobby part you can ask me, if you have any question on the mission part ask quantum, or trepan or any good Lua/Mod coder.

http://tasclient.it-l.eu/TASClient.7z (it includes the mission test and the campaign)
http://tasclient.it-l.eu/Mission3.sd7
http://tasclient.it-l.eu/Campaign1.sd7

Quantum did the test mission.

and if you have a free music to replace the TA one i added to show it can play music it would be great.

edit: two fixes : launching using the SP button failed because the skin was not extracted if you didn't launch it with -menu, and music is paused when a game is launched

edit2 : other bugs fixed

EDIT3 : The rendering use IE, and only IE and it won't use Firefox or opera ... it must works on both IE6 and IE7 if you want to make a new skin
Last edited by Satirik on 26 Jun 2008, 17:52, edited 3 times in total.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by FLOZi »

'Descriptor.tdf' is a dreadful name.
ZellSF
Posts: 1187
Joined: 08 Jul 2006, 19:07

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by ZellSF »

Great to see singleplayer being worked on in TASClient, but uh, it does nothing.
Masure
Posts: 581
Joined: 30 Jan 2007, 15:23

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by Masure »

Some shots :

Skirmish

Players list :
Image

Map view & players positioning :
Image

Map selection :
Image




Campaigns & missions

Single missions list :
Image

Campaigns list :
Image

Campaign's missions :
Image

Mission detail :
Image

Ok this mission detail looks bad. But html gives opportunity to make something really beautiful.
User avatar
very_bad_soldier
Posts: 1397
Joined: 20 Feb 2007, 01:10

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by very_bad_soldier »

Awesome! As far as I can tell I like it very much! Especially the main menu, it has style.
User avatar
clericvash
Posts: 1394
Joined: 05 Oct 2004, 01:05

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by clericvash »

Please make it browser independant, as awesome as it is, relying on IE makes it highly un-portable!
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by aegis »

The TASClient implementation relies on IE

Which iirc can be replaced in WINE (if you are so inclined to use tasclient in linux) with the gecko engine (mozilla)

For other implementations, AFLobby already uses html in the lobby itself and is cross-platform, and any other lobby can do it how they wish.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by LordMatt »

Satirik is clearly THE man! :-)
User avatar
sombriks
Posts: 50
Joined: 03 Jan 2008, 15:40

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by sombriks »

i just started to update the svn and took lots of updates; so i came there and well well! there's some kind ppl doing nice work!
User avatar
Roflcopter
Posts: 47
Joined: 24 Dec 2006, 21:09

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by Roflcopter »

This is awesome! If only it used another browser...
I have never seen the SSK extension before. Which program can open SSK files?
Satirik wrote:If some of you are interested in making different skin or updating the current one, just tell me and i'll add further information on available [data] and lobby commands.
I'm so interested. :P
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by koshi »

first off: why has there been no discussion about this in advance? have there been _any_ thoughts given on portability to other platforms?

what exactly is that (binary) ssk file? with what can i open that?

how does the interaction between lobby and that interface work in detail?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by AF »

You knew I was working on stuff like this and spring lobby were thinking of it too, yet you went and defined your own stuff anyway?!

I've been going on about missions for weeks now, working in my own time laying down foundations and supporting structures, and you spring this on us all out of nowhere without asking anybody or discussing any of it.

You should have discussed this. Anything that exposes an API that's for features that aren't specific to your lobby should be discussed otherwise we end up with rival formats and divisions.
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by Satirik »

ssk is just a 7z with html inside but it has nothing to do with other lobbies ... only mission and campaigns do ... and you can make any suggestions you want to improve or change anything ... the discussion is now ...

i know how most discussions end on this forum so i did it and now we discuss how to improve it ...

koshi what you have to worry, i repeat, are mission an campaign files, ssk are just skins for tasclient except if you want a crossplatform skin system

and btw we did discuss this on the campaign mission thread where only braindamage posted (i took most information he made to make theses files) and i discussed with him about html or hardcoded stuff with button and warmap (which is too limited)

edit: commands used by missions and campaigns are

for missions:

lobby:startmission

for campaigns:

lobby:pickmission:missionfile:htmlVictory:htmlDefeat (optional)

edit: tasclient just intercepts the url change (onnavigate event) and if the command is known, it does what i has to do and it cancel the navigation otherwise it just cancel the navigation

edit2: braindamage told me there is an html component wx .. which supports html + css but not javascript ...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by AF »

I do not remember such a discussion in that thread, more of wrangling about what the official way to start missions is.

Eitherway you and braindamage should have publicly discussed this and your methodology is highly irresponsible and disrespectful.

Campaigns and front ends are something the community considers very important and we should not solve the problem by creating headaches and dirty dealing behind each others backs.

I find it hard to see how I could work in a lobby environment with things such as this occurring. It is not conducive to a healthy development community.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by LordMatt »

AF wrote: Eitherway you and braindamage should have publicly discussed this and your methodology is highly irresponsible and disrespectful.
I think it is nice that he has actually produced something for people to use.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by AF »

I would consider moving from 7zip to normal zip archives.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by aegis »

7zip means you need to support the lzma algorithm, and not all 7zip archives are created equal. Standard zip compression is compatible with a much wider range.

You probably don't need the compression benefits of 7zip in a simple skin.
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by Satirik »

yeah but if you want to make things advance you must start somewhere, and that's how i contribute ;)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by AF »

How you chose to advance involved going all the way from analysis->design->implementation->testing and then consulting the other developers who it might affect.

How you were going to implement it, how you define missions as campaigns, are all integral to how the other lobbies implement it but youve gone and done it anyway with no consideration for the headaches and stresses your dumping on other developers.

And how you did it too is bad programming practice. Here is just one example:

http://www.codinghorror.com/blog/archives/001134.html
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: TASClient Single Player mode, Missions and Campaigns WIP

Post by aegis »

AF wrote:I would consider moving from 7zip to normal zip archives.
Satirik wrote: omg you noob
7zip is future
7zip is cool
7zip is cross platform
7z is free
why the fuck should we stay in past with that crappy zip ?
Locked

Return to “Engine”