How do I Make connection between java and construct2

0 favourites
  • 8 posts
From the Asset Store
Creating Artificial Intelligence Games Using Construct2 and Construct3.
  • Hello guys, how do i make connection between java and construct2

    example:

    i make a socketserver in java and i want to use this socketserver in my c2's game.

    thanks.

  • Hello guys, how do i make connection between java and construct2

    example:

    i make a socketserver in java and i want to use this socketserver in my c2's game.

    thanks.

    The only thing I can think of is for you to use the C2 SDK and write your own plugin to act as a 'middle man' between the two.

    I have no idea of how - or even if - this would be possible.

    It comes down to how much interaction you would need, i.e. what information needs to pass between them.

  • There is the Ajax plugin to communicate with websites outside your game,

    aso the browser object has execute javascript action..

    If (a combination of) these don't work for you, writing your own plugin would probably be your best shot..

  • i was thinking in JAVA SDK, not javascript sdk, Is this possible?

  • i was thinking in JAVA SDK, not javascript sdk, Is this possible?

    C2 has nothing to do with Java, so what is it you actually mean or are trying to do?

  • I tried to do this (a centralized Java-based web socket servlet) and failed, because the Construct is inherently a peer-to-peer architecture. The only way you can make it work (short of writing a whole new multiplayer plugin) is to have your "host peer" as a browser running on your web-server.

    Barring that, you would have to create a completely new Multiplayer plugin that runs on an external customizable API.

    I am going to do this eventually, but it requires more time than I have at the moment.

    If you do create such a plugin, put it on Github so that other folk can help develop it. I would also recommend using http://socket.io/

    See these posts for reference:

    viewtopic.php?f=146&t=122599

    viewtopic.php?f=147&t=161343

    viewtopic.php?f=146&t=150315

    viewtopic.php?f=146&t=162260

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • thanks i will search more about this.

  • We use and abuse the AJAX to connect our Construct client to our Java servlets. Then we just make calls according to a preset API. That is the "easy" way rather than writing a full scale web socket solution.

    We are using periodic polling to update "real time" information. We also run parallel calculations on both the client and server that give the impression that everything is being updated in real time, when in reality the numbers are only updated from the server whenever the user executes an action.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)