Jump to content

Ykkrosh

WFG Retired
  • Posts

    4.928
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Ykkrosh

  1. Lines like "E = V I_0 \int_0^{d \over f} (1-e^{-t / k}) dt" aren't exactly the easiest things to write either, but I agree that it's much better than the ASCII alternative (and not too ugly when you get used to it). I've heard of Texvc (part of MediaWiki), which can convert TeX equations into PNGs, and I think I used it successfully a while ago, though I'm not sure whether the WFG server is likely to have OCaml installed; are there any other similar programs?
  2. var object = getGUIObjectByName("etc"); var size = object.size; size.left += 100; size.rleft = 0; // percent object.size = size;and object.size = new GUISize(1, 2, 3, 4, 5, 6, 7, 8); // last four are optional work for me. (Unfortunately "object.size.left += 100" doesn't; I'm not sure if that's even possible in JS (at least without making "s=object.size; s.left += 100" also affect 'object' directly))
  3. The JS/GUI interface code uses something that looks like an exception(*) when the GUI detects invalid inputs (as well as logging "Invalid value for setting ...", and whatever the GUI itself might log), so the rest of the function won't be executed. (The 'exception' propagates upwards until it reaches some C++ code which ignores the failure). So it's not a crash, it's just a controlled response to an unexpected error condition . (Though there's always a good chance of my code being broken and causing real crashes, so please complain if you ever find any ) You can (I think) write try { object.size="orangutan"; } catch (E) { /* it failed */ } (in JS) if you want to carry on after failures. Or would it be more straightforward just to log the error and then carry on as normal? (which would avoid the confusion of functions suddenly aborting; except it'd add the confusion of things being subtly wrong (and unnoticed until you look at the log(**)) and would remove any way of letting JS code detect the error when it wants to. Eventually it'd be nice to just launch a debugger, but I have no idea when we're planning to start thinking about beginning to do that). *: It just does a "return JS_FALSE" into SpiderMonkey; I have no idea whether they really are exceptions, or how to store more data in them if they are (or how to throw real exceptions if they aren't), but they do respond to try/catch like exceptions do. **: Maybe the last few lines of recent console activity should always be displayed at the top of the screen? That would make the errors/warnings more obvious while we're developing things. A 'developer mode' (independent of debug/release mode) would be nice, to enable those kinds of things for us and for modders but not for general players.
  4. A while ago I found something about Φ (hoping Unicode works) here (link to audio hidden at the bottom). It's surprising how much stuff you can discover on the internet when you're bored
  5. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <TITLE>Hello, World Page!</TITLE> </HEAD> <BODY> Hello, World! </BODY> </HTML> Why assume that "valid" requires HTML 4 or XHTML? Older specifications still exist, and there's nothing wrong with writing for them
  6. That's precisely why I dislike Java (although I last (and first) looked at Java about five years ago, when I'd never even tried OOP in C++, so hopefully I'll now be able to survive having to learn it later this year...)
  7. For cross-platform GUIs I've been using wxWidgets, which works very nicely (in my opinion). Our desire is for all 0 A.D. modding tools to work on Linux, and wx is also nice enough to provide lots of other things for cross-platform applications (file handling, threading, dynamic library loading, HTTP/FTP, etc, most of which I've never wanted but at least it's there), so I like it
  8. The maximum texture size should be limited only by your graphics card -- my GF4 can apparently go up to 4096x4096 (see e.g. glview, Extensions...Capabilities...Various limitations...Max. texture size). I can't see any obvious limits in the game engine lower than 2 billion x 2 billion, and I wouldn't want to download a mod with textures approaching that size
  9. Ostrich, camel, Tyrannosaurus Rex. Do I win?
  10. Not unless someone wants to donate $1200/year for us to get the gmax dev tools (A couple of years ago, gmax dev cost $80,000 - I guess they've decided it isn't worth quite that much.) It is possible to write exporters in MAXScript just using the free parts of gmax (although they're not particularly easy to use) - it should be useful for lots of people, and so it would be good to provide with 0 A.D., but I have no idea if it will actually be done.
  11. I think we're solving that by just not having any blocking operations. Most things are event-based -- e.g. using setTimeout(code, time) to execute a piece of code in some amount of time, rather than using sleep(time). Guessing wildly (someone please correct me if I'm wrong ) there won't even be a separate piece of script code that's executing for every unit -- a higher-level AI script will tell the unit to attack, and the unit is made to choose targets and attack them by the C++ engine. (But I wouldn't trust me to be correct about that). It's possible to use closures in JS to emulate something vaguely like coroutines (I think that's what they're called), as a kind of cooperative threading: function stuff(z) { var x = 0; alert("x = "+x); return function(){ var y = 1; alert("x = "+x+", y = "+y); return function(){ alert("x = "+x+", y = "+y+", z = "+z); }} } (where "return function(){" means "return now but let me be called again to continue from this point" -- a preprocessor could make it less ugly), then use it with something like var a = stuff(5); // says "x = 0" a=a(); // says "x = 0, y = 1" var b = stuff(10); // says "x = 0", as an independent 'thread' a=a(); // says "x = 0, y = 1, z = 5", accessing the original parameter to stuff()Have the engine code store the function-object-thing that's returned, and execute it again when the blocking operation has finished, and that should vaguely work. Alternatively, SpiderMonkey supports multiple 'contexts' which might be a simpler solution to the problem, but I don't know much about them or whether they could do what you want.
  12. Completely useless information but almost relevant to the discussion: I found time to be patient and tried PAQAR 2.0, which some places consider to be the best that exists; after about half an hour (1824.63 seconds), it produced a 2306KB file, 12% smaller than 7zip's 2635KB. It's extremely good at compressing, but it's painfully slow, and I think there's a limit to how much time I'm willing to wait
  13. Ah, I don't think I've seen that before - thanks for mentioning it. Except UHARC gave an almost identical file size to 7z (10KB smaller, or about half a percent, which is fairly negligible), but took about 20 seconds to decompress that 2.5MB file compared to 7z's 2 seconds. So unless people want to spend as much time decompressing as downloading, UHARC is probably not the best choice
  14. 7-Zip does even better compression - various parts of Prometheus are 3.4MB as zip, 2.9MB as rar, and 2.6MB as 7z. And it's free, which is nice For any attempt at security, you have to assume people are as nasty and devious and patient as they can possibly be; telling a non-tester the password is no harder than telling them the URL to download the file, and neither are much harder than just sending them the uncompressed contents; none of those are at all effective as security. A CD key type thing for testers might work reasonably well - tie each key to a specific username and limit it to one connection at a time, which would discourage people from giving anyone else their key (since they'd have to share their username and their time). For the released game, CD keys would be fairly pointless - we're not going to charge $50 to get a new one, so losing a key (by being banned) wouldn't have any negative effect on its owner. Unless we make it really really difficult to get one (mmm... Tribes 2...) but putting off legitimate players is probably not a particularly good plan
  15. Yes, in a very limited way - as you download a piece of the file from one person, you're sending other pieces of the file back to them. It only uploads from the file which you're currently downloading, rather than sharing everything you've ever downloaded, so it's nicer than most other P2P systems. About security/privacy: There's no way to stop transmission of a downloadable file, so making it public (but hidden) over BT is no worse than having people send copies to their friends over IRC. I think the only way to restrict usage is by having some online verification system whenever someone tries to play it.
  16. It should be fairly easy to use the web server as a seed for the torrent - with only one person downloading, it would be almost identical to downloading directly from the web site, and it'd be faster/cheaper as soon as more people start downloading.
  17. Just something I saw when looking aimlessly around various places; relating to elephants in war: I noticed that 0 A.D. does include elephants and pigs, but unfortunately this important tactic appears to be impossible in the game :-(
  18. I did the SWGB mod programs in [not-particularly-advanced] VB (easy to make nice windows, hard to make nice resizing or dynamically-generated windows); the original GeniEd in Perl with a console-based UI (only slightly better than a command-line interface); the AOM file-converter in Perl/Tk (didn't need a particularly complicated interface since it was just a few buttons and file dialogs, but the code was still quite ugly); and GeniEd2 in C++ with wxWindows, which seems to solve all the problems I had with the other methods (although it probably adds all new problems which I just haven't noticed yet ). And it's easy to embed C++ code in C++ programs, unlike in other languages (the SWGB tools take forever to decompress SLPs and AOMEd has the most unbelievably pathetic (and still extremely slow) palettisation code), so it's now my language of choice until something better comes along
  19. I don't know much about MPS, but it sounds like the only particularly interesting part of MPS3 is terrain editing, which isn't hugely interesting - not enough to make me happy about touching VB again :-( (Although it's quite probable that I'm unaware of what MPS3 can actually do that nothing else can.) There might be some potential for boredom in the near future (four months of holiday left! yay!) -- I don't want to commit myself to anything long-term, but I'd be happy to help out if there's something simple enough
  20. The original (and slow and ugly) GeniEd tried to understand the entire genie.dat file from SWGB, and there were too many differences in AoK's empires2.dat for me to bother doing it. GeniEd2 is much simpler since it only tries to handle the unit data, so reading AoK's slightly different format wasn't particularly hard. And being a complete rewrite, it's far less horribly slow and ugly than the original
×
×
  • Create New...