Playing digital controls as pseudo-analog

Get help using Construct 2

Post » Mon Apr 29, 2013 7:48 pm

Later on, I plan to incorporate analog controls to my game using a USB Xbox controller to allow for micro-movement. But for now, I'm using digital, all-or-nothing controls while I get the game set up. With that in mind, I have the following scenario that I'd like some suggestions on how to make a reality...

During my stealth game, there will be certain "audible" triggers that will alert the enemy that something/one is nearby, but it won't activate the chase status... Right now, I have a "water" object to simulate a puddle on the ground. When the player walks through it, it's suppose to generate a "splash" sound (that's to come later...). However! If you "tip-toe" through the puddle, virtually no sound will be made and the enemy will not be alerted. This is difficult to do when you have digital controls.

So what I'm thinking is to have a test where an audio trigger won't be generated until the player has walked so many steps through the water. Say, every 10+ steps, alert enemy. If the player stops before reaching ten steps, then it's akin to having walked softly (slowly) through the water.

I'm using the 8-Direction for controls via the keyboard presently. (Again, later on I will incorporate analog controls to make it easier to walk slow/fast. But not everyone will have analog controllers, of course.)

Suggestions on how to make this work, please? Thank you!
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661

Post » Mon Apr 29, 2013 8:01 pm

Why not offer a walk stance button instead to replace the analog value.

Right - Normal Right
Double tap Right - Faster Right
press 'z' - stealth mode
- Right - slow stealth Right

OR

Right = Normal Right
Shift Right = Slow Right

this would be similar to what you would be trying with an analog to keyboard. This would be easier than counting the steps and would be more ready to implement for analog. As your suggesting would be to create a mechanic now that you might not use later.

However, if your going to do the "10 step".
OnMove
- startAlertTimer = -1
--> startAlertTimer = time + 500(time 10 steps)
- If startAlertTimer < time
--> AlertTriggerCheck

MoveOver
--> startAlertTimer = -1

that's just a suggestion of course

you can check for if the animation reaches a specific frame
OnRight
- If sprite.animationframe = 8(frame 8 for a step on the ground?)
--> alertStep++
- If alertStep = 10
--> alert Check

good luck :)
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Mon Apr 29, 2013 8:01 pm

What about just checking the speed of the player? If you just tap the arrow key it shouldn't get up to full speed so it would be similar to holding the analog stick halfway.

Example: sneak.capxramones2013-04-29 20:12:42
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Mon Apr 29, 2013 8:21 pm

I'm not sure about these ideas... I've never really played that many sidescrolling stealth games...

What if the player doesn't immediately start running when the movement keys are pressed? Holding down the left or right arrow key will make the character start moving slowly until they get to walking speed. Holding and releasing these keys in a certain rhythm could cause a slow walk or sidestepping movement or something...
(This would probably be weird to get used to... :P)

You could also try crouch/down arrow key + arrow keys for slowed movement and a sprint button/double-pressed arrow keys for running.
(This is probably most practical...)

Or the character could just move slowly by default :P

I don't know... Take a look at other sidescrolling stealth games on PC and see what they did!
(I recall a Williams arcade game called "Bubbles" that did a sort of analog movement with a digital joystick. I doubt that helps though... :P)
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Tue Apr 30, 2013 2:30 am

@Zero6 & ramones - Actually, you two just game me a good idea for what to do: Something to the affect of adjusting the acceleration and max speed after a certain value is reached.

Something to the effect of
Max speed: ###
-> speed < ###
--> acceleration = #
-> speed >= ####
--> acceleration = ##

Or something to that effect.

@jayderyu - I actually like that "on animation frame" idea. ALSO good.

Time to experiment...
(Other ideas are welcome if you think of any.)
I'm seeking Narnia. Who wants to come with me! Aslan is on the move!
B
113
S
20
G
8
Posts: 741
Reputation: 13,661


Return to How do I....?

Who is online

Users browsing this forum: farfetchd83, Laurent, makkancs and 24 guests