Loading...
52
1 year ago

!!!SLIGHT VOLUME WARNING!!!

got bored earlier and had an Idea to make a marble game but the velocity is controlled by your Microphone Input It moves in the direction you look at when you talk / scream / blow air into your mic.

v Explanation in Article v


It might sound like something That'd be complicated to do but no lol

The player is just a RigidBody3D, set up in a way I felt best.

for the camera, the player has a child node called "CamGymbal" which holds the Camera (so you can move the camera from left to right, I didn't add looking up and down because I felt it was better that way)

image.png

CamGymbal has "Top Level" on, which makes it not follow its parent's position (which is the player) this is to prevent it from rotating along with the ball. We put the Gymbal to the Player position in code.

The Level layout is pretty simple to make, it just uses a Path3D with a CSGPolygon3D as a child node, which I connected to the path so the CSG Follows along the path.

This is what the CSGPolygon3D Looks like:

image.png

And this is how the Path3D works.

image.png

These were my CSGPolygon3D Configurations:

image.png

For code, It's pretty simple.

image.png

MicIdx is the Audio Bus Index for the Microphone Input

I added a "Mic" bus with the "Record" Filter, then connected it to "MicMute", which is a muted track.

This is to prevent the Microphone Input from being played back to you.

image.png

I then have an AudioStreamPlayer in the Scene set up like so:

image.png

Under _ready():

image.png

we set the mouse to be Captured to the Window.

AudioServer.get_input_device_list()[2]is my manual Implementation of setting the Input device to the correct Microphone lol.

get_input_device_list() returns a PackedStringArray

a Finished game would obviously put this in the Options or something but for Testing purposes I just did it manually

The line below it then sets the Microphone Input to the Device.

Under physics_process():

image.png

we set the Camera Gymbal's position to the Player's position so the Camera follows the player.

then we get the peak volume of the mic track using the MicIdx we got earlier.

peak volume basically means your microphone volume, since we have a "Record" filter on the bus.

in that same line, we also remap from -50 and 0 to 0 and 10

that means -50 is now 0 and 0 is now 10

-50 is the quietest I've seen my mic go, although it turns to -200 when turned off, no difference, since it caps the minimum to 0.

and 0 is the max input volume, so the loudest you can be.

If Sample is more than or equal to 3 (this is so it doesn't detect random noise, obviously a finished game would have all of this customizable in the options but this is just a test)

we -= the linear velocity of the player to the CamGymbal's global basis z, which is basically rotation to facing or something. Idk I suck at all this math vector stuff.

we divide that Initial Vector3 by 20 to make it wayy slower, then times that by Sample, which again. is our volume.

Under _input(event):

image.png

we check if event is InputEventMouseMotion and then rotate the Gymbal's y to -event.relative.x * 0.003 (we times that by 0.003 to make it slower)

Sable Gif:



2 comments

Loading...

Next up

Happy Devruary! Devruary Day 4 celebrates @ElPichon ! They're just a bird who likes to draw! They're also the developer behind The Bunny Graveyard II and Chunky JUMP!. We also have a question for the devs of Game Jolt: How Did You Learn Game Dev?

A quick look at Ryn: And the thread of Life, our game in development, platforms and traps in action.

#gamedev #indiedev #godot

This is a general #UnrealEngine tool, not specifically for the Mega Man project. It can copy the data from ANY Blueprint or C++ UPROPERTY variable, and copy it back to any compatible variable. Could lead to making Save States for Rollback Netcode.

Did you know that today is #InternationalJazzDay? 🎷😎

No? 😯 Well, we couldn't pass up this date!

And what better to celebrate this day than #Pecaminosa #OST? 🎷

Let us know what you think about it and have a great weekend!

So

i may or may not make an full art of some person or i may just leave this like that-

art comission.

Been working lately on lots of 'behind-the-scenes' boring stuff that no one really cares about, so here’s a guy playing the sax for some reason.

#screenshotsaturday

I-Buki

Mio-Da!

Ibuki Mioda!

A few screenshots of the places you'll cross in the Demo of Blu. You can play it today on #gamejolt !

Coming Soon...