rogerfgay's Forum Posts

  • Are you sure that the free version has a debugger? After my first day, which is a little hazy, I have to go back again and let things settle in. I now feel slightly more oriented, as though the day of understanding will in fact one day come. But I think I tried to click on some debugging stuff yesterday and found that it wasn't supported in the free version.

    I don't need anything too fancy just to do this experiment / proof of concept thing. If I can get it to send a clear message that I pressed the right arrow (or JSON action description that goes with it or whatever), I can just maybe reverse it ... send back left arrow command; or something like that.

    Was thinking about this yesterday ... the very first experiment doesn't even require two players. If I do the above, pressing right moves the sprite right, followed by returning to its original position in response to the reverse echo ... or ... maybe right + up or something, since if right + left happens too fast, it could look like nothing happened.

    That would be very, very simple to do as long as the action sends a message to the server that I can modify and send back, and when received, the demo will carry out the new action.

  • Thanks for that jayderyu. I'm just getting focused on applying my technology to games for the first time. I thought I'd start with games requiring transmission of rather small amounts of data, not streaming large numbers of packets. Right click, left click. Moving through a scene might involve sending a series of messages.

    There's nothing a standard transmission protocol can do to defeat lag in transmission times, slow transfers when the Internet is busy, etc. As you mention, there are strategies within applications for dealing with that. For Beta and further development, I'd also very much like to be working with people who understand the issues clearly and are designing appropriately based on that understanding. What actions and interactions hold up well? If the first demos and apps are well-designed with the character of the technology in mind, it would help tremendously. It would also help in further development ... beyond simple websockets ... to be able to focus attention directly on important, well-defined, solvable problems.

    For my first plunge, I want to use WebSockets. It's a standard that is now supported by all major browsers subject to Microsoft's traditional delay. But they have promised it will work in their current version. (Although my latest test in v10 on Windows 7 didn't.)

    But beyond that, I can do anything that I want to do. If the first phase goes nicely, an installable version can support any transmission protocol, and even direct transmissions between users rather than through a common server. That's just one option. Anything is possible.

    One of the great things is that I've developed small footprint components. Even from the start, I envisioned installing even on cell phones.

  • Firebug is telling me that it's continuously reloading localhost:5000

  • I also read in a forum post that someone fixed a problem by setting protocol to something ... meaning yes, use it. Right now, it's set to null.

  • Just as a quick experiment, I entered the ws address for my demo. I can see the connection being made from localhost:5000, the C2 program, with some crazy Cookie data in it, referring to one of my blog articles. But then when I click right, left, or whatever, it requests /robots.txt, which causes it to drop the WebSocket connection. (My demo doesn't take kindly to special requests.)

  • I might be catching on ... I can set values for key right, etc. on the websocket. Will that prepare and send a message? Will it interpret and apply if it receives a message with the codes I set in the same form?

  • That's weird. It began running in Chrome after I used the short-cut to display the html file source, but I can't inspect code. And although it's not actually running in Firefox, I'm now (after viewing source too) looking at the CSWebsocket code in Firebug.

    OK ... So, I should set up server info in event 1 ... but how to I trigger the dictionary update based on received info as you suggested. I'm used to editing directly in code and I'm not seeing any in the development system so far.

    (also wish the forum would stop timing me out)

  • And I apparently need to install CSWebSocket_plugin.js ... searched the directories and then googled, but haven't found it.

  • You could set up key values named for the different directions, and use a Boolean 0, or 1 to tell an object to stop or go.

    Heres an example.

    https://dl.dropboxusercontent.com/u/666516/ws4dir.capx

    OK, now I need to know how to update my free version. The project was saved in R143, and I have R139 ... so it wouldn't load.

  • Well if the return string was already formatted to "{"c2dictionary":true,"data":{}}" then when you received the message you could just load it into the dictionary object, and compare known keys, or do a for each key.

    I would assume there shouldn't be many issues reloading the dictionary that way.

    OK. I'll try to figure out how to do that. Do you happen to have an opinion as to whether this will work with the "8 direction 1 (simple movement)" example?

  • The implication is UDP is necessary for real-time multiplayer games. WebSockets only support TCP.

    I understand what you're saying, but the jury doesn't seem to have given their final verdict on that question: for example,

    stackoverflow.com/questions/13040752/websockets-udp-and-benchmarks

    I can rig my server to do UDP. The problem is at the browser end, which in some configurations might not be a problem at all.

  • Id say the biggest issue now is parsing the notification messages from servers.

    Most strings are in json key pair format, and C2's data objects use that, except they must all have the first key formatted to something they recognize.

    Thanks. I can look at that when I've gotten a little farther along so I have some way to id the problem and test. As per your description, it could be more than one thing. Top of my head says it may need to be serialized or deserialized, depending on how you want to access the results. I don't use JSON myself, but as I understand it, the functions for that are window.JSON.parse("a json string"); and window.JSON.stringify(myObj);

  • I'm new to Construct 2, and am interested in doing a quick experiment / demo with my WebSocket technology.

    highlevellogic.blogspot.se/2011/09/websocket-server-demonstration_26.html

    I'd like to construct a very simple initial demo, like for example, using the existing "8 direction 1 (simple movement)" example with two players. If you're more familiar with another simple example, that would likely work just as well; but movement just seems like a good basic start.

    I'm wondering if I could get come quick tips / pointers. I need to capture event data to be sent and make use of data that is received. I can do the WebSocket part. My questions have to do with working with Construct 2 browser code.

    1. Identify / get data to send that informs the other player of the character used in the local browser.

    2. Capture movement event information.

    3. Apply movement event information received from the other player.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have my own server ... built it myself; fully standard compliant. I've had a demo running for about 2 years.

    highlevellogic.blogspot.se/2011/09/websocket-server-demonstration_26.html

    It definitely works and the browser side stuff is pretty easy, if all you're doing is sending and receiving data. I have also developed an application framework that can be wrapped around the WebSockets (called High Level Logic - HLL) with distributed applications in mind ... which could include multiplayer games.

    With or without HLL, I can make this baby work any way that I want to, and provide any support that I want to. The interesting thing right now is that it looks like Construct 2 could use this support, and I am very interested in applying the technology to games.

    I'm just starting to look at Construct 2, and wondering what the best way is to capture shared event data and apply it when it comes in.

    But also, the initial question ... do you have any thoughts on what would make use of WebSockets easy for you and give the results that you want?

    Do you for example, need to be able to program the server side with JavaScript? Or would you get fired up already if the WebSocket server did something as simple (not requiring app developers to program at all) as registering users for a game (can support more than one game group) and echoing incoming data back out to all active players accept the one who sent it?

  • I'm starting to play with Construct 2 for the first time today, looking to see how I can use my WebSocket client / server technology with it. I can do anything I want re: WebSockets but don't have experience with Construct 2. Just thought it might be a lot more efficient to ask experienced users, who have perhaps tried or constructed apps with WebSockets, what you really need and want.