Switch branches/tags
Nothing to show
Commits on Apr 26, 2011
  1. Fixed incorrectly handled EOF

    archwyrm committed Apr 25, 2011
    EOF signals that the client has disconnected, not that there is no more
    data available. Thus when a client disconnected, we went spinning into a
    busy loop trying repeatedly to read from a closed socket. Fixes #10
    EOF is handled like all other fatal socket errors now, by removing the
    client (data structure). The same goes for EINVAL which does not need
    any special handling either.
Commits on Apr 25, 2011
  1. Added new concurrency utilities and converted most code to use them

    archwyrm committed Apr 25, 2011
    The new concurrency handling operates off the simple principle that when
    a given goroutine sends/receives to/from a channel, it must also
    attempt to receive on its main input channel. This prevents a lot of
    deadlock situations where an entity and service (for example) are
    trying to send to eachother and thus neither send can go through.
    The current behavior is to queue messages when blocked on
    sending/receiving to/from a specific channel. These messages will then
    be handled when the operation on the specific channel has gone through.
    This behavior is easy to change for any given type implementing
    Currently there is a possible deadlock when waiting for a reply to
    return, as any messages that the waiting-on-reply goroutine may need to
    handle before the whole game can proceed just sit in the queue.
  2. Changed core imports to import into the local namespace

    archwyrm committed Apr 25, 2011
    core is used so frequently (nearly every file in the project) that
    importing it into the local namespace on a regular basis makes quite a
    bit of sense. This will save some typing and some long lines.
Commits on Apr 24, 2011
  1. Remove KillCount entity state, ...

    byce committed Apr 24, 2011
    Also add Killer member to MsgEntityDeath
Commits on Apr 23, 2011
  1. Add EntityDeath message

    byce committed Apr 23, 2011
  2. Implement event listener

    byce committed Apr 23, 2011
Commits on Apr 21, 2011
  1. Implemented basic combat, fixes #14

    archwyrm committed Apr 21, 2011
     * Spiders can now be killed and when they die, they are removed from the
     * Made the initial spider stationary so there is something to kill
       right off the bat.
     * Added util function for async sending that may be useful in other
     * Reduced spider health so they can be killed faster
  2. Made view handle removed entity correctly

    archwyrm committed Apr 21, 2011
    View no longer causes a deadlock when its entity has been removed. By
    use the select statement, it properly reads MsgQuit and exits.
  3. Some cleanup and gofmt

    archwyrm committed Apr 21, 2011
  4. Updated tests to compile against latest code changes

    archwyrm committed Apr 21, 2011
    Tests still deadlock.
Commits on Apr 20, 2011
  1. Fixed MsgBuffer sending behavior and simplified func

    archwyrm committed Apr 20, 2011
    The last implementation would only send a value when it received one
    which was filling the buffer pretty quickly (depending on the volume of
    messages received). This current implementation is simpler, but has the
    drawback of always putting the received message in the queue.
    The last implementation also had a bug where it would miss the
    occasional message. This had the effect of preventing the player from
    moving when other messages were being sent to World.
  2. Send messages from pubsub asynchronusly to prevent deadlock

    archwyrm committed Apr 19, 2011
    Testing out another method of avoiding deadlocks. The other method being
    the MsgBuffer, a variable sized buffer.
Commits on Apr 17, 2011
  1. Spawn spiders on player movement

    byce committed Apr 17, 2011
    Spiders will spawn at random locations around the player. The further
    the player is from the center of the world, the more spiders that will
Commits on Apr 16, 2011
  1. Generalized entity spawning in Game

    archwyrm committed Apr 16, 2011
    Previously there specific functionality for spawning a player, this has
    been generalized to spawn any entity which simplifies the code a bit and
    allows us to spawn any entity through a message easily.
    To make this possible, the entity creation functions have been changed to
    'InitX' functions which return a core.Entity so the entity to spawn can
    be specified simply by sending a function.
    The modified/new MsgSpawnEntity lives in the game package as only game
    handles it. It is not clear whether making messages package specific
    like this clears their intention of use or makes them hard to find
    rather than being with all the core messages.
  2. Made avatar remove its player when quiting

    archwyrm committed Apr 16, 2011
    Entities can now be removed from the game by way of the Remove state (an
    internal cue) and sending the proper message to Game. Fixes #13.
  3. Added a cmpId subpackage for core

    archwyrm committed Apr 16, 2011
    core will eventually provide a few default states, actions, and
    entities. This subpackage records their IDs as it does in sf. However,
    END constants are provided so that specific game cmpId packages (such as
    sf) can make sure that the two ID constant lists do not overlap.
    Also removed the State, Action, and Entity constants as they were not
    used for anything.
Commits on Apr 15, 2011
  1. Neglected gofmt

    archwyrm committed Apr 15, 2011
  2. Made World internals simpler

    archwyrm committed Apr 15, 2011
    World uses 3D vectors rather than its own internal 'cell' struct. This
    is not only simpler but apparently more efficient. The earlier lag has
    been eliminated which fixes #11.
  3. Satisfy Entity interface completely with CmpData

    archwyrm committed Apr 15, 2011
    Entities now pass their EntityId and entity name to their CmpData
    instance which then gets passed to anything requiring an Entity. CmpData
    functions relay the entity's stored data.
    This fixes a missed bug where EntityId 0 and name "CmpData" were being
    passed for every entity.
Commits on Apr 13, 2011
  1. Log when the game loop is behind

    archwyrm committed Apr 13, 2011
    Which it currently never is!
  2. Added World which controls spatial relations in the game

    archwyrm committed Apr 9, 2011
     * World's exact behavior is game specific
     * Moved Game from core to its own package 'game' because of a
       dependency on pubsub and pubsub's dependecy on core
     * Variable size buffer is used for World's input channel to prevent
     * The aforementioned buffer is part of the util package but a more
       integrated startup would be ideal
     * cases of an entity sending to World and World sending back to an
       entity causing a deadlock
     * There still remains some kind of delay issue and some code could use
       improvement, but given the concurrency trouble that this feature has
       already caused, it is time to let it out into the wild.
Commits on Apr 12, 2011
  1. Allow external access to entity input channel

    archwyrm committed Apr 9, 2011
    The input channel for a given entity can now be accessed with Chan(),
    this simplifies a good deal of code which was forced to treat entities
    and their channels as separate. It also allows access to this channel
    where it has not explicitly been passed (Action.Act was the motivator
  2. Synchronized service startup

    archwyrm committed Apr 12, 2011
    Game only proceeds after all services listed in its ServiceContext have
    reported in.
    comm tests are broken despite introducing new code to support the above
    changes. This seems to be related an older concurrency problem and the
    fact that the tests are all run from a single main (i.e.: one program)
    so goroutines from previous successfully run tests are still running.
    Currently leaving these tests broken seems acceptable.
Commits on Apr 10, 2011
  1. Ignore 5g and 6g output too

    archwyrm committed Apr 10, 2011
Commits on Apr 5, 2011
  1. Converted game loop into time based loop

    archwyrm committed Apr 5, 2011
    Currently runs at 60 ticks per second. Reduced spider movement increment
    to move by one unit per second at this loop speed. Player movement is
    now fluid.
  2. Apply movement one time rather than every tick

    archwyrm committed Apr 5, 2011
    Each movement command is run immediately when received rather than being
    added as an action to the entity, this allows finer control of the
    player. MsgRunAction has been added to allow this.