326 reputation
311
bio website
location
age
visits member for 3 years, 2 months
seen Dec 2 at 17:43

May
12
comment Canvas - darken sprites rendered by drawImage
Yeah, it would be faster, but the trouble is, I have 16 light levels, and I am considering going up because the difference from one tile to the next is still rather noticable. That would mean increasing the memory consumption by 16x! I guess I could give this technique a try, it just feels like it wouldn't be fast enough.
May
12
comment Canvas - darken sprites rendered by drawImage
That's a good and simple technique, but I fear it would be too slow to be done on a per-tile basis.
Jul
13
comment Huge performance difference when using drawImage with IMG vs CANVAS
@hustlerinc: You mean render from a canvas onto itself? What would that prove? All the game's graphics are loaded from images, so you have to use an image at some point in the process.
Jul
13
comment Huge performance difference when using drawImage with IMG vs CANVAS
The trouble is that I'm relying on offscreen canvases to compose complex images. For example, I'm rendering a character's animation frames into an offscreen buffer, and then rendering things like clothing/armor/weapons on top. The game then renders from the composite canvas, rather that re-rendering all these details for each character, each frame. With canvas-to-canvas performance being so poor in non-Chrome browsers, I'd have to render the composite back into an image. It's not the end of the world, but I was hoping there is a workaround.
Jul
12
comment Huge performance difference when using drawImage with IMG vs CANVAS
But why is there a difference at all when in both cases they are rendering the same data? And the fact that at least one major browser has the opposite performance characteristic means we need to implement two code paths in our renderers.
Jun
26
comment QuadTree: store only points, or regions?
Thanks, this makes sense. Sure, processing cross-node objects would be slower than objects that are completely inside a node, but I can't see any way around that. I could increase the node capacity to keep the fragmentation down, but this would increase the number of objects included in collision detection. I'll play around with that to find a good balance.
May
23
comment Choose tile based on adjacent tiles
I am examining all surrounding tiles, but I didn't know how to handle all the tile combinations. For example, you have seven possible tiles to choose from (horizontal, vertical, four corners, and a cross). I thought of using complicated switch statements, but that felt wrong.
May
23
comment Choose tile based on adjacent tiles
Great, now my comment doesn't make sense! :p Just kidding, thanks for your answer. That's exactly what I was looking for.
May
23
comment Choose tile based on adjacent tiles
Never mind, I see what you're doing. You're setting bits 3 and 7, but you're counting from the left, instead of the right.
May
23
comment Choose tile based on adjacent tiles
Very nice! Simple and efficient. The only thing that I don't understand is how you're getting those bitmasks. For example how are you getting a bitmask of 17 from the numbers 3 and 7?
Oct
19
comment How can I determine the first visible tile in an isometric perspective?
@Man With Steel Nerves...: You're right, I saw that too. Rendering needs to start from the 14,3 in this case. This actually makes cases 1 and 2 the same. In both cases the algorithm needs to "backtrack" from the starting tile (decrementing map-x and view-x), until the current tile is -HalfTileHeight above the top of the view.
Oct
15
comment How can I determine the first visible tile in an isometric perspective?
@user712092: I have thought about it, but it seemed easier to do a 2D game first. There is too much code already written to switch now. The next version will almost certainly use WebGL.
Oct
15
comment Java vs Javascript for Web-based games
Thanks, that's a pretty detailed analysis. I am designing a Web-based game, with an eye towards mobile support, so Flash is out (no iOS support), and it appears so is Java (no support on Windows Mobile in the future).
Oct
15
comment Java vs Javascript for Web-based games
It does seem that way... if the future is plugin-less browsers, then Java is in the same boat as Flash and Silverlight. It looks like Javascript will be the only choice for Web apps. At least until Google persuades the world to switch to Dart.
Oct
13
comment How can I determine the first visible tile in an isometric perspective?
@Man With Steel Nerves: I'd post a screenshot but SO won't let me because of my low reputation. But picture a large diamond clipped inside a smaller rectangle.
Oct
13
comment How can I determine the first visible tile in an isometric perspective?
That's a good idea. I could simply continue the rendering loop until the current tile is inside the map and the view. I'll try this as soon as I can find some time! :)
Oct
13
comment How can I determine the first visible tile in an isometric perspective?
@user712092: Yes, I am using a 4x4 matrix to transform between view space and world space. That works, but the issue is how to calculate the x,y coordinates for the tile closest to the top-right edge of the view.