Newer
Older
Import / applications / HighwayDash / ports / Docs / Markdown / Todos.md

@page Todos Todos @tableofcontents

@page Todos @subpage todo @page todo Todo List

@page Todos @subpage OtherTodos @page OtherTodos Other Todos

  • work out why the shadows 'swim' - DONE!!! :) highp on mvp of shadow vertex shader
  • state mapping created from state registration
  • split graphics.cpp in to 3 parts
  • make the translation of models a part of the matrix in the uniforms - reduce the uniforms
    • wrap the state better
  • shaders as resources
  • generic async system with continuations and cancellations

  • jenkins client for mac to do automated compile and unit tests

  • android port and jenkins job?
  • add code style check job
  • something like a 'do' command to do a one step build/test/package/check etc, perhaps python

  • static type decoration per types

    • currently the visitor idea with macros for serialization / deserialization is fine for objects but if you don't have an instance you can't do anything interesting. You could make a dummy one I guess But idea would be to have a types table, and then each type has full type information about the members and their names and types and the member functions etc, so in theory could make C/C++ fully scriptable too not just serialization and de-serialization. Could in a UI create new objects of a type etc. Perhaps the game has a object tree too which can be manipulated at runtime too. All objects having parents and so on. That might be a bit heavy for some thing though, but the type info is static so it isn't per instance so is actually pretty light
    • object system: what do I actually need an object system for with ref counting etc? I do need serialization and deserialization for loading and unloading data - but probably specific formats for textures and for vertex data. Perhaps for models. Perhaps for scriptability. Need some ability to control values from a UI. But probably the important code which needs to run fast will be quite streamlined with out this object system.
  • I'm considering that c++ does actually do what I want, doing code gen might be easier. problem becomes build integration - eg generating xcode project file that correctly regenerates the generated code from the template and can then compile the generated code when building the project and also nicely shows the template code in xcode so edit the right files, not the generated files etc

  • Done: check allocations - allocations hook

@page Todos @subpage Requirements @page Requirements Requirements

Generally Required Systems

  • Object System
    • JSON / RapidJson ideas
    • rapidJson::Document is like a Variant which includes an Object type which can be nested (a 'Value')
    • Object serialization and de-serialization
    • Object heirachy - structured and un-structured (fixed layout vs something like a JSON value which is arbitary)
    • Versioning?
  • Event System
    • Different types of events
    • tracking events - for specialised logging
    • events like signals and slots or observer pattern (single process - possibly dispatch across threads)
    • IPC - actions or similar where the event can be dispatched across process boundaries or over networks
    • event payload could be an Object from the object system - giving serialization/deserialization
    • ...
  • Task System
    • Task objects and AsyncTaskManager / thread pool(s)
    • Tasks can be cancelled?
    • Tasks can have continuations
    • Task return type can chain in to the input to the continuation in a templated way
  • Ui System
  • Pipeline System
  • Scripting System
    • Python and Lua bindings
  • Logging System
    • Refer to Java and Python
    • Components:
      • Logger
      • Formatter
      • Handler

@page Todos @subpage Ideas @page Ideas Ideas

Entities:

States - game state - loads a ui set and view etc Levels - game level Views - 3d views - view ports, scenes UIs - contains 0 or more views and UI elements in json Models - input data: frog, voxel data. GL data: vertex arrays, textures, shaders Shaders - types, vertex and fragment, shadow and normal, texture / water shader etc Cameras - follow, controlled, lerp, orbit etc Input - touch screen, other

Data driven as much as possible

UI can be declared in json easily state machine can be declared in json etc but what a state is perhaps needs code layout of viewports in the ui json scenes and models can be described declaritively - perhaps with animations too views should then just have an associated scene what about editor view or game view - these need code too?

Hierachy UI - json declares the UI screen layouts, the view ports, and the transitions between UI screens

 Model
   Model data - from OBJ file or json of PNG areas for voxel models
   Shader reference
   Texture reference
   Animation reference

 Scene
   Source - Generated or described (eg: game code or model lists)
   Camera

 Data referential integrity checks
   - code generates list of supported states
   - check the things UI references are valid/available
   - check the model references are valid - shaders, textures

Automagical LUA bindings

Johnathan Blow talk - Jai programming language - idea is a langauge that gives very fast iteration times

  • simple compiler so very fast, great introspection for great tools that give rapid prototyping, exposes structs in to UI tweakables in an in-game editor

Tweakables and in-game editing prototyping / real-time data editing

Task based scheduler

UI API which is async with callbacks - eg show selector dialog, callback when user selects something / accept/cancel Use of continuations - eg: futures with a then() which when the async task completes, it does some code in the context of the caller (eg: the original thread). Idea of putting things on a particular thread - dispatch to main thread. LUA is single threaded but with threaded execution (co-routines) so great for doing ui logic etc

boost::asio - for sockets

GameDB ideas - JSON / Excel editing of data ? / convertors / editors

introspection - editor of format of the structs

SOA - structure of arrays for efficiency (instead of AOS - array of structures) locality of reference - put things together that are accessed together

concurrency - what is able to be done concurrently

task based concurrency - create an OperationQueue which has as many worker threads as execution cores on the CPU.

pipelines - plugable functions that fit together to form a pipeline - think unix piping between processes also think of media processing and source and sinks and filters.

OpenGL code to be bound to a specific thread/task

continuations, then, dispatch to thread, cancellations (C++14 or C++17 - experimental future with then) run on main thread suspend resume lua, async ui calls (callbacks on completion)

Expected (error handling, C++17 ?)

http://stackoverflow.com/questions/8130602/using-extern-template-c11 extern template class so as to reduce linker time - only one expansion of it. Also can use it for making a header/cpp version of template so as to avoid exposing details

just use #pragma once use of namespaces interface classes that just expose the public methods - implementation can change no static variables - use of std::bind for callbacks to an instance const int blah = 5; - in headers there is a link time overhead for this - extern and include in one cpp file - or use enum for ints shouldn't use defines to configure what is required - stay out of interfaces - just use inside implementations unit tests - unit test everything - coverage testing

Jai ideas introspection - structs becoming tweakable property sheets in rapid prototyping in-game editing SOA / AOS -> tags to re-arrange data layout but without cost of re-arranging code, decorated types eg: Vector3 struct SOA { }; Code editor - emacs / vim plugins / msvc plugins

#run - code execution in the compile phase - self making build process - all tools etc can be expressed in the one language

#run can generate tables to be inserted or can make a build process or do anything you could do with the language - perhaps can still do with C++ with two compile passes

https://mollyrocket.com/casey/stream_0019.html Efficient coding - not just the code but the process Semantic Compression Don't prematurely write reusable code, 'refactor' when you have the 2nd case of the code reuse (2 examples, easier to see the general case) C++ with classes makes it harder to perform semantic compression because variables are bound as members to classes, but the refactoring described is easier when dealing with just plain functions.

Shared stack frame - concept is basically turning commonly used together parameters to functions in to a struct - a bit like a class, but conceptually the thought process of the programmer is different - grouping by what would be in the stack rather than logically what variables belong to an 'object' - then turning it in to C++ classes

Soft launching - get build ready, get metrics / analytics ready. measure retention http://www.gamasutra.com/blogs/NielDagondon/20160624/275737/Why_you_should_Soft_Launch_your_Mobile_Game.php play sessions of 5-10 minutes - energy systems Measure the ARPU

#define CONCATENATE_IMPL(s1, s2)  s1##s2
#define CONCATENATE(s1, s2)       CONCATENATE_IMPL(s1, s2)

#ifdef __COUNTER__
#  define ANONYMOUS_VARIABLE(str) \
           CONCATENATE(str, __COUNTER__)
#else
#  define ANONYMOUS_VARIABLE(str) \
           CONCATENATE(str, __LINE__)
#endif


template <classFun>
class ScopeGuard
{
  Fun f_;
  bool active_;
public:
  ScopeGuard(Fun f)
    : f_(std::move(f))
    , active_(true)
  {
  }
  
  ~ScopeGuard()
  {
    if (active_)
      f_();
  }
  
  void dismiss()
  {
    active_=false;
  }
  
  ScopeGuard() = delete;
  ScopeGuard(constScopeGuard&) = delete;
  ScopeGuard& operator=(constScopeGuard&) = delete;
  
  ScopeGuard(ScopeGuard&& rhs)
    : f_(std::move(rhs.f_))
    , active_(rhs.active_)
  {
    rhs.dismiss();
  }
};

namespace detail
{
  enum classScopeGuardOnExit {};

  template<typenameFun>
  ScopeGuard<Fun> operator+(ScopeGuardOnExit, Fun&& fn) {
    return ScopeGuard<Fun>(std::forward<Fun>(fn));
  }
}

#define SCOPE_EXIT \
  auto ANONYMOUS_VARIABLE(SCOPE_EXIT_STATE) = ::detail::ScopeGuardOnExit() + [&]()

void fun()
{
  charname[] = "/tmp/deleteme.XXXXXX";
  autofd = mkstemp(name);
  SCOPE_EXIT { fclose(fd); unlink(name); };
  autobuf = malloc(1024*1024);
  SCOPE_EXIT { free(buf); };
  ...  use fd and buf ...
}

Managers - code that uses factories and creates them and delegates to them - perhaps like interfaces GameObjects - sub-class of 3d model file types to give them behaviour Events & Actions - event systems to notify / listen for triggering things - observer pattern - CRTP - json payloads - serialize/deserialize - RPC - perhaps server<->client RPC Camera - modifiers GameStates GUI - attaching behaviour to UI Tracking Economy Network - GS - IAP - etc

Idea

  • pre-pass to collate max tris or quads needed for everything - then space allocated
  • second pass to populate