JeremyBenson11's Forum Posts

  • Awesome thanks for the update, will definitely check these out. I've got a lot of movement issues solved, and line picking. Even though I don't understand all the equations I know what they do and saved them away. My math is a bit bad, but I've been studying. Problem is the math level for great games is considerably high... For mathematicians they're like oh, it's not that bad, trig, and linear algebra... but for someone with weak math skills, and just starting to learn trig at all, they're nowhere near that level of understanding in numbers, and matrices.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey,

    I can't find any information on how to move an object along a curve from point a to point be.. This could be a half circle, or any kind of curve. I can use Lerp or LightTween. Please don't just say it's all math. I know that much, lol. I'm trying to find the math to solve this problem. I understand a random curve with bullet, adding to angle of motion and subtracting from angle of motion, but what if you want to curve to a specific location?

    Thanks for your time,

    JB.

  • snapshot undo seems like a bad idea. I don't know the solution to your problem, but I do now for undo to work this way you're going to need a picture a second. You're going to fill the user's hard drive. Imaging having to capture all the seconds back, and pixel change...

    Unless you make it like notepad.. either only allow 5-10 undo steps.. or... undo is farther a part... like take a snap shot every minute or so... on project start you might want to consider deleting all files from the folder that aren't relative anymore..

  • Ah, I'm not gonna say there isn't one. Just wait for another more advanced user, or shoot support and e-mail. They might be able to help.

    You've likely seen this:

    c2-plugins-and-behaviors-list_t65170

    This guy has a load of plugins, but doesn't sound like there's anything in there that will help:

    http://c2rexplugins.weebly.com/

  • You can create javascript plugins using JS SDK. If you're a good coder, and you sound it, you could create a plugin to interface in your events. You can even create custom expressions. All you would do is store your text in a variable, array, or dictionary, then you can feed it to your plugin and do all the processing you want with JS.

    https://www.scirra.com/manual/15/sdk

    Other than that, you'll definitely need a more advanced user to help with this one.

  • To disable a custom control you don't need a separate event sheet. Each key press should be on it's own event. If you want to disable one you could do it with a instance variable on the player and have it as a Boolean called canMoveLeft... set it to false when they can't move left. Use it as condition on the left key event. That should do the trick

  • Hm, this is why you should make custom movement. Then you have control over the small details. I don't usually use predefined behaviors unless they work perfectly for what I'm doing. I'm kind of a ground up developer. If you knew what your keys were doing, and how they were coded, you could do whatever you wanted...

    Check this thread though. There's a conversation on the topic, and some links to some solutions.

  • I don't mind who a character is. I've enjoyed both. Some of my favorite games had female characters. Resident Evil, Parasite Eve, Silent Hill. They were some of the best in the world. I also love major male heroes too, Cloud, from Final Fantasy 7. I wouldn't play a game that had a "homo sexual" or "Transgender" hero. I think a lot of straight men will feel that way, and likely the industry knows it. I still think, at large, the straight world is set against homosexuality with acceptance of it. Likely major studios know this, and wouldn't want to hurt their profits. Some might dabble in it, but others, that are straight, might not, no more than any other straight guy. The world still has a stigma that gay is not cool, or something bad. People say "this is gay, that's gay, don't be gay!" I don't think people need to talk like that, but I don't personally hate that view point. I'm pretty well against homosexuality, but accept it. I wouldn't tell a gay person unless they asked, and they would still be my friend. I don't go hang out with them, but I know plenty. Met a few awesome people that are gay, but if they asked, I would tell them, lol. They'd have to accept me and my views as I would have to accept them for their ways..

  • Of course. It's the same in every industry. Movies actors don't really watch movies like the general public, no more than famous singers treat each other like screaming fans. At first I would feel like it was a bane, like games were less fun, but you get to create things, and learn... Trust me, it's not just games, if you let it, your view of movie actors, singers, games... all of it will change, and you'll start treating famous people like other content creators..

    Don't worry about it.. Idolizing people isn't healthy or good anyway. Count yourself lucky you don't want to be a screaming fan that wants to lick some guys tooth brush just because he sold a million records... No one wants to be around people like that anyway... Also, you're maturing into a place where your less blind. This is also a positive direction.

  • According to the manual off screen objects aren't still rendered. You could place anything off screen that you don't want rendered, then when it's time to see them place them back on screen. Read the article below to double check. Also if you have lag issues elsewhere the entire first section, in the overview, is about efficiency, proper image use, and stuff like that. Hope this helps.

    https://www.scirra.com/manual/134/performance-tips

  • Call to Action

    This is something that doesn't seem to be around a lot, unless people ask for help. I thought it might be interesting to start a math resource thread. This is where we can help each other learn some great math ideas to help in our games. If people help support the thread by adding their own math knowledge I would learn, and others as well. We should keep the math relevant to Construct 2, and share snippets that would actually help people develop better games.

    I just want to add the premise that the math below was not created by me. You can thank Archipetes, lol, just joking. I got help from here on the Scirra forums to gamedev, but it's good stuff, and should help people, so I'm sharing my findings.

    Some ideas of things people could use in this thread:

    1) The simplest way to move an object in a circle.

    2) How to move an object along an arc.

    3) How to move an object at an arc to 90 degree position (Like would be needed for a circular menu.)

    If someone would add those I would gladly test them, save them for my own efforts, and post them here in the first topic. Also feel free to add any other math bits that would help us here in the forums.

    Note - correct anything below, and I'll test, and update.

    Lerp With Delta Time

    Thanks to a blog post by Ashley, the current C.E.O of Scirra, we learn to use lerp with delta time. The method below is how it works to a 't'. The numbers seem to be pretty precise, so I'll explain below. For an explanation beyond my grasp read his post.

    a = starting point.

    b = destination.

    lerp(a, b, 1 - f ^ dt)

    The lerp function will ease from point a to b. F is a float between 0.1 and 0.9 which will increase or decrease the speed. The lower the number the faster the object will move.

    https://www.scirra.com/blog/ashley/17/u ... delta-time

    Note - A good substitute for lerp is lunarray's plugin: LiteTween. It's great if you don't quite like the behavior of a regular lerp. There's a bit extra with it too, and quite easy to learn.

    Any Point, Any Angle, Any Distance Away

    x = Sprite.X + d * cos(a)

    y = Sprite.Y + d * sin(a)

    The method above will set x and y any number of pixels set by d(distance) in any direction set by the angle. So lerp the following: Sprite.X + 100 * cos(90), Sprite.Y + d * sin(90) will move the sprite 100px in the 90 degrees direction.

    Find an X,Y Within Range

    X = sin(random(0, 360)) * random(1, 100)

    y = cos(random(0,360))) * random(1, 100)

    The following methods will pick a point roughly 1 - 100px away in a random direction. Basically a location within a 100px area. This needs to be calibrated to consider the offset of the sprites size, as the center is usually the starting point, unless specified elsewhere during the sprite editing process.

    Find Point Between Sprites

    Sprite 1 is traveling halfway to sprite 2.

    Adjust fract, or fraction, to change distance.

    fract = 0.5

    Sprite1.x = Sprite2.x + frac * (Sprite1.x - Sprite2.x)

    Sprite1.y = Sprite2.y + frac * (Sprite1.y - Sprite2.y)

    Example:

    Sprite1.x = Sprite2.x + 0.5* (Sprite1.x - Sprite2.x)

    Sprite1.y = Sprite2.y + 0.5 * (Sprite1.y - Sprite2.y)

    Above will move sprite1 halfway of the way towards sprite2.

    Note - The lower the decimal the closer the sprite will move.

  • You might want to consider using path finding to. The problem you're going to face with lerping sprites around is working around collision objects like walls... if you use the lerp method, and click outside a building, your sprite isn't going to care if it's going through a wall or not... If you use path finding instead it may be a bit easier, and you can use the same method... set the walls as obstacles, and the player should find a way through there, through a door, but not a closed one... You can just stop his path walk if he bumps into something that might be better for you..

    What you would do is add path-finding behavior to your character. On click find path... then next event.. on path found.. start following path... Not sure if that needs to be every tick or not.. Just test it without first... You can set acceleration based on distance.. new event, the cogwheel compare two values... the first value will be distance(player.mouseX, player.mouseY, player.X, player.Y) < 10 then set acceleration slower... if 20 or whatever, set acceleration higher...

    mouseX and mouseY are instance variables like before attached to your player, you attach them yourself as a number..

    On start of layout event... set all your obstacles in path finding..

    A crucial step is to set cell size. You do this in the layout window after clicking your path-finding sprite. To the left.. find cell size and set it to roughly the size of your box the sprite is in.. should be something like 32, 64... not sure about rectangles.. but I find having the cell size as close to the box size, or a tiny pinch smaller works best..

  • The problem is if you have animations you'll need to find a way to know which direction the sprite is moving in to work accordingly. One issue is I'm not sure how you want to let the player move. This method will let the player move almost anywhere, kind of like gliding there. You'll need to set that with animations if you're okay with that.. But if it's like the old old Ultima games, you would need to do something else, like only allowing four direction move..

    What I put above might not even be what you're looking for

  • Just a quick question. Why would I use this over local storage, which does the same thing in ini format?

  • I'm not sure that construct gives you any way to work with collision data at all. As far as I've seen it only allows you to collect the fact that a collision has occurred. A less accurate method would be to collect the x, y position of the object you are colliding with and spawn the object here...

    A more accurate way would be to create your own buffers, or sensors. Little objects so far away from the object like, tiny clear squares, and then spawn the object at the location of the square the hits.. This would be tricky and require some overhead, because you're going to have to turn off the sensors as soon as there's a collision, and then turn them back on when they are overlapping nothing but the ball... or set them some pixels away from the ball..

    Honestly, neither seem really professional. I'd like to see the proper answer for this. I've yet to see anyone talk specifics on collecting collision data...