- Map and gameplay enhancements. Add strategy to the real-time
- Use of other html5 techniques, e.g. audio-tag for audio, websockets for multiplayer gameplay
- Custom content creation and modification. Users will be able to upload own units and maps to a central repository. Also AI of units might be controlled by editable user-scripts...
Blog about (Web-) Programming, Graphics and Games.
11.03.2010
Towards a Web-RTS-Game
Here is a demo for a real-time-strategy (RTS) game using WebGL. Currently there is only very basic gameplay: you can select units using left mouse button and let them move around with the right mouse button. Following is planned for future releases:
Abonnieren
Kommentare zum Post (Atom)
17 Kommentare:
Nice demo!
However, very much performance is lost in some very inefficient calculations, especially calcVerts.
Mmul is also quite slow. See ewgl (http://code.google.com/p/ewgl-matrices/source/browse/trunk/ewgl-matrices/javascript/EWGL_math.js#167)for fast matrix and vertex implementations. Also use WebGLFloatArrays as much as possible!
Good luck!
Thanks for the comments and link. That will help me to make the code more efficient. Are there nice tools to detect performance-bottlenecks in javascript-code? I too have in mind to implement more stuff using WebGLFloatArray, maybe also the inner matrix representation.
Yes!
In Chromium and Safari you have a built-in profiler (Chromium: Page icon, Developer, Developer Tools, Profiling) and in Firefox you could install Firebug.
Nice! I will take a look at that.
I get an error, maybe my graphics card is not good enough? (Radeon HD 3650). Though gnomwgl.htm works fine.
Error message:
http://www.jameswritesstuff.co.uk/err.png
Thanks for the comment and error message. Here I cannot reproduce the error (I have nvdidia gtx 8800). With regard to gnomwgl.htm, I changed the shaders (to introduce transparency for shadows and cursor). This might cause the crash on some computers..
I guess it is probably just the card, it is pretty old.
Yes, that may be the case. Btw, the demo runs on my computer with minefield and with chromium (http://bit.ly/9G5Z01) but not with chrome dev.
same error message. running current mozilla firefox nightly build and current chrome "dev channel".
In Firefox (Minefield 3.7a4pre) no content is rendered in the canvas. In Chrome (5.0.360.4) the models are loaded once accepted the error message, but instead of textures, they look white and un-playable.
Maybe this link helps you in the debugging, so i'll paste it here: http://khronos.org/webgl/wiki/Debugging
I can also confirm that the behavior in chromium 5.0.366.0 (43120) is very similar to Chrome: Shader fails to compile, so you get untextured actors.
If it worked 19 days ago, then maybe something has changed in the spec.
I cannot reproduce the bug, here it runs with chromium and minefield. It probably depends on graficcard. Maybe someone can tweak the shaders so that they dont cause that error and post the results here. That would be nice.
I get the same error compiling the shader with http://www.iquilezles.org/apps/shadertoy/ . I wish I could be of more help, but I'm not a GLSL expert.
For the record: The spec changed last week and latest builds are adapted to it. WebGLArray has changed, getParameter and getAttribLocation have been merged, getContext has been corrected and in general, a lot of previous WebGL work is now incompatible with the spec and doesn't work with latest builds. All examples in http://learningwebgl.com/blog/?p=11#examples do work with my GFX card.
However, I don't think that is the issue. I don't think Shaders have changed. ATI card here. It runs a dx9c shader model 4 game daily.
OK, I got the shader fixed. Where it says "uniform float uAlpha=1;" , it must read "uniform float uAlpha=1.0;". woot, now I can write GLSL!
Thanks for the help! I updated the source with that fix.
This fails in WebKit nightly with WebGL enabled, with the error:
ERROR: 0:3: 'uniform' : cannot initialize this type of qualifier
This like this is due to this line:
uniform float uAlpha=1.0;
Initialization of uniforms is not allowed in GLSL, but apparently some drivers allow it.
This fails in WebKit nightly with WebGL enabled, with the error:
ERROR: 0:3: 'uniform' : cannot initialize this type of qualifier
This like this is due to this line:
uniform float uAlpha=1.0;
Initialization of uniforms is not allowed in GLSL, but apparently some drivers allow it.
Sorry for long time no update, but the Webkit issues should be fixed now.
Kommentar veröffentlichen