Oarcinae / FactorioScenarioMultiplayerSpawn

A custom scenario for Factorio which provides each player a unique starting spawn point in a multiplayer game.
MIT License
50 stars 30 forks source link

Settings Question #39

Closed Cyberzoid1 closed 6 years ago

Cyberzoid1 commented 6 years ago

Me and my friends want to play a scenario where we have to find each-other and work towards each-other as a end-goal. We can work alone and on our bases but be able to eventually connect to each-other.

That said is there a way to combine teams or transfer teams? Would doing so affect your current base?

Also can these settings be changed part way through the game (or any setting)? https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn/blob/22a691e0c826b604bcbc2a2f31a78f04b43e5896/config.lua#L87-L88

Thank you for this scenario btw

Oarcinae commented 6 years ago

I currently don't have any options that would allow you to combine teams later. However, keep in mind that the friendly teams right now can link up electricity, rail lines can be shared (stops can't be though), and you can pick up each other's buildings and interact quite a lot once you find each other.

No, you currently can't change the shared vision during run time. It wouldn't be too hard to change that though. It's just how you would give it

Shared vision between forces is kind of hacky right now. I don't have a good way to do it.

So there is a lua function you can call to merge teams, in theory I could add an option, maybe in the spawn control menu, that gives you a button to press to "join the main team".

When you merge a force with another force, the force that is being merged INTO is the one that keeps it's reasearch and force name. When merging, you would have to be careful that you don't lose a bunch of research.

A few questions I have for this type of feature addition:

  1. When would you want to "allow" combining / transferring teams?
  2. Would you care if you lost research? Would you want to combine research progress from both teams?
Cyberzoid1 commented 6 years ago

The traditional merging may be fine if it was well documented on what exactly it would do.

An alternative: if you can create a wrapper around the built in merge function to do the following. It may retain the research from both teams. This feature could be selectable/optional when merging

save research from team 1
save research from team 2
call built in merge function
save research from merged team
loop through saves from team 1 and add them if missing from merged team
loop through saves from team 2 and add them if missing from merged team

For when. I would say it could be any time. For instance 2 teams finally cross the expanse with their trains and decide to pool their resources for launching rockets even faster. Both teams would have to agree to the merge.

For a similar case. Transferring teams There may be friends that create their own bases at the start and then decide to actually work together. Or the opposite they start together but then one player wants to start off on their own.

Oarcinae commented 6 years ago

@Cyberzoid1 I like that idea. It wouldn't be too difficult to do as well. I've had some ideas about splitting up teams to do different tasks (military, science, smelting, etc...) and that each team can only build certain things and research certain things.

I'll see if I can at least make a helper function that does what you ask, so that you could call it from the command line if you need to. Not sure when I'll get time but will leave this open until I get to it.

Oarcinae commented 6 years ago

@Cyberzoid1 I added a function to try merging forces AND keeping research... I did a basic check to see if it works, but I have no idea how it will work in a real game. If you can give it a try that would be cool.

You can call it from the command line like this: /c MergeForcesKeepResearch(game.forces[MAIN_FORCE], game.player.force)

This will merge your force into the main force for example, but you can do it between any 2.

For your requested scenario, you can try turning off shared vision, and when you merge forces, you should get shared vision automatically. Let me know how it goes.

Oarcinae commented 6 years ago

Marking as closed since I don't plan to make this an official feature.