Arrow Key / Controller Movement + Spine Animations

  • #10, z afrlmeThursday, 23. June 2016, 18:04 hodinky 8 years ago
    Use an event instead. Inside of the way systems tab is an action area tab in which you can trigger events when characters or a specific characters enters or exists a particular action area you define. So, you could when the player enters the stairs location create a cut-scene in which you automatically control the players movements.

    Imperátor

    7285 Posts


  • #11, z sebastianThursday, 23. June 2016, 18:05 hodinky 8 years ago
    You could try to add 20px in the lua script, then check if the new point is inside the waysystem polygon (i remeber there is a function for that) and if not add/remove some y height to let him also go diagonal...
    But this depends a bit from case to case and how steep a slope is...

    Kapitán

    2346 Posts

  • #12, z AvenThursday, 23. June 2016, 18:09 hodinky 8 years ago
    Wouldn't feel naturally taking the control from the player. I think it's too complicated with that engine and it's okay. I am only trying to find out what can I do and what not or what is too complicated for me.

    My game will work like a classic point & click too. The other way would be feeling better I think so the player will have better feeling with that world but it's okay too.

    Than the only open point and I hope this is easy without developing much.. grin .. the Spine issue ^.^

    EDIT: Thanks Sebastian! This could be an idea too. If there would be an easy way using the paths so player has only press right, up, left, down so character will slide on this paths that would be awesome. I had no problem with creating the ways for every scenery.

    Bažant

    23 Posts

  • #13, z CrossThursday, 23. June 2016, 18:18 hodinky 8 years ago
    I would also use an event thats triggerd through entering an action area. Let it change a condition (or better a value) and ad an if-structure to the key pressed action: if value=2 send character to Destination (x,y). Reset the value/condition when leaving the action area.
    With the lua script it is of course possible to walk in a diagonal direction also, just enter different numbers for x,y Position (e.g. x + 20, y - 10 should work on the stairs).

    Bažant

    92 Posts

  • #14, z afrlmeThursday, 23. June 2016, 18:24 hodinky 8 years ago
    I would also use an event thats triggerd through entering an action area. Let it change a condition (or better a value) and ad an if-structure to the key pressed action: if value=2 send character to Destination (x,y). Reset the value/condition when leaving the action area.
    With the lua script it is of course possible to walk in a diagonal direction also, just enter different numbers for x,y Position (e.g. x + 20, y - 10 should work on the stairs).


    That is essentially how it works in an engine like Game Maker Studio. They use what is called FSM (finite state machine) which is basically a bunch of if queries that change up how functions work based on what the players character collides with. For example the character collides with a ladder then they can activate the up/down arrow keys (or W/S keys) to allow the player to move up or down the ladder. Platformers are complicated in their own rights because you have all these different environmental situations that the player can interact with, however we don't have any physics engine support (gravity), but it can be emulated easy enough with a loop, some if queries & action areas.

    Imperátor

    7285 Posts

  • #15, z AvenThursday, 23. June 2016, 19:07 hodinky 8 years ago
    Thanks for your ideas and help! I worked with GMS so far and created basic FSM. So in general I understand what you mean smile

    Bažant

    23 Posts

  • #16, z afrlmeThursday, 23. June 2016, 20:09 hodinky 8 years ago
    Thanks for your ideas and help! I worked with GMS so far and created basic FSM. So in general I understand what you mean smile


    I guess you will be able to figure out some workarounds for creating a side-scroller with VS then. If you've created some FSM in Game Maker, then you must have dabbled into the scripting side of it. Lua script although not exactly like GM code is pretty similar in various ways, so if you understand the basics of scripting in Game Maker then you shouldn't really have much of an issue learning Lua.

    P.S: I'm planning on sorting out some video tutorials on Lua script & VS shortly. I will mostly be focusing on Lua related content as I heavily use Lua script for most things as I find it faster than working with the pre-made action parts & if queries most of the time.

    Imperátor

    7285 Posts

  • #17, z AvenThursday, 23. June 2016, 21:47 hodinky 8 years ago
    I am really looking forward seeing your tutorials! smile

    The problem in coding is that is should make *click* grin
    I know if-else-statements, loops, variables and this stuff in theory how FSM works and so on. But the biggest problem is... if I have a problem... I don't know how to achieve the solution for it. Because with all this theory there is no *click* or light in my head grin

    Bažant

    23 Posts

  • #18, z afrlmeThursday, 23. June 2016, 22:24 hodinky 8 years ago
    I believe David has been working on an integrated debugger for the next update of VS. At least he showed me a screenshot of it a little while back. Unfortunately there still won't be an auto-complete system in place, which would make scripting in VS a breeze; even for non-scripters / people new to scripting.

    If you ever get stuck with something then you can always google for a solution or ask for help on here.

    P.S: we don't actually classify multi-purpose functions / events here under FSM. Technically you can do pretty much everything without resorting to Lua script, however scripting tends to be a lot faster & provides more flexibility for those that are willing to learn / use it.

    P.P.S: Solving issues & finding workarounds is all about logic or reverse engineering or searching / asking for answers / help. grin

    Imperátor

    7285 Posts

  • #19, z AvenThursday, 23. June 2016, 22:39 hodinky 8 years ago
    If spine is too hard or doesn't work... If I have a game with fullHD resolution (on pc). And a giant which needs 50% of screen and needs a smooth animation. Maybe saved in 250 images so it really smooth. Do you think it will work without lag on standard pc/mobile?

    Bažant

    23 Posts

  • #20, z afrlmeThursday, 23. June 2016, 23:16 hodinky 8 years ago
    Spine should work according to SimonS. I don't have any documentation for it, so I've no idea how to actually use it myself or where to even begin. I also don't own Spine.

    What do you mean by 250 images? Are you talking about 250 frames in a single animation or are you talking about 250 frames spread out over various animations for said giant? Because I can't recommend 250 frames for any single animation. At most you should be aiming for about 24 frames or less per any animation, though you can use more if you want.

    Quick tip #1: VS accepts webp image format. I highly recommend you convert all your png / jpg files to webp lossy quality 100 as it's hard to distinguish the difference between those & lossless png versions, plus you get the bonus of massively reduced file-sizes when using webp (anything up to 50% less than the original png file-size), which means your animations / images will load much faster than png versions.

    https://wiki.visionaire-tracker.net/wiki/Image_Encoding

    Quick tip #2: Try to refrain from using duplicated animation frames for the sake of making your animations look smoother. I am talking about using the same image multiple times in a row (different files) as you can specify the delay / pause value manually between each animation frame if you so choose. You can also manually insert new animation frames & you can also control the global delay / pause value between all frames, as well as the playback order (forwards, backwards or random - we don't have a pendulum option yet, but I think I will put in a request for it to be added at some point).

    https://wiki.visionaire-tracker.net/wiki/Game_Optimization

    Imperátor

    7285 Posts