cjbruce's Forum Posts

  • Our main site is completely free, and it attracts enough users and has garnered enough attention to get us contract work, which is what actually pays the hosting and business bills.

    It is very difficult to drive enough traffic to pay for everything on unit sales and/or ads alone.

  • Hope you enjoy the new plugin!

    Psychokiller1888,

    I'm using the new plugin now, and it is working great! Thank you for your hard work on this!

    Also,

    For anyone who is looking to make both the AirConsole screen and controller in Construct 2, I have just posted this guide in the AirConsole Controller thread:

    https://www.scirra.com/forum/viewtopic.php?f=153&t=186227&p=1119512#p1119512

  • cjbruce Can you please share an example of your method, just a simple capx demo alongside the instructions so I can update the thread with your post. Thanks in advance.

    Sure! The key to building both the AirConsole screen and controller in Construct 2 isn't actually the .capx files, it is the correct directory structure and the manual addition of one line in the screen.html and controller.html files.

    1. Create a new project folder. In this folder create 2 subfolders, screen/ and controller/.

    2. Export your "screen" .capx into the screen/ subfolder.

    3. Export your "controller" .capx into the controller/ subfolder.

    4. Copy the index.html file from screen/ and paste it into the project's root folder. Rename this file as screen.html.

    5. Copy the index.html file from controller/ and paste it into the project's root folder. Rename this file as controller.html.

    You should now have a directory structure that looks like this:

    6. Add the following line in the screen.html file's header to redirect all screen requests to the screen folder:

    <base href="screen/">

    7. Add the following line in the controller.html file's header to redirect all controller requests to the controller folder:

    <base href="controller/">

    From now on, you should be able to just continue exporting your screen's project to the screen/ subfolder and the controller's project to the controller/ subfolder. Unless you do something drastic that requires an additional <script src=""></script> line, or some other change to the html, you should not need to update your screen.html or controller.html files. If you do, just repeat steps #2-7. I have found that it takes about 30 seconds, not including the time it takes to export the projects.

    Here is the html header for my screen.html:

    <head>
        <meta charset="UTF-8" />
    	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    	<title>Robot Rumble 2</title>
    	<base href="screen/">
    	
    	<!-- Standardised web app manifest -->
    	<link rel="manifest" href="appmanifest.json" />
    	
    	<!-- Allow fullscreen mode on iOS devices. (These are Apple specific meta tags.) -->
    	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui" />
    	<meta name="apple-mobile-web-app-capable" content="yes" />
    	<meta name="apple-mobile-web-app-status-bar-style" content="black" />
    	<link rel="apple-touch-icon" sizes="256x256" href="icon-256.png" />
    	<meta name="HandheldFriendly" content="true" />
    	
    	<!-- Chrome for Android web app tags -->
    	<meta name="mobile-web-app-capable" content="yes" />
    	<link rel="shortcut icon" sizes="256x256" href="icon-256.png" />
    
        <!-- All margins and padding must be zero for the canvas to fill the screen. -->
    	<style type="text/css">
    		* {
    			padding: 0;
    			margin: 0;
    		}
    		html, body {
    			background: #000;
    			color: #fff;
    			overflow: hidden;
    			touch-action: none;
    			-ms-touch-action: none;
    		}
    		canvas {
    			touch-action-delay: none;
    			touch-action: none;
    			-ms-touch-action: none;
    		}
        </style>
    	
    
    </head>[/code:33gyi2ky]
    
    ...and the header for my controller.html:
    
    [code:33gyi2ky]<head>
    	<base href="controller/">
        <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
      <style type="text/css">
        html, body {
          height: 100%;
          overflow: hidden;
          padding: 0;
          margin: 0;
        }
        body {
          background-color: #222;
        }
        button {
          margin-bottom: 1px;
          width: 100%;
          height: 48%;
          border: 0;
          box-sizing: border-box;
          font-size: 40px;
          color: #FFFFFF;
          background-color: #333333;
          outline: none;
        }
      </style>
    	
    	<link href="button.css" rel="stylesheet" type="text/css" />
    	<link href="dpad.css" rel="stylesheet" type="text/css" />
    	<link href="joystick.css" rel="stylesheet" type="text/css" />
    
    </head>[/code:33gyi2ky]
  • Can i build controller.html in C2? or only screen.html?

    Yup! This plugin is for the controller.html.

    Recently I have been experimenting with moving most of my game onto the controller itself.

    Here's my setup:

    1. In the root directory create a screen/ folder and a controller/ folder.

    2. Export your screen game into the screen/ subfolder and your controller game into the controller/ subfolder.

    3. Copy/paste your screen's index.html file into the root directory, and rename it screen.html

    4. Copy/paste your controller 's index.html file into the root directory, and rename it controller.html

    5. Add a line to your screen.html in the header to load all URLs to the screen/ subfolder.

    6. Add a line to your controller.html in the header to load all URLs to the controller/ subfolder.

    With this setup, you only need to replace your screen.html or controller.html when you add a new type of plugin. Otherwise, you can just export your projects to the screen/ or controller/ sub folders, as appropriate.

  • Is there an easy way to use 8 Direction behaviors with Mobile devices? For example, swiping left causing the 8 Direction to behave as if a left arrow were pressed.

    I have found that the easiest and most intuitive way to do 8-direction on mobile is to just use a 3x3 grid of invisible buttons:

    upleft / up / upright

    left / stop / right

    downleft / down / downright

    Logic:

    Is Touching Object (upleft) -> simulate 8-direction "up", simulate 8-direction "left"

    Visuals:

    -Make each of the buttons in the 3x3 grid invisible.

    -Overlay a joystick background (a large colored circle will work) that is stationary and covers all 9 of the invisible buttons.

    -Overlay a joystick (a smaller colored circle) that starts at the location of the background, and changes its location by about 10 pixels toward the direction of whatever button you are pressing.

    I have had less luck with more complicated joysticks. Dragging/swiping controls have always seemed a bit finicky to me.

  • QuaziGNRLnose

    I've been using Q3D without problems for about 6 months now, but this morning when I exported a project, it wouldn't run. Preview works just fine.

    Here is the error:

    Here is the c2runtime.js:

    I am using OIMO physics, and this is a new project.

    Any ideas?

    Fixed!

    I had accidentally used a version of index.html that didn't include Oimo.js.

    Everything is working fine now.

  • QuaziGNRLnose

    I've been using Q3D without problems for about 6 months now, but this morning when I exported a project, it wouldn't run. Preview works just fine.

    Here is the error:

    Here is the c2runtime.js:

    I am using OIMO physics, and this is a new project.

    Any ideas?

  • This is great news!

    X3M

    It would be awesome if we could get the AirConsoleController plugin on C3 as well.

    I've been busy making C2 game templates to integrate the two for generic controllers (joystick, 8-direction, buttons), and would be happy to post them here when ready.

  • tunepunk,

    Any progress on movement or map-making?

    I've gone through a couple of iterations on movement, and basically decided that it is too CPU-intensive to try to raytrace downward to get the height of a player from the ground. This basically leaves creating height maps somehow.

    Also, when you export from Maya, what direction are the objects facing? I'm working with an artist right now who doesn't use Construct 2, and I don't use Maya, and we are having trouble getting things facing the right way.

  • tunepunk

    Nice!

    3D is pretty taxing for mobile, but the best way to get increased performance is to avoid bone based animations and use morph targets (these run almost entirely in shaders so they can be quite fast), and to cap the resolution to something lower than the native screen resolution (in Q3D Master) since mobile GPUs lack the performance to keep up.

    For anyone who is interested, here is a modified version of the morph animation test. I got rid of the 5 point lights, and turned shadows off for the directional light.

    https://dl.dropboxusercontent.com/u/55106174/morphanimationtest/index.html

    Here is the .capx for the test:

    https://dl.dropboxusercontent.com/u/55106174/morphanimationtest.capx

    You can tap the text to get rid of models one at a time until the framerate becomes acceptable on your device. On a 2-year-old iPhone 6, I can have 25 animated models onscreen at 60 fps. On a Nexus 5, I can run about 4 animated models at an acceptable framerate.

  • I managed to solve it. It was pretty easy. I exported a json file with all the animations in one long animation. Then I just opened edited the json file and renamed the frames. frame1-4 idle, frame 5-9 walk, frame 10-13 death etc etc.

    "morphTargets": [{ > "name": "frame_1", < this was the only thing I hade to rename in the json file to have multiple animations. frame_1 was renamed to walk_1 etc etc.

    Might be useful for anyone who is using an exporter that doesn't support multiple animations. Renaming the different frames is enough.

    tunepunk

    Would you mind posting a quick breakdown of your workflow from Maya to Q3D for morph animations? I'm working with an artist now, and we need to go from Maya bone animation to Q3D morph animation for midrange mobile devices.

  • > And then we modify the controller.html by adding controller/ before each href=" an src=" except for those who contain static http: hrefs.

    >

    Actually, there's one thing that could make this easier - if you add <base href="folder/"> in the <head> tag, all requests are automatically made relative to that. But this will still break offline.

    Ashley

    You are a genius. This works perfectly!

    As per X3M and Psychokiller1888 's suggestion, I did the following:

    1. Exported the controller into a subdirectory called controller/

    2. Renamed the index.html file to controller.html.

    3. Added the following line of code to the <head></head>:

    <base href="controller/">[/code:3aff88bp]
    
    4. Exported the screen into a subdirectory called screen/
    5. Renamed the index.html file to screen.html.
    3. Added the following line of code to the <head></head>: [code:3aff88bp]<base href="screen/">[/code:3aff88bp]
    
    With 2 instances of Construct 2 running, the whole process took about 30 seconds.  And I can now keep the controller and screen separate without worrying about deconflicting them every time I change them.
    
    Edit:
    
    I have been playing around with this for the past 30 minutes, and realized that the problems are completely solved with this approach.  Because screen.html and controller.html never change, and any index.html files that are produced in the export process are never actually used after the initial renaming, you can just export the screen project and the controller project to the appropriate subdirectory, and everything just works!  There is no need to rename anything!
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • . cjbruce, X3M

    [quote:gw9gii75]New features ahoy!

    Once the architectural work is done and projects are able to be ported, we'll have a much faster and better base to build major new features on top of. We're keen to address many long-standing requests with the new runtime. Some of the new features we'd like to build on it include:

    Modular event features, aimed at capabilities like building plugins out of events

    Advanced rendering features like mesh distortion

    Rudimentary 3D capabilities like adjusting the Z height of a sprite, and exposing more capabilities to the SDK

    Sub-layers for advanced lighting and blending effects

    Sub-layouts for embedding other layouts, creating split-screen views and more

    Redesigned first-class support for functions

    A built-in color filter feature similar to what we had back in Construct Classic

    A set of new plugins ranging from custom drawing canvases to integrating HTML content

    Add lots of long-standing plugin requests like rotatable 9-patches, scale and rotate Tiled Background image, and more

    Even more ideas in future!

    I'm not sure exactly what this means, but this seems to me like.. "I would love to help you out so u can make 3D plugins or whatever but this isn't at all my priority right now" which seems fair enough

    stefanos,

    I saw this one too, and it was definitely encouraging.

    As long as we maintain the 3D capabilities (via plugin) that currently exist in C2 in C3, I will be happy. That means porting over the plugins, but it is all part of the process. By the time the plugins are ported, they might have z-ordering in place, which (I think) will be a big step toward a proper 3D editor.

    For now, I'm working with an artist who is laying everything out in Unity 3D. Once the scenes are laid out, we will port everything over to either Q3D or B3D. Even with plugins, I don't know if C3 will ever get to be as feature-complete as Unity, but all we would really need is a rudimentary 3D visualizer in the C3 editor to turn C3 into a super-fast 3D development tool.

    Baby steps!

  • In the process I've learned a lot of things regarding cross-browser compatibility, and I've rewritten the whole plugin to make sure that every single function works on all browsers.

    I'm not going to release it until I've completed my tutorials series and linked some capx templates with it.

    Sounds good. You've made a lot of great progress so far. I'm definitely interested in making sure things run across all of the major browsers. The new version of the game needs to go on AirConsole, so cross-browser compatibility is a big deal. To that end, I now have a pretty complete set of devices (Mac + Windows + Nexus + iPhone + iPad) to test things on, so let me know if you need me to try anything.

    Is there any chance that the new version is coming out during the month of April?

  • cjbruce I didn't get the question, can you elaborate ?

    X3M

    Sorry. I did some poking around in the plugins and found most of what I was looking for.

    I need a way to do explosions. Either particles or 2D sprites would work. Particles would be ideal. but I'm currently using 2D sprites for Robot Rumble, and we could keep doing that.

    I couldn't find shadows anywhere. Does the engine support shadows?

    It looks like I can bring in a Unity terrain map and use it with a physics mesh collider for driving robots. This means I could do levels with bumpy surfaces, rather than just flat planes. This could open up some cool level design possibilities.

    Are decals possible?

    Any other cool features on the way?