Multiple Game Modes in a Single Mod...

Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
Is it more hassle than it should be to run Multiple Game Modes in a single mod?

I am having problems with conflicting files. I have one set of files for the first game mode, but almost everyone of the files needs editing again for the 2nd game mode. This is a source of great frustration.

Sure, subclassing some files is ok, and resolves a lot of issues, but I am changing files like HealSprayMixin, Spit, between each mod, so in essence I am having to create 2 separate mods in the same package. The code is confused about the gamerules, as 2 gamerules files are loaded at launch, so things like GetGamerules() don't return the expected results. It is a pain.

Does anyone have any suggestions or ideas? Especially as I have a 3rd game mode planned for the same mod... I really don't want to have to break the playerbase by running 2 separate mods, that would be heartbreaking :(

Comments

  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    If i was going to do it I would probably modify how the game loads certain scripts and have it triggered off of the gamerules type detected, and just make seperate copies of the abilities/tech for each gamerule. Would require some restructuring of some scripts tho.
  • MCMLXXXIVMCMLXXXIV Join Date: 2010-04-14 Member: 71400Members
    We've just managed it with Combat... It's probably a bit OTT for a mod where most of the files between the two game modes are basically the same.

    What we did was to have it so on StartWorld the server works out whether to run Combat or not based on the saved state from the previous game and loads one set of files. When the client loads it receives a network message from the server on connect that tells it to load the relevant Game Mode files. If you want to go from a Build mode to a Fight mode you can either do this kind of switching between entire codebases or it might be easier to just have a global enum GameMode.Build / GameMode.Fight that you use to specialise the behaviour as required.

    I think we will use this if we ever get around to implementing different game types inside Combat (capture the flag, king of the hill etc).
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    <!--quoteo(post=1987944:date=Oct 6 2012, 09:24 PM:name=MCMLXXXIV)--><div class='quotetop'>QUOTE (MCMLXXXIV @ Oct 6 2012, 09:24 PM) <a href="index.php?act=findpost&pid=1987944"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->We've just managed it with Combat... It's probably a bit OTT for a mod where most of the files between the two game modes are basically the same.

    What we did was to have it so on StartWorld the server works out whether to run Combat or not based on the saved state from the previous game and loads one set of files. When the client loads it receives a network message from the server on connect that tells it to load the relevant Game Mode files. If you want to go from a Build mode to a Fight mode you can either do this kind of switching between entire codebases or it might be easier to just have a global enum GameMode.Build / GameMode.Fight that you use to specialise the behaviour as required.

    I think we will use this if we ever get around to implementing different game types inside Combat (capture the flag, king of the hill etc).<!--QuoteEnd--></div><!--QuoteEEnd-->

    If you figure it out before me, I'll put the code into Proving Grounds..
Sign In or Register to comment.