Showing posts with label 3 hour game. Show all posts
Showing posts with label 3 hour game. Show all posts

06 March 2021

Week 5: done, but not fun

This week, I learned the hardest thing for me to do is set aside a project that inspires me. When my daily life is stressful, as this past week has been, this becomes doubly true. However, in the interest of this little "3 hour game each week" project I'm on, I tried my best to move on from Ghost and Hostage to something new.


I spent far more than 3 hours this week experimenting with mechanics in Godot. My self justification was that I needed to settle my mind into a new goal I might achieve in 3 hours. I ended up stuck on ideas and mechanics that would only apply to the growing list of projects I've shelved at one time or another, and that continue to haunt me.


I finally settled on a new project yesterday, and started building it at my earliest opportunity. The idea was a simple puzzle game. I don't typically play or enjoy puzzle games, but it was all I'd come up with all week. The result was so mechanically uninteresting to me I will not be publishing it.

To break it down: you play a little green dude who picks up green bugs. You automatically pick up the bugs, and automatically drop them in the appropriate spots to cross over lava to reach a goal. You control your character using the mouse.

 

I imagined a really simple and breezy puzzle experience, and ended up with something that was too simple with less than an hour left for changes. I tried some changes and ran out of time. 

 

I can still see some potential in the idea. More hazards, height and or jumping, more obstacles, and there might be something. Trouble is, I don't think I care enough to return to the project.

 

I've re-written the ending to this post multiple times. How much do you vent about growing pressure at work to conform in a public blog? About wanting to find a new job, but feeling hopeless in regards to your ability to step into a new industry or find anything better in your current one? I have no answers, these 3 hour games aren't helping, and I'd rather use 1 or more of these hours looking up jobs each week. So, as of now, the 3 hour games are done.


I'm going to step back and figure out what development I can fit in without adding too much stress. I'll post an update next week on what that means.

28 February 2021

Week 4, game 2: Ghost and Hostage

After several setbacks, I've finally completed another new game! You can play it here:

https://dgalga.itch.io/ghost-and-hostage


Brief gameplay video:


The basis for this game idea is the cloaking and anti-terrorist/government operations featured in the Ghost in the Shell series. (Video omitted for copyright content, but check out the series if you're interested!)


There's far too many concepts in the above video (remote hacking and possession, coordinated defensive action, coordinated team action, etc) for me to cover in one 3 hour prototype at my current skill level. So, I also focused on what I can recall enjoying most from my time playing an old multiplayer mod called NEOTOKYO:


NEOTOKYO also focuses heavily on squad tactics, but teamkills (your teammates killing you or you accidentally killing your teammates) are a thing, so I actually spent most of my time in the game going off on my own. It was the feeling of stealthily lone-gunning an area that I was hoping to recapture with my new prototype.


I don't think I was successful. As you can probably tell in the gameplay video of Ghost and Hostage, it's easily possible to lead all of the enemies in the level away from the hostage and the main path. This is because the enemies can respond to your gunshots, but don't patrol or return to their original positions. I believe that a modicum of coordination or independent action on the part of the enemies would make the game far more interesting and challenging. Unfortunately, I ran out of time to test this.


The most important aspect, to me, is the enemy pathfinding. I borrowed a solution from the following site and adapted it a bit:

https://www.davidepesce.com/2019/11/19/godot-tutorial-how-to-use-navigation2d-for-pathfinding/


After that came the invisibility. I did find this

https://gamedevserj.github.io/godot-invisibility-shader-tutorial.html

However, I couldn't get the same shifting/murky effect. I did get as far as making my player object disappear, so I mixed in some code from this shader on outlining an object:

https://godotshaders.com/shader/2d-outline-stroke/

and, mixed in a little from the Action RPG tutorial series by HeartBeast to arrive at this shader code:

shader_type canvas_item;

//variable to allow disabling and re-enabling shader:
uniform bool active = false;

uniform vec4 line_color : hint_color = vec4(1);
uniform float line_thickness : hint_range(0, 10) = 1.0;

void fragment()
{//need previous color to revert to!
    vec4 previous_color = texture(TEXTURE,UV);
    vec4 screenTexture =  texture(SCREEN_TEXTURE, SCREEN_UV);
    COLOR =  screenTexture;
    
    vec2 size = TEXTURE_PIXEL_SIZE * line_thickness;
    
    float outline = texture(TEXTURE, UV + vec2(-size.x, 0)).a;
    outline += texture(TEXTURE, UV + vec2(0, size.y)).a;
    outline += texture(TEXTURE, UV + vec2(size.x, 0)).a;
    outline += texture(TEXTURE, UV + vec2(0, -size.y)).a;
    outline += texture(TEXTURE, UV + vec2(-size.x, size.y)).a;
    outline += texture(TEXTURE, UV + vec2(size.x, size.y)).a;
    outline += texture(TEXTURE, UV + vec2(-size.x, -size.y)).a;
    outline += texture(TEXTURE, UV + vec2(size.x, -size.y)).a;
    outline = min(outline, 1.0);
    if(active)
    {
        vec4 color = texture(TEXTURE, UV);
        COLOR = mix(screenTexture, line_color, outline - color.a);
    }
    else
    {
        COLOR = previous_color;
    }
}

I don't fully understand shaders yet. I think I get the basics of what this code is doing, but I don't trust myself to fully explain it yet. Basically, this shader is using the color of the background to overwrite the color of my sprite, effectively hiding it, while drawing a line around the outline of the sprite. I think.


Finally, there was the issue of making sure the enemies cannot see the player through objects. This was a pickle, because I initially started out using a raycast2D scanning thing that looked like a Cylon scanning the environment.

https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/4430159a-24ce-4291-8254-173eb8dbfebb/d1nl1ht-772fb2cc-9351-4a15-9aed-515315bcbbee.gif?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOiIsImlzcyI6InVybjphcHA6Iiwib2JqIjpbW3sicGF0aCI6IlwvZlwvNDQzMDE1OWEtMjRjZS00MjkxLTgyNTQtMTczZWI4ZGJmZWJiXC9kMW5sMWh0LTc3MmZiMmNjLTkzNTEtNGExNS05YWVkLTUxNTMxNWJjYmJlZS5naWYifV1dLCJhdWQiOlsidXJuOnNlcnZpY2U6ZmlsZS5kb3dubG9hZCJdfQ.DPPqg7T25hxrjF6xy8c4nNvp_XB8uaJGAQcXdYOhkHU


After fiddling with this scanning idea for far too long, I gave up and adapted this solution to fit my needs instead:


Ghost and Hostage is lacking alot, but it's better than the project I failed to finish for week 2. I'm a little disappointed with myself that I failed to put out 4 games in 4 weeks, so I'm going to do my best to ensure I get 3 uninterrupted hours to finish something playable this week. Expect something next weekend!

14 February 2021

3 hour project Week 2: Not complete

For this past week, I decided I would try to use my 3 hours of game development time to tackle a new idea. A shooter that uses mouse aim. Somehow, I've never tried to make this kind of game before.


I was able to implement most of the mechanics before falling short:

Titled "Bugsnipe", the above project was still a little confused in terms of what I wanted it to be. The original idea was something of a stealth shooter focusing on a rogue rocket-launcher-wielding soldier taking on some tanks. Anytime the soldier fired his rocket-launcher, the tanks would be alerted to his position and the player would have to duck into high-grass to avoid being swarmed.


I switched the tanks to bugs after deciding I didn't want to deal with tank turrets or making WW1 style tanks. I then got attached to the idea of there being 2 bug factions, and spent probably a little too much time trying to figure out how the player would impact a little bug war going on in the center of the play area. I started creating art assets first, and spent too much time on that as well. By the time I actually finished importing assets into Godot and began coding, I had 40 minutes left!


On the plus side, I learned 2 things I really like. The 1st is a method of having a player rotate towards the mouse position with a small amount of delay or smoothing:

var Mouse_Position = get_local_mouse_position()

self.rotation += Mouse_Position.angle() * smoothing

source:  https://www.youtube.com/watch?v=iOYv4HLWDh0

 

The last time I tried something like this, I had to use the function .look_at() for the mouse position. look_at() is fine, if you want something to rotate and look at something else, like the mouse cursor, immediately. However, it's not really designed to be tinkered with too much. get_local_mouse_position().angle(), on the other hand, can be modified fairly easily. The result adds a bit of weight to turning, which I like in this case.


The 2nd thing I learned was that it's absurdly easy to add a custom mouse cursor to your Godot game. It's right under Display in Project settings:

 

I didn't finish Bugsnipe in 3 hours, and that's OK. According to the rules for this little self-challenge, Bugsnipe will now be set aside until the end of the month. I'm still free to return to it next month if I should decide I want to finish it. In the meantime, I think I have a good foundation for a top down shooting project to build on.


I'm not sure yet what I'll try next week. If this past week taught be anything, it's that the design and research that occurs before I begin development could easily expand into 10 hours or more if I'm not careful, and I'm already pressed for time! So, whatever I decide on, it's gotta be small and simple. Or, build off what I already know (and have example code of), at the very least.


Until next week.

Piecemeal Jack - post 4 - wrap up

 I'm calling it quits on Piecemeal Jack for now. This is as far as I got: I built everything I had planned, to some extent, and the resu...