« first day (142 days earlier)      last day (2622 days later) » 

2:35 AM
@raynos did you ever end up doing any node game development? I saw a couple of your posts on occasion but checked your github repo and didn't see much
 
@BradDickason no, pretty much just a blog engine. That I'm getting ready to dive in on, now that he's built his framework
 
2:52 AM
@jcolebrand ah interesting, what's different about the blog engine from your standard wordpress/cms/etc?
 
3:02 AM
That this one is written in node?
 
 
4 hours later…
7:14 AM
@Raynos did you write an issue on github yet?
 
 
2 hours later…
9:31 AM
@yojimbo87 didnt bother
@BradDickason I didnt
I was going to but ehm
Being a lazy ass of no value got in the way
On the other hand I plan to start some articles on html5 game development
 
there is no plan which survives the first contact with reality :D
I think that lazyness has nothing to do with your belief of "no value" thing
it's probably just lack of self discipline
 
9:55 AM
So a couple of days in
I realise backbone, node and couch dont go well together
Man I've been recommending that stack for ages :\
what bad advice
I really lack hands on experience. I have far too much theory
 
I would say it depends on scenario
each technology has it's limitations and just because you encounter some bad experience with them doesn't necessarily mean that they shouldn't be used together or that there is no use case for this combination
 
10:29 AM
Thats a good point
I think im just hitting into leaks in the abstraction
and need to use something else
 
11:06 AM
Event-driven architecture (EDA) is a software architecture pattern promoting the production, detection, consumption of, and reaction to events. An event can be defined as "a significant change in state". For example, when a consumer purchases a car, the car's state changes from "for sale" to "sold". A car dealer's system architecture may treat this state change as an event to be produced, published, detected and consumed by various applications within the architecture. This architectural pattern may be applied by the design and implementation of applications and systems which transmit ...
this is a pretty good architecture to consider expecially for node based stuff
 
I keep uploading my password ;_;
How do I manage database passwords in public repositories?
 
well that's a good question
either you create some account with lowered privileges
or rewrite it everytime
 
I mean
 
maybe there are other ways
 
I use git to push to heroku
but I have to commit that
does this mean I need a heroku fork
 
11:09 AM
I see
well I can't really say
 
11:24 AM
where is that graph showing the trend of node.js tagged questions on SO?
 
the best way to manage db passwords is through env variales
variables*
e.g. i have a config file in most of my public repo's that looks like this:
# Mongo
exports.MONGO_HOST = process.env.MONGO_HOST || 'localhost'
exports.MONGO_DB = process.env.MONGO_DB || 'game'
(not sure if that answers your question or not @Raynos)
 
@BradDickason ._. Why can't I think of that?
Then I should be able to tell heroku to inject those variables into the environment
 
@Raynos yeah using 'heroku config' (if you have the cmdline version)
I think you made the right choice not working on a game btw :D It's damn hard!
 
@BradDickason why do you commit compiled cs -.-
 
@raynos dunno i guess for the people who don't like cs? :\ figured they'd take one look at my project and start yelling :D
(not that anyone's actually viewing any of my projects haha)
 
11:32 AM
compiled js is worse then cs
I'd rather read cs then compiled js
and I dont like cs :D
How's debugging compiled js? :D
 
you can always read minified js
there it is
 
I don't mind debugging compiled js when node sends me to a line :) my brain is pretty well wired to convert debug issues to the cs spot :X
 
lets do some survey
which editor/IDE do you use Brad?
for js
 
i'm using textmate right now, experimenting with macvim a bit
 
oh so you are mac user
 
11:38 AM
yep
I'm a product manager by day, coder by night :)
 
well that sounds unusual I would say :)
do you specialize on game industry?
 
figured my next startup would be super early stage and i'm useless sitting around making wireframes and doing user tests when you have 10 lines of code and 1 developer :P
I used to
worked for game startups for like 8 years, was a professional gamer before that (competed for $$$)
i work for bookish now tho
that one :x
 
wow pro gamer
I'm sorry but what means bookish?
oh I see
 
it has some meanings.. "someone who reads books" :)
 
I just saw it in that article
looks like a good idea
 
11:44 AM
we'll see :D until its launched it is just that.. an idea ;)
what about you?
 
me? just a random passioned developer I guess
 
@BradDickason o/
 
@yojimbo87oh i meant what IDE do you use?! :D
 
I'm using sublime text 2
but it's so unpolished lacking features :\
 
11:46 AM
@BradDickason oh, I use notepad++
 
hm i haven't heard of sublime text, used to like notepad++ when i was on windows
btw @yojimbo87 how versed are you in event driven architecture? (the pattern you linked to)
 
well I'm in the process of studying it from various sources in order to get bigger picture and than try to apply it in node
 
hm
may i have your opinion?
 
Oh there was this awesome thing for node
I bet I cant find it
 
11:53 AM
hm i will check out that presentation, it looks good :O
 
it's a little bit different from the original EDA but the quy mentioned CQRS which is related to this architecture
 
this is from an article discussing event-driven design
 
Where was that awesome node project with nodes and networks :(
 
yeah pdf in this article was a quite good read about this architecture elementallinks.com/2011/02/06/…
 
ok i am writing examples in coffeescript is that ok?
(to show you and see which approach you think is best)
 
11:58 AM
for some reason I don't really like coffeescript
I guess it's because I spent a lot of time with C based languages :/
 
ok let me rewrite in js
one sec
can't quite remember how to do 'extends' in js hehe
actually i think for this purpose (10 lines), cs might be ok?
 
yeah
 
If I mentioned this nodejs framework
for writing your application as a network graph
and linking everything up using fancy graph stuff
Could you find me the link to the github
I know exactlty what it is. I've seen it.
I can't find it on the web because github is poorly indexed >_<
 
hm
i have no idea o_O
this maybe?
 
wait, it's not about visualisation isn't it
 
12:09 PM
phew ok prepared my examples :)
so i am creating a simple game
in which there is a client (which handles drawing, and interaction via canvas)
and the server has a 'world' class which initializes the game and keeps track of enemies, etc
 
i have struggled with how to design the event system, here are my two options:
 
@yojimbo87 no its not
its about using graphs and nodes to piece an application together
 
1) the world interprets all requests and sends them to the client:
gist: Event design - world routes all events from objects to client, 2011-08-13 12:08:22Z
class enemy extends EventEmitter

load: ->
  emit 'load'

move: (location) ->
  # moves an enemy across the game
  emit 'move', location
  
  
class world extends EventEmitter

enemy.on 'load'
  emit 'loaded', enemy

enemy'on 'move'
  emit 'moved', enemy
  

class client extends EventEmitter

world.on 'loaded', object
  # load object data

world.on 'moved', object
  # show enemy moving to the client
2) the world listens for a 'load' event and the client then listens directly to the object once it is loaded:
gist: Event design - client listens directly to object, 2011-08-13 12:07:50Z
class enemy extends EventEmitter

load: ->
  emit 'load'

move: (location) ->
  # moves an enemy across the game
  emit 'move', location

class world extends EventEmitter

enemy.on 'load'
  # process loading
  emit 'loaded', enemy
  enemy.move [3, 2]
  

class client extends EventEmitter

world.on 'loaded', object
  # load object data
  object.on 'move'
    # show enemy moving to the client
  
(obviously the code is more involved but that basically abstracts the idea)
 
I prefer one
Or do I :\
 
12:13 PM
its easier to read the diagram, at least! haha
 
I presume world is on the server and client on the client
 
right now 'client' is socket.io in my app.js
which basically mimics any events to the client
 
I've used a similar concept
except I labeled Enemy as Entity
and World as Game
 
I think that the architecture can be abstracted even more into categories: event producers, event processing engine and event consumers
 
And clients listen to any changes on the game
 
12:14 PM
yes, because entity could be enemy or player, i assume? or any game object
 
Game is a proxy for all Entities
 
event processing engine is probably world in this case
problem is that event producers may also be event consumers
 
true
in most cases, they are
 
yeah
 
so world will need to handle all 'client' requests most likely
 
12:15 PM
so this has to be taken care of somehow
 
@Raynos it does seem that world needs to become a proxy
(i.e. #1) instead of just proxying the load and then enabling direct listening (#2)
 
probably each object which can be interacted would have consumer and producer part
or something like that
 
@BradDickason the thing is it needs to be a proxy
Client does not need a list of entities
the list of entities should be in game
Unless your client is not dumb
in which case you need a different architecture
You may also want to use EventEmitter2 for its namespacing abilities
 
ok guys I have to go but keep this conversation going I'm really interested in this stuff
 
yes i like emitter2, looked at it
@yojimbo87 will do! :D
@Raynos so client only needs to know that an object moved, or one attacked another, etc. i like that
 
12:21 PM
Well yes or even less
It needs to know enough information to keep the visual display accurate
that's all
There are two types of messages you want to send
one from the entity that an event occured
and one from the game telling the client the information it needs
the game is not a dumb proxy
it narrows the information down to only what the client needs to know
 
yes, true :O
brb
 
 
2 hours later…
2:03 PM
How do I set process.env data in ubuntu?
 
should be the same, i think?
 
same as what?
I have no clue how to do it
 
oh sorry
you do it like this:
export REDIS_HOSTNAME="localhost"
export REDIS_PORT="6379"
export REDIS_CACHE_TIME="90"
(this is in your OS, you mean, right?)
that will set it for this instance of your shell
if you want to set it permanently (i.e. each time you startup your computer) you can edit ~/.profile
and paste the commands in there, so they'll run each time you start your shell
the above variablename becomes process.env.REDIS_HOSTNAME
in node
 
Ah ok
 
does that look about right for the world being a router?
mob == enemy
 
2:35 PM
@BradDickason what do you use to draw diagrams?
Your missing the eventsource for the new mob
world should not be the event source
I also think tower and map should listen to mob directly
@BradDickason know anything about couch?
 
2:56 PM
world should be something like message/event broker where this stuff converges
when producer send message/event, he sends it to world and world process it by notifying relevant consumers
I think it's more like star structure than layered
where world (or event processing engine) is the central
since consumers can turn into producers themselves after receiving notification
and responding to them
@BradDickason what do you use to creato those schemas?
 
The more I do node
the more it feels like asp.net mvc :(
 
you mean express?
 
@yojimbo87 sorry was afk, i use Keynote (comes w/ mac) but it's just like powerpoint
it's what i do all my prototyping in, etc :x
 
I see
 
@raynos haven't messed around with couch at all!
 
3:10 PM
@yojimbo87 I'm using lazyboy
 
@raynos just saw your notes about the eventsource, isn't the idea that world would be the event source (aka the proxy)?
so client doesn't have to know 'mob' exists
it just waits for a 'move' event that world sends it
(and world passes mob as an object so client then knows its loc, etc)
 
@Raynos link me to that
 
btw couchbase looks like a good nosql db for storing game objects state and related data
 
but I'm suggesting all the entitires on the server take a shortcut
only the clients should talk to world
 
3:15 PM
in recent webcast they used it for that
 
hmm what's the advantage of entities on the server talking to themselves? (Rather than world routing everything)
wouldn't that jsut lead to alot of extra event listeners piled around?
and potential race conditions (tower needs to know when mobs move but mob might not be loaded when tower is loaded and vice versa)
 
@BradDickason I find it neater
Take a look at github.com/bergie/noflo
gist: 1143943, 2011-08-13 15:18:32Z
# Flow-based example of serving web pages

noflo = require "noflo"

graph = noflo.graph.createGraph "blog"

graph.addNode "Web Server", "HTTP/Server"
graph.addNode "Profiler", "HTTP/Profiler"
graph.addNode "Authentication", "HTTP/BasicAuth"
graph.addNode "Read Template", "ReadFile"
graph.addNode "Greet User", require("./HelloController").getComponent()
graph.addNode "Render", "Template"
graph.addNode "Write Response", "HTTP/WriteResponse"
graph.addNode "Send", "HTTP/SendResponse"

# Main request flow
graph.addInitial 8003, "Web Server", "listen"
graph.addEdge "Web Server", "request", "Profiler", "in"
graph.addEdge "Profiler", "out", "Authentication", "in"
graph.addEdge "Authentication", "out", "Greet User", "in"
graph.addEdge "Greet User", "out", "Write Response", "in"
graph.addEdge "Greet User", "data", "Render", "options"
graph.addEdge "Write Response", "out", "Send", "in"

# Templating flow
graph.addInitial "#{__dirname}/hello.jade", "Read Template", "source"
graph.addEdge "Read Template", "out", "Render", "template"
graph.addEdge "Render", "out", "Write Response", "string"

console.log JSON.stringify graph.toJSON(), null, 2

noflo.createNetwork graph
 
interesting
 
I prefer to visualise this as creating edges, nodes and graphs
It's a good way to visualize event networks
everything is listening on everything else
This is to counter your "a lot of listeners piled around"
@yojimbo87 I was looking for noFlo actually. It should be helpful in event based architecture
 
@raynos yep understood!
 
3:21 PM
I see
that's interesting
I wonder how are the objects notified
if it's just events or something elese
 
4:00 PM
Initial reaction lazyboy is ok
Its got some bugs I will have to fix
@yojimbo87 just event emitters
 
so each object would emit something as producer and listen to something as consumer
 
4:34 PM
probably a stupid question, but is it not possible to bind a function to an event? (rather than using an anonymous function)
trying to do something like this:
mob.on 'load', @loadobj.bind mob
loadobj: (obj) ->
# proxies 'load' events from objects
@emit 'load', obj
i really just want to say "Every time 'load' is emitted, call the function 'loadobj' with the parameter mob'
 
5:00 PM
ugh
lazyboy builds on cradle
and has the same bug
ill just use couch directly
@BradDickason should be possible
but coffeescript might be being hurr durr
depends how it implements @
 
5:25 PM
@Raynos file a bug report
 
Ugh the bug is "delete" doesnt work
It's a useless bug report
 
removing document doesn't work - response hangs out
better than nothing
 
Oh
its a known bug?
Why does the response hang
it doesnt hang in curl
Its bloody annoying that it hangs
how I supposed to check that it succeeded?
gist: 1144061, 2011-08-13 17:31:31Z
r = require("request").defaults({
    "json": true,
    "headers": {
        "Authorization": "Basic " + new Buffer(process.env.COUCH_USER + ":" + process.env.COUCH_PWD).toString("base64")
    }
}),

var base_url = "http://raynos.iriscouch.com/raynos"

// data is an Object
r({
    "uri": base_url,
    "body": data,
    "method": "POST"
}, error(function(err, resp, body) {
    console.log(body);
}));

// returns
{
    error: 'bad_request',
    reason: 'Document must be a JSON object'
}
My POST doesnt work :(
 
I haven't seen this issue within the list on github
 
5:47 PM
Oh
So how do you get around the delete hangs bug?
 
well the truth is that I don't delete stuff in DB
depending on your data structure deletes can break your referential integrity if you have referenced documents
 
>_<
But I have some posts
im storing in the database
do you update them with an isDeleted flag or something stupid ?
How would I remove a post from my blog
 
yeah usually isDeleted
 
:\
 
btw couch also sets similar tag even when you delete it
 
5:59 PM
Why would you do that
 
only compaction deletes it entirely
as I said referential integrity
 
can you back up referential integrity?
 
back up?
you mean rationale?
behind it
 
Yes
 
when some document reference to others and it's deleted you can create "ghost" docs which are not shown
as I said earlier it's a question of data structure
I'm not saying that you shouldn't delete your documents
that's just how I done these things
 
6:39 PM
where is the couchdb error documentation
 
6:59 PM
Something is truncating my URIs
 
shouldn't be quotes also encoded
 
Yes
I need url encoding
 
btw how come you guys are using couchdb and not mongo?
 
I developed fear of mongo from the times when it didn't support single server durability
 
7:16 PM
@BradDickason I tried mongo and didnt like it
im not really using couch for a justified reason
 
also there are some stories about unrepairable data corruption
 
I like its HTTP exposure
 
what I really like about couch compared to mongo is it's crash only design
couch can't be corrupted
some stuff about this "feature" is written here in ACID properties last paragraph
I think couchbase server will become more popular than mongo in the future if it will support UnQL querying
 
7:41 PM
> three days later
DELETE WORKS
IN YOUR FACE COUCH
 
nice! Now you should fix socket.io and the latest chrome ;)
 
no u ._.
how do I permanently add heroku to my path?
 
8:07 PM
i usually do it in my ~/.profile but i tend to muck it up :(
 
@BradDickason how do I add environment variables to heroku?
 
@raynos if you're using the heroku gem you type: heroku config
 
9:12 PM
nice :)
i'll deploy my game when it's not a piece of shit :D
 
 
1 hour later…
10:20 PM
@BradDickason does it do anything?
 

« first day (142 days earlier)      last day (2622 days later) »