{"id":19190523,"url":"https://github.com/indigoparadox/dsekai","last_synced_at":"2025-05-08T04:49:20.191Z","repository":{"id":37678140,"uuid":"377042708","full_name":"indigoparadox/dsekai","owner":"indigoparadox","description":"Minimal world engine for old computers. Scriptable NPCs, growable crops, editable maps, in glorious CGA (or VGA).","archived":false,"fork":false,"pushed_at":"2025-04-05T05:01:23.000Z","size":3327,"stargazers_count":27,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-08T04:49:11.934Z","etag":null,"topics":["8086","c","cga","classic-mac-os","maug","ms-dos","palmos","pre-alpha","roguelike","sdl2","win16","xlib"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indigoparadox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-06-15T05:09:21.000Z","updated_at":"2025-04-13T16:22:09.000Z","dependencies_parsed_at":"2023-02-12T11:00:58.365Z","dependency_job_id":"87157fe5-1677-42ee-b058-5bf6597add48","html_url":"https://github.com/indigoparadox/dsekai","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indigoparadox%2Fdsekai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indigoparadox%2Fdsekai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indigoparadox%2Fdsekai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indigoparadox%2Fdsekai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indigoparadox","download_url":"https://codeload.github.com/indigoparadox/dsekai/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253002842,"owners_count":21838637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["8086","c","cga","classic-mac-os","maug","ms-dos","palmos","pre-alpha","roguelike","sdl2","win16","xlib"],"created_at":"2024-11-09T11:34:45.879Z","updated_at":"2025-05-08T04:49:20.170Z","avatar_url":"https://github.com/indigoparadox.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# dsekai\n\n[![Code Grade](https://api.codiga.io/project/29729/score/svg)](https://www.codiga.io)\n\n* [dsekai](#deskai)\n  * [Roadmap](#roadmap)\n  * [Documentation](#documentation)\n* [Building](#building)\n  * [Datafiles](#datafiles)\n  * [Platforms](#platforms)\n* [Modding](#modding)\n  * [Mapping](#mapping)\n  * [Skinning](#skinning)\n  * [Scripting](#scripting)\n* [Tools](#tools)\n  * [mkresh](#mkresh)\n  * [convert](#convert)\n  * [map2asn](#map2asn)\n  * [headpack](#headpack)\n\n![Overworld Screenshot](screens/overwrld.png)\n\ndsekai is an extremely minimal world engine, intended to run on very old hardware. It is originally targeted to the 8086/8088 CPU with the intention to make it more portable later. See below for a list of supported platforms.\n\nThis project is being built around/in tandem with the unilayer project, in order to create a somewhat-universal framework/library for games on legacy/weird platforms.\n\nThere are also some rough examples of CGA graphics programming in unilayer/graphics/dosg.c, if that's what you're into.\n\n## Roadmap\n\nFeatures that are planned include:\n\n* ASN.1 save dumps.\n* Housing system based on in-game map editing.\n* Item usage and crafting.\n* Minimal resource use (shooting for \u003c500k RAM).\n* Multi-height raycasting POV support.\n* Compile script source files as part of JSON loading.\n\n### Linking and Compiling Considerations\n\nIdeally, this engine will compile with legacy compilers as a general rule. For this reason, the following rules/limitations should be observed within the codebase:\n\n* C should be limited to C89/ANSI C in general. No C99 features should be used. In some cases, not all ANSI features should be used.\n* Except within platform-specific modules that can definitely handle it, dynamic allocation should also be avoided.\n* Except within platform-specific modules that can definitely use them, external dependencies should be avoided.\n\nIn general, these restrictions are relaxed for items in the tools/ and check/ subdirectories (though these should also be limited to C89). For this reason, items in the src/ directory should also avoid depending on items in the tools/ and check/ directories (except for in platform-specific modules that do not have these restrictions that may use the tools/ subdirectory. Nothing should depend on the check/ subdirectory).\n\nItems in the tools/ and check/ subdirectories may depend on the src/ directory freely.\n\n### API Coding Considerations\n\nIn an attempt to keep the API consistent, functions should adhere to the following rules:\n\n* Arguments should be in order of state modifiers **first**, followed by a pointer to the object being modified if no global state is modified **or** a pointer to the global state struct which should be auto-unlocked before it is accessed with engines_state_unlock().\n\n## Documentation\n\nSome attempt has been made at documentation with [doxygen](https://www.doxygen.nl/index.html). Simply run doxygen in the project root in order to generate HTML documentation under doc/.\n\nThis documentation is also available at [https://indigoparadox.github.io/dsekai/](https://indigoparadox.github.io/dsekai/).\n\nThis is a work in progress.\n\n# Building\n\nCurrently, this project uses GNU make to (cross-)build on a GNU/Linux system. Compilers and tools required depend on the desired [platforms](#platforms) to build for.\n\nFor MS-DOS, the INCLUDE environment variable must be set to the location of the OpenWatcom header files (e.g. /opt/watcom/h).\n\nThe script pkgs.sh in the root directory should build the recommended set of packages if the proper compilers are installed.\n\n## Datafiles\n\nThis engine should be capable of retrieving assets (levels, graphics, etc) from different locations, depending on how it was built (e.g. ASN.1 vs JSON maps support). Aside from loading directly from the filesystem, it should be able to use OS-level resources embedded in the binary. On platforms without this facility, a rough approximation of this is emulated using [object embedding](headpack).\n\n## Platforms\n\nThe following platforms are currently supported:\n\n* **MS-DOS w/ CGA Graphics** (Maybe VGA graphics in the future...)\n* **GNU/Linux with SDL** (May work with other POSIX platforms.)\n* **Windows (16-bit/32-bit)**\n* **WebASM**\n\nThe following platforms are mostly functional, but still a little wonky:\n\n* **PalmOS \u003e= 3.5**\n* **GNU/Linux with Xlib** (May work with other POSIX platforms.)\n* **GNU/Linux with NCurses** (May work with other POSIX platforms.)\n* **Nintendo DS**\n\nThe following platforms are planned to be supported but not yet functional:\n\n* **Mac-OS 6/7**\n\n| Platform | Make Target         | Requirements |\n|----------|---------------------|--------------\n| +MS-DOS  | bin/dsekai.exe   | [OpenWatcom](https://github.com/open-watcom/open-watcom-v2)\n| SDL      | bin/dsekai       | SDL2\n| Xlib     | bin/dsekaix      | Xlib\n| PalmOS  | bin/dsekai.prc   | [PRCTools](https://github.com/jichu4n/prc-tools-remix)\n| +Win16   | bin/dsekai16.exe | [OpenWatcom](https://github.com/open-watcom/open-watcom-v2)\n| Win32    | bin/dsekai32.exe | [OpenWatcom](https://github.com/open-watcom/open-watcom-v2)\n| MacOS 7 | bin/dsekai16.dsk | [Retro68](https://github.com/autc04/Retro68)\n| NDS     | bin/dsekai.nds   | [DevKitPro](https://devkitpro.org/)\n| WebASM    | bin/dsekai.js    | [emscripten](https://github.com/emscripten-core/emscripten)\n| Curses  | bin/dsekait      | NCurses\n\n * + Platforms marked with + do not support JSON tilemaps directly.\n\nJust using \"make\" will attempt to build all currently working targets with OS-level resources and statically compiled maps.\n\n## Platform-Specific Notes\n\n### MS-DOS\n\ndsekai is being written to support MS-DOS in real mode on an 8086. This means that it only uses conventional memory. This leads to some technical considerations:\n\n* dsekai uses overlays to page unused engines to disk during execution. The engine .ovl files must be kept with the dsekai.exe file for it to work properly! Please see the Makefile.dos for more information.\n\n# Mechanics\n\n## Items\n\nItems are defined in each tilemap in an array. Through scripts, items can be\ncoped from the item definition array into the player's inventory where they\ncan then be used even if the player is on a different tilemap.\n\n## Crops\n\nCrops are also defined in each tilemap in an array. However, seeds in the\nplayer's inventory only reference the crop GID. This means that crops can\nonly grow on a tilemap in which they are defined. This also means that crop\nGIDs MUST NOT collide between tilemaps.\n\n## Crops\n\n# Modding\n\n## Mapping\n\nMaps are stored as JSON files in the format used by the [Tiled](https://github.com/mapeditor/tiled) map editor.\n\nPlease see map_field.json in the assets directory for an example.\n\nThe following special considerations should be observed for the dsekai engine:\n\n * [Scripts](#scripting) are loaded from the map file according to the rules in that section.\n * NPC (or \"mobile\") spawns are stored in an objects layer called \"objects\". The engine selects the NPC sprite based on its name and its script based on a custom property called \"script\".\n * The static layer of the map is loaded from a layer called \"terrain\".\n\n## Skinning\n\nTBA\n\n## Scripting\n\nInformation on scripting including detailed instruction reference has been [moved into the documentation](https://indigoparadox.github.io/dsekai/group__scripting__instructions__sect.html).\n\nFor the time being, the script compiler can be compiled by using ``make bin/compile``, and then running ``bin/compile \u003cpath-to-script.s\u003e`` to generate bytecode output that can be pasted into tilemaps.\n\nSee ``assets/m\\_field`` for some example scripts.\n\n# Tools\n\nIncluded in the tools/ subdirectory are a few tools required for preprocessing and compiling. These include tools for preprocessing resources from easier-to-edit formats to more compact formats for resource-limited platforms, as well as tools for packing up resources as part of compilation.\n\n## mkresh\n\nCreates header files with resource listings to be included as OS-level resources.\n\n## convert\n\nConverts between various image formats common to resource-limited platforms.\n\n### Usage\n\n./bin/convert [options] -ic \\\u003cin_fmt\\\u003e -oc \\\u003cout_fmt\\\u003e -if \\\u003cin_file\\\u003e -of \\\u003cout_file\\\u003e\n\n### Options:\n\n * -ic \\[In format extension from Input Formats table.\\]\n * -oc \\[Out format extension from Output Formats table.\\]\n\n### CGA options:\n\nThese options only apply to raw CGA files:\n\n * -ib \\[in bpp\\] \\(defaults to 2\\)\n * -ob \\[out bpp\\] \\(defaults to input bpp\\)\n * -iw \\[in width\\] \\(requried for CGA in\\)\n * -ih \\[in height\\] \\(required for CGA in\\)\n * -il \\[in line padding\\] (full-screen uses 192\\)\n * -ol \\[out line padding\\]\n\n### Input Formats\n\n| Type            | Extension |\n|-----------------|-----------|\n| Windows Bitmap  | bmp       |\n| Mac Icon        | icns      |\n| CGA Memory Dump | cga       |\n\n### Output Formats\n\n| Type            | Extension |\n|-----------------|-----------|\n| Windows Bitmap  | bmp       |\n| Mac Icon        | icns      |\n| CGA Memory Dump | cga       |\n\n## map2asn\n\nConverts maps from JSON to a more compact ASN.1 representation for use with resource-limited platforms.\n\nUsage: map2asn \\\u003cJSON tilemap input path\\\u003e \\\u003cASN.1 tilemap output path\\\u003e\n\n## headpack\n\nPacks resources into #include-able header files to be inserted directly into the final binary.\n\nUsage: headpack \\\u003cheader path\\\u003e \\\u003cpaths to files to encode\\\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findigoparadox%2Fdsekai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findigoparadox%2Fdsekai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findigoparadox%2Fdsekai/lists"}