Author Archives: Anthony Messina

Screenshot Saturday

Here’s a screenshot showing off the new sprites. The walls definitely need some shadows effects. It’s not perfect, but it’s getting there. Certainly better than how it looked before!

New item and ground sprites

New item and ground sprites

Developer Tool: Atlas Manager for libgdx

I have a problem. My sprite creation workflow goes like this: add a new sprite to a spritesheet, then hardcode the coordinates and dimensions in various places. I don’t even use an atlas. So this week I decided to start using one.

Then I have another problem. It seems most devs have individual sprite files, and use tools like Texture Packer to create a spritesheet and atlas. My sprites are on the sheet itself, in one big image file. (This let’s me easily adjust sprite colors and see how sprites look next to each other) That means I would have to create my atlases by hand. Pre-made tools aren’t an option.

Enter Atlas Manager. It’s a program specifically for libgdx that allows the user to add and remove sprite entries to and from an atlas without the need of creating individual image files for each sprite. Users can edit existing sprites. Animations will also be supported. So far ,it’s mostly a bunch of Scene2d widgets stuck together.

Atlas Manager as it looks today

Atlas Manager as it looks today

It’s nice to finally be comfortable enough with Scene2d to be able to whip something out this quickly. While developing tools isn’t pushing the game towards completion, the goal is to save time in the long run.

Evolution of a Rogue

Here’s a picture showcasing the various character styles I’ve tried out over the months. Gradually I went with smaller, cleaner looks since I’m just starting to experiment with pixel art. Simply choosing the right colors was an ordeal for me. Here’s the guide I used to create the most recent color palette: http://gamedevelopment.tutsplus.com/articles/picking-a-color-palette-for-your-games-artwork–gamedev-1174

Evolution of a Rogue

Evolution of a Rogue

I really enjoyed how the hood turned out. The shadow hides her face really well, giving the hood some depth. Maybe it’ll reappear someday. I’m trying to customize each character, possibly letting the player stylize each person. Class-based hoods and hats impede that idea. So for now, everyone gets a wig!

Implementing Walls

When implementing walls, I wanted 3 things:

  1. Walls would be one tile wide and two tiles tall. Too many base building games already exist with a top-down view.
  2. Building walls would be simple. The player would only need to worry about building the foundation. Roofs would appear automatically.
  3. The player can see what’s behind walls.

20160807aoeoutlinesSo I chose to draw the outlines of things that existed behind walls, similar to Age of Empires II.

ezgif.com-gif-maker(1)And here’s the result. So happy it works!

The relevant code is below. I had to divide some lengths by 16, due to (I think) how my spritesheets are split. The outline shader is from http://www.allpiper.com/2d-selection-outline-shader-in-libgdx/


// draws outlines of objects that are behind other objects
private void drawOutlines(GameData data) {
  // make the off screen Frame Buffer Object the current buffer
  fbo.begin();

  drawLayer(data, fboBatch, SortingLayer.CHARACTER);

  // unbind the FBO
  fbo.end();

  // set the shader
  float outlineSize = .5f;
  startOutlineShader(outlineShader, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), outlineSize);

  startStencilTest(false); // set to true for visual testing

  batch.begin();
  batch.draw(fboRegion, 0, 0, fbo.getWidth() / 16f, fbo.getHeight() / 16f);
  batch.end();

  // end stencil test
  Gdx.gl20.glDisable(GL20.GL_STENCIL_TEST);
}

private void startOutlineShader(ShaderProgram shaderProgram, float width, float height, float outlineSize) {
  ShaderProgram.pedantic = true;
  
  shaderProgram.begin();
  shaderProgram.setUniformf("u_stepX", outlineSize / width);
  shaderProgram.setUniformf("u_stepY", outlineSize / height);
  shaderProgram.setUniformf("u_color", new Vector3(1, 1, 0)); // yellow
  shaderProgram.end();
  
  batch.setShader(shaderProgram);
  
  if (!shaderProgram.isCompiled()) {
    throw new GdxRuntimeException("Couldn't compile shader: " + shaderProgram.getLog());
  }
}

// draw only where the over furniture (roofs, bed covers, etc) HAS been drawn
private void startStencilTest(boolean alwaysOn) {
  Gdx.gl20.glColorMask(true, true, true, true);
  Gdx.gl20.glStencilOp(GL20.GL_REPLACE, GL20.GL_REPLACE, GL20.GL_REPLACE);
  if (alwaysOn) {
    Gdx.gl20.glStencilFunc(GL20.GL_ALWAYS, 0x1, 0xff);
  } else {
    Gdx.gl20.glStencilFunc(GL20.GL_EQUAL, 0x1, 0xff);
  }
  Gdx.gl20.glEnable(GL20.GL_STENCIL_TEST);
}

Shape Racers – Ludum Dare Jam Post-Mortem

screenshot

Tired. Alone. Trying to de-invest myself from the project.

http://ludumdare.com/compo/ludum-dare-35/?action=preview&uid=14965

Initial comments are mixed, but mostly positive. There are recommendations for the game, but nobody outright dislikes it. Racing games with gears systems is a tough sell.

Started off bad. Then was terrible. Then stressful. Then great. But it took me working nonstop around the clock, pushing myself harder than I ever had before.

At least it’s a fun game.

Things I Learned

  • Audio can come later.
  • Things need to be in the game as early as possible, if you want to playtest.
  • For Ludum Dares, stick to what you know.
  • Lists are MVP. Scratch paper too.
  • I need deadlines. If an obstacle comes up, I can put my mind to it and figure out another way.
  • Not everyone has the same background in game design as I do. I’ve seen a lot of videos, and read a lot of tutorials. I shouldn’t assume other people are the same.
  • Model assets take longer than it looks.
  • Audio is magic, and makes the game feel real.
  • Details go a long way polishing a game. Even last minute ones.
  • Unity is great f you want something done fast.
  • Programming is my passion.

Things That Went Well

  • End result is something I’m proud of.
  • Unity’s GUI is great.
  • Unity’s navigation meshes and AI agents are ridiculously simple to set up and run.
  • The tracks are diverse, even without adding lava.
  • Cutting features to focus on a solid entry.
  • Audio is superb.
  • Models came in as dictated. Flat tracks, with same terrains grouped into one object. Made sticking into the game a breeze.
  • The write-up on Ludum Dare is well done, in my opinion. Especially considering it was last minute.

Things That Could’ve Been Better

  • We could’ve prepared more. Brief everyone on how game jams work, what’s important, and how the development process goes.
  • Design the game as whole in the beginning. Different people had unsaid ideas about the game, and assumed everyone was with them.
  • Assets and game mechanic code earlier would’ve helped playtesting.
  • I could’ve been more understanding with comments about the game. Ask myself why they’re suggesting things. Usually they were right.
  • More sleep. I got 3.5 hours the last night.

It’s disturbing how it’s the day after, and I have no motivation to work. I made a list of improvements, but every time I come across a difficult problem while coding, I shut it down and go browse the web, or play a game. The pressure of deadlines is real.

Can’t wait for the next one.

Ludum Dare 35 – Shape Racer

The theme: Shapeshifting

The participants: Me, Lou, Vin, and Leo

The game: Shapes and shifting galore.

——————————-

SHAPE RACER

screenshot

First, they ignored you. Everyone knows only Spheres can compete in the drag.

Then, they laughed at you. An n-sided polygon? Who does this Shape think it is?

Now, they race you.

Compete with the Spheres for glory over four distinct courses, and prove to the world that n-sided polygons have what it takes.

Controls:
——————————-
W/A: Accelerate/decelerate
S/D: Turn left/right
MMB/RMB: shapeshift
Tab/Shift: Shift gear up/down
——————————-

Hints:
——————————-
Some shapes are better at navigating certain terrain than others. Use the upper-left guide to know which shape you should be.

Not going anywhere? Try down-shifting;

 

Ludum Dare Entry

twitch.io

Hopeless Place – a Postmortem

Ever listen to a song that transports you to a different place? Hearing We Found Love by Rihanna takes me to a mystical place, full of light and sound. So I made a game about it.

Hopeless Place

Here’s the page with a link to the download.

The first thing I did was go through the lyrics. I was surprised to see that only the chorus and one verse could be easily adapted to a game. I took those lyrics, made each line into a gameplay element, and started programming.

What went well:

  • Entity-Component-System. I listened to a talk on YouTube about how to use databases in games. “If you don’t understand the data, you don’t understand the problem.” It made things so much more manageable by cutting down on classes and inheritance. I’m still trying to figure out how it can be applied to AI systems.
  • Scripting. I probably should’ve used a real scripting language, but instead I used libgdx’s actor action methods to get the job done. For my first time using scripts, it was easy to start and worked very well in my opinion.
  • Debug controller class again was critical in testing out different aspects of the program on the fly. It loaded scripts, reset animations, and quickly moved between levels. I had implemented one for Spirit-uality where it literally saved the game, since time was of the essence. In the end, I just commented out the line of code that added the debug controls to the game and it was ready for production.
  • Hit detection turned out to be simple. For Hopeless Place, I only needed very basic triggers, so I just programmed my own. I know it’s not efficient; I calculate all collisions twice a frame to check for old and new triggers. Turns out computers can handle lots of computations.
  • Finishing. On the subreddit /r/gamedev, users are always suggesting to finish your game before moving on to the next one. Otherwise, you’d never have anything to show to people. I took this to heart when I got thoughts of abandoning ship to start yet another project. While not everything I wanted made the final cut (I never added the ambient music I picked out, for example), the game is complete from the start menu to the final scene.

What could’ve been better:

  • Sprites. I got lazy at the end, and didn’t do a final pass for quality. Hell, I didn’t even replace the placeholder tree sprite! I don’t know if I was going for a top-down or 3/4 view or what. A graphics bible would’ve been helpful. The sprites were definitely not what I had in mind when I started this project (I imagined an FPS game).
  • Lighting. Placing lights close together made things super bright. I could never get the colors or distance where I wanted them. Instead, I took an artist’s approach and let the pieces fall where they may.
  • Data organization. A real database would’ve been amazing. Instead, I faked it by using HashMaps as two-column database tables, and implementing classes for more advanced tables. Then again, perhaps I should’ve used more of those kind of classes, not less.
  • Music. While boscaceoil helped transpose the sheet music into .wavs, the music is super simplistic. I’d still like a more fleshed out music system, but I got bored of programming this game before I could make one.

What was terrible

  • Gameplay and puzzle elements. The tree “puzzle” isn’t a puzzle. I imagined the final torch placement to be more of a puzzle than what it turned out to be. Maybe an action button would’ve helped, instead of just walking through things and having the game take care of itself.
  • The final product as a Video Game. You walk around until you can’t. It reminds me of Dear Esther, or Stanley Parable. At least you could interact with the world in Stanley. A few more days brainstorming a game people would want to play would’ve been helpful.

All in all, I’m glad it’s done, and while it isn’t the vision I had in my head, I learned a ton and the new tools and techniques really helped my game development skills.

Onwards and upwards!

 

Programs and resources used in the creation of Hopeless Place:

Spirit-uality: A Post-Ludum Update

I made a post-Ludum update to Spirit-uality. A lot of things bothered me, and while it’s not the best it’s certainly now more pleasing than the first submission. I still hate the music and sounds, but I don’t have a good grasp on how to make better ones. That’s the most important thing to improve on for next time. Glad to finally be done with the game!

Play it here

Spirituality Spirit

 

PATCH NOTES

Bug Fixes:

  • Controls can no longer be set to the same key
  • Spirit now regrows normally after reducing to smallest size

Gameplay:

  • Revamped the final Boss. Will no shoot you until you or it are dead
  • DOWN: hold to prep attack, release to launch bolt
  • UP: spam to raise shields to block the boss’ projectiles
  • Lengthened the world by ten times for those that need it
  • Pressing ‘esc’ now exits the game
  • Game over when the spirit is hit when it’s already the smallest size
  • Six more good deed encounters
  • Tutorial now displays what happens in-game when the user presses UP and DOWN

Graphics

  • Jerry fist pumps on six successes in a row
  • Jerry will have a fit if he misses a good deed when he’s on a streak
  • Sky: changed the texture, and now fades in and out to go from night to day more clearly
  • Added screenshake
  • Spirit hovers slightly in place
  • Replaced default window logo
  • Many textures were retouched