cjbruce's Forum Posts

  • The first Robot Rumble was released for AirConsole in February 2017. It is available to play at the following URL. You will need a computer to host the game and a mobile device to use as a game controller:

    https://www.construct.net/out?u=https%3a%2f%2fwww.airconsole.com%2f%23!play%3dcom.nerdislandstudios.robotrumble

    It supported up to eight player multiplayer.

    The Unity WheelCollider is a RigidBody with four downward-facing raycasts. If the ground is in range it applies custom forces to the RigidBody depending on which “wheels” are “touching”, the friction coefficient, the normal force, and the friction force. All of this would need to be recreated by you.

    A simpler version of this would be a hovercar that is always perfectly level and only uses a single raycast to get distance to the ground.

  • > If you use the Q3DOimoPhysics behavior you will have gravity force on the Z axis.

    But for multiple cars, 4 wheels per car, I can't rely on that many wheels (Plus Car Body's) to do the Physics calculations.

    It costs too much and the physics acted too unreliable.

    Weird. We did up to 8 cars with four cylinders each for the wheels and it was pretty smooth for the original “Robot Rumble”. IIRC it ran fine on a 2017-era phone.

    You could also create a simple Unity-style wheel collider with 4 raycasts downward. You can tune the raycast to take as much CPU time as you can spare.

  • > jatin1726

    Is it possible to create a video for importing characrter(sprite or obj) and add the movement?

    That will be very helpful.

    You might want to check out the Q3D tutorials:

    https://www.construct.net/en/tutorials/search?q=q3d&l=1

    They both should provide an overview of how to get started with Q3D. Maybe you can find what you are looking for in one of them?

  • Looking great! I feel like it could use a little more silhouette contrast against the dark background.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You are very welcome! Dot Product is super useful in both 2D and 3D games. The Cross Product is also useful if you ever want to incorporate spinning things.

  • how complex do you need the physics to be?

    I know you can use the raycast object to get the angle of a face and it's height. provided you don't need super realistic physics you could make a raycast above the car down to the ground. you could then compare the change of height and add to an upward momentum. and then if it lowers apply a gravity to this same value. and if the car falls below the raycast (below the level)then set the cars height to the level. (this is just the idea of course) It's not the ideal solution. but it's better than nothing.

    This is a great point! There are a ton of good Unity hovercraft tutorials. Here's one that seems to have all of the key bits in one page:

    https://medium.com/thefloatingpoint/ground-hugging-vehicles-in-unity-3d-50115f421005

    Your track would be a perfect fit for this kind of driving mechanic. It would be great to have a Construct-based 3D racing game with nice smooth tracks.

  • In order to get a track working you would pretty much have to build an in-game track editor. Either that or create a script that can transform a track mesh into a bunch of box primitives. It isn’t impossible, but you might have to get a little creative with simplifications.

  • This looks great! Well done!

  • Do you need to normalize? It sounds like you just need to know if the enemy is facing the player. Normalizing involves an inefficient square root operation, and it is best avoided if you don’t need it.

  • It is quite possible that what you have is okay, but I did notice two things:

    1. Dot product will only evaluate from -1 to +1 if you normalize the vectors first. Since you haven't done this (and don't really need to), what you are seeing is the expected result. Since all you need is a number greater than 0, you should be fine.

    2. Is the enemyFacing vector a position or a direction? If it is a direction, then you don't need to subtract the enemy's position from it to get dot2. If it is a position, then you are computing v2 correctly.

    I'm not sure if dot1 and dot2 are being calculated directly, but from the numbers you have in the screenshot, they are both pointing roughly in the same direction. Their x and y components both have the same sign. The dot product should evaluate to be >0.

  • I think a Dot Product would do the trick. Take the Dot Product of the surface normal and the direction to the player. If it is >0, then it is facing the player.

  • You can do it like this, it converts the binary to base64, downside is a larger filesize.

    For Snapshots

    For DrawingCanvas Snapshots

    The YOUR_SERVER.com/snapshot.php

    It works! Base64 isn't an issue, and I switched over to image/jpeg to cut down on the file size. The pngs were huge, but .jpg makes things a whole lot faster.

  • Still no luck. I've tried everything I can think of:

    1. Getting the contents of the raw binary in php using $data = file_get_contents('php://input'). This gets me a string of garbage that I can't figure out how to use.

    2. Sending a standard POST with AJAX with "data="&URLEncode(BinaryData.GetBase64) in the Data field. I have then been able to successfully decode bits of the image using php. The result is some of the pixels being the right color, but the overall image seems to be compressed into a narrow strip at the top.

    #2 is the closest I've come, and I'm out of ideas. Is there anyone out there who has successfully uploaded an image to a php server?

  • Ashley, thanks again for your help on this.

    I'm not sure what I'm doing wrong, but on the server side the php script sees an empty $_POST[] array.

    1. Should this array be populated with a Base64 encoded version of the image?

    2. The "POST" method in the Construct 3 AJAX object doesn't allow you to set a key. Does the AJAX object in Construct 3 set a key automatically? I believe there should be a key->value pair received by the php server. Maybe I need to Base64 encode the image first, then send it via a standard AJAX post?

    --------------------

    Here's my event sheet:

    + DrawingCanvas: On saved image

    -> previewSprite: Load image from DrawingCanvas.SavedImageURL (Resize to image size, cross-origin anonymous)

    -> maskSprite: Set animation frame to 0

    -> DrawingCanvas: Clear canvas rgba(0, 0, 0, 0)

    -> AJAX: Set response binary to BinaryData

    -> AJAX: Request DrawingCanvas.SavedImageURL (tag "Step 1")

    + AJAX: On "Step 1" completed

    -> AJAX: Send BinaryData to URL "../upload.php" (method "POST", tag "Step 2")

    -> Browser: Alert "Posting "&BinaryData.GetText(0,BinaryData.ByteLength)&" to server."

    + AJAX: On "Step 2" completed

    -> Browser: Alert AJAX.LastData

  • You can't send the saved image URL. It refers to local data so the remote server will not be able to access it.

    Use AJAX to first load the Drawing Canvas in to a Binary Data object, and then send the Binary Data to your server.

    Ashley Thank you for this! I'm a little dense, but I'm not following what the event structure would be for this. Is there an example online that I have missed?

    EDIT: Under "ajax", I see the following:

    Step 1 - Which one works for loading the Drawing Canvas to the Binary Data object?

    Step 2 - I'm assuming I can use "Post Binary to URL" once the Binary Data object's buffer has been populated.