Showing posts with label ludum dare. Show all posts
Showing posts with label ludum dare. Show all posts

Tuesday, October 29, 2019

Physics are fun! Also Ludum Dare 45

Hello everyone, I hope you're having a fun Halloween time! I've spent most of the last few weeks working on costumes for the family, but I've also managed to squeeze in some programming, and even another fun project that my wife suggested and is co-producing!

Early this month was Ludum Dare 45! I thoroughly enjoy attempting this jam and I was looking forward to giving it another run. The theme was "Start with nothing" and I set a restriction to NOT make another 2d sidescroller action game. Instead I started with the idea "Open a shop in a back alley as a homeless person." I do wish to take a moment and say I recognize the sensitivity of this topic. Many cities in the US are facing a major problem with homelessness, and I strongly feel the position of many citizens and governments are actively making the situation worse. This helped shape the tone of my game to focus on the desperation of such a situation.


Every morning random garbage spawns in 2 back alleys. You must collect this garbage and attempt to talk to people to find anyone willing to give you money in exchange for this garbage. "One man's garbage is another mans treasure." If you are unable to raise $10 by nightfall you will not have enough money for food and water, and will not survive the night. To make things even harder every item is made up of a grid which takes up space in your inventory. Your inventory is pathetically small at 2x5, with items being 1x1, 1x2, 2x1 or 2x2 in size.

Just because you manage to fit an item in your jacket doesn't mean you'll be able to sell it. People are not willing to stop and chat with a homeless person and will largely ignore you. If you don't have exactly what someone wants, when they want it they'll continue on their way and get the item from somewhere else.

This game took me right up to the deadline to finish and is missing many features I had hoped to implement. That said if you are interested I have posted a playable version to Itch and the source code is available on Github.

I've been really focused on working through physics and collisions for Project Bogie. I know I want rather large environments and a system that integrates well with my entity-data structure, so I figured I could tackle most of the collisions from scratch. This is working pretty much as well as I had hoped, with some parts going very smoothly and others being kind of a pain, but progress is being made every week and I can't complain about that!

The flight physics I want to try are loosely based off real aerodynamic lift models. I am boiling the flight dynamics I wish to see in each aircraft into as few tables as possible. I am not trying to make a simulator so everything is being focused on feel.

I should note that I do not plan on including any real world vehicles. Everything will be fictional and slightly futuristic. I find the aesthetic for Crimson Skies very appealing.

Debug boxes showing the OcTree, a heightfield broken into multiple parts and a couple of box colliders
Collisions are causing a bit of a headache. Object to object collisions were surprisingly straight forward to implement and I am very happy with the results. Terrain is currently problematic and I have gone through several iterations to find what works the best. I do not need incredibly accurate terrain collisions to get a functional prototype working, I do need one that works consistently. This is likely going to be my focus for the next week or so.

Until next time!

Monday, December 4, 2017

Post Ludum Dare #40

Ludum dare was by far some of the most fun I've had making a project. Having the feed with other creators open in the background really gave me the motivation to keep moving forward. Even when I realized my codebase was becoming quiet shaky, I pushed through. I have a finished game! It is small and not well balanced, it becomes quiet repetitive, but it works the way it should, and I am very happy I submitted it.

You can play it here.

Friday night when the theme dropped I quickly started brainstorming. I decided on defending an ever growing hoard, with the number of enemies directly corresponding to the size of your hoard. I opened a text document and quickly jotted down my basic game loop:

"you're a swordsman, you run around collecting gold coins
the more coins you have the more enemies spawn to kill you you'll eventually die BREAKDOWN Character-sideways movement, jump, swing sword Enemies- gobs, ignore player rush towards gold if gobs collide with player player takes damage gobs die after 1 hit
player has hp, takes damage from gobs
gobs who leave the area permenantly take the coin with them"

GDD complete!

I open jMonkey ide and create a new project and start importing libraries. I initialize my repo and make a first commit, everything going smooth. Until I realize I made my project inside of another one of my projects directories. I quickly tell jMonkey ide to move the project, but now my repo is messed up. I try to fix to no avail. Not the best of starts, but I'm not to worried.

Next I create some very simple artwork. A simple human, a coin, a pile of gold "poo", some cobblestone, and scribble of a "Gob" - the main enemy in the game.


With some quick artwork finished I can start working on some game elements. This is one of the first times I was attempting something in true 2d, with all pixel art. I knew I needed to keep pixel densities as close to eachother as possible but I didn't know how to approach a spritesheet or 2d animations. I made a simple entity component that you assign a texture to, and the system will create a jMonkey spatial which uses the size of the texture to determine the size of the quad needed for the world. This worked perfectly, for now.

Working without animations is easy, most of the logical code is similar to games I've worked on in the past. I decided I wasn't going to use the library I have been building up with easily re-usable code for this project. I was curious how I would come up with implementing things without using my old code as a crutch. This turned out to be a good thing as I have re-worked systems I have taken for granted in my old library and I believe my new systems are much cleaner. This helped with this project as I could quickly implement exactly what I needed without any added weight.

With dyn4j integrated, character movement functioning and the beginning of the coin code started I decided I was far enough along I needed to start having animations. I needed a way to visualize attacks and goblin states without relying on println's. This is when I realized that nifty system I designed in the beginning was actually quiet terrible for sprite animations.

For sprite animations it's best to have large image maps with every frame of the animation on one image. With my current system this would have caused the game object quads to be huge and the animations to not appear correctly. I was relying on a sprite shader I found in the jMonkey forums from a long time ago (Thank you Pesegato!) which would position a quads uv coords along an image for the specified index, thus making setting the frame as simple as "setFloat(index)". I probably could of found a way around this, kept each frame a seperate image and loaded each image as needed but I believe this would have been much slower.

I wound up making a "bandaid" system which took an animation component, a new image and just stole the existing game object quad to use. Not great at all, but functional.



Fixing the animations took me to the 24 hr mark, I had no sleep at this point and was looking forward to another 24 hours. I used to work 2 jobs so I've been up for 48+ hours in the past, but things are a little different sitting at a computer. I made sure to take frequent breaks. Get up, stretch, grab drinks. Eventually my stamina was wearing thin.

Nearing 30 hours I had finally finished the coin counting and inventory system. It's a pretty reliable system but it is limited. No entity can carry more than 1 coin, and the entityId is simply added to a list of "carrying coin" entities. If the player reaches his hoard his id is removed and he gets +1 hoard. If a gob runs off the world his id gets removed from the list. Gobl spawns are a simple 1+hoard/3.

36-37 hours in I took a nap. Thank you to my ultra-supportive wife who put up with me being grumpy and got me out of bed after 2.5 hours.

The nap helped but I was still exhausted. I wound up finishing art assets, re-doing all the animations and called it done. I really wish I had tried to add in 1 other enemy type and an "end game" boss, but my head was way to cloudy to focus. I wound up posting the project a couple hours before compo ended and went back to sleep.

When I woke back up around 7-8 (an hour before compo ended) my wife asked to play the finished game. I went into my dist folder to open the finished game file as opposed to loading the ide which takes a lot longer. I'm really glad I did because it turns out I had packaged everything wrong! I spent the next half hour or so figuring out what went wrong, fixing it, re-packaging and re-uploading. Still turned in early but now I had at least a working executable uploaded!



Ludum dare was an awesome experience. As a newbie dev this was a kick I definitely needed and enjoyed every minute of it. I already plan on entering the next dare, as well as focus on producing more finished projects between now and then.

Thanks for reading and I hope to see you at a dare in the future!

Friday, December 1, 2017

Ludum Dare 40

I'm in!

It's my first time trying a game jam. I figure I can take the weekend and really put in an effort at making something short and sweet.

Result will be uploaded on itch.io regardless of quality. You've been warned in advance :P