Code Monkey home page Code Monkey logo

glare's People

Contributors

immutableoctet avatar

Watchers

 avatar  avatar

glare's Issues

Set up unity builds for reflection source files

We should try building reflection code together, since they're a significant bottleneck. For some reason MSVC doesn't want to build them in parallel, so there's no downside in scalability there, either.

Collision idea: Slide on surface (as opposed to stopping)

Current kinematic resolution has the tendency to stop an entity dead in its tracks. Something like the following might help with making an applied correction less oppressive toward fixed motion:

Abs(dot product of approach angle and surface's forward vector) * penetration amount * surface forward

Haven't tested this, or looked into it any deeper than brainstorming.

Look into Bullet's "Ghost Objects"

Need more context on these and why we should/shouldn't use them. Currently have rigid bodies working as expected, but would be interested in the pros/cons of using these for player objects, etc.

Implement axis inversion for Mouse and Gamepad devices

From what I remember, this is one of the last things needed for the input system(s). Implementation of this would likely be done through the input devices themselves (configured via JSON profiles), rather than through the high-level system.

ResourceManager should be partially reworked to use weak references

The ResourceManager type currently holds shared_ptr instances, meaning that anything cached will stay allocated even after no one is referencing that resource. There's pros and cons to this, but I think it makes more sense to allow resources to be deallocated naturally, rather than waiting until the ResourceManager instance goes out of scope.

To achieve this, we will need to look at any data structures tied into the existing caching mechanisms, as well as the obvious switch to weak for storage + strong/shared for return-value/query.

Implement targeted event sending

The idea would be that an event could be received only by the targeted entity. We would do this by filtering to only trigger yield operations of Entity Threads of the targeted entity. This could be achieved using either a MetaAny or a templated wrapper type to hold the event. We could then listen for those targeted events in the Entity System, dispatching accordingly.

This would be useful for messages between entities, and could be extended further to networking concepts like messages to/from a specific player.

Implement Animation Slices

System: AnimationSystem

Animation slices indicate start and end frames of animations.
These slices should be loaded via JSON through character/asset description files.

Implement Device-level Input Handling

To be handled at the application level, but interpreted at the game engine level.

Input devices include:

  • Mouse
  • Keyboard
  • Gamepads/Joysticks (multiple)

Each device type should have its own event types that relay appropriate state information, split into two categories:

  • Axis/motion inputs
  • Button up/down inputs

The game engine would then be able to interpret these messages/events in order to produce its own device-agnostic input events, etc.

Other features:

  • Interoperate with game/engine on button mappings and device profiles.

Allow implicit state import from state transition declaration

We currently require that all states be declared during the archetype parsing phase. This feature would allow importing additional states to the entity-descriptor if they're referenced as possible transition states in one of the regularly imported state definitions.

Example:

  • Archetype declare States A & B
  • State A has a rule declaration referencing State C if some condition is met. On runtime, this would not currently work.

Proposed solutions are as follows:

  • Produce an error/assert indicating that an invalid state would be reached
  • Ignore rules pointing to invalid/missing states (Probably best to detect this dynamically, since you could theoretically add to the entity-descriptor during runtime)
  • Statically scan the names of all transition states, implicitly importing them due to being referenced in a rule. (This is problematic, since we don't have actual state paths, only state names)
  • Allow states to declare their imports in a dedicated "states" or "imports" section. (This would also allow for exact paths to be used, rather than hoping we can directly resolve by state-name)
  • Allow for an in-line import directive for the referenced state, allowing for an exact path to be provided.

I am currently undecided on which approach would be most effective, but I'm leaning towards an "imports" section for each state.

Continuous button-down events are not triggering for Mice/Touch and Gamepads.

Keyboard devices appear to be triggering as expected, but if a mouse or gamepad button is held, the event only fires once.

NOTE:

  • The input device level is meant to continually fire these events; it's the high-level (engine) system that covers pressed vs. held vs. released. In the high-level system's case, this still affects the end result, since the held/down events for that system are caused by these device-level events.

Implement 'Motion Attachment' functionality

For scenarios like moving platforms, etc. -- Essentially, this would parent/un-parent an object to a platform or other moving geometry, allowing it to be influenced implicitly, rather than via collision resolution/casting procedures.

Rework rendering internals

Rework the low-level rendering functionality in graphics::Context to build a data-driven command queue that can be sorted and manipulated for performance and ordering purposes.

This would tie well into the 2D pipeline we intend to implement.

Build a data-driven system for entity creation

Entities should be constructed primarily through composition. As an extension of this idea, we could standardize a means of composing entities through a data format (e.g. JSON). We could then have a JSON file that describes how to create a Camera, Player, etc. -- rather than having specific free functions to do so.

We could have a Player object's JSON file perform each step of behavior/component attachment with this -- Example:

  • Attach motion component
  • Attach model
  • Attach/set name
  • etc.

Would be a lot simpler than having this described in code for each object type.

We could then use our current object creation mechanisms through stage to point to these entity description (JSON) files so that we can instantiate many of them in a structured way.

Implement `Zones` and `Triggers`

The idea behind Zones is that they'd be descriptions of collision shapes (i.e. volumes) that don't have solid behavior, but instead are used to check for specific conditions within their bounds.

With Zones, you could have a sphere or cube volume that waits for a player to enter, then triggers an event to be interpreted by some other system.

This concept could power death planes, events within a game world, cutscene triggers, camera switching, etc.

Implement a natural interface for managing entity states from C++ script

Implement an interface that allows for variable-like semantics. Something like this:

state = "State Name"_hs;

if (state == "Some Other State"_hs) { /* ... */ }

switch (state)
{
	case "A"_hs:
		// ...
		break;
}

Something similar can be done for the previous state as well, possibly sharing a common base-class.

if (prev_state != "Old State"_hs)

Look into using PCH for build time improvements/faster iteration

Build times are definitely a bottleneck, and they'll continue to get slower as the project grows.

I've experimented with enabling multi-processor build options in MSVC, which seems to have a significant impact on build times, but we'll definitely want to look at using PCH for later in the project's development as things become more stable / stay the same.

Implement 'Cadence' control blocks for `EntityThread`s

These would be control blocks in EntityScript that would change how often the thread is stepped.

I'm currently looking at the following options:

  • fixed -- The thread is stepped at a fixed rate per-second. (e.g. 60hz)
  • realtime -- The thread is stepped on each realtime update (i.e. each frame)

These would function similarly to multi.

Rework reflection into several translation units

We currently compile a single reflection cpp source file.
As the codebase gets larger, this will become problematic as changing anything this source file references requires a rebuild.

We will need to determine if there are any side effects to changing each module's reflection.hpp file to reflection.cpp to allow for parallel and incremental builds.

Look into ways of optimizing or caching meta-type descriptions

Currently only factory objects are cached. Because entity descriptors (found in factories) are processed from archetypes, they may share data.

Note: This may be a hard optimization to achieve, since component redefinition and modification can happen at any point during the construction phase of a factory / entity descriptor.

Implement unified input system

Integrates with #8

Unified (device-agnostic) input system, including events for:

  • High-level input state changes
  • Button Pressed
  • Button Held/Down
  • Button Released/Up
  • Directional/Analog Input

Implement functions for `EntityScript`

Functions would be subroutines that can be added to a script via merge composition.

The syntax would look something like this:

function f(x, y:int, z:string)
	return ((x + y):string + ", " + z)
end

Review current file path/import requirements for archetypes -- Determine what needs to change for single-file instantiation to work

We currently assume filesystem access when processing archetypes. This means we always expect imports and state references to be the proper method of entity-descriptor construction. In a theoretical scenario where we would want to embed all logic data of an entity in a single file, this would not be sufficient.

Take for example an entity description sent to a game client from a server. In this example, we would need to send multiple files from the server in order to construct a single entity factory and descriptor. This becomes wildly inefficient compared to a single (possibly space-optimized) JSON object or string stored in memory.

Add a standard method of attaching collision primitives to nodes of assets/models

This is currently possible with the entity generation that happens when loading models, including their skeletal nodes, model groups, etc.

There isn't currently an easy way to describe e.g. a small sphere collider on a bone of a player's model. The idea here would be to use a JSON format linked to either the asset itself, or to the object/entity type via its creation routines.

Idea: Activation component

Simple bool or maybe set of bit flags as component per entity. We could then use this to trigger on activate and on deactivate events. Maybe even have States so it would be inactive activating activated deactivating. Maybe have timers for this?

You could have things like doors that are closed when deactivated, open when activated and opening/closing in the other states.

Name ideas:
ActivationComponent
Activateable
Trigger/Triggerable

Things like buttons, pressure plates or zones could activate these.

Thought: what about entities in the abstract sense that only perform some function when activated; i.e. as a behavior tied to a component. Maybe even have this tied to the player, etc. (Child entity, but with no transform, etc.) -- we could even have a death trigger entity tied to a player.

Implement deserialization for container types

We should have straight-forward routines for container deserialization (vector and map types). We currently have support for engine::load, which lets us handle individual objects via MetaTypeDescriptor, but we do not have a simplified interface for containers.

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.