gumshoe2029's Forum Posts

  • Everade I loved your "predictable" random title. :-p And you pose interesting problems, to which folks post interesting answers that I can learn from.

    Glad to see that it works for you.

  • Like use a server side program (Python, PHP, Java, etc.) to run the logic for your game. Then communicate with that program via WebSockets. Then your clients would make a request like: "shoot at position x,y" and the server would take that request, apply the randomization at the time of request receipt, and determine if there is another object at r(x),r(y) at the time that the request is received and turn around and push the same results to all clients.

    You should be able to do the same thing with an authoritative client, but it seems easier to work in another more robust language than JavaScript.

    I can give you a guide on how to setup your own servers and point you to programming resources. I have been hesitant to post a guide on how to setup and run authoritative servers because I don't want to step on Scirra's store. Feel free to PM me though, and I will send you information.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Everade you always make for interesting forum reading, lol.

    Did you get it working?

  • Why don't you use an authoritative server? You could use websockets to transfer the relevant info back and forth?

  • You should be able to use either "Bounded Scolling" or just write a custom event to move the red_target back inside the view whenever it exceeds your visible boundaries.

    Something like:

    if red_target.x > boundary.x : red_target : move to : boundary.x

    if red_target.y > boundary.y : red_target : move to : boundary.y

  • Just re-use the link that you used to load the music in the first place.

    Ultimately, anyone will be able to download that song from the same link even if they don't complete the level.

  • There is a drop box one, and you might be able to modify it to work with Google/Facebook. But I couldn't find one already dedicated to G/Fb.

  • https://www.appodeal.com/sdk/documentat ... _positions[]=1&ads_type[]=3&disabled_networks[]=1&earn=1&framework=1&proguard=0&to_generate=1

  • That sucks if that's the case, any way to invoke the share to wall options via the AJAX/HTTP call 'old school' way?

    Yea, look through the developer's API on Facebook (the link I shared above). Sometimes you can Google "Facebook API tutorial" to get more stuff too.

    https://developers.facebook.com/docs/ja ... quickstart

    https://developers.facebook.com/docs/ja ... t/examples

    You want to look, specifically, for their GET and POST requests, then use AJAX "Request URL" for GET and "Post to URL" for POST, then you just have to process and use their replies.

    Or it looks like they even have a pre-made share button for you to simply import on to your website:

    https://developers.facebook.com/docs/pl ... re-button/

    You might even be able to use an iFrame plugin to use it directly in C2.

  • I've thought about procedural generation a lot, but the only procedural generation I have done is a strategic-scale galaxy.

    It seems to me the art of this kind of procedural generation is careful control of the relationships and spatial paradigms.

    But, nice work so far!

  • There is already a well-packed Discord channel for game developers (not just C2).

    You can access it via this site (I think.. I got in before they added all this extra stuff..)

    http://www.tigrisdev.net/

  • Did you procedurally generate the terrain ahead of time, or are you generating on the fly?

    Also, can I see your algorithm? (assuming its not proprietary)

  • No, it is not possible to pull the user id from the session on the client side, because HTTP security prevents that to stop session hijacking.

    I tried storing the user id in a different cookie, but I still had trouble accessing it via JavaScript. You have to make sure the Cookie is not "HttpOnly" or "Secure". But don't do that to your session cookie, or you are putting your users in jeopardy of being session-jacked.

    If that doesn't work, try to pass the user id back to the C2 client, you need to pass it back by a HTTP(/AJAX) GET request.

    EDIT:

    I forgot about direct JavaScript injection. Which is what we use. I forget where I found this method, but it was some obscure website.

    For our game, I pass session parameters to the C2 client by direct JavaScript injection using this method:

    			out.println("function doIt(){");
    			if(localSess!=null) {
    				out.println("document.getElementById(\"dispName\").value = \"" + localSess.getDisplayName() + "\";");
    				out.println("document.getElementById(\"pid\").value = \"" + localSess.getPlayerID() + "\";");
    				out.println("document.getElementById(\"serverIP\").value = \"" + SP.domain(me) + "\";");
    				out.println("document.getElementById(\"serverURL\").value = \"" + SP.url(me) + "engine\";");
    				out.println("document.getElementById(\"serverTimestamp\").value = \"" + System.currentTimeMillis() + "\";");
    				out.println("document.getElementById(\"capitolStarID\").value = \"" + Coordinate.starIdFromPlanetId(localSess.getCapPlanetID()) + "\";");
    			}
    			out.println("}");
    [/code:13nup5g8]
    
    Which makes a JavaScript function inside of the index.html file that looks like:
    [code:13nup5g8]
    function doIt(){
             document.getElementById("dispName").value = "username";
             document.getElementById("pid").value = "2";
             document.getElementById("serverIP").value = "www.ravenheart.ca";
             document.getElementById("serverURL").value = "/dev0";
             document.getElementById("serverTimestamp").value = "1490642097";
             document.getElementById("capitolStarID").value = 65;
    }
    [/code:13nup5g8]
    
    Then I have a bunch of TextBoxes which have the "ID (optional)" fields named, 'dispName', 'pid', 'serverIP', 'serverURL', 'serverTimestamp', 'capitolStarId' which the doIt functions access to change the values of these TextBoxes.
    
    Then on layout start, I simply do a Browser > Execute JavaScript("doIt();") and it loads all of these parameters from my servlets into the TextBoxes.
  • That is because the Facebook object (when did they add this?!) abstracts all of the AJAX/HTTP calls away, so you don't have to deal with them. They are still there, just hidden.