Showing posts with label LUA. Show all posts
Showing posts with label LUA. Show all posts

Monday, May 11, 2015

It's starting to resemble a game

Tools: LUA, Love2D, ZeroBrane Studio

Back in October I made a post about a procedural dungeon generator I was working on for a 1GAM game. Shortly afterwards I decided that I wanted to expand the game way past its original scope, and I wound up choosing to quit 1GAM all together so I could focus on making one good game instead of a dozen mediocre ones.

Unfortunately my dev computer died on me right before Thanksgiving and I wound up shelving the project for a while, until I finally had a chance to come back to it in the beginning of March. I'm making a lot of progress, so I figured I'd post an update going over some of the features I have working in the game so far.

In a nutshell the game will be a rogue-lite dungeon crawler with randomized enemies, weapons and armor. I intend to have some kind of meta-progression to increase replayability and encourage multiple playthroughs.

Currently, dungeons are generated on demand as the player progresses. The player can pick up new weapons and ammo drops from enemies and chests as they go. Here is a short demo of the game as it currently is (very, very pre-Alpha):

Saturday, February 28, 2015

Experiments with Procedural Generation, Part 3

Cave Level Generation: The 4-5 Rule 

Tools: LUA, Love2D, ZeroBrane Studio

I was playing around with my Game of Life project a few weeks ago and I decided to put this together really quick. This is just a quick implementation of the 4-5 rule, often used for procedural cave-like level generation. It was a quick change and only took a few minutes to put together, but the effect is interesting so I figured I'd share it here.

 

The 4-5 Rule
At the start the entire grid is filled with noise. In this example every tile has a 53% chance of being white.

Every step two simple rules are applied to every tile:
- If the tile is black: If 5 or more of the adjacent tiles are white, it becomes white.
- If the tile is white: If 4 or more of the adjacent tiles are white, it stays white.

More work would need to be done to generate any real levels from the result due to all of the disconnected rooms that are generated from this, but there are several solutions which are all pretty easy to implement.

Saturday, October 25, 2014

Experiments with Procedural Generation, Part 2

Conway's Game of Life

Tools: LUA, Love2D, ZeroBrane Studio

A friend of mine from college introduced me to the Game of Life when he built his own for class. Ever since then I've been interested in the subject and I've always wanted to write my own version of it. Since I was planning on learning about Cellular Automata this month, I figured the Game of Life would be a great starting point.



The rules of the Game of Life are:
- Any living cell that has fewer than 2 neighbors dies.
- Any living cell that has more than 3 neighbors dies.
- Any living cell that has 2-3 neighbors lives on.
- Any dead cell that has exactly 3 neighbors becomes alive.

These simple rules working together can create some extremely complex and seemingly-intelligent behavior, which is what makes the Game of Life so fascinating.

My implementation of it has pause/unpause, fast forward, stepping forward, and a series of brushes that should make it a little easier to create complex patterns.

Download the project here.

Controls:
Left Mouse Button - Place cell(s).
Right Mouse Button - Delete cell(s).
Space - Pause/unpause the simulation.
Enter - Fast forward when unpaused. When paused, step forward one tick.
Backspace - Clear the entire grid.
Mouse Wheel - Scroll through the brushes.
#1-6 - Select a specific brush.

Wednesday, October 22, 2014

Experiments with Procedural Generation, Part 1

Dungeon Generator

Tools: LUA, Love2D, ZeroBrane Studio

Since Itch.io is having a procedural game jam in November which I'd like to participate in, I decided it might be a good idea to use 1GAM to get some practice with procedural generation.

My October 1GAM project is a top-down rogue-lite shooter that takes place in procedurally generated dungeons where you fight procedurally generated enemies. The plan is to have a virtually unlimited amount of procedurally generated weapons and gear to collect and choose from. Because the end of the month is nearing I am likely only going to get a simplified version of this done by the end, but I am definitely going to continue working on this game past the end of the month.

The dungeon generation system is pretty powerful and flexible. I can completely change the look and feel of the dungeons being generated just by tweaking a few small settings.

Here are some dungeons generated using settings designed to create disorganized, cave-like dungeons with lots of open spaces:





In those screenshots, green and red tiles mark the entrance and exit of a level, blue marks a dead end which is a place where chests or other nice things can spawn, and cyan blocks mark big open spaces where we can potentially spawn a lot of enemies at once to create some big, interesting battles.

And here are some dungeons generated using settings designed to make more square, man-made looking dungeons with many straight hallways and corners, and few open spaces:





As you can see, just by having a few different predetermined settings to select from I can potentially generate a huge variety of levels that all feel and play completely differently.

1GAM (September 2014)

Tools: LUA, Love2D Framework, ZeroBrane Studio (an awesome open-source LUA IDE)


The title screen, with 3 AI fighting each other in the background.


My 1GAM project for September was a simplistic real-time planetary-conquest strategy game, similar to Galcon or Eufloria. Players fight for control of planets which produce ships, which you then use to conquer more planets. The game keeps going until one side eradicates all opposition. It's a genre that has been done plenty of times before, but it still isn't over-saturated. And it's a genre that I particularly enjoy, for some reason.


Fights are happening on multiple planets simultaneously.


What excited me most about this project, apart from making it in LUA, was the idea of writing an AI for the game. Though the behavior of the AI I planed was simple, it turned out well. It is both challenging and intelligent-feeling, and I could watch the AI fight itself all day long.

If you want to check the game out you can download it on GameJolt.

Next Month

Itch.io is having a procedural game jam in November, so as practice I am putting a lot of procedural generation into my project for October. I already have my procedural dungeon generator working, and I also made my own implementation of Conway's Game of Life to practice Cellular Automata. I will be doing a blog post on procedural generation to cover the two projects later.