Coder Social home page Coder Social logo

hades's Introduction

Hades

NOTE: this library is still in early development. Hades is a 2d game framework library containing many utilities, classes and subsystems for use in games.

Synopsis

Requires C++17

Examples are held in the hades-examples repository

Features

Parallel Jobs: A parallel task subsystem for managing many small tasks across multiple threads.

Console: A console command parser and property storage object. This acts as the backend for a quake style game console. It supports many of the expected console functions, running commands, setting named properties that the game can use, and rebinding input commands.

Archive Stream: A SFML compatable input stream that reads from zipped archives.

Data Manager: A resource loader that loads files, properties and game values from game manifest files.

Curves: Curve based value storage, allowing access to the complete history of the value, and for interpolated values.

App: An application class that uses the framework utilities to manage game states, frame timing and other common game tasks. NOTE: this class is automatically instantiated with a provided main() unless HADES_NO_MAIN is defined during compilation.

Transactional storage: Provides multithreaded wrappers for arbitary objects, providing value guarded or shared mutex semantics. Also provides a transactional map class that locks the map a short as possible and only locks individual entries to update them.

property_bag: a type erased map, capable of storing any copiable value and retrieving it.

modules

hades-util

Contains utilities used by the library, but not related to the goal of the library

hades-basic

Contains classes, interfaces and functions that can be implemented only with standard C++

hades-core

Contains the remaining library features that depend on zlib, yaml-cpp, sfml and sf-gui.

hades-app

A full engine application built using the library

hades example

See the /test project for a simple example of building hades and starting a user specified gamestate.

hades's People

Contributors

cyanskies avatar

Stargazers

 avatar

Watchers

 avatar  avatar

hades's Issues

Server support

Add support for a built in server with connection and curve syncing functions

a server consists of a Server/Trunk and one or more server/branches.

only one trunk can be run at a time, and a client can only connect to one trunk.

branches represent sub-instances of the game, like different areas in diablo2. branches may communicate with each other through the trunk. and the trunk may be responsible for data that is persistent between branches(such as player data)

Animation system

ability to command a sprite to load an animation, with a fallback default animation.

an animation contains the texture reference it needs, plus all the data needed for that animation,

these are loaded from yaml

animation:
player_jumps:
texture: texture_id
length: how long the animation should last in game time
frames: [each frame is a set of 4 coordinates + a relative frame time]

Add new random generators to ortho_terrain

includes a few simple terrain generators:

  • fill with terrain type
  • fill with random terrain from terrain list(avoiding incompatible transitions)
  • fill with random terrain shapes from terrain list(as above)

also includes functions for drawing terrain straight onto vertex arrays without a tile map:

  • draw vertex(size, terrain)
  • draw tiles(size, terrain)

Scripting

add support for scripted components and systems. these will be running in angelscript.

they should be able to be specified by manifest.

Hades 2.0

  • sync and serialisation of curves
  • curves can tag themselves as trimable at the cost of being able to save replays(client can trim and let server hold the full data)
  • Save/load mechanic
    • Saving of curves and objects on a low level

input and binding system

This should handle cleaning passing input to game states, states register actions(like MOVE) and receive them along with context(joystick number and state, or key state). This should be exposed to the console for macro rebinding and needs to be saveable/restorable and exposed to be edited easily in game menus as well.

SpriteBatch shader support

a sprite batching system, needs to manage different groups of textures/sprites and support automatically moving a sprite between batches, if it's animation isn't on a single texture. with some form of key for accessing the sprite.

Probably should be thread safe as well. as it would be modified by the client controllers.

Import components from ortho

A few components have been developed in ortho that need to be brought back into line with hades

  • parallel_jobs
  • transactional_map
  • value_guard
    • shared_guard
    • transactional_guard

Add Debug header

This header should provide support for debug info overlays to be rendered on top of the game.

with the assistance functions
overlay* CreateOverlay
DestroyOverlay(overlay*)

finish linux compatability

Current linux blockers:

  • filesystem being linked in automatically(scheduled for GCC 9).
  • std::from_chars supporting float conversion

Editor isn't thread safe

Make tile_work and terrain_work thread safe, by only accessing the datamanger through const or by sharing a shared_ptr to a mutex they both use.

current impl causes a race condition.

3d rendering

either wait for sfml to support this directly or add the following features.

  • view with 3d coordinates and rotation
  • verticies with 3d coordinates

refresh only unloaded assets

change refresh() to refresh(bool unloaded_only = false)

same for all the other refresh overloads

also add a clear command for the refresh list.

Game/Mod file manifest

Support a hard-coded file/name manifest.
files added to the manifest by the engine are in the /common directory
files named in the C++ manifest are expected to be in the root /game directory
files in the scripted manifest are expected to be in the same folder as the manifest file
example
define the manifest.
all files will be loaded and kept in memory after this point
in main() { //it is a total failure for a manifested file to be missing resource.addtxture("texture_tank", "filename"); }

before the game starts, assign all the files from the manifest global names, so they can be referred too.
scripted manifest item will have global names generated.

struct textures { //manifested files are read only const texture tank = resource.texture("texture_tank"); }

manifests should support adding extra stuff too, like unique identifiers for game elements, or yaml for new units?

manifested types should contain extra info to easy their use.
textures -> expected dimentions
audio - > expected length

custom asset types will need to implement loadfromfile/loadfrommemory

class asset : public resource::baseAsset {}
//before reading manifests
auto assetTypeId = resources->register asset type("typename", loadfilefunc, loadmemfunc);

//for a compiled manifest(in hadesmain)
resource->addCustomasset(assetTypeId, "name", "path");

//at the start of the gamestate
asset* custom= resources->(assetTypeId, "name");

custom types must be registered before loading any assets. or external manifests

TGUI loaders

We'll need to add TGUI loaders for image, texture and font types, so that tgui themes will work correctly with the data manager.

move debug path extention

currently applied to mod paths when loaded, should be applied to all file activities, in as_raw.

the result is that debug paths are erroneously applied to usercustomdirectories like %documents%.

Collision system

A collision base type, with support for comparing any of the the child types.

Axis aligned Rect,
Circle,
Point

collision_test(returns true if intersecting):

  • Rect -> Rect
  • Rect -> Point
  • Rect -> Circle
  • Point -> Point
  • Point -> Rect
  • Point -> Circle
  • Circle -> Rect
  • Circle -> Point
  • Circle -> Circle

collision_move(returns a vector pointing from the objects current position, to it's final position,
this includes allowing the object to use up remaining move by sliding along no-colliding directions):

  • Rect -> Rect
  • Rect -> Point
  • Rect -> Circle
  • Point -> Point
  • Point -> Rect
  • Point -> Circle
  • Circle -> Rect
  • Circle -> Point
  • Circle -> Circle

safe_move(returns the largest non-intersecting move):

  • Rect -> Rect
  • Rect -> Point
  • Rect -> Circle
  • Point -> Point
  • Point -> Rect
  • Point -> Circle
  • Circle -> Rect
  • Circle -> Point
  • Circle -> Circle

collision_normal(returns the normal vector of a move that would result in a collision):

  • Rect -> Rect
  • Rect -> Point
  • Rect -> Circle
  • Point -> Point
  • Point -> Rect
  • Point -> Circle
  • Circle -> Rect
  • Circle -> Point
  • Circle -> Circle

Hades 2.x

This is basically for tasks that have been ejected from the Hades 2 target.

  • support travel between separate maps; this would be done with a decoupled server system.
    • This must be done without shutting down the first map, allowing players to be connected to difference logical servers, with their own map, but still sharing the same shared campaign and player state
    • these need to be actually separate unlike the current system
    • allow connecting to multiple of these at once(ie. pip of a player on a different map)
    • this will allow us to use more standard layer systems(like Link to the Past)
    • server must be able to spin up sub areas as scripts attempt to access them.
    • should also allow for sub areas to be shut down once all players leave.
  • Investigate 3d rendering primatives( sf view, sf vertex)
  • scripted systems
  • network support, both local and internet rendering.
    • curves must be automatically synchronised
    • client side will have to deal with how to interpret them
    • being able to have more automatic serialisation and synchronization of network data and commands?
    • network sync would be a property of curves
    • only sending needed data again, hiding non-local entity updates
  • In game cut scenes( this will require scripting to be completed
    • For rts, just a queue of orders and callbacks should work
    • for other games alternate actor versions of entities may be required.
  • Campaign support
    • Default campaign type(sequential mission list)
    • Support for a campaign header in the save file to track campaign progress
  • Campaign upgrades
    • Additional Campaign types
      • Mario world connected level graph
    • Multimap travel This must allow for ending a server on one map, but continuing the same logical 'game' on a different server/map(ie. load the inside of a house and move to it, using the campaign save header to load the correct flags and so on in the new map)
    • auto local area persistence registry, saving data automatically as player moves between multimaps
  • Object Editor
    • Support drag select of multiple objects
    • Support movement of group of selected objects
    • Allow editing of common curves for multiple selected objects

rewrite transactional map

current implementation is overly complicated, and blocks out a few needed abilities.
we should be able to replace the curvemaps in GameInstance and the spritemap in Gamerenderer with transactional maps instead of maps of value_guard. after all thats the point of transactional map

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.