Coder Social home page Coder Social logo

corpse's Introduction

image

Corpse is an easy to get on with full-featured cross-platform modular TDS game engine.

What makes corpse stand out from other game engines?

  • Corpse's a game engine driven on top of the ECS pattern totally, which's one of the most efficient game architecture patterns for smooth development experience. ECS driven engine makes game architecturing process as pleasant as possible. Corpse uses esper, a lightweight ECS module for Python, with a focus on performance.
  • Modularity. It's extremely easy to append new functionality to the game being developed as everything one needs to do is just create a separate Python file with needed components and systems and register them in the executor one. ECS on top of Python makes modular development pretty straightforward.
  • Cross-platform. Corpse-made games can run on any Python-supporting operating systems such as Windows and *nix ones. In the some of multiverses' future it's planned to append mobile platforms support.
  • Convenient GUI level-editing via Tiled built-in support. «Tiled is a free and open source, easy to use, and flexible level editor».
  • Perfomance. You didn't hear wrong. Yeah, the engine's written in Python, a slow programming language, on top of esper, which uses just loops and raw caching mechanism underline. Therefore, corpse provides its own perfomant so-called chunk-system to optimize ECS-component pipeline heavily. The presence of this system softens perfomance disadvantages of the selected stack, we repeat, heavily.
  • Simplicity. Almost everyone out there knows Python, seriously. An evening, and one'll've already known of the ECS principles. Another evening appends Tiled to the stack and... That's it! Really! Anyone can start prototyping their own games with corpse almost from scratch in short periods of time without need of a complex tech background.
  • Simplicity, again. Again, C# and Unity do take time to start; C++ and Unreal Engine do take time to start; GDScript and Godot do take time to start. At least a somewhat heavy game engine do take time to start. Corpse doesn't—this's its one of the heaviest advantage, which completes this fancy seven-point list.

We hope, this list clearly shows how the corpse stands out from the rest of the engines and why you should try it out.

Corpse capabilities

As said before, corpse uses entity-component-system as an underlying pattern to work with game objects. Thus, the completed game made on top of it is just a bunch of sequence of processors (or systems if you will), which are pipelined to process game components. The thing is that corpse already has the big amount of the needed systems and components implemented, so one can construct their own game with them.

See the root directory of the package source code for available modules. Here's list of them with short description:

  • ai (enemy route-making module)
  • animation (everything related to pipelining sprite states)
  • bind (provides system to pin player legs to his body, for examples)
  • camera (centring camera to the player)
  • chrono (daylight-cycle)
  • chunk (chunk system to optimize and lighten up game when it has pipeline of hundreds of components)
  • creature (systems and comps for making entities like player, zombie and so on)
  • effect (effects like redding the screen when player bleeds)
  • event (handle key-related events, like keyboard presses and mouse clicks)
  • item (handle item collision, provides full-featured inventory system and fire-weapon-related processors, also has item-registry initializer and storage)
  • location (makes it able to build a game on top of Tiled-made map containing the most of needed objects already)
  • menu (game menu with background and the needed buttons to start and pause the game, set it up and so on)
  • meta (provides entity metadata components like id and about one)
  • movement (systems to move, rotate and direct movable entities)
  • object (object-related components like size, solid and invisible flags and so on)
  • render (corpse rendering module; responds for displaying game objects as sprites properly, saving collissions, synchronizing animations and so on; one of the heaviest and most important and interesting module to explore)
  • roof (roof component and processor to hide a roof object when player goes under)
  • shoot (fire weapon shooting markers and a processor; provides bullet physics and logic underline)
  • size (provides simple size components with width and height fields)
  • ui (logic related to placing and drawing game-related ui components on the screen, like inventory, tips and so on)
  • utils (a bunch of utility functions to development easier; constants, math, filesystems, creature-making functions and so on)

Demonstration of some of the engine mechanics:

player damage inventory demo enemy kill

Running game engine in sandbox mode

If you want to test engine capabilities, you may edit ./data/world/sandbox/map.tmx file via Tiled (not essential) and run sandbox world with these commands:

poetry install
poetry run python corpse/sandbox.py

Creating own game on top of the corpse engine

Fork the repo and go ahead! See related sandbox world file for the reference.

Corpse's corpsed?

Formerly, corpse was a try to create a TDS RPG game in the post-apocalyptic genre called the Corpse Inc. For now, it's the engine which's planned to be rewritten in Rust sometime as esper's ECS implementation in Python is too slow despite the chunk-system and has no alternatives.

To be truly honest, a team-making of the own game engine on top of pygame, esper and tiled was an amazing experience, which showed us that gamedev sucks. Thanks Yandex Lyceum for making us trying so.

Can I contribute?

Of course you can! Just fork the repo and do the thing.

Credits

Mark Meliksetyan ([email protected]), Anton Grishin ([email protected]).

License

MIT.

corpse's People

Contributors

markmelix avatar alchemmist avatar

Watchers

 avatar  avatar

corpse's Issues

Один цикл collide за кадр

Сейчас в разных системах происходят проверки на sprite collide, из-за чего производительность движка значительно снижена. Можно сделать одну систему, где каждый кадр будет происходить проверка на collide и в зависимости от объектов, подверженных коллизии, на них будут вешаться соответствующие компоненты (это уже можно раскидать по другим системам). В потенциале это ужасающе сильно оптимизирует движок.

Пауза всей игры

Во время паузы вся игра должна быть заморожена и должно быть показано соответствующее меню для продолжения игры и выхода в главное меню (см. #25).

Детали и переход на следующую локацию

Задача:

  1. Раскидать по карте 3 рандомных предмета-детали
  2. Сделать, чтобы при подходе к лодке происходила проверка на наличие именно этих трёх деталей в инвентаре. Если проверка проходит успешно, сверху вылезает всплывающая подсказка с текстом "Починить (E)", если нет -- ничего не происходит
  3. При:
  • наличии нужных деталей
  • нахождении рядом с лодкой
  • нажатии кнопки E
    Забрать детали из инвентаря и произвести телепорт на следующую локацию.

К началу выполнения данной задачи движок должен быть достаточно хорошо сделан и вылизан, чтобы иметь простой и понятный API, через который сделать эту задачу не составит никакого труда.

Chunk-система

Так как на карте будет огромное количество объектов (больше тысячи), а мы используем Enity-Component-System, а наш ECS-framework при получении компонентов проматывает всю db сущностей в цикле, а итерация сквозь 1000+ сущностей каждый раз — это долго — необходимо разработать так называемую chunk-систему (название взято из майнкрафта), которая будет автоматически подгружать в активную постоянно итерируемую на каждом кадре базу данных сущностей объекты, находящиеся не далеко от игрока, из полной базы данных сущностей.

Реализовать подбор предметов

При приближении к предмету по клавише Е можно положить его в инвентарь. Если в инвентаре нет места высвечивается сообщение

Закончить зимнюю локаацию

  1. Уменьшить количество зомби на реке
  2. Поставить вертолёт
  3. Починить пол в зданиях
  4. Доделать интерьер зданий

Добавление Solid объектов в группу спрайтов

В файле object.py создать систему SolidGroupingProcessor, которая будет перебирать все сущности с компонентами Renderable и Solid, и если Renderable.sprite не находится в группе solid спрайтов (эту группу ещё нужно будет предварительно создать как компонент в object.py и добавить в world в fill_world), то добавить его туда.

Распараллелить chunk-систему

Сейчас chunk-система работает довольно медленно и резко, а всё потому что вся работа происходит в одном потоке. Распараллелив процессы, можно будет значительно оптимизировать игровой процесс.

Меню игры

В меню будут следующие элементы:

  • Какой-нибудь аутентичный фон
  • Кнопка для начала игры
  • Кнопка для показа в меню настроек
  • Кнопка "Об игре"

Меню настроек

В меню настроек можно будет производить настройку различных элементов игры. Настройки будут сохранятся в json.

Хранилища

Хранилища позволяют хранить (удивил, да?) предметы.

Улучшения карты

  • Уменьшить количество зомби
  • В зиме добавить место откуда приплывает игрок
  • решить проблему с невидимыми блоками воды (на зимней карте)
  • проредить деревья

Установка точки спавна существ из Tiled

Сделать так, чтобы можно было устанавливать точку появления существ в игре прямо из редактора уровней (Tiled). Например, делаем объект существа на соответствующем слое в Tiled и помечаем его свойством is_player или is_zombie или обозначаем существо каким-либо другим способом, чтобы можно было из игрового движка понять, что этот Tiled-объект является соответствующим существом. А в коде просто перебираем нужные объекты и меняем Position на нужные координаты.

Меню паузы

В меню паузы будет 2 кнопки: продолжить игру, открыть главное меню.

Нарисовать летнюю локацию

Совместно нарисовать летнюю локацию, используя Tiled. На локации должны быть:

Ground

  • Трава
  • Земля
  • Асфальт
  • Дорога

P.S.
Воду наверное не стоит использовать, так как придётся добавлять в игру логику взаимодействия с ней.
Песок можно, но вряд ли он органично впишется.

Objects

  • Кусты(разных видов)
  • Деревья
  • Пни
  • Ящики
  • Камни
  • Предметы
    • Еда
    • Медикаменты
    • Оружие
    • Патроны
    • Броня
  • Обломки самолётов
  • Разбитые машины
  • Бочки
  • Дома + интерьер
  • Стены из мешков

Creatures

Интерфейс

Система распределения компонентов

При инициализации игры предметам должны получать нужные компоненты. Например ружье имеет тайлд-свойство "is_fireweapon" инициалищации игры эта сущность получает компонент FireWeapon

Переделать весь рендеринг

Сейчас рендеринг (файл render.py) работает прекрасно и стабильно, но очень медленно и не оптимизировано, из-за чего даже с chunk-системой (#7) игра подлагивает (хоть эти подлагивания и не значительны).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.