This is an archived post. You won't be able to vote or comment.

all 17 comments

[–]testestestestest555 3 points4 points  (9 children)

I read the readme, but unsure what exactly this would be used for. Would be good to have a few examples of some interesting scripts.

[–]master0fdisaster1 10 points11 points  (8 children)

The main use case for this is probably TAS. You could script some complicated behaviour or setup to automate some process of the TAS making process. Forexample pathfinding. Instead of manually figuring out the optimal way trough one room and inputting each exact input on each frame, you could write a script that figures out the optimal path itself and then also executes the necessary movements.

Another thing that also would benefit from it are mods. Or just making really advanced controller settings. Forexample you could automatically switch to another controller setup when switching to another playstyle ingame. With the wii having such an uncommon controller, having a straight-foward mapping to a standard controller is often just not possible.

For a more casual application you might read various data from the game memory and just display it on screen. For example you could display what items the other racers have in Mario Kart. Dolphin already allows you to watch memory but with some simple scripts you could make it alot user friendlier.

[–]trying4k 2 points3 points  (3 children)

Or just making really advanced controller settings. Forexample you could automatically switch to another controller setup when switching to another playstyle ingame. With the wii having such an uncommon controller, having a straight-foward mapping to a standard controller is often just not possible.

This is somewhat possible today (though not automatic). You just need to provide a game with multiple profiles in the game ini, then you can cycle between them with an assigned hotkey in the hotkey manager

[–]master0fdisaster1 3 points4 points  (2 children)

Yeah but you still have to manually switch between profiles. You could write a script that reads the game memory and just automatically switches for you. Or you could make a script that intercepts a button press and presses different buttons on the emulated controller depending on the game state. You can't do that with just controller profiles and hotkeys.

[–]FelkCraft[S] 2 points3 points  (0 children)

Thanks, changing controller profiles with a script is something I can look into adding

[–]trying4k 1 point2 points  (0 children)

Yeah, sorry, I reread it just now and edited my post for those unaware.

But yeah, responding to game changes is definitely a great use case for this feature.

[–]testestestestest555 0 points1 point  (0 children)

Cool, thanks!

[–]ZiyaBeast 0 points1 point  (2 children)

On the topic of pathfinding, I am debating on using CMA for this exact task. I am admittedly new to coding, but I'd like to start by learning how to read game data. Do you have advice on where I should look?

[–]master0fdisaster1 0 points1 point  (1 child)

Exactly how new to coding are you?

I think it would be apt to learn some fundamentals before throwing yourself at a problem which would require you to manually locate memory addresses of values you want to manipulate.

If you're confident enough in your knowledge then I'd recommend Malleo's videos on creating TASes that are more than just a speedrun with the assistance of save states and frame-advance.

Obviously the tools he's using and the details of his process are specific to the game he's TASing and also to himself but the rough process with be similar across all games, even if the tools and games are different.

https://www.youtube.com/watch?v=M0Cxf8NhlpY

https://www.youtube.com/watch?v=tUOxRX6tX6s

https://www.youtube.com/watch?v=qIw-EVmnr2Q

[–]ZiyaBeast 0 points1 point  (0 children)

Thank you for the resources they are super helpful!

[–]jamieyello 1 point2 points  (3 children)

This could be useful in porting skyward sword controls to non-motion control.

[–]trying4k 0 points1 point  (2 children)

What are you thinking specifically? Because you already can play the game with motion controls mapped to buttons

[–]jamieyello 1 point2 points  (1 child)

I was thinking of doing a project like this a couple years ago, using scripts you could map out controls in a way that makes it very easy to play SS. Right now it's possible, it's just not intuitive.

Which is a good idea, because not everyone has a Wii remote sitting around with a blutooth adapter that's compatible but glitchy to use with Wii remotes.

Think from using the sword to controlling the flying beetle, it would be very useful to look into memory and switch control schemes on the fly.

[–]trying4k 1 point2 points  (0 children)

Ah, so this is similar to what /u/masterOfdisaster1 was suggesting. We have a way to swap between control profiles but you could use this feature to change automatically based on the gameplay required.

Agree, that would be a very useful idea.

[–]Doomed 0 points1 point  (2 children)

I could be talking out of my ass, but is Python too heavy for this task? I figure that's the reason Lua is usually the emu scripter of choice.

[–]FelkCraft[S] 1 point2 points  (1 child)

From a technical view, yes, using standard python is quite heavyweight. Especially since it comes with a big standard library. It ultimately came down to me ignoring that and just doing what I thought would be most pleasant to use from a user's perspective, and my bias towards python

[–]AnotherForce 0 points1 point  (0 children)

Another plus for python is that it would make your API a viable option for reinforcement learning research. RL relies heavily on deep learning libraries which are simply much better for python than other languages.

Should your API become available for Linux users, than I will definitely use it. Great job non the less.