#Gamepad or console control method

1 messages Β· Page 1 of 1 (latest)

vale swan
#

I've been playing a couple adventure games with my kids. Instead of us all cramping around a PC, we've been playing on the TV in the living room, either on Switch or the Playstation.

For someone who grew up playing on PC's I'm very fascinated by the range of control methods games today choose to use. Some are very traditional (like Darkside Detective or Lions Song), where you control a cursor over the screen with the joystick. It's very much a classic point'n'click method. But others have direct control of the characters, like RΓΆki, Sam'n'Max and the latest Monkey Island. The ones I have played have buttons mapped to inventory, primary and secondary actions. Even buttons to select and do something with hotspots. Very handy!

To me, the latter controls method feels a lot more immersive and natural. It feels less like a chore, to be honest. I was wondering if this way of controlling the characters are easy to do with Power Quest, maybe even built in?

ocean summit
#

nothing builtin, but it can be added. What I do is have PQ "click to walk" on the update method, and the point where it clicks is current position + direction, with direction being the current direction being pressed by the gamepad

#

it's not trivial, but we can probably help you add it to your game

#

it also depends on what input package you're using, although I'm mostly sure you haven't changed that so it's Unity's old input, which is PQ's default

vale swan
#

Great to hear! Right now I am just curious about it, it is more interesting for a future project. But great to hear its doable!

latent sail
#

I've added gamepad support for our game... horribly hackish. hopefully I can tidy it up... one day

#

but it's really basic so far, use left stick to move the cursor and two buttons for each mouse click

#

wanna add the option to use the dpad for selecting dialog options and buttons to highlight hotspots but they are down on the todo list

#

I found it unusual you can't play return to monkey island with a gamepad. maybe I missed something in options and it's something you have to enable.

hardy jolt
#

I have a pretty unique gamepad control scheme for the Drifter. Basically, left stick to move, right to look around at hotspots and trigger to interact

#

So yeah, not built in but definitely possible

vale swan
vale swan
#

Return to Monkey Island has something similar; left stick moves the character and right stick changes hotspot. They use circles around each hotspot to show which one is "active", are you doing something like that?

latent sail
#

rtmi definitely works with a gamepad. I have two xbox controllers laying around, once connected to my pc and one to a dev kit, I suspect I just tried using the wrong one, haha

latent sail
#

my plan for both analogs is do what you described. might use dpad for dialog options

hardy jolt
#

Mine is pretty hard to describe, there's a circle at the characters feet that appears when you're "looking" with the right stick. That serves as a radial menu of the surrounding hotspots. There's a lot of fiddly nuance to the implementation ha ha. It seems to work when I exhibited the demo on switch, people found it quite natural

#

The demo should be going up again in a couple of weeks so I'll let you know if you wanna try it

#

It's not something that's really transferable to other games or anything. But interesting to talk about!

latent sail
#

if the demo is on pc will sure give it a try πŸ™‚ I don't own a switch, heh

hardy jolt
#

Yeah on PC

latent sail
#

ah, cool. will definitely check it out then!

woven jay
#

Glad ro hear there's a new demo coming! Issue with controllers is going to be - there's no standard yet and everyone will do things differently and it's going to be clunky for a while. I still wonder if it's worth the effort considering PnC sales and all. Accessibility is a good thing but when you're fiddling with 5-15 hotspots per scene it's just something that, to me, seems nearly forever terrible with a controller. At that point (direct drive of character etc) just make a 3rd person adv game with pixel art and drop 30y old PnC conventions like hotspots and shit? Will be interesting to see unfold. To me, you pick the genre and go with the conventions. Not sure you can bridge it with a controller without maybe watering game down (so say good bye to dialogue trees, which may be fine) or other concessions!

#

Just played 5m of RtMI. Works really well, actually! Might even be better on PC due to not having to hover over '.' all the time to skip dialogue. A button press is easier.

hardy jolt
#

It's just the same demo sorry πŸ˜‰ Not really worth my time updating it until I do a "final" demo much closer to release really

latent sail
latent sail
#

I'm running into this crazy bug which I haven't been able to figure out just yet...
this happens when using the gamepad. when selecting an item from inventory and interacting with certain areas of a hotspot it will fire an event as if I had just pressed the power button in the toolbar

#

weird thing it doesn't happen the second time you do the itneraction. this is select item -> click hotspot -> click hotspot again

#

but if you un select the item then start over it will happen again, just on the first interaction

#

this is probably a sign I should just throw my hack implementation of a gamepad with the new input system and just go through and replace the old input system completely

#

needed to vent this, lol

latent sail
#

oh shit, I think it might have to do with the fact I had some duplicated action setup. 1830 and I can't think anymore

#

gonna call it a day and try it fresh in the morning

hardy jolt
#

I'd be wary of the new input system, and use rewired instead. Don't know if many games have shipped with new input system and unity is good at making half baked systems and fixing the major issues later πŸ˜›

#

Rewired is pretty much industry standard at this point. (Note I would never use the old input system for actual controller support either)

#

(It's 100% fine for keyboard and mouse though)

latent sail
#

oh man, I knew about rewired but completely forgot about it. gonna give it some thought

hardy jolt
#

<@&553356454812188673> If anyone's interested in trying the control scheme I have for The Drifter, the demo's up on steam for this week only!
https://store.steampowered.com/app/1170570/The_Drifter/

FEATURES A Pulp Adventure Thriller from the minds that brought you Crawl and Peridium An engrossing roller-coaster of a story - Drawing on King, Crichton and Carpenter, with a dash of 70s Ozploitation. Point 'N Click or Controller - Featuring unique LOOK-360β„’* technology (*not actually a trademark) Brooding dark-synth cinematic score Fully voic...

Release Date

When It's Done

β–Ά Play video
sharp junco
#

neeeeeedddddddddd

#

downloading immediatly

wide owl
#

yay!

#

how different is it compared to the old demo?

hardy jolt
#

It's not, ha ha. Same old demo πŸ˜›

wide owl
#

Oh! It was quite awesome back then, I should replay it

hardy jolt
#

I think that section of the game is pretty perfect for a demo. So when I eventually update it, it'll probably still be the same section, just some minor tweaks/fixes anyway

wide owl
#

I agree

storm latch
#

Oh okay interesting, yeah I'll give it a spin if I don't forget

glad sigil
hardy jolt
#

It's always had those, but you wouldn't know unless you had a controller plugged in

#

But yeah, the demo's only been up for festivals, so more just letting people know they can play it now if they hadn't had a chance before

glad sigil
#

Might be worth an explicit mention. Especially with the new monkey Island dropping and it's controller comparability being a current discussion

hardy jolt
#

On twitter you mean?

#

I'm not pushing the demo/steam page super hard at the moment, waiting until I have a bit of a grasp of how long there is to go so I feel like I can keep up momentum

#

There's only so much I can tell people to play the same demo ha ha

glad sigil
#

Sure. Maybe "if you're familiar with the controller system the new monkey Island uses, you might be interested to know the Drifter has controller input now as well. Try the demo with a controller plugged in and let me know how it feels"

#

Yours sincerely, Duzz on Drums

rich mica
#

I'll give it a go too Dave thanks!

hardy jolt
rich mica
#

Will it work with my PS5 controller or are you aiming it at XBOX only?

#

I went looking for my A button πŸ˜›

glad sigil
#

Sorry, i didn't speak clearly, I'm not proposing we discussed MI interface. It was an example announcement to raise awareness you do controllers "as well"

hardy jolt
#

Yeah I've only put in switch and xbox glyphs so far ha ha, it should work. but PS5 wasn't out yet when I made that demo

rich mica
#

Roger and roger

glad sigil
#

I didn't know about your controller thing until I saw it in your video, and I assumed it was newly added, not that it already existed

rich mica
#

Same action handlers - I'll give it a go. Sorry Shady I thought I saw a call to arms for testing πŸ™‚

glad sigil
#

Nah, I figured given MI is sparking interest in point and clicks among the filthy casuals, you could name drop it for a bit of the old traction

hardy jolt
#

yeah I cringe at that stuff though πŸ˜›

glad sigil
#

And then of course I could reply "I agree Dave, monkey island IS shit and yes you're right thimbleweed park was garbage too"

#

That'll really get the clicks going

hardy jolt
#

Yeah I haven't talked about it much really (since the original demo playtesting). Just mentioning in here since we were discussing different ways to approach controller input

#

ha ha ha

#

Also I want to keep it secret so no one steals it before I launch the drifter in like 2036

glad sigil
#

Kotaku: Dave on Dave crime etc

glad sigil
woven jay
latent sail
storm latch
hardy jolt
glad sigil
#

Curated content!! He's too good to us!

latent sail
#

oooh, just started watching this and guess I'm not the only one using a wired xbox 360 controller con pc πŸ˜„

#

as I said before I specially like how you do the inventory/item handling, just a couple of buttons to scroll through them, might actually try this

#

specially since we don't plan to have the player have a huge amount of items

#

I agree if you have ~10+ items at any time it's probably cumbersome and a traditional inventory (ala rtmi) works better

hardy jolt
#

Yeah, I think Drifter gets up to about 10 or 12 max. Which I think I can manage with a radial menus

vale swan
#

Had a go at the Drifter controls! Great use of the gamepad, and I like how it's centric to the player. Very nice!

There are minor inconveniences in the controls, but that is also true with Monkey Island. With the complexities of point and click-functionality, I think it will be hard to make it any simpler than this πŸ™‚

hardy jolt
#

Thanks! Yeah mouse will always be more accurate and quick I think. But it's nice to be able to sit back with a controller too

woven jay
#

Been back to working on controller stuff lately and nearing the end. Lots to do to do it correctly. Generally I'm doing what RTMI did. You can hot swap between mouse or controller. Hotspots highlight when near them and brightlight (interactable) when you face them. Or you can use shoulder buttons to cycle focus on visible hotspots.

I'm down to the final bit...using the right stick to "aim" towards a hotspot which would then brightlight it to be used. Do @hardy jolt @latent sail or @slate bramble or anyone have any ideas for the best way to approach that one? I'd assume some direction vector with some little angle cone around it and if the hotspot is in there, highlight it?

I will say that dealing with hotspots with a controller is a pain in the ass. 1) have to highlight them as you walk around (either just all or based on dist) 2) allow another mode where you can just cycle through them forward/backward as a list and 3) ideally use the stick to navigate toward them (as this is more intuitive than pressing cycle 3-4x). My code is pretty messy and in need of a refactor but all but #3 is done and working now.

I talked to Ron Gilbert about all this and he basically said if it weren't for console ports he wouldn't have bothered. But even on PC, I want to sit back and play with a controller instead of having to lean in, have a hand on the mouse and another on the keyboard for some actions.

Thx for any help.

slate bramble
#

Yeah that's basically how we did it, I weighted the hotspot to highlight depending on which way the character was facing and how close they were and then allowed you to navigate directionally on the right stick, but also allowed you to cycle through all of them using the shoulder buttons

hardy jolt
#

I added a "center point" to each hotspot/prop etc so I'd have somthing to point to (and show hotspot highlight on)

slate bramble
#

Same!

#

I did think about adding a weighting to each prop, so it would be more likely to target 'important' props in a room, but didn't have the time to add that in the end. I think if you faced the coat stand in the first room, it would always highlight the door first, which was a bit annoying

#

It certainly felt a lot better once we added the character direction

woven jay
hardy jolt
#

hmm. my hotspots are all at 0,0

hardy jolt
#

The "look at" might work, but there's times where you want the player to face up or down so the look at point isn't usually at the center of the object

woven jay
#

Assume I have the center sorted already. I use it to show the highlight icons and teleport the cursor to. Just unsure how to use the direction of hte stick to know that it's aiming toward some hotspot?

#

I haven't started coding it yet, so I might stuble on it easily. Was just looking for guidance πŸ˜‰

hardy jolt
#

In terms of the math, you want the highest (or closest to 1.0) of each Vector2.dot(stickDirection, playerToHotspotCenterDirection) (if it's 1 it means the vectors are pointing exact same direction, assuming they're normalised)

#

I'm guessing you'd do a combo of that and how "close" the player is to the hotspot too?

woven jay
#

Oh, interesting. Yeah I'm not well versed in vector math but that's a solid direction to pursue. Might just be a few lines of code. Thanks!

#

fwiw here's how I'm calculating the center of the hotspot in screenspace from it's worldspace. Seems to work:

PowerQuest.Get.WorldPositionToGui(new Vector3(hotspot.Instance.transform.position.x + hotspot.LookAtPoint.x, hotspot.Instance.transform.position.y + hotspot.LookAtPoint.y, 0));```
hardy jolt
#

Oh right, so really just the look at point. gotcha

#

For checking against player pos, want to keep it in world space btw

woven jay
latent sail
#

I arrived a bit late to the party 🀣

candid pulsar
#

What's the proper way to add a center point, by the way? I just edited the QuestEditorUtils file like a cave man, but surely there's a better way?

hardy jolt
#

extentions πŸ˜‰

#
{
    Vector2 CenterPoint {get;set;}```
#

(nb: mine had a "controller range" too, so there's some more properties in there than othes would need)

#

CenterPointEditor.cs has to go in an \Editor\ folder too btw

#

The stuff in OnScene() is probably familiar (and what you hacked into QuestEditorUtils I imagine)

candid pulsar
#

Dang! Thanks Dave!

woven jay
#

Dave why not just use look at point and keep it centered (or really it can be anywhere). I’m sure there’s some reason but curious what case made you add a center point?

hardy jolt
#

Just because there's times your don't want the character to look at the centre of the hotspot

#

Might not be an issue for you though

woven jay
#

I figured that was it. Just couldn’t think of an example! I’ll keep it in mind and may add it as future proofing. Thx.

woven jay
#

Dave, and @slate bramble : Doing exits now where you just walk into them and exit via controller. I assume you guys used a region/OnEnter there? Sort of sucks having to have two ways to exit based on control method and duplication of code. Still pondering if I can clean it up any.

hardy jolt
#

I just have the exit hotspot have WalkToClicked, then the region does the rest

woven jay
#

I see. So the hotspot just sends you on your way, and you will hit the region as you walktoclicked then the region likely directs you to a point off screen when you enter it.

#

Been transitioning from lots of c# coding for controller crap back into questscript and some lightbulbs are slowly turning back on πŸ˜‰

slate bramble
#

Yeah I did the same as Dave 😁

woven jay
# slate bramble Yeah I did the same as Dave 😁

Got it all in and working and it's cool. Thanks to you and Dave for the guidance here and there. Much appreciated! The only thing really clunky about PnCs with a controller is the inventory, but it's not too bad. Just sometimes get a button confused in your head. But I do like a grid based inventory where you could chose to have 15 items at a time if need be.

woven jay
#

Dave, check my math. I added Centerpoints last night but had to jump through some hoops. I iterate through IQuestClickable's a lot. So I needed to add the Centerpoint to that. And that forced me, for some reason, to add it to everything (even stuff like GuiControl, Gui, Inventory...).

So here's what I have:

{
    Vector2 CenterPoint {get;set;}
}```

Then something like this for prop, character, hotspot.

```public partial interface IHotspot
{
    Vector2 CenterPoint { get; set; }
}

public partial class Hotspot
{
    [SerializeField] Vector2 m_centerpoint;
    public Vector2 CenterPoint { get { return m_centerpoint; } set { m_centerpoint = value; } }
}```
hardy jolt
#

Yeah that's what you have to do

woven jay
#

This seems to work and I get a Centerpoint Vector2 on the Componets on the scripts etc.

#

Ok cool. I just struggled with it for an hour. I also really appreciate your script above for adding the control tool to the editor. Very handy!

woven jay
#

Another dumb question. Characters triggered this. So you set a centerpoint, drag it (for props/hotspots) in the editor. For the character, I guess open the prefab and set it where you want on the body.

Thing is...if you move a hotspot/prop the centerpoint doesn't update. And for characters, their centerpoint is something like 0,36 vs wherever the char is on screen.

Things being static works (apart from characters). So how/where to adjust the centerpoints and update them if something moves? I've tried a few things. Hope this makes some sense.

hardy jolt
#

The CenterPoint is always an offset from the object- so just add the Position

#

IQuestClickable has a Position property already I believe

woven jay
#

Yeah I knew that. I guess I was thinking just accessing Centerpoint would do it. Previously I was accessing everything with position + lookat, and it just got messy, so I though reducing to just centerpoint would clean up the code. I guess it's really the same thing except now you have a new dedicated point. So I just sort of misunderstood things. I'll try to find a central place to alter the center point vs having to do offsets all over?

hardy jolt
#

Hmm not sure what you mean really, it couldn't work any other way (unless you never move characters πŸ˜‰

#

You could add another property if you want to save the typing or something public Vector2 CenterPointWorld => Position + CenterPoint;

woven jay
#

Yeah I may try that. Just wanted to avoid things like:
float dist = Mathf.Abs(Cursor.PositionOverride.x - (thing.CenterPoint.x + thing.Position.x));
But yeah I was scratching my head with "this won't work for anything that moves" (the way I was thinking about it). I had it all working fine, but just thought it'd be cleaner with a dedicated centerpoint.

#

eg: I guess I though there was some magic somewhere πŸ˜‰

hardy jolt
#

hehe, yeah well, that property would solve that issue for you

#

Personally I just add the position when I need to πŸ˜›

woven jay
#

Right got it. So just a search/replace then πŸ˜‰ I'm going to do one more refactor on the controller gui code and never fucking look at it again! ha

woven jay
#

Great now I have to go room by room and set all the centerpoints. Work work work. I feel like a Warcraft 2 Orc. Zug Zug!

woven jay
#

Dave, added the Controller Range to the extension method and made sure it all hooked up in your CenterPointEditor.cs above. Seems to work for everything but Characters? ControllerRange stays 0, vs going to whatever default I assigned them in CenterPointEditor.

Thoughts?

hardy jolt
#

Are you editing the prefab?

woven jay
#

No I left the prefabs alone and they are at 0? Do character prefabs just need to be hand set?

#

If I set it in the prefab it obv works, but I assumed the editor script would handle it?

hardy jolt
#

Any changes to a character in a room are lost when you hit play. It's just a preview really

woven jay
#

ok, so when I got it all hooked up properly, all at once all the hotspots, props changed from 0 to the default (say 50). The characters stayed at 0. So is that a bug, or issue, or how it is?

hardy jolt
#

No idea sorry

woven jay
#

ok, cool. But they should have updated yes?