Game
Rhythm, Paper, Scissors
8 years ago

Timing is everything


When the code that you’ve been working hard on, the one you’ve been failing to complete several times and almost bringing you to the verge of surrender. Is there a better feeling when this code finally works and you’ll get to start working with it? Is there a better feeling than feeling that wind in your back? I
think not.

Since last time I’ve only really spent two days on the project since I took an early holiday over Christmas, new years and then returned last Wednesday evening to Skövde to continue. But man has it felt good those two days!

The first thing I needed to do was to send the information I got from Wwise and send it to the scripts that needed it. I created a new script called “BeatTiming” and created floats for Metre and Beat Duration to name two. These were then connected as you can see below:

PrintCallbacks script (the script I’ve used the most in my previous posts):

5d0a84e970fb1.png

PrintCallbacks basically receives the information from Wwise regarding Beat Duration and the callbacks for Entry, Bar and Beat while sending them over to BeatTiming as well as a few other scripts.

BeatTiming (the new script):

5d0a84ebeaa9a.png

The BeatTiming code basically checks if the song is being played in 3/4 or 4/4 and then checks on which beat it is currently playing. Then we have a SafeTriggerZone so that the player has some room on each side of the beat to make the button press without failing. If the player presses the button within the safe trigger zone she will perform an attack. If the player is too far off beat the player character will be stunned for a while.

I also made it so that the player has a chance of making a strong attack on the first and fourth beat of a 4/4-track and weaker attacks on the second and third beat. This might change after some game tests but the idea is, as seen in my first blog post, that the player should be able to commit to stronger attacks or play it a bit safer with some quick, weak attacks.

The results can be seen below in the Debug.Log:

5d0a84ee6809b.png
5d0a84f0bf8a2.png

As you can see I had a good run with a streak of successful attacks but was then slightly too slow on the second beat of the 30th bar. This resulted in my character being stunned and unable to attack for a while. So the player will have to be careful, attacking off beat will give the enemy a chance to attack you when you’re defenceless!

A similar thing will soon be implemented for the enemies in the game. The enemies will on each beat decide wheather to attack or not on the next full beat. If the enemy decides to attack it will show a hint above their head at half the Beat Duration to let the player know what they should attack against. On the full beat the attack is performed and depending on what attacks the player and the enemy has chosen one of the two might be damaged.

Since I haven’t spent any time on the actual battle mechanics this will be more fleshed out in a later blog post. We’ll see who in our team eventually gets to work on it as well as it’s not yet 100% decided.

But I’m gonna leave you all here for now. But we have plenty of fun stuff ahead! We’ll try getting the Rhythm, Paper, Scissors-world into a full out dance mode, compose some music for the game and get the combat working as intended!

See ya next week!

/Sebastian



0 comments

Loading...

Next up

Smile! Here, take some happy pills! ✨💊 #Blender #3DModelling #3DArt Buy me a Ko-fi: https://ko-fi.com/barbarafb_

We made a lot of improvements on the Freezing Plains visual. Things like pine trees, tiny bushes, some rocks, and others game props!

#IndieGame | #IndieDev | #GameDev | #PixelArt | #WaifuQuest | #WifeQuest | #screenshotsaturday

🍒Did you like the game? A demo is available for free on Steam.

✌️ Thanks for playing IndieGameiacs!

⚙️ Free Demo: http://bit.ly/UniDuni

📺 Full Video: https://youtu.be/5qEbVXg7GaQ

#steam #uniduni #clops #screenshotsaturday

"Our work is never over" they said.

One of the most critical update for Sunblaze demo. Now you are able to pet a cat! Finally!

Rockin the Guitar, an Axe like Guitar I made for my Uni project

The Authority decided to investigate the Basement and leads to recovering classified documents Fun fact: The building has 928 doors and not 1000 doors. #horror

Sonic The Hedgehog style Super Smash Bros 4 Pixel art Gif.

I just wanted to introduce you to my latest musical production and hear some opinions about it. Thank you very much.

I thought I would do a quick show and tell, with a 2 min video of the start of the game and some of the game elements, after many many months it is really starting to come together, time to start networking https://gamejolt.com/games/Dungeon_fable/490669