Showing posts with label finished. Show all posts
Showing posts with label finished. Show all posts

Monday, February 12, 2018

One Game Mechanic Jam 3

This weekend I took part in a little game jam held on Itch.IO by Game Dev's Quest. I kept the game super small this time with the focus only on interactive buttons and dials on pre set machines. Here's my submission.



LemurUI really helped a lot this time around. It's strong integration with jMonkey engine allows the ui to be implemented in any way you can imagine within jMonkey's scene graph. This means all those 3d buttons, the lever and dials are all gui element "MouseEventControls" and mouse event listeners. The ability to put this control on any spatial in the scene graph is awesome and something I will definitely make use of in the future!


I also used ZayEs entity/component system again. This is simply my favorite addition to jMonkey and really makes storing data with game objects a breeze. Each station added or changed components based on user input. The bottle spatials were also handled by the components using the component filter system which is something I haven't tried before. It's probably not the cleanest way to do things but it really allowed for rapid prototyping and I always new exactly what code was responsible for different things.



I had fun in this jam and look forward to the next one ;)

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!

Monday, March 6, 2017

Bork Pawtrol

This week I was challenged to make a game themed about internet memes by my wife... I'm not entirely proud of this one, though looking back at it I realize it has far more assets and stuff going on than any of my previous games. This week I bring you, BorkPawtrol...

So what is BorkPawtrol? well for those who don't know Bork is the sound a Doge makes... apparently... and Pawtrol was a fun play on words apparently... Originally I was asked to clone MoonPatrol, which I wasn't opposed to but I thought I had enough space-themed last month so I wanted to try something fresh. I went with an infinite runner where you control Doge, bork other internet memes and try not to fall in holes by turning into a corndog...

Controls are simple: Right arrow fire a bork. Borks will kill any meme they hit. Holding Up arrow will transform you into a corn-dog. Corn-dogs can fly, but corn-dogs cannot bork. Corn dogs will fly over pits, but will run into Shoop Da Woops. Press M to toggle music off.

What troubles did I run into this week? Mostly animation, and not game engine related. Blender wanted to fight me every chance it could. Mostly with the ogre-xml exporter which I had never tried before. I'm fairly sure I understand it's issues now and will be able to avoid these headaches in the future.

Tools used: jMonkey, Zay-es, Lemur GUI, Blender, Krita

Download URL
https://drive.google.com/open?id=0Bz4nByoX2Ks7OEQtRGhpSDJhSXc

Sunday, February 26, 2017

Landing on the Moon

Hello again, this week I bring you, jLander! A game where you must successfully land a lunar module on the moon. Careful, you have limited fuel and every input needs it! You get points by landing on a zone (smaller = more) and having extra fuel remaining. Landing zones are highlighted green. Landing empty means you won't be able to return to orbit.

I am going to stop bundling a runtime environment to keep download size smaller. If you are having trouble getting the app to work, be sure and download the latest version of Java here.

As usual I made jLander with the help of JMonkeyEngine LemurGui, Zay-Es, and this week I used dyn4j for the physics.

The hardest thing about jLander was setting the proper win or lose states. Turns out theres alot of different ways to win or lose, and I most likely missed a couple! For those who are curious, you are considered landed when: The lander is in contact with the terrain, the lander is pointed +-3 degrees from straight up, the lander is not applying thrust, the lander is not out of fuel and finally, when the lander has not moved more than 0.4 world units for a total of one second.

A short review for dyn4j. It took me the better part of 2 days to be fully comfortable with how dyn4j operates. Now that I am familiar I believe it will be easier for me to implement the engine and its features in the future. That said, the documentation is rather lacking. I gather that for the most part dyn4j is intended to be freely integrated how the user sees fit. This has positives and negatives but I believe I will attempt to use the library in future projects where it makes sense.

There is a known glitch where if you crash while applying thrust the particle effect continues to play. I could probably iron this bug out, but particles were one of the last things I implemented and I'm honestly feeling done with the game as it is now. Sorry :p

Download link:
https://drive.google.com/open?id=0Bz4nByoX2Ks7S2ZKRlRaNUJBLWM

Monday, February 20, 2017

jSnake!

This weekend I finished another game, this time a Snake game. As far as gameplay goes it's a very basic snake game, there's only 1 objective and that's to eat as many coins as you can without eating yourself or a wall. Arrow keys or WASD for controls, M toggles the music on and off and Enter will reset you when you die. There is a secret way to make the game go faster, which also awards you more points every time you eat a coin ;)

As far as the technical side of things the game itself was actually super simple. I made it in jMonkey again, with zay-es and lemur gui like last time. The game itself is actually just a grid of numbers with each number representing either empty space, a wall, a coin or a part of the dragon. Every time the game world updates it advances the head of the dragon by the currently chosen direction (just hold the direction you wanna go) and it will remove the tail, all the other numbers stay the same. If a coin is eaten it doesn't remove the tail this round, so it will grow.

The hardest part was getting the game to be visualized in 3d. I accomplished this by breaking my map down into several parts.

First, the Dragon (or snake as it's usually referred to internally) is a list of coordinates which are written to the map every time it updates. This list is ordered so I always know where the head and tail are, and I can keep tabs on each part of the body. The head and tail always exist and they just update their positions, a new body needs to be created every time the coin is eaten though. At first I thought the entity component system would make this hard, but in practice it made it super easy to update the body without much work.

The coin is rather simple. The 3d model is actually always present, it just gets hidden when the coin is eaten. Then the game will attempt to place the coin somewhere on the map, once a frame until it's successful. The larger your snake the more attempts this will take. I suppose theoretically you might get to a point where it takes several of the games turns before a new coin actually appears, but in practice you're more likely to get bored and bite your own tail before then. (editors note: 1 game turn = alot of frames)

The maps 3d model is updated on a reset. This is to allow the possibility of a map re-size, but for the purposes of this demo I just left the size fixed.

Once again you can download the finished game by using the url below. I posted a win32 build and the JAR so if you have Java installed it should run on most operating systems.

https://drive.google.com/drive/folders/0Bz4nByoX2Ks7NGd5X0QzWjVFSjg?usp=sharing

Friday, February 17, 2017

Intro and jAsteroids!

Hello and welcome to my gaming blog! This blog is a place for me to post about what I'm working on as well as links to things I've finished.

My goal is to make a game a week for at least the next year. These games will likely all be small, and most of them clones. I'll detail out the creative process for each game and be sure to highlight areas where I had trouble so hopefully you can learn to make games as well.

Last weekend I finished my first game, jAsteroids! This is a simple asteroids clone coded in Java using jMonkeyEngine and zay-es. I followed zay-es tutorial rather closely to implement the spatial rendering, but most other code I had to create myself. I implemented a super basic collision detection for every collide able object in the scene. The asteroids are defined by an integer, 1-5 which corresponds to their size. Every time an asteroid collides with something non-asteroid they are destroyed and spawn 2-4 asteroids of the next size down, until size 0 where no more will spawn. The game ends when you clear the screen. Write down that score and re-start to see how high you can get! (sorry, no persistence between levels, I only had 3 days)

Your ship has 3 health before it explodes. So fly safe and clean up those asteroids ;)

You can download by clicking the jAsteroids above, or by using this url below.
(sorry, win32 only for now, if you would like to see other OS's let me know!)
https://drive.google.com/open?id=0Bz4nByoX2Ks7QV82UUViekxjWUU

I will be taking suggestions for what games people would like to see made over 1 weekend.
This weekend will be a Snake game ;)