Jump to content

Yves

WFG Retired
  • Posts

    1.135
  • Joined

  • Last visited

  • Days Won

    25

Everything posted by Yves

  1. I have checked the profiling a bit more closely and discovered some issues with the soundmanager's threading implementation. The worker thread always runs at full speed and newer sleeps. This is not an issue if your CPU has enough idle cores but can theoretically have a significant impact if you only have one core or if your system decides to put the main thread and the soundmanager worker-thread on the same core. I've done a quick and dirty implementation with semaphores, similar to the user reporter. It wakes the thread up every 10 seconds. This implementation currently breaks fading for obvious reasons, the music on the main menu starts delayed and most likely there are a bunch of other issues I haven't discovered yet. However it's good enough for a first comparision: current svn implementation: my modified version: As you can see it makes quite a difference. Obviously my implementation will become a bit slower too as the bugs get fixed. @stwf Is it ok for you if I continue my work and ask you for review as soon as it's more stable? If you like to fix it yourself it's fine for me, in this case I'd start checking wraitii's new AI for performance issues. I have some ideas there too.
  2. Could you check the profiler output please? There are two kinds of profiling information available. One is for average performance of certain components of the game and the other is to measure performance in specific frames. I guess the first won't be sufficient in this case but we can check it anyway. 1. Average performance Start a game an hit shift+f11. It will save a profiling log and show you where it was saved. Please post it here. 2. Detailed performance per frame That's a bit harder to explain. Switch to windowed mode by hitting alt+enter or start the game in windowed mode by adding the following line to local.cfg windowed = "true" Now start a game and then press F11 which should enable the profiler. Open profiler2.html in a web browser (I think it doesn't work with chrome, but IE or Firefox should be fine) I'm not sure if profiler2.html is included in the alpha 12 download but if not you can get it here (you also need the other two files): http://trac.wildfire...tools/profiler2 There will be an assertion failure when profiler2.html tries to get data from the game (hit continue). That's a known problem which will hopefully be fixed in the next alpha. You should get something like this: On top you see a lot of frames (each vertical bar is one). There should be some bars which are much higher (the lag spikes). You can click in the upper bar to get a detailed view below. Click higher to get less frames in the lower part and therefore a better overview of the single frame that takes longer. With this view you should be able to quickly identify the coloured region that causes the lag. Something like "gui" or "sim update". Not sure if that was compreshensible .
  3. I agree that the game has a fast pace in multiplayer games. My definition of fast is that the most important resource is my time and the game deciding factor is where I spend this time. I would prefer if good tactics were more important than clicking-speed and knowing your shortcuts (I don't know them well). Maybe it will be improved when we have better support for formations and when we really start working on the balancing.
  4. My first guess is that the download is corrupt somehow. You can try downloading it again or if you want to make sure that the download is ok you can check the MD5 sum. The resulut should be: 18b33696da59d76e9a3f08f31708a615
  5. Nice video, it should be posted on the frontpage of play0ad.com. Maybe about a week after the release of alpha 12 so that both alpha 12 and your video get the attention they deserve.
  6. Thank you! Now it's a bit clearer grep 'DRI driver' /var/log/Xorg.0.log [ 23.737] (II) RADEON(0): [DRI2] DRI driver: r600 It tells me that I'm using the r600 driver but noch which version I'm using. I guess I can use different versions with Mesa 9.0 or is that tied together?
  7. I'm a bit confused about the drivers. glxinfo | grep OpenGL OpenGL vendor string: X.Org OpenGL renderer string: Gallium 0.4 on AMD RV730 OpenGL version string: 2.1 Mesa 9.0 OpenGL shading language version string: 1.30 OpenGL extensions: Mesa is the OpenGL implementation but since imporatant parts of OpenGL have to be implemented in the device driver, there are different drivers which are part of mesa, right? Radeon (the same as xf86-video-ati?) and RadeonHD are 2D drivers, but are they completely independent of the 3D drivers and not part of mesa? According to wikipedia Gallium3D is a free software library for 3D graphics device drivers. R300 and R600 use this Gallium3D api and their name seems to refer to the graphics chips with the same name. However they support much more than just R300 and R600 chips, so this name is quite misleading. Is this more or less correct and how can I find out which 3D driver and which version I'm exactly using?
  8. I noticed that most of the links on moddb point to the old website.
  9. I've found out that the profiler gets an assertion failuere because it can't find any sync markers in the soundmanager's buffer. For testing I've put "g_Profiler2.RecordSyncMarker();" on line 149 of soundmanager.cpp which fixes the problem... but I'm not quite sure yet how often/when this should be called. That's the description in Profiler2.h * The RecordSyncMarker calls are necessary to correct for time drift and to * let the buffer parser accurately detect the start of an item in the byte stream. ... * Other threads should call g_Profiler2.RecordSyncMarker occasionally, * especially if it's been a long time since their last call to the profiler, * or if they've made thousands of calls since the last sync marker. It looks like you currently don't really use the profiler for the soundmanager. Do you think it makes sense to add some profiler macros to the code?
  10. Looks here (and in the following posts) for information about the profiler: http://www.wildfiregames.com/forum/index.php?showtopic=15270&st=20#entry228237 At the moment the html output seems to be broken somehow (it doesn't output anything) but I'm trying to fix it.
  11. I've upgraded to Ubuntu 12.10 and I'm currently using the open source driver. Now I get around 30 fps, so that upgrade doubled the framerate! The performance is still not as good as with fglrx but it's enough to actually play the game and the X-freezes are gone. Btw. when testing some settings for the game I tried: postproc = "true" You can see how it looked in the attachment. That's the first time I've tried this settings so I don't know if it worked with other drivers before.
  12. Yes it's this one. I get this in my Xorg.0.log: I've tried disabling buffer tiling because I red that it could be related but it didn't help (but reduced the framerate to radeon-level ) Option "BufferTiling" "off" Now it becomes difficult... I guess the only way left is to try a newer version of the radeon driver.
  13. ARGH. I've installed fglrx 12.6, but it still has the same bug.
  14. Have you ever tested the radeon driver? If you did, was there such a big performance difference too?
  15. When using fglrx (the proprietary driver from AMD) the system often freezes with this error when debugging: Fatal IO error 11 (Die Ressource ist zur Zeit nicht verfügbar) on X server :1. This means "Resource temporarily unavailable". The radeon driver does not have this bug but its performance is much lower. On Acropolis 1 I get around 44 FPS with fglrx directly after starting and only around 16 FPS with the radeon driver. I'm using a Radeon HD 4670. I could try newer versions of both drivers or I could try the radeonhd driver but I wanted to ask first if anyone has similar problems. Do you think it's normal to have a so much lower framerate with the radeon driver? I've red that its performance is a bit lower but that seems to be quite a lot.
  16. http://www.gesetze-i.../stgb/__86.html I'm not a lawyer but I think it clearly states that using symbols as the swastika is allowed if it's used for teaching, coverage of history or art which I think could all apply to our situation. I don't think it should be a legal problem. On the other hand I think if we can accurately portray the maurians without using swastikas we should avoid it (I don't know if it was used everywhere or if It's just one symbol out of many). My opinion is that freedom of speech or the freedom of artists should have a high value from the legal point of view but there's no need to use this freedom if anyone could get hurt or offended and if there are comparable alternatives.
  17. You can always check the sourceforge stats. We had a peak ealrier on the 24th and a very little increase on the 28th. http://sourceforge.net/projects/zero-ad/files/stats/timeline?dates=2012-11-01+to+2012-11-29
  18. Unfortunately I don't know what it dumps exactly. I wish it was documented better. Until 5000 recursions it doesn't change the output but when I set 10000 i get: InternalError: too much recursion lol
  19. Philip suggested that on IRC too, so I tried this: function jsfunction(s1) { var textfromscript = "textfromscript"; function1(textfromscript + s1); } var countInJs = 7; jsfunction("blablubb"); function2(countInJs); I made two dumps. The first in function 1 and the second when the script has terminated. I can see "textfromscript" in both dumps but "blablubb" only in the first. However the output at the end (where the script has terminated) is still "textfromscriptblablubb". I guess that means the object is actually copied as wraitii said and will always be available. Maybe JS_ConvertArguments prevents GC-related errors.
  20. Makes sense... this means I'd have to create a lot of new objects to fill all available memory and try accessing it later to confirm it. Edit: hmm I remember a function to dump the heap. Maybe I could use that.
  21. Argh. That's true. I also named this variable str and didn't notice it. Now the third output of str is also "textfromscript". So I'm back where I started. No way to cause a GC-Error.
  22. I stumbled upon some garbage collection related questions in 0ad's code and spent a few hours trying to figure out how GC works. The documentation didn't help much so I decided to write a small example program to answer my questions by testing. I understand it better now but there are still some open questions. I thought I could share the program here and maybe someone can even answer some of the open questions. Question: - I'm quite sure that the value of str inside myjs_function2 should be "undefined" too because the javascript variable textfromscript is out of scope. Why not? Output: value of str inside myjs_function1: textfromscript calling GC and waiting 2 sec... value of intjsval inside myjs_function2: 7 value of str inside myjs_function2: textfromscript return value:undefined value of intjsval after script termination: 7 value of str after script termination: undefined main.cpp #include "jsapi.h" #include <iostream> #include <fstream> #include <streambuf> #include <sstream> using namespace std; jsval intjsval; JSString* str; const char* readFile(); /* The class of the global object. */ JSClass global_class = { "global", JSCLASS_GLOBAL_FLAGS, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL, JSCLASS_NO_OPTIONAL_MEMBERS }; /* The error reporter callback. */ void reportError(JSContext *cx, const char *message, JSErrorReport *report) { fprintf(stderr, "%s:%u:%s\n", report->filename ? report->filename : "<no filename="">", (unsigned int) report->lineno, message); } JSBool myjs_function1(JSContext *cx, uintN argc, jsval *vp) { char *text; if (!JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), "S", &str)) return JS_FALSE; text = JS_EncodeString(cx, str); cout << "value of str inside myjs_function1: " << text << endl; //JS_free(cx, str); JS_SET_RVAL(cx, vp, STRING_TO_JSVAL(str)); /* return undefined */ return JS_TRUE; } JSBool myjs_function2(JSContext *cx, uintN argc, jsval* vp) { cout << "calling GC and waiting 2 sec..." << endl; JS_GC(cx); sleep(2); int count; if (!JS_ConvertArguments(cx, argc, JS_ARGV(cx, vp), "i", &count)) return JS_FALSE; intjsval = INT_TO_JSVAL(count); cout << endl; char* text; text = JS_EncodeString(cx, str); cout << "value of intjsval inside myjs_function2: " << JSVAL_TO_INT(intjsval) << endl; cout << "value of str inside myjs_function2: " << text << endl; JS_SET_RVAL(cx,vp, JSVAL_VOID); return JS_TRUE; } JSFunctionSpec myjs_global_functions[] = { JS_FS("function1", myjs_function1, 1, 0), JS_FS("function2", myjs_function2, 1, 0), JS_FS_END }; int main(int argc, const char *argv[]) { /* JS variables. */ JSRuntime *rt; JSContext *cx; JSObject *global; /* Create a JS runtime. */ rt = JS_NewRuntime(8L * 1024L * 1024L); if (rt == NULL) return 1; /* Create a context. */ cx = JS_NewContext(rt, 8192); if (cx == NULL) return 1; JS_SetOptions(cx, JSOPTION_VAROBJFIX | JSOPTION_METHODJIT); JS_SetVersion(cx, JSVERSION_LATEST); JS_SetErrorReporter(cx, reportError); // Enable debugging of GC-related errors (maximum garbage collection after each and every allocation) #ifdef DEBUG JS_SetGCZeal(cx, 2); #endif // DEBUG /* Create the global object in a new compartment. */ global = JS_NewCompartmentAndGlobalObject(cx, &global_class, NULL); if (global == NULL) return 1; /* Populate the global object with the standard globals, like Object and Array. */ if (!JS_InitStandardClasses(cx, global)) return 1; if (!JS_DefineFunctions(cx, global, myjs_global_functions)) return JS_FALSE; /* Your application code here. This may include JSAPI calls to create your own custom JS objects and run scripts. */ const char* script = readFile(); //cout << script << endl; jsval rval; JSString *str; JSBool ok; const char *filename = "unnamed"; uintN lineno = 0; ok = JS_EvaluateScript(cx, global, script, strlen(script), filename, lineno, &rval); if (!ok) return 1; str = JS_ValueToString(cx, rval); printf("\n return value:%s\n", JS_EncodeString(cx, str)); //JS_GC(cx); //sleep(10); int count1 = JSVAL_TO_INT(intjsval); char* text; text = JS_EncodeString(cx, str); cout << "value of intjsval after script termination: " << count1 << endl; cout << "value of str after script termination: " << text << endl; /* End of application code */ JS_DestroyContext(cx); JS_DestroyRuntime(rt); JS_ShutDown(); return 0; } const char* readFile() { ifstream file; char* content; int length; file.open("../../script.js", ifstream::in); // get length of file: file.seekg (0, ios::end); length = file.tellg(); file.seekg (0, ios::beg); // allocate memory (+1 for null-termination) content = new char[length+1]; file.read(content, length); file.close(); content[length] = '\0'; return content; } script.js function jsfunction() { var textfromscript = "textfromscript"; function1(textfromscript); } var countInJs = 7; jsfunction(); function2(countInJs);
×
×
  • Create New...