Giter Site home page Giter Site logo

roguelove's Introduction

roguelove

Roguelike code written in Lua, based on Possession. Designed to be used with the LÖVE game framework (http://love2d.org)

Currently not a full game, but has some test content. If you want to start from scratch, rename or remove the data/ directory, and rename the data_empty/ directory to data/

Highlights:

  • Supports creatures and items, as standard, but also has support for static map features (like trees, pits, or doors), fired projectiles, and dynamic effects (like poison gas clouds or fire that spreads on its own).
  • Items and inventory
    • Equipment can add stat bonuses, have callbacks when various things happen, and grant abilities when worn.
    • Support for ranged weapons, with attached ranged attacks and capable of using multiple types of ammo with varying effects. Throwable items can also be created.
    • Well-defined (but optional!) crafting system.
    • Items can have proper names (including players renaming items if they want).
    • Item enchantments: Currently have effects for melee weapons and projectiles. Enchantments can add prefixes and suffixes to item's name.
      • Melee weapon enchantments: Can add hit and critical conditions to an attack, can modify a weapon's stats (damage, accuracy, etc.), can run code after either a hit or miss occurs. Can add extra elemental damage, and only apply that damage to certain creature types if desired. Can be permanent, or can last for a set number of either attacks, successful hits, or kills.
      • Projectile enchantments: Affects thrown items, or ammunition. Can add hit conditions to a projectile attack. Can modify damage done by a projectile. Can modify hit chance of a ranged attack (if applied to a thrown item only, not ammunition). Can run code after the projectile hits or misses. If a projectile leaves an item behind, the projectile's enchantments are carried over to the item left behind.
      • Armor/equipment enchantments: Can add bonuses or callbacks to the armor. Enchantments on other types of items (ranged weapons, armor).
    • TODO: Getting NPCs to use items and change equipment.
    • TODO: Auto-comparing an item's stats to your current equipment.
  • NPC (and player) factions
    • Factions can determine NPCs' hostility or friendliness to the player, to other faction members, and to specific creature types.
    • Players can gain or lose favor with factions from killing specific creatures or creature types. Factions can view the player as an ally or enemy depending on their favor level.
    • You can join, learn spells from, trade items with, receive services from, learn recipes from, and get missions from factions.
  • Stores
    • Stores can dynamically generate their inventory from a list of tags rather than it being pre-defined (though pre-defining store inventory is also an option).
    • Stores can also offer "services" (arbitrary chunks of code that can do whatever) and teach abilities.
    • Stores can be defined with a list of tags they'll buy (or, again, a list of specific items). You can sell items to the store matching these tags rather than having to pre-define every single item the store will buy.
    • Stores can use an item as a currency rather than money.
    • Different instances can exist of the same store with their own inventories (eg. a weapon store shows up every level, but has different items every time)
  • Maps
    • Many customizable built-in map layouts, including rooms-and-cooridors, natural-looking cave-like maps, and mazes (including natural-looking cave-like mazes).
    • Map types are defined that include what sorts of creatures and items can spawn on the map.
    • Multiple "branches" can be defined in game. Each branch has its own defined number of floors which the player moves up/down along linearly.
    • Each branch has a list of map types it uses to generate its floors, and can generate them in random order or force specific map types to spawn at a given depth.
    • By default, you can return to previously-visited floors within a branch, but this can be turned off.
    • Branches can be set to ensure each floor within the branch is a different map type, so it doesn't repeat.
    • Branches and MapTypes can define the specific creatures/items that will spawn in them, or list creature/item types, factions, and tags they'll pull stuff from.
    • Room and map decorators can be defined that customize appearance and content of rooms and maps.
  • Spells/abilities
    • Robust ability system, with support for active and passive abilities, as well as abilities that can be toggled on and off.
    • Active abilities can use MP, have cooldowns, have a set number of charges, or none of the above.
    • Abilities have a variety of callbacks that can run at various points in the game.
    • Abilities can appy passive buffs/debuffs.
    • Abilities' stats can be upgraded.
  • Skills
    • Extremely customizable creature skill/attrbitute system. "Skills" are defined per-game, and the base engine doesn't assume any creature has any given skill.
    • The game can set given skills or stats to use as melee and ranged hit/damage, and dodging bonuses. Creature definitions and item definitions can override these to use their own skills. For example, you can have a default Melee skill for most weapons but have a magic weapon that gives extra damage based on your Magic skill instead.
    • Skills can grant spells, increase creature stats, and grant bonuses automatically when upgraded. Skills can also grant the option of purchasing spells from the character screen.
    • Skills have all the same callbacks as spells/items/conditions.
    • By default, you increase skills infinitely at 1 per point. But you can cap them, or cause them to increase by more than 1 per point. They can also be capped to 1 if you just want a skill to be "you have it or you don't" instead of having skill ranks.
    • Skills can be assigned to different categories that use their own points, so you can for example, split them into Attributes, Skills, and Feats D&D-style, or have special class or species-specific skills that level up with their own points.
  • Conditions
    • Creatures can suffer/benefit from conditions, which can have callbacks that can run at various points in the game.
    • Conditions can apply passive buffs/debuffs.
  • Events
    • Events are arbitrary code chunks that can run at given points during the game.
    • There are four times that events can be checked to run: Entering a map, entering a map for the first time, killing a creature, and randomly.
    • Events can be associated with a faction, and can be set to only run if the player's favor is above or below a certain level, or only if the player is a member of the faction.
    • Events can be set to only run a limited number of times during the game, have a set rarity, and can have requires() code that determines if the event can be run at the current time. They can also just be run manually, if desired.
  • Missions
    • Can be given by factions.
    • Can have callbacks that runs while the mission is active.
    • Can have any amount of unique data stored and tracked as part of the mission (for example, storing the definition of a specific item that needs to be found).
    • Game setting to have all players start with given missions. Starting missions can also be set by the player's class.
    • Can be repeatable, or only occur once.
  • UI/UX:
    • Save/load system.
    • Fully rebindable keys, also completely playable with only the mouse.
    • Achievement system.
    • Tutorial system.
    • Animated effects and creatures.
  • Miscellaneous:
    • Customizable NPC AI enabling a range of behaviors. For example, ranged creatures prefering to keep a distance, creatures moving between patrol points or guarding certain areas, creatures with varying degrees of aggression and fear. NPC behavior also interacts with the faction system mentioned above.
    • Many game features are customizable and optional. For example, you don't have to have crafting (or even items) in the game, can disable species/class selection, bosses, etc.
    • Map features can have "actions" attached to them.
    • Many types of content can have "tags" attached to them, which are used to dynamically determine where that content can be used, rather than having to explictly define what items/creatures/etc are available where.
    • Lighting system. Entire maps can be lit or unlit. Map features, creatures, projectiles, and items can cast light in unlit maps.

Incomplete guide to using the Roguelove engine

Trello board I'm using to keep track of tasks

Incomplete documentation of the code

Available under the MIT license if you want to use any of the code. If you do use it, please let me know! I'd be interested to see what you make with it.

roguelove's People

Contributors

vaughantay avatar rorkh avatar

Stargazers

 avatar Matthew Blanchard avatar The Finch Company avatar Yegor Budylin avatar Matt Kelly avatar  avatar  avatar Stefan Devai avatar  avatar Augusto Baffa avatar Andrés Brugarolas avatar Richard Dally avatar loathing avatar mohamad hani janaty avatar  avatar Bruno Meyer avatar  avatar Joe avatar  avatar  avatar Sergiy Tkach avatar Jimmy Angel Pérez Díaz avatar Vijay Rudraraju avatar Joohun, Maeng avatar Sergey Pestov avatar  avatar Ondřej Míchal avatar doublah avatar Marvel Wild avatar

Watchers

 avatar  avatar  avatar

Forkers

rorkh brugarolas

roguelove's Issues

Change modding system

It's would be cool to have modding system similar to Cataclysm DDA game:

  • All mods have same structure (kindaa similar)
  • Base game data is in it's own mod (not similar :( )
  • Each mod loads it's own data (similar)

So I suggest to move data files into it's own mod (there will be no data folder, so make global variables for all data) and during mod load each supported file in each mod will merge it's return with global variable.
Like

-- Global data table
data = {achievements = {}}

-- Load mod with name 'name'
local function load_mod(name)
   -- List of file names to load from mod (all filenames that now in data folder)
   local files = {'achievements'}
   -- Load each file
   for _, part in ipairs(files)
      local path = 'mods/' .. name .. '/' .. part
     
      if love.filesystem.exists(path) then
         -- Get returned table from mod file
         local mod_data = require('mods/' .. name .. '/' .. part)
         for k, v in pairs(mod_data) do
            data[part][k] = v
         end
      end
   end
end

So core data as other mods will have same structure and loading will be simplified (because of unification), And it will be possible to delete core data because global variables for data containment will be created not in data files.
I can do PR for this but idk if there will be changes to data.

Status? Is this still alive?

Just wondering about the status of this project. Is it complete or at least useable? If not complete, what is outstanding that a dev would need to know about before using this framework?

data/ai.lua:464: attempt to index field 'target' (a nil value)

Got this error when played, attacked the enemy.
I was unable to copy error (Ctrl + C or tap didn't worked) so I wrote some part of it by hand (to copy and navigate to main error functions) and attached the screenshot

Error

data/ai.lua:464: attempt to index field 'target' (a nil value)

Traceback

[love "callbacks.lua"]:228: in function 'handler'
data/ai.lua:464: in function 'moveAlongPath'
data/ai.lua:140: in function 'basic'
classes/creature.lua:937: in function 'advance'

image

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.