lazy game developer

Showing: 1 - 7 of 7 RESULTS
Game Programming Patterns cover

Книга «Шаблоны игрового программирования»

Game Programming Patterns by Robert Nystrom. В книге рассматриваются различные шаблоны проектирования, применительно к геймдеву. Это не что-то новое, а просто удобная подборка с примерами и доступным описанием. Крайне рекомендую к прочтению, читается и воспринимается книга легко.

Краткий список шаблонов, которые рассмотрены в книге: Command, Flyweight, Observer, Prototype, Singleton, State, Component, Event Queue и прочее.

На английском языке книга доступна в разных форматах на сайте автора. Есть и исходники, и переводы на русский язык.

Worms Zone logo

Worms Zone

A brief story of creating a “clone” of slither.io

The main thing is to believe 🙂

Worms Zone – a game about worms, or slither.io on steroids

At first, I didn’t even think of making a game. I just wanted to try implementing smooth worm movement – where the segments don’t follow the exact path given by the player, but behave more naturally. Yes, it’s a bit more complex and requires more calculations, but the movement looks much nicer and more interesting. My first tests were done in a Java-like language using Processing. After about an hour, I had a working prototype – a project on GitHub.

Watching the worms eat “apples” in my prototype, I decided to move forward with developing a full-fledged game.

I first rewrote the worm movement algorithm in C++ and then began refining it.
The most important part was to pass the “coiling test” – when a player curls the worm into the smallest possible loop. Most games of this kind fail here: the worm’s tail stops moving, and only the head and a few segments follow, which looks awful.

Once I had an algorithm that passed the coiling test, I ran into a new issue: long worms had many “invisible” segments hidden behind others on the screen. Time to refine the algorithm – the tail still follows the head, but the number of visible and calculated segments decreases. When the worm moves straight again, the segment count returns to normal.

Then came the small details: when boosting, the worm should lose mass, becoming shorter and thinner. When moving normally and eating goodies, the worm should grow in both length and width. These details turned out trickier than they seemed at first – always a nuance, and here there were many 🙂

Game development and gameplay evolution

Worm bots were added to the arena, and their AI gradually improved. The first versions of the AI were, frankly, terrible. Now the bots are much smarter – and sometimes even cheeky.

I experimented with the interface. Unfortunately, I’m no designer or artist, so the result is what it is.

Gradually, support for different platforms was added – iOS, Apple TV, Android, Android TV, Web, Linux, Facebook Instant Games, OK, VK, and more. Since development was done on macOS, that was the first platform the game worked on.

I implemented multiple control schemes – mouse, remote control, gamepad, keyboard.

Gameplay evolved with new power-ups: a temporary worm extender; a radar showing other worms on the map; and a 5x multiplier for rapid growth and score boosts.

Balancing gameplay is still ongoing. I haven’t yet found the ideal parameters for arena size and maximum worm count; worm growth and weight loss rates; and the cost of skins and customization.

Over time, the game accumulated various features. Skins with textures were added, and I wrote a simple Photoshop plugin to make textured skins easier to create. It was very basic – it automated only a small part of the process, so some steps still had to be done manually.

A few technical details

All sprites (UI, skin elements, effects, power-ups) are stored as separate files. During the resource build stage, atlases and descriptions are generated – all done via the console. Yes, I love the console. The atlas packer, of course, is my own.

I also wrote a simple shader implementing a “circular indicator” to show remaining power-up time. I based it on one of my older shaders available on ShaderToy. Nothing fancy – it could have been done without it.

The game supports multiple languages: English, Russian, French, Spanish, Vietnamese. Adding a new language is no problem — you just need to order a translation. The game uses the free Google Noto TTF font, which contains glyphs for many languages, and the required character atlas is generated at runtime.

Official Worms Zone website and browser game

ZX-Spectrum +

Неизвестный Синклер

Весьма занимательное чтиво об истории становления компьютера ZX-Spectrum, Клайве Синклере и компании Sinclair Research.

Не все то золото, что блестит.

Цветной, с полноценной клавиатурой, дешевый

К декабрю 1981 года количество проданных ZX81 превысило 250 тысяч. На волне этого успеха, как пена, всплыли недостатки, свойственные полукалькулятору-полукомпьютеру, которым, по сути, и являлся ZX81. Прежде всего, это было отсутствие цветной графики и недостаточный даже по меркам 1981 года объем ОЗУ (RAM). И если недостаток памяти компенсировался низкой ценой и возможностью «прилепить» дополнительные килобайты в виде коробочки RAM Pack, то отсутствие цвета было для ZX81 неисправимо.

ZX-Spectrum 48
ZX-Spectrum 48

В начале 80-х годов в Великобритании больше половины выпускаемых и импортируемых телевизоров — цветные. В Америке аналогичные показатели достигали 80%. Черно-белый компьютер, подключенный к цветному телевизору, выглядел «инвалидом». И хотя на витринах компьютерных магазинов уже красовались цветные Apple, Commodore и Acorn, сделать очередной ZX цветным было очень непросто.

По аналогии с предыдущими моделями, в качестве монитора предполагалось использовать телевизор. Только теперь вместо черно-белой картинки (ZX80, ZX81) нужно было передавать цветную. Сложность состояла в формировании качественного видеосигнала в стандарте PAL. Далее сигнал преобразовывался в высокочастотный (UHF). Это позволяло подсоединить телевизор через антенный (UHF) вход. Добиться качественного изображения было непросто, но такое решение давало максимально простое подключение.

Полная история доступна по ссылкам ниже.

King Valley

King’s Valley on ZX-Spectrum

This is my version of the game King’s Valley for the ZX-Spectrum, which I wrote back in my school years. The game is not a clone of the original MSX title but rather inspired by it. The main character was copied pixel by pixel from King’s Valley 2 with the help of graph paper, a few keen eyes, and a pencil, thanks to my friend Yevgeny Yanushkevich. My brother Ilya and my friend Yevgeny also helped me design the levels. All the development of the game and its resources was done entirely on the ZX-Spectrum.

In the video, there’s quite a serious player – completing the game in just two hours.

In fact, the game turned into quite a long-term project, stretching out, if I remember correctly, for about a year. It was written right after I lost the disks with the source code of my previous game – a port of Knightmare from the MSX.

The game can be found in the World of Spectrum archive and on other sites.

Strangely enough, World of Spectrum claims that the game was released in 1994. That doesn’t quite match reality, since that was already my third year at the Academy, while I had actually written the game back in school.

To this day, I continue working on reviving the game for mobile devices (iOS, Android), TV set-top boxes (Apple TV, Android TV), desktop platforms (Linux, macOS), and the web. But I’m doing this VERY slowly – sometimes putting development aside altogether, and sometimes spending just a few hours a month on it.

King Valley levels map
King’s Valley Level Map
Simple Viewer GL

Simple Viewer GL

Lightweight image viewer powered by OpenGL.

I use this viewer daily for:

  • Quickly browsing through a list of images.
  • Determining the parameters of the area occupied by a sprite on a texture.

Advantages:

  • Compact and fast.
  • OpenGL support for smooth operation.
  • Simple interface for quick image viewing.
  • Sprite parameter determination feature.

Wide range of supported formats:

  • Graphics formats: PSD, AI, EPS, PNG, XCF, JPEG 2000, JPEG, TIFF, ICO, DDS, GIF, BMP, TARGA, PNM, XWD, XPM.
  • Image formats: SCR (ZX-Spectrum), WebP, OpenEXR.

Additional features:

  • Multi-page TIFF.
  • PNG frame support in ICO.
  • View each GIF frame separately.

Advanced features:

  • ICC color profile support: Ensures accurate color reproduction using embedded ICC profiles.
  • Image file information: Access EXIF and other data stored in the image file (<e>).
  • Smooth loading: Loads images in a separate thread with a progress indicator.
  • Convenient navigation: Creates a file list and allows quick navigation to the desired position.
  • GIF animation support: Plays animated images in GIF format.
  • Pixel information: Displays the coordinates and color of the pixel under the cursor (key -p or <p>).
  • Area selection: Allows selecting a part of the image with a frame to determine coordinates and area size.
  • Quick zooming: Convenient zooming of the image using the keyboard or mouse.
  • Automatic scaling: Automatically adjusts the image to fit the viewer window.
  • Multi-page images: Views multi-page images using the PgUp and PgDn keys.
  • OpenGL: Utilizes OpenGL for high performance and smooth operation.
  • Large image splitting: Splits large images into multiple textures for performance optimization.

Simple Viewer GL source code is available on GitHub.

CPP C++ logo

Венгерская нотация

Статья «Как заставить неправильный код выглядеть неправильно», поясняет в чем отличие Венгерской для Приложений (Apps Hungarian) от Системной Венгерской.
Я давно перестал использовать Венгерскую нотацию, которая на самом деле была Системной Венгерской. Но только сейчас понял, почему мне она казалась несколько странной.

Системная Венгерская

char szVar[]; // ясен только тип переменной, но не ее назначение
unsigned long ulVar; // аналогично

Венгерская для Приложений

float spriteWidth; // ширина спрайта
int currentPage; // индекс текущей страницы

Более подробно написано в статье и в ссылках в конце статьи.

ZX-Spectrum 48k

Карты уровней игр ZX-Spectrum

Speccy Screenshot Maps – на сайте размещено более 1100 карт из игр для ZX-Spectrum. Владелец ресурса так же написал утилиту, которая позволяет делать снимки экрана игры в эмуляторе, и утилиту, которая склеит эти снимки в одну большую карту.

King Valley levels map
King Valley levels map