Showing posts with label playable. Show all posts
Showing posts with label playable. 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!

Saturday, June 2, 2018

Universal Sound Board side project

I've been quiet the past month and a half, but I haven't stopped working. I'm still working on the tutorial series for jme3 and I'll hopefully get the next article up in the next couple of weeks. In the meantime I made a fun little soundboard app!

Universal Sound Board

Instead of making a keybinding for every sound file you want to play (ctrl-h for hello.wav, ctrl-g for goodbye.wav) with this soundboard you can make custom "key combos" that lead to your desired sound. Turn on the key-capture with a user defined key (ctrl-v by default) and enter the combo for your sound. This lets you make as many sounds as you want in easy to remember combos! ctrl-v, h for hello, ctrl-v ty for thank you. The possibilities are endless.

The only restriction is you cannot assign a sound "passed" another sound. If you have "h" as hello, you couldn't make "hg" as goodbye, since it'll start playing "hello" first! I suggest you make your combos at least 1 or 2 letters deep to prevent them from stepping on eachother. g-h and g-g could be "hello" and "goodbye" respectively, and you could still use "h" seperately, or as the start of even more combos.

I hope some of you find this interesting and make some fun soundboards. Install a virtual audio cable for twice the fun ;)

Tuesday, February 13, 2018

Gothic is out

Gothic is up on Itch.io, for a multiplayer game it does not have a game browser or any easy-join functionality. You'll have to find other players and share ip's and set up port forwarding. There is a single player challenge mode with a castle prefab to see how quickly you can take it down, but the enemy does not return fire.



This project is now on hold until I can get enough support to justify looking into a central server. With a central server it'd be easy to implement a games browser and host games without forwarding ports, but I don't have the means to support one at the moment.

I have another small to medium sized project in the planning phase right now, Project Field. I'll have some more info on that shortly.

If anyone is interested in playing Gothic feel free to comment and I can set up times to have a server hosted on my personal computer. The only map in the game is 2 teams at the moment but each team can have multiple players controlling it! They share resources and units can a lot of fun can be had assigning roles within the teams and coming up with strategies to counter your opponents onslaught.

It is also extremely easy to add new maps or units to the game. Even though the project is officially on hold (kinda like Reindeer Rearing) I might swing around and add a new map or two. If you like making maps for games take a peak in the /assets/ directory (open the .jar with win rar as if it were a zip archive). There is a simple xml detailing the info for a map, and a text file under /assets/Scenes/Maps that you can append with the xml for your map and it will appear as a selectable map in the game. The challenge castles are a regular xml you can open and modify as well, and can be listed in a map as a valid challenge target.

I apologize for Gothic coming out in such a state but I wanted a chance to put the game out there as an early prototype to see if people are interested in this style of game. Single player would be an awesome addition but writing good ai for an rts is difficult and time consuming, especially for a project I am unsure will be played enough to justify the amount of time involved.

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 25, 2017

Reindeer Rearing early build!

An early build of the project I was teasing is up on itch, Reindeer Rearing!


Reindeer Rearing is a simple game where you have 15 days to raise a reindeer to be the best reindeer it can be among 4 different stats. To train a stat you engage in a mini game related to that stat. When you win the stat is increased. When you lose a corresponding stat is effected negatively.

As it stands it's a pretty early version I put up to enter in the contest I originally started the project for. The mini games are not balanced well, though most do scale in difficulty. It's lacking a lot of art assets and animations as well. There is also no audio in the game yet.

Over the next week or so I will have another update which will focus on adding in more artwork and hopefully getting the balance of the mini games.

While I'm working on art assets for Reindeer Rearing I also plan on implementing my new sprite system into Dungeon Hoard. This won't get uploaded right away as it doesn't add anything performance wise for the player, but it does help maintain pixel accuracy while also making it much easier to add new units and animations.

I'll have a new blog post later this week talking about how I achieve pixel accuracy in a 3d, floating point game engine.

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 ;)