Work, work

Posted on April 1, 2012 | 3 minute read

Warcraft 3 peon work, workGot a bit more sleep last night - went to bed at 2am instead of 3-4. The lighting saw a lot of progress. I think all of the core functionality we need thus far is in. There will be tweaking of lighting levels etc, but in terms of what it can do - it’s pretty much all good for the time being, although I’ve accounted for the possibility that we may need to add more to this later and made sure the code is fairly flexible. This meant that last night I also got started on coding the stuff we’ll need for level 1.

Lighting overview

The main thing that was left to do with the lighting was to enable the range of light from the emitting entity to influence other things in the world - including game states and other entities. Using the .distanceTo method worked as I suspected, so now we can figure out the exact distance from any entity in the level to the edge (or any part) of the light by doing this:

distanceToLight: function() {
    var distance = this.distanceTo(ig.game.lightobject);
    var vis = ig.game.lightobject.visDistance;
    var lightSize = vis * 64;

    if (distance < lightSize) {
        this.atLight = true;
    }
}

[caption id="attachment_47777” align="alignleft” width="224” caption="Notes”]JavaScript game notes[/caption]

Now here’s the thing…

Right now we have one entity emitting light and references to it are hard coded throughout the entire project. However, in level 1 specifically, the regular light emitting entity will need to get destroyed and changed to a different entity. This is what I will be working on today. Basically I’ll need to create a separate “emitter” attribute in my controller class and use that to set the lighting instead of the direct reference. This shouldn’t be too difficult, but with how permeated these references are throughout the code it can take a bit of time and debugging to get it all working.

Placeholder art is becoming a challenge

Aside from the challenges of actually coding this thing, art is becoming a bit of a blocker. I’m using placeholder tiles and spritesheets for the time being and even though I’m resizing them to the general size I think we’ll go for with so many random placeholders everywhere it’s hard to visualize the overall feel of the first level. I know what it is in my head and I know that the functionality is almost there in the code, but then it’s a matter of translating the head feel to the game feel. In addition the placeholders are also causing potential technical limitations. The length of the animations, resizing based on state, how they’re triggered, etc all need to be considered in the code - all of these things are going to have to be recoded when we start working with finalized art assets and the longer we wait the more recoding there will be.

I think I’ll spend some time tonight documenting potential dimensions for every in-game element and playing around with things like player movement speeds, gravity, jump height, etc.




Categories:game dev dev games
comments powered by Disqus