Сообщения

Сообщения за февраль, 2020

Update 26.02.2020

Изображение
Just added some lighting. Looks awesome.

Marching squares in 2d tile-based game

Изображение
Marching squares - is an algorithm that can generate contour for scalar field (only two-dimensional, for three-dimensional you can look at marching cubes , it has the same idea). It's usually used in computer graphic. Why do we need it? So, let's assume you've generated map as grid of "walls" (we will call it as 1) and empty cells (0). If you'll start placing square tiles at this positions, you will get something like this It could be acceptable for some kinds of RPGs or even strategies, but when you have smooth and fluent gameplay you will stumble on corners of your squares. So you need to make your map smoother. And that's where you need marching squares. Look at the difference: That's how my game looks now: Implementation So, as I said previously, we have a grid of zeros and ones. We can encode every four neighbour cells with four bits, each of them will contain value of corresponding cell. So, if first cell contains "1...

New enemies!

Изображение
Today I wanna tell you about new enemies, that I've added to game. Kamikaze This small and slow ship could seems to be not enough dangerous, but when it will come closer, you will be rammed by this thing. Do not underestimate it. Bomber ship Slow and heavy - those words are describing this artillery ship. Despite own slow speed, bullets from its gun will reach you anyway. It even has its own shield! Admiral's Flagship Main ship of expeditionary fleet and also the first boss in Galactic Looter. It has 14 plasma guns and one heavy artillery cannon that will smash you down. Do not stand on his way. It has its own arena. There are a lot of places to hide from Flagship's weapons, but that not for long - all walls are destructible and Admiral will destroy everything on its path. Colorful things on the left and right sides of the map are portals, that can teleport ships and bullets. But be careful: bullets that went through the portal will hit anybody on the...

Experience of implementing Cave Generator using cellular automaton

Изображение
There are many algorithms of generating level maps. I wanna tell you about generating cave levels via cellular automaton Getting started So what actually is a cellular automaton? Simplified, cellular automaton is a grid of cells, each with one of different finite states. Cell's states are switching according to some set of rules. We will have "Wall" and "Empty" states. Initial states of cells would be chosen randomly. When generating caves usually use rules of these kind: "Wall" becomes "Empty" if there are less than X "Walls" "Empty" becomes "Wall" if there are more than Y "Walls" X and Y characterize work of our generator. Some pairs of (X, Y) will lead to fast filling out of our map, some will lead to fast emptying. Moreover, on some (X, Y) we will have Game of Life . Implementation But we are here not to stare at entertaining cell's state switching forever. We can't let our m...

So, it's the first post about game.

Изображение
At first, I should say, that I'm not just started development. I work on it since summer 2019. But I had a laaaarge breaks, coz I'm student and I'm lazy. So what do I have now?  Map generator! I use cellular automaton cave generator with simple rule: cell type (floor or wall) is chosen according to it's neighbours. It works for 5 rounds and then connects caves into one big cave. You can read more about it in this article . Enemies! Yet just one type of simplest enemies: they are randomly spawn on their spawnpoints (that are instantiated in map-generating time), fly towards you and shoot, when you are too close. I use BFS algorithm to find path from enemy to player and let them go, when player in detection range. On this screen you can see enemies (red-black ships), player ship (drawn by my friend), enemies path (red lines) and their current direction of movement (green lines) Editor! A little bit chunky, but actually it works and I can load level...

Welcome

Hi there! Welcome to my blog. Here I will post about development of my game. I'm a student, so i don't think that there will be regular post, but I will do my best to keep this blog updated. Intruments, that I use: Unity  Aseprite (for drawing sprites) Microsoft Visual Studio 2019