Implementing Input Dog

posted Dec 5, 2017, 3:22 PM by Good Idea Games   [ updated Dec 5, 2017, 3:23 PM ]

Time Throttle has some major issues with its controller input. Most significantly, the menu can only operated by game pad device ID 0, and apparently if it gets unplugged, Windows reconnects it as Device ID 1. Long story short, if I unplug a gamepad, I have to reboot to play Time Throttle again.

Input Dog is a Game Maker asset that should address this.

To familiarize myself with this asset, I'm going to start by importing it into a blank project, and walk through it's intended functionality in this article.
I am pleased to say that input dog works right on import, though as I type this, the little dogs are moving around and my controller vibrates every time I hit 'm'. Apparently it doesn't care whether the associated application is in an active window or not.





Configuring Input Dog
Input Dog starts by opening the 'rInputManager' room, which creates a unique InputForPlayer object for each player in the game.  This loads a pre-defined configuration for each player, where named game functions are mapped to one or more inputs. 
For example, in the screen shot to the left, you can see that player 1's game function "bark" is mapped to N, or gp_face3.
The actual game effect of "bark" is defined as a part of the Example Dog object.
Input Dog then transitions to 'rExampleRoom' where it loads an Example Dog (player) object for each player, and a mouse-clickable button to transition each player to a special room for configuring their controls.

Off the shelf, these controls are limited to a single keyboard command and a single joystick command. 

Input Dog appears to assign game pads to players on launch, and each player can only accept input from a single game pad (though interestingly, a single game pad can control multiple players). 
Input Dog seamlessly accepts input from both X_INPUT and DIRECT_INPUT devices, which means immediate compatibility with more devices.

This is already structurally similar to Time Throttle, where player craft are immediately playable in the configuration menu.

Like in Time Throttle, player controls are defined as part of the player object itself.

I should be able to replace my current gamepad button checks with inputdog function calls, and even without understanding how inputdog works under the hood, I suspect for most functions this will just work.





To Be Continued...

Time Throttle: POC 3 Complete!

posted Nov 22, 2017, 5:25 PM by Good Idea Games

Riding the hot wind of my successful POC2, I jumped straight into POC3: Feature Parity within Game Maker's Box2d Physics Engine.

Using the physics engine solves a bunch of problems with POC2, like object collisions feeling unimpactful player craft handling feeling 'floaty' and player pawns getting stuck to walls. It also opens a lot of avenues for novel game play, where I can introduce props and objects with interacting physics effects, like gravity wells, chains, oil, etc.

And let's not forget that it will also make it easier to implement player-built craft! 

So this is something I want. Baddly.

I've been spending a few hours on this migration every day, and the biggest hurdle I'd faced so far was implementing Time Throttle (go figure). Game Maker's Box 2D physics engine is *very* particular about the way it allows you to interact with physics objects, and cutting the frame rate of the game does not work.

At this moment, I am 90% of the way there. I am able to 'simulate' a global slow by iterating over all objects in the game, and applying an appropriate value to each object's 'time_modifier' variable. This variable is then used within each object to dictate it's motion and behavior.

For example, when the 'time_modifier' variable changes by X%, a proportional force is applied to the moving object, slowing it's motion by X%. When the 'time_modifier' returns to normal, that change is tracked as well, and likewise a force is applied to the object to speed it back up. There's a little more going on, but that covers it pretty well.

All in all, it's generating the effect that I want!
Except... my cannon balls aren't inheriting the functions that change the 'time_modifier', and without that... there's no change to the motion.

It's an issue with inheritance. I'll get it sorted soon, and then I'll post a new video.
...
Actually, since I just wrote that down, I went to my cannon_ball object to check it's inheritance, and sure enough, it was NOT inheriting step events from its parent. So that would pretty much do *exactly* want I described. So... now I have that problem solved!

And following that, I performed a little code clean-up, a few bug-fixes, and VOILA! POC 3 is Complete.

Time Throttle: POC Milestone

posted Nov 13, 2017, 9:22 PM by Good Idea Games

This weekend I reached a new milestone with Time Throttle.
It's Fully Playable, and it's FUN.
Here's a short video showing off what's going on in a match...
https://youtu.be/ccI3Ws80_Yw

Of course I have a lot of work left to do... All of the VFX are just recycling the same smoke and flame objects, I don't have all my sounds in place, and the game only works while supervised. There's a lot that can go wrong. For the love of god, don't unplug a controller after the game starts. My game pad support is so janky you basically have to reboot ;^).

But it WORKS.

Time Throttle: Dev Journal 16

posted Nov 7, 2017, 11:16 AM by Good Idea Games

I ran into an issue with engine noise that I can't explain, so I've posted to a few forums for support.
Once I get that sorted out, I can move forward on SFX, but for now...

TIME THROTTLE.
So my proof-of-concept is almost complete, BUT.. the time throttle isn't *really* working.
Don't tell anyone, but it's just a series of hacks that give the appearance of time throttling.
SHHHH.
In reality, left trigger reduces the game's frame rate, which *literally* slows down time in the game.
This is pretty Okay, as long as I can keep the game's frame rate smooth.

The right trigger is supposed to be a local acceleration... it applies to your pawn, and a small area around it.
This isn't doing that at all. In reality, I just up the player's speed, acceleration, reduce their cool-downs, and up the pitch of their sound. I mean... technically I'm doing all the things that an actual time-speed-boost would do, BUT... I'm not creating an AOE around the player that can speed up bullets.
I want that.

So it's back to the drawing board for the Time Throttle.
The Time Grenades *are* working, and produce the desired effect...
Any object that enters one has it's active properties effected by a certain 'time factor' and when they leave, the difference is restored. They even stack nicely!

So... what if left trigger creates a grenade effect that's centered on the player, and just happens to be large enough to cover the entire screen? It should work.

With some simple (read as 2-days) augmentation of the grenade, I updated the code to allow the time_factor to change dynamically based on player input, and continuously augment the motion of those affected objects. 

The tragic draw-back is that this much activity is overloading my desktop, and driving the game down to like 10 frames per second. 

I'm going to do some optimization and troubleshooting before I move on.

Time Throttle: Dev Journal 15: SFX

posted Nov 5, 2017, 3:53 PM by Good Idea Games

The time has come to implement Sound Effects to Time Throttle, and it's been interesting.

The first thing I did was implement background music, and tie the pitch to the game frame rate.
My global time manipulation mechanic is a hack, and just reduces the game's frame rate. By doing it this way, it was extremely simple, and produces *all* the side effects that I want... a general slowing of everything that the game does. It's a terrible solution, but I'm still running a proof-of-concept. If the game is fun, I can do this in a better way.

After that, there were a few simple SFX to implement... cannon fire, grenade fire... 
These were also simple. My audio wizard Lara Barden put together some SFX for me.

Next, for the engine noise I needed something special. And Stupidly complicated. It took me more than 3 hours to get it working right. This was dumb, and for a POC that will have like 4 players, it was a waste of time... but I learned a lot. 

The sound of a VW engine is special and unique, since my POC vehicle is a rocket powered bug, I needed to capture the unique sound of an idling air-cooled bug engine. I ended up ripping the sound from a youtube video, and breaking it up into different loops using audacity. I have one loop with an uneven pace, and one loop with an even pace. Then, I set the two sounds to play in order, a random number of times each. It worked out perfectly, and I created an idle engine sound that doesn't sound like a single looping track!

Next, I have a rocket engine. So I created a rocket engine loop (youtube+audacity again) that plays when the player is applying thrust to their craft. This did *not* work.

After a few hours of troubleshooting, I had to turn to reddit for help.

Time Throttle: Dev Journal 14

posted Nov 1, 2017, 10:13 AM by Good Idea Games

I've reached a major milestone!
My core game loop is complete. The game can start, play, end, and return players to the selection screen again. Hooray!

I've also implemented basic bullet trails for time throttling and background music with tempo tied to the time throttle as well!

https://youtu.be/sfebUEY6Op8

Upcoming features: full SFX, additional vfx tweaks.

Time Throttle: Dev Journal 13

posted Oct 26, 2017, 5:11 PM by Good Idea Games

Things have come along nicely for Time Throttle in the past week.
I've got the memory hole patched up, and gameplay-wise, the POC is complete!
... But I still have a bit of work to do before it's ready for sharing.

I need to implement a menu system so players can load in, set the game mode and track, check the controls, and set their colors.
I need to augment the victory condition so it honors the players' choice.
I need to generate a Victory menu, so the players can see their performance after the match.

I still need to implement sound. the game is completely silent at the moment.
I need to implement additional VFX for player craft, forward thrusters need to generate smoke and trails as well.
And most importantly, I need to implement sound and VFX for the global time slow.

And after that, it's bug fixing!
This is really coming together.

Time Throttle: Dev Journal 12

posted Oct 15, 2017, 10:10 PM by Good Idea Games

Things are getting interesting!
I've implemented the first of my necessary VFX, flame and smoke.
This was important, because I need some on-screen effects to slow down, to give the appearance that time is slowing, not just speed.

This means that my flame and smoke need to be 'objects' that can store the data necessary to receive and recover from a time modification. And consequently, this has shown me that I'm not properly destroying my data structures, and when I create 120 new objects per second (smoke+fire) I have a massive memory leak. This means the game doesn't recover the memory it's used, and the footprint just steadily increases.

It has to be fixed.

Also, my flame and smoke sprites are too small and symmetrical for any animation to actually be noticedm so the desired effect of animation slowing down isn't happening. But I can fix this.

Also, I have a local speed boost on the right trigger, but it doesn't get undone... so using it permanently boosts your ship's clock time, reducing cool downs to ~0. Good Times!

Here's a video!
https://youtu.be/kjlnUlF1gz8

Time Throttle: Dev Journal 11

posted Oct 12, 2017, 9:36 PM by Good Idea Games

I've reached a major breakthrough with Game Maker!
After so many hours in this tool, I've become familiar enough with the debugger, error messages and documentation to troubleshoot most of the issues I've run across. This feels *incredible*.

POC 2 of Time Throttle has made massive strides in the past 48 hours.
  • 1-4 players are supported, rendering in unique colors and on unique spawn pads
  • Players are scoring laps
  • Player scores are decremented when hit
  • Players can shoot Time Grenades out the rear of their vehicle
  • Time Grenades cause an AOE slow effect for objects touching them
  • Time Grenade effects are tracked on the affected object, and removed when no longer colliding
  • The effects of multiple time grenades can stack
Now I'm working on getting the Left Trigger, Global Slow working.
Player craft still get stuck to obstacles :^(.

Time Throttle: Dev Journal 9

posted Oct 10, 2017, 9:07 PM by Good Idea Games

Inheritance.
This tutorial covers the basics of inheritance in Game Maker.

I've got a problem where the player object gets 'stuck' on obstacles in the game. I *suspect* this is because a collision causes some small amount of overlap, and ends up locking the player object in place.

If I apply move_bounce_solid(true) to the player object, this applies a good bounce effect, but this 'automatic' bounce doesn't reduce speed, so a fast moving player starts to bounce like a pinball. Not the behavior i'm looking for.

So I need to write my own collision handling code. This is a good opportunity to learn about inheritance.

The practical purpose is to put my player collision code in a parent object, so all player objects inherit the same collision properties.

I also augmented the YoYo Games Recommend Controller Implementation to create additional player spawn pads in a vertical row, preventing new players from spawning atop one another.
obj_spawn_pad is a non-solid starting line whose purpose is to posess x,y coordinates where a player should spawn.

if !(instance_exists(player[pad]))         // Check to see if an instance is associated with this pad index
        {
        //Create a new spawn pad, located on top of starting spawn pad
        instance_create(obj_spawn_pad.x, obj_spawn_pad.y, obj_spawn_pad)
        //Identify instance number of new spawn pad
        player_pad_instance = instance_find(obj_spawn_pad, pad)
        //move spawn_pad down, according to player number
        player_pad_instance.y = player_pad_instance.y - 80*pad
        // Create a player object, spawn it on the new spawn pad, and assign it a gamepad number
        player[pad] = instance_create(player_pad_instance.x, player_pad_instance.y, object_player);
        with (player[pad])
            {
            image_index = pad;
            pad_num = pad;
            }
        }

1-10 of 58

Comments