User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Sending data between sub applications for split screen

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Skarnek's Avatar
    Join Date
    Mar 2015
    Posts
    53
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Sending data between sub applications for split screen

    Hi everyone!

    I am currently working on a split screen multiplayer using sub applications.
    I managed to sync, players postions into each frame using global values but i dont think it's viable with many objects.

    What i'm trying to do is, having the game calculated in player 1's frame and sending all objects data to player 2's frame
    in order to sync ennemis positions, angle, size, life...

    I tried a message system with global values (trying to handle this as lacewing), the problem is that i can't do loops and objects will not sync instantly..

    Do you guys know a method to do such things? (with no extension if possible, because i'm thinking of an xbox one version)

    Thank you beforehand

  2. #2
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleUnicode Add-onInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Posts
    574
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Is this local multiplayer? If so you could use the "Shared Data" extension which you can use to send data between the sub apps. I believe that it is done that way in the MMF split screen example.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Norway
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would recommend having the players in just one frame, instead of having two different frames for player 1 and 2.

    I have made a small example for you

    What I do, is that I have two sub application objects and make sure they don't share the global values with each other.
    Then I just send Global Value A (named "playerID") 0 to SubApp 1, and 1 to SubApp 2. Then in the game frame, I check if the "playerID" is 0, then center on Player 1, if it is 1 then center on Player 2.
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Skarnek's Avatar
    Join Date
    Mar 2015
    Posts
    53
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the quick answer danworth. Yes it's for local multiplayer, I will take a look at the shared data extension.

    Anyone from clickteam can tell me if this extension will be compatible with UWP exporter?

    Does anyone know a methode without extension?

  5. #5
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Skarnek's Avatar
    Join Date
    Mar 2015
    Posts
    53
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks Decal for this example. I was thinking of 2 different frames because i don't want each frame to process the same calculations.

    Imagine we have simple ennemi with a random direction, how can we do if we want the ennemi on the left side to do the exact same thing on the right side?
    (or shooting in a direction, be destroyed, etc)

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Norway
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure I understand what you mean. If you have one frame, then its very easy to make stuff happen identically on both frames.
    See this updated example, I just made one enemy on the Game Frame just move around shooting at the two players, and it happens at the same time on both Sub Application object. Because they are showing the exact same frame.
    Attached files Attached files

  7. #7
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Skarnek's Avatar
    Join Date
    Mar 2015
    Posts
    53
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm using a lot of random in my game so i want the ennemy to pick the same random direction, that's why i want the first frame to calculate the movement of ennemis and the second frame to simulate it retrieving values from the first one.

    If i give a random direction to an object in your example we can see that each frame is generating is own random number:

    Splitscreen ExampleTest.mfa

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Norway
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see what you mean. I still think its better to do everything in one frame and just do some changes where having everything in one frame cause problems.
    Like the random number generator which are different in the two sub applications of the same frame.

    To solve this I set Global Value B (named "randomSeed") to a number. And then At start of game frame I set the Randomizer to the this seed. This way they both generate the same random number.
    This seed can be changed in the Main Frame (by changing the global value).

    See the updated example below.
    Attached files Attached files

  9. #9
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Skarnek's Avatar
    Join Date
    Mar 2015
    Posts
    53
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes global values can do the trick but i think there is to much values to handle in my game to do it with global values.

    Here is a video so you can see what i'm talking about:


    As you can see, there is a lot af ennemis, they are created at random positions, some have random movements, others have complex AI and make decisions...
    A lot of things are based on random numbers and there is a lot of calculation in the whole scène, so i think that calculating everything twice is way to heavy.
    And i cannot use 5 global values for each ennemi in the scène.

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Just to add another option to the great suggestions by danworth and Decal above,
    if you target windows systems only, you can have split screen with the viewport object
    with appreciable results if the game is not already too "heavy" by itself

    Pros: save you lots of hassle (no need to sync values among applications, just handle both players in the same frame as in a single-screen-single-frame multiplayer)

    Cons: a bit awkward and counterintuitive to setup (not the viewport itself, but the additional job you have to do with the Window Control object to make it work )
    Not sure I remember correctly, but may give some limitations (like forcing window size / limiting player window resizing chances)

    If you are interested I may have an example somewhere, or could prepare a quick one to see.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Is it possible to split the screen into two?
    By leightonw87 in forum Android Export Module 2.5
    Replies: 1
    Last Post: 3rd December 2015, 01:34 PM
  2. Split Screen???
    By Zorcano in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 17th March 2014, 08:33 PM
  3. Split screen 3d TV
    By MdNelson in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 22nd October 2013, 02:41 AM
  4. Split Screen...
    By ToffeeandPebbles in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 19th January 2009, 02:44 AM
  5. split screen(sub app)
    By looner in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 20th March 2007, 10:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •