robotpencil's Forum Posts

  • Hey! This is a demo build of our game Centurium! Go check it out on Itch.io

    deadrockgames.itch.io/centurium-demo

    Also you can watch a playthrough of it here on youtube!

    Subscribe to Construct videos now
  • The solution I have now is as follows

    I basically determine the sine by code.

    I create my own Magnitude variable (To determine how far it will move)

    And created a Speed Variable (To determine how fast)

    And I just incrementally add to a MoveAmount Variable (To make sure the sine function is constantly adding)

    And just get the player's position based on what I want to sine, and it just works

    Looks something like this.

    • Is Player Visible >
    • Set Position of Pet X = to Player.X + some offset value>
    • Set Position of Pet Y = to Player.Y + (sin(MoveAmount) * Magnitude)>
    • MoveAmount = MoveAmount + Speed.

    But Again if there is a built in function for this, i'd love to know.

    Also I reset my MoveAmount to 0, once sin(MoveAmount) = 0. Just so I don't have a value forever counting up.

  • So let's say I have attached to my character a basic platform movement.

    I then want let's say a Pet to follow my player, and attach a sine behavior on vertical. (So it floats up and down)

    When I do this, the sine behavior acts as if it doesn't work. If I don't have the pet follow the player, it works fine, but as soon as I do (Either through pinning or whatever) it doesn't anymore.

    Now I understand why this is happening at some level, but intuitively it shouldn't. Basically it's just overriding the sine behavior in favor of maintaining the position you asked it to follow.

    In other game engines this is usually no big deal. Because you have things like local position and world position. Something where you can have your player move in world position, have your pet follow in world position AS WELL as having the pet have it's own local position to move within (the floating up and down)

    All this is usually calculated for you and presented as a 'parenting' system.

    Just wondering if people have a solution for this outside of just doing the math. It seems like a no brainer feature for such a user friendly tool as Construct, but I get that the devs have other things take priority or if it exists already, I have no clue where it is.

    Some help on this would be amazing :D

  • https://robotpencil.itch.io/fire-everything

    Sometimes the link doesn't work so here it is in code:

    https://robotpencil.itch.io/fire-everything[/code:1yxvit03]
    
    [img="https://img.itch.zone/aW1hZ2UvMjE0NzI5LzEwMTI0MDkuanBn/315x250%23c/pg82Xg.jpg"]
    
    Your crew has been allowed to escape as you buy them time going against ungodly amounts of enemy crafts. 
    
    Your only weapons are your two pistols, your head which shoots lazers, and your wits. 
    
    How long can you survive. Can you beat a score of 20,000? psh... no one can. 
    
    Keyboard Controls:
    A, D to move side to side.
    Left, Right Click shoots pistols
    Spacebar shoots lazers.
    Esc to go back to title screen and Enter to play the game.
    
    Gamepad Controls:
    Left,Right analog stick to move side to side.
    Left, Right trigger to shoot pistols.
    A button to shoot lazers.
    Start button to go back to title screen or play game. 
    
    This is just a prototype made in 4 days. Was testing my speed on creating the art, gameplay and coding. Donate if you are cool. If you don't donate... I guess you're still cool.
  • So something weird happened.

    It works now. Not sure why but it does.

    So I decided to do a remote preview and copy the link into a different browser like Mozilla, and now.. it works!?

    In fact, when I came back to using a regular preview it works now on chrome. I'm bewildered.

    Also when I try to see the UserAgent it's picking up as Mozilla 5.0 on chrome. Is that normal?

  • I have it set up simply by having player 1 sprite controlled by Gamepad index 0, and player 2 sprite controlled by Gamepad index 1. I also did a console log to see how many gamepads were recognized and it would say 2, if both plugged in, and then 1 if I unplugged one of them.

    So I assumed it should work right out of the box, but it doesn't The browser supports it and recognizes there is another gamepad but nothing happens when I actually press the buttons. I'm sure I'm missing a simple thing.

    Here is a link to the game file.

    https://www.dropbox.com/s/ep7z36oqenotdee/kidsgame.c3p?dl=0[/code:1tmbu9rj]
  • > This.Is.Perfect.

    >

    > Do you have any documentation on this? Like how to change the values within the event sheets?

    >

    > I'm not sure how to actually have it dynamically change like you are doing! I've done this in the past in other engines not sure how to get this effect in Construct 3.

    >

    Check out the original thread scirra.com/forum/effect-normal-map-extended-1-01-updated-13-jul_t149650 normal-map-extended for more details.

    Here's an example C3 project for the image at the start of this thread. kindeyegames.com/forumfiles/NormalExtendedNoSF.c3p NormalExtendedNoSF.c3p

    For 'correct' rotating normal maps using this effect and changing parameters in events, see my scirra.com/forum/effect-normal-map-extended-1-01-updated-13-jul_t149650 posts in the original thread.

    Awesome! I'll give this a go later! Thanks a lot for the conversion and reply!

  • This.Is.Perfect.

    Do you have any documentation on this? Like how to change the values within the event sheets?

    I'm not sure how to actually have it dynamically change like you are doing! I've done this in the past in other engines not sure how to get this effect in Construct 3.

  • robotpencil I think you can do the same with 8-Direction. Disable standard controls, set acceleration=10000, deceleration=0, On key pressed simulate controls.

    To clarify,

    I started with 8 directions, the problem was no gravity. So I switched to the platform since I didn't feel the need to program gravity since it was already built in. Seemed easier to overcome the jump up(as many times as you like) and jump down mechanics. Which was pretty simple.

    Again the best solution would have been if the force physics didn't delay the lerp. But I'm discovering that having a lerp camera at such high speeds may not be needed at all lol. But we'll see what's up!

  • I have figured it out perfectly using the platform controls! Too bad the force stuff isn't applicable right out of the box, but this works fine!

    Thanks again to everyone who helped me out!

    The physics lerp follow is still a bug, but no worries this will work for me

  • There was something wrong with your project, some bug maybe. I created a new project with the same Physics movement and scrolling and couldn't reproduce the jittering.

    So yeah, use 8-Direction and everything will be fine.

    Actually, I think it has something to do with animation. Watch here is lerp without animation on my sprites.

    You can see as he slides on the platform it's fine. NOW, once I added a 4 frame animation on the idle at speed of 4, POPAGE.

    Here is the project file to test yourself. I did start from scratch too. >>

     https://www.dropbox.com/s/7rj6upn1rrtkhgd/testPhysicsControls.c3p?dl=0
    [/code:1yatzy7n]
    So I'm thinking there is some weirdness with the physics engine + animation + scrolling, almost like the animations lag behind. Not sure why though and I would love for people to replicate this and see if they have this bug occur for them.
    
    Now Using 8 direction and Platform controls do an acceleration approach, that isn't ideal for the controls I want. Meaning that if I press and hold a button it will keep accelerating the character in the respected direction, whereas the controls that I want should be on key tap. Press up, go up. Press and hold up, go up, but begin to fall since holding the button shouldn't do anything. 
    
    I can obviously code it so that once you pressed a button you should slow down. But I would only do this for the sake of a smooth camera move and the code/logic made to replicate the controls I'm looking for to me seems like it'll bloat the event page. 
    
    Thanks again for the awesomeness yall, let me know what's up! Also reported this as a bug so perhaps in the next patch this will be fixed and BAM lerped Physics yo!
  • Maybe you are right! I'll do some more tests to be sure. And report back!

    It may be that I scaled my sprite to be smaller.

  • So I used another editor and use physics to move my main and it seems to perform great. So I assumed the same with construct. The editor I use is Playcanvas but what I lose out on is the intuitive 2d art making. Construct has a lot of great features for 2d and was working fine until this. Not sure why it's jittering but it's no big deal. The set position is fine.

    I like the idea of 8 (or 4) direction movement but applying force seemed like a simple solution to the type of movement I'm after and kept the code lighter.

    I'll play around with it today and report later.

    Thanks again guys. You f'n rock!!!

  • Wait, I don't understand. Why do you need the second sprite? Is it for scrolling only?

    So the Mech moves smoothly and jitter only happens when you add scrolling?

    Why don't you try this:

    System->Scroll to X -> lerp(scrollX, Mech.X, dt*4)

    System->Scroll to Y -> lerp(scrollY, Mech.Y, dt*4)

    Also, the link you posted if broken.

    First of all... your solution is dope! Didn't know I could do that instead lol I was following a tutorial that had the 'camera' follow the player. But if the system can do it, then why make a camera. Either case, it still jitters. But now I have the system follow the player. But having a slight Delay would be nice.

    Second of all DOH on the broken link! Try this one. >> dropbox.com/s/gw56nkhazc5u2jw/umsd-remix.c3p

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's not clear from your gifs which object is Sprite and which is the Character?

    Is the movement smooth if you disable Physics behavior?

    You should avoid changing x,y position for Physics objects, directly or with other behaviors like Bullet, Sine etc.

    Ideally physics objects should only be moved using Physics actions like Apply Force, Apply Impulse, Set Velocity etc.

    See this demo for example - the ball is moved to mouse position using impulses (last 3 events):

    https://www.dropbox.com/s/9cdcj8omeurgs ... .capx?dl=0

    Also, to ensure consistent movement on different framerates, use lerp with dt:

    lerp(Self.X,Sprite.X, dt*10)

    Thanks for the response. So what I've done is applied physics to my character ( The mech ) and made a sprite that scrolls by following the mech.

    Just occurred to me to share the file for help. Here it is! >> dropbox.com/s/gw56nkhazc5u2 ... x.c3p?dl=0

    Also I tried the change you suggested and it didn't work <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad" />