Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: I_E_Maverick on June 15, 2005, 08:48:45 am

Title: [Request]
Post by: I_E_Maverick on June 15, 2005, 08:48:45 am
hi there! i am very new to fs2 projects and i work for the Babylon project as a modeler. i read a very interesting suggestion about a multiplayer mode and i wondered if it could be implemented.
if this was asked before i apologize but could it be done that you get points or money for your kills in game so that you could spend it for stations or better ships, weapons capital ships and stuff?

i heard about that you can call in backup after having an amount of kills and stuff, so i thought you could modify this to make it a bit more like a buy or upgrade system.
Title: [Request]
Post by: karajorma on June 15, 2005, 12:08:18 pm
If persistant variables were implemented for multiplayer a half-decent FREDder could probably do almost everything on that list.

So Goob. How hard are persistant variables for multiplayer?
Title: [Request]
Post by: Goober5000 on June 15, 2005, 02:21:06 pm
I honestly don't know.  I'm waiting for multiplayer to be fixed before answering that. :p
Title: [Request]
Post by: karajorma on June 15, 2005, 02:48:42 pm
The fact is I'm getting more and more interested in making a couple of multiplayer missions. No one appears to be making any missions for MP that use the new SCP features. I can understand that a lot of stuff can't be done cause any table changes require validation but all the new SEXPs should be usable.

I don't particularly want to take on anything new but if I get a nice idea for mission that does something completely new (like the above) I might actually give it a go just so I can finally release something :)
Title: [Request]
Post by: Goober5000 on June 15, 2005, 04:29:38 pm
The problem is that anytime you add a new feature to multiplayer you have to add some packet stuff to handle it.  If multiplayer requires any packet fiddling, you're most likely out of luck.  It's why the ship limit has stayed at 130 for so long.

Have you tried making a multiplayer campaign with PVs?  I see nothing in the network code that explicitly prohibits it or fails to allow it.
Title: [Request]
Post by: karajorma on June 15, 2005, 04:40:37 pm
I've not actually but I seem to vaguely remember you saying that they didn't work with multiplayer.

What I was planning to do would have any PVs I used staying local to the the hosts machine not the players so there shouldn't be any problems to do with packets.

Anyway even without PVs there are a hell of a lot of new mission types that could be made that were previously impossible using the new SEXPs.
Title: [Request]
Post by: Goober5000 on June 15, 2005, 06:26:18 pm
Well I just checked again, and since the PVs are saved directly into the campaign struct the multi code should handle it automatically.  So theoretically it should work.
Title: [Request]
Post by: karajorma on June 15, 2005, 06:52:09 pm
Cool :) I'll brainstorm some ideas later :)
Title: [Request]
Post by: I_E_Maverick on June 15, 2005, 07:11:10 pm
so many posts and i didnt understand the half of it :(
what are PVs? and did anybody actually answered my question?

would it be possible to set a mission so that 2 teams play against each other with the goal to destroy a structure with buyable ships and equipment?

as told i am just a modeler and dont understand anything of code related or mission editor things. so i would be glad if you could answer this a bit more noob friendly :)
Title: [Request]
Post by: Grug on June 15, 2005, 07:30:15 pm
PV = Persistent Variables.

IE To save numbers / score / points in multiplayer we need PV's to store that data and to transmit it to the other players.

To add extra stuff to send to people over the web however will mean more bandwidth required and thus in some cases more Latency, aka Lag.

Apparently it should work. We just need a few Fredders to try it out.

Help? :)
Title: [Request]
Post by: Goober5000 on June 15, 2005, 08:26:19 pm
Well, this (http://www.hard-light.net/forums/index.php/topic,29170.0.html) is already possible in single player using retail. ;)
Title: [Request]
Post by: Black Wolf on June 15, 2005, 11:34:59 pm
Quote
Originally posted by Goober5000
It's why the ship limit has stayed at 130 for so long.
 


I don't suppose this could be bumped with a command line? - breakmulti or something? It's probably too fundamental for command line parameters, but worth the time it took to ask this question if it isn't IMO.

Quote
Originally posted by Goober5000
Well, this (http://www.hard-light.net/forums/index.php/topic,29170.0.html) is already possible in single player using retail. ;)


You know, it wouldn;t be that hard to flesh that out with a storyline and some basic missions - I had an idea to do just that awhile back, but Uni and TI kind of got in the way timewise.

It's still a kickarse proof of concept though.
Title: [Request]
Post by: Goober5000 on June 16, 2005, 12:19:51 am
Quote
Originally posted by Black Wolf
I don't suppose this could be bumped with a command line? - breakmulti or something? It's probably too fundamental for command line parameters, but worth the time it took to ask this question if it isn't IMO.
Aye, that's why we have the Inferno builds.  They're not multi-compatible, but they have bumped limits. :nod:
Quote
You know, it wouldn;t be that hard to flesh that out with a storyline and some basic missions - I had an idea to do just that awhile back, but Uni and TI kind of got in the way timewise.
Yeah, I think I remember that.  But ShadowWolf is working on a full-fledged campaign that will make extensive use of this kind of gameplay. :)
Quote
It's still a kickarse proof of concept though.
Thanks. :)
Title: [Request]
Post by: I_E_Maverick on June 16, 2005, 01:55:44 am
thx for the clear answers! now i got a little something :)

i will have a look of fredders that can help just give me some time.
Title: [Request]
Post by: karajorma on June 16, 2005, 04:28:53 am
Quote
Originally posted by Grug
PV = Persistent Variables.

IE To save numbers / score / points in multiplayer we need PV's to store that data and to transmit it to the other players.

To add extra stuff to send to people over the web however will mean more bandwidth required and thus in some cases more Latency, aka Lag.


I've been thinking about this one a little and I'm wondering how a few things work.

Before playing multiplayer the mission is xfer'd across to the client so it's obvious that the client machine needs a copy of the mission for something but it seems odd that each computer would be running it's own copy of the mission because what would happen in the case of things like use of the random SEXP, each machine would generate it's own number and the mission could very easily go down divergent paths for each player.

I might need to test this to see how the game treats variables and randomly generated numbers in multiplayer before I say that everything is possible. Cause if the clients have a different variable stored from the host I can see everything going to pot pretty quickly.
Title: [Request]
Post by: I_E_Maverick on July 12, 2005, 08:28:22 pm
was there any success by now?
Title: [Request]
Post by: Goober5000 on July 12, 2005, 08:53:35 pm
What do you mean?  The concept should work; all you have to do now is FRED it.
Title: [Request]
Post by: wolfdog on July 13, 2005, 03:51:15 am
Quote
Originally posted by karajorma


I might need to test this to see how the game treats variables and randomly generated numbers in multiplayer before I say that everything is possible. Cause if the clients have a different variable stored from the host I can see everything going to pot pretty quickly.

Don't know if it's of any help, but you can have random events in multiplayer, I know it because there are working missions with them... Try looking for the mission "knife Fight" for an example.
Title: [Request]
Post by: karajorma on July 13, 2005, 03:55:59 am
Thanks. When this topic was bumped I figured I'd spend tonight playing with multiplayer to see what I could learn. Now I've got a good place to start :)
Title: [Request]
Post by: I_E_Maverick on July 13, 2005, 04:12:08 pm
good to hear! i hope you can tell some progress after testing ;)
Title: [Request]
Post by: karajorma on July 13, 2005, 04:28:08 pm
Odd thing is that I've opened up knife fight in notepad and there isn't a single use of the rand SEXP.

I can't think of any other way to get random behavior without using it either.

Exactly what happens at random in that mission?
Title: [Request]
Post by: karajorma on July 13, 2005, 05:25:26 pm
Hmmmmm. Did some preliminary testing and I had mixed results.

I set up an event that set a variable to a random number, printed out that number (using $variable in a message) and which set the value of Alpha 3's sensor subsystem to that variable.

The mission ran, Alpha 3's sensor subsystem displayed the correct percentage and the host machine displayed the message correctly. The client machine however did not. It reported the value of the variable as whatever the default value was.

I'll need to test this some more but this probably means that missions involving money etc are probably out. Only the host machine would keep track of how much was being earned and spent correctly. The clients would just assume that there had been no change.

The problem may have been down to me using random though so we'll see what happens when I use a variable that should be the same on both machines.
Title: [Request]
Post by: wolfdog on July 14, 2005, 02:39:22 am
Quote
Originally posted by karajorma
Odd thing is that I've opened up knife fight in notepad and there isn't a single use of the rand SEXP.

I can't think of any other way to get random behavior without using it either.

Exactly what happens at random in that mission?



The first wing of bombers jumps in at random locations....  

But I was wrong, it was done in another way.. like this...

http://www.xs4all.nl/~joost5/cancerwing.jpg
Title: [Request]
Post by: I_E_Maverick on August 02, 2005, 03:26:01 am
i am sorry to bump this from time to time, but i really like this idea of multiplayer games, so i would like to hear if there were any more test results, any success maybe?

i would like to try it myself, but i am so damn busy with all the ships making that i dont have the time, also i am not so experienced in FRED than most of you.

so, any progress?
Title: [Request]
Post by: karajorma on August 02, 2005, 04:05:51 am
I had a play with it as you can see above. The basic problem is that there is no way for the machine hosting the game to inform the clients how much money each of them has made. The host can do all the calculations but it can't pass the value to the clients in any way and none of the coders understand multiplayer well enough to fix that at the moment.

You could probably make a mission where the team gain money for kills etc as a whole though. If you're willing to let the person hosting the game spend the money then you could have a campaign where the number of kills the team racks up are used in future missions. What you can't do is have a TvT or dogfight campaign where everyone racks up points and chooses what to spend them on. You may be able to make a mission where the players tell the host what they want and he picks it for them though.

It may also be possible to cheat that slightly and do it by adding a capship to the mission far away and setting subsystems to a value and then reading the value of the subsystem on the client PC. I'll have to give that a try at some point.
Title: [Request]
Post by: Roanoke on August 02, 2005, 05:04:12 am
Heh Heh, is there anything FRED you don't have your fingers in k ? ;)
Title: [Request]
Post by: karajorma on August 02, 2005, 06:30:05 am
I've never actually tried making a multiplayer mission actually. All I did for this were test missions to try out the individual features I'd need to make Maverick's idea work.

That said multiplayer missions are on my list of things to try as soon as I complete one of the campaigns I'm working on. I love FREDding as long as it's a challenge and from looking at Cetanu's tutorials multiplayer has a whole load of new ones for me :)
Title: [Request]
Post by: I_E_Maverick on August 04, 2005, 05:18:37 am
well, there could no team ressources then, so how about that:

each machine running this mission must get the points for their kills, how about every one on the team gets his own money for kills, so he could buy anything that he wants.

for example, the client one destroys a fighter, gets 50 points or $ or whatever, when he has 300 $ he can buy the team a fighter killer or something. the mission would be to kill the opponent team as a team, so everybody has to buy good ships for the team
Title: [Request]
Post by: karajorma on August 04, 2005, 12:20:20 pm
I don't think you're grasping the problem.

If I were running a muliplayer missions with you and I was hosting the game, my machine would calculate that you have $300 to spend on whatever you want.

Your machine however would say that you have $0 (in fact it would say you had whatever was the initial amount you started with) so as a result you wouldn't be able to buy anything.

The problem occurs because only the host machine appears to calculate variables correctly. (I'm assuming the problem lies there. It could be that it's calculating them correctly but not reporting them correctly. If that is the case then the machine would be reporting that you had $0 but would let you spend the $300 that it says you don't have!).

Now what might be possible is to cheat ever so slightly and feed those numbers into something that the game can read directly without having to resort to variables (For instance the damage a subsystem on a capship has). Since this doesn't use variables the game can use it. Reporting how much money you had in the bank however would be a different matter.

Anyway I just found out that I've got the whole of next week off so I might have to give this a try :)
Title: [Request]
Post by: speedyR on August 04, 2005, 12:46:55 pm
hello,

only an idea/question/request - so don't throw it away to fastly -

i haven't fredded a long time now, and also i have to say, because of my very limited time i have played fs2_open with a few missions but haven't started fred_open at all...

and multiplayer... i havne't played fs or fs2 in mp since 98/99... huh, a long time...

so, my first question:
1 ) Server has a mission file which one or all of the client(s) do not have. What's the result ?
a ) this mission won't be played (perhaps you even can't join)
b ) the mission is transfered

if b ) (if not then could that be integrated in fs2_open?)
next ones are part of the idea:

2) now what would be, if there are sexps which would SAVE parameters/values to disk ?
could that be implemented ? (yes) could it be easily done ? (maybe - your answers here)

3) from these values and some mission templates (to be more exactly the whole next mission with some place holders (right word?) for missing parameters like money, weapons, names or what ever you need - and what has to be saved to disk during the last mission) you (the server) could generate the next mission.

then when next mission starts it would be transfered to all others and fine... next stage in the dynamic storyline ;7

only an idea, so please think twice before you hit it :wtf:


btw. are there any german here who would test some very old ;7 missions (i only would rework them if they would fit "your" needs - i mean if they are "worthy" to be reworked).
missions includes speech, "but" are made for vanilla FS1...
Title: [Request]
Post by: speedyR on August 04, 2005, 01:22:28 pm
perhaps this is not a question about existing fs_open but of a new mod (including modified exe) ? a freelancer-mod ?!! hehe
Title: [Request]
Post by: karajorma on August 04, 2005, 01:47:46 pm
1) The mission will Xfer across to the client machine that doesn't have it.

2 & 3) It's an interesting idea and it would get around the problem if you could get the machines to xfer the new missions. You would however be corrupting the original version to do it though so whoever coded it would have to make sure that the changes were written to a different file.

While possible that sounds like an awful lot of programming effort. No mission ever knows which mission is following on from it as that info is saved in the campaign file not the mission itself.
 Besides variables are already saved to disk via the persistant variables option. The problem is getting those to xfer as they are stored in the pilot and campaign files (which don't Xfer as they are specific to each player).
Title: [Request]
Post by: speedyR on August 04, 2005, 02:17:49 pm
Quote
Originally posted by karajorma
2 & 3) It's an interesting idea and it would get around the problem if you could get the machines to xfer the new missions. You would however be corrupting the original version to do it though so whoever coded it would have to make sure that the changes were written to a different file.


correct. perhaps an option in the sexp ? (security relevant!!)

Quote
While possible that sounds like an awful lot of programming effort. No mission ever knows which mission is following on from it as that info is saved in the campaign file not the mission itself.


my idea was to start another process (or sub routine or whatever you call it) WHICH would change the "next" mission file (or writes into a new file).
that means the mission itself (and only he/it) has to know what mission follows.
when talking about an random campaign the order in which the missions will be played are NOT known besides the very very next one which will be determined via SEXP expressions in the actual mission and STORED in external config files (or whatever you call it)

Quote
Besides variables are already saved to disk via the persistant variables option. The problem is getting those to xfer as they are stored in the pilot and campaign files (which don't Xfer as they are specific to each player).


see above, my idea was to store in a different way.
the variables themselfs do not need to be transfered, only the generated new mission file (what's about the campaign file me asks) needs to be transfered.
Title: [Request]
Post by: karajorma on August 04, 2005, 03:42:46 pm
hmmmmm. Half an hour spent working up a proof of concept mission only to be defeated by the fact that there is no such thing as a dogfight campaign :lol:

I'd be annoyed if it weren't my own stupid fault for not checking first :rolleyes:

I should be able convert to TvT without too much trouble but I doubt I'll be doing it today :)


@Speedy. I got your point. I was simply saying that since the game already writes PVs to the hard drive you might as well simply extract and use those. Of course the fact that there doesn't appear to be such a thing as a dogfight campaign rather scuppers that idea though.
Title: [Request]
Post by: Taristin on August 04, 2005, 03:48:08 pm
:wtf: is a dogfight campaign?
Title: [Request]
Post by: karajorma on August 04, 2005, 03:50:18 pm
Several dogfight missions in a row. If you don't have a campaign you can't use persistent variables which means that the ideas on this thread will never work.

You can make campaigns for single player, coop and tvt but you can't make one for dogfight.
Title: [Request]
Post by: karajorma on August 13, 2005, 05:32:04 pm
Okay. I've got a campaign in its preliminary stages but I can't play it much because I'm getting all kinds of bugs which may be due to that Zeta 1 leading Alpha wing thing I reported in the multiplayer forum.

So if you guys want to try playing a campaign where you get you buy stuff with your kills I'll need some people to sign up and test this out with/for me.

I'm attaching the campaign file but if anyone is available to play sometime tonight or tomorrow post here or on Game Warden cause it's easier to test this with me around.

The campaign is in a very alpha stage so I'll explain here what's going on.

In the first mission you play a standard TvT with a Fenris cruiser each. When the mission is over you go to the shop level. Alpha & Zeta 1 have 2 minutes to approach within 200m of the ship they wish to buy. Targetting each ship will show you how much it costs and your escort list will show you how many points you have to spend from kills (You start with around 40 points as a freebie). The rest of the fighters can kill each other, kill the enemy wing leader to prevent him buying a ship or if they're feeling evil use morning stars to push him towards something he may not want to buy. :D Kills from this mission are not added to each teams tally.

The next mission is a repeat of the first but the fenris cruisers are replaced with whatever you bought in the preceeding mission. You'll get another shop after that followed by the final TvT mission.

Briefings, debriefings and objectives will all be added later.

Anyway here's the campaign. I've used lightspeed's nebulae and a background from Singh's emporium so if you have them you can make the mission look prettier.

Anyway here's what I've got so far
Title: [Request]
Post by: karajorma on August 14, 2005, 12:39:36 pm
Playtested with DaBrain but I've got a rather major stumbling block with the mission. The Change-Ship-Class SEXP only appears to work in singleplayer. When we both bought Aeolus class cruisers DaBrain who was hosting saw both while I still saw fenris class cruisers.

I probably could get around this using the get and set position SEXPs but it does involve a fair bit more work and is much more of a hassle and it basically limits me in what I can do (We can't make the player have a shop level in which they buy their fighters for the next mission for instance).
Title: [Request]
Post by: I_E_Maverick on August 15, 2005, 04:26:15 am
hey, thats at least something, maybe in cooperation with the SCP you could change some of the SEXPs to your liking, so that some dificulties are solved.

thanks for you work so far, you are doing a great job on this!!
Title: [Request]
Post by: karajorma on August 15, 2005, 02:07:51 pm
Thanks for the encouragement. I was feeling a bit disheartened that DaBrain was the only person willing to download the missions let alone help test them out with me.

I'm going to continue working on this but to be honest it's a lower priority than MindGame and SoR so I'll mostly be working on it when I feel like a change.

I've got a few other ideas for multiplayer missions though.