historic_bruno Posted September 7, 2013 Report Share Posted September 7, 2013 Historic_bruno, just to be clear, are your issues with the SVN AI or my beta above?They are all from A14. Quote Link to comment Share on other sites More sharing options...
niektb Posted September 8, 2013 Report Share Posted September 8, 2013 (edited) If we're gonna switch from JS to another language, then Python is surely a great option, because its fast, you don't have to compile it and it works well with C++. Edited September 8, 2013 by niektb Quote Link to comment Share on other sites More sharing options...
sanderd17 Posted September 8, 2013 Report Share Posted September 8, 2013 As almost all game mechanics are in JS, switching to a different language is as plausible as writing a new engine. As you see, we have about just as much JS as C++ code: https://www.ohloh.net/p/game_0ad Quote Link to comment Share on other sites More sharing options...
Yves Posted September 8, 2013 Report Share Posted September 8, 2013 As almost all game mechanics are in JS, switching to a different language is as plausible as writing a new engine. As you see, we have about just as much JS as C++ code: https://www.ohloh.net/p/game_0adWe have multiple copies of JQuery and some JS libraries for tools which aren't directly part of the engine. Also there's a lot of duplicated code in the different AI APIs. This affects the comparision of the amount of C++ code vs. JS code. But I agree that switching would be way too much work, probably just to get the same issues again in a slightly different way. Quote Link to comment Share on other sites More sharing options...
Sonarpulse Posted September 9, 2013 Report Share Posted September 9, 2013 Well if you are going for a big donation push, now's the best time to seek these things, as some things might merit rewriting anyways. Also if enough new code needs to be rewritten vs just maintaining old stuff, the new code can be in the new language and the old stuff kept in the old. Even if something were rewritten, and in the short term the rewriting slowed things down, you may be glad you did it. It's like the US switching to metric, it's annoying, it's painful, but it's only going to get more difficult in the future. Better incremental changes now than a complete engine rewrite for the sequel.Last I heard (about a year ago), much of 0ad's performance woes could be traced to the fact that it wasn't very parallel. Haskell provide very per formant lightweight (implicitly preemptive) concurrency http://benchmarksgame.alioth.debian.org/u32q/performance.php?test=threadring and unlike, let's say node.js, distributes those threads across multiple OS threads/cores. Additionally transaction memory, and/or immutability means deadlock and the other normal concurrency woes are out of the picture.Rust also supports similar lightweight concurrency, though I am not sure if it's implementation is as mature. It doesn't support transaction memory for safe shared state, but also allows rigorous use of immutable data structures and additionally offers unique pointers / notions of ownership to tackle the same problem. Additionally it's probably easier to interface with the existing C++ code.Javascript doesn't support parallelism, so there is little you can do to tackle that problem while staying with it. Even with existing code, I wouldn't say rewriting in C++ is going to be less painful than one of these languages, and without a good preemptive concurrency library you may still not reap all the performance benefits. Quote Link to comment Share on other sites More sharing options...
MoLAoS Posted September 9, 2013 Report Share Posted September 9, 2013 Using Javascript inside C++ may not have been the best choice IMO. I mean, you are going to all this trouble for a JS compiler. Sure its JIT but, it may have just been better to use a compiled language in the first place.It will be interesting to see if you eventually make it all the way using Javascript and still have top notch performance. Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted September 9, 2013 Report Share Posted September 9, 2013 Guys you tested all Ai with maximum population 50. The Ai never try to attack only defend and is easily to beat. Quote Link to comment Share on other sites More sharing options...
alpha123 Posted September 9, 2013 Report Share Posted September 9, 2013 Using Javascript inside C++ may not have been the best choice IMO. I mean, you are going to all this trouble for a JS compiler. Sure its JIT but, it may have just been better to use a compiled language in the first place.It will be interesting to see if you eventually make it all the way using Javascript and still have top notch performance.The nice thing about JavaScript is that it allows us to develop really fast, and since most of the game logic isn't performance-critical speed doesn't really matter. Some stuff that is in JS really shouldn't be though. For example, AIs do pathfinding in JS. We can move performance-critical components to C++ pretty easily, so I really doubt our usage of JS is much of a performance issue.You guys should consider something besides C++ and Javascript. Haskell, Rust maybe.Ha! I thought I was the only one that thinks we should have used Haskell! Quote Link to comment Share on other sites More sharing options...
MoLAoS Posted September 9, 2013 Report Share Posted September 9, 2013 Well its a performance issue because you HAVEN'T move all the performance critical stuff to C++.Personally I am not sure what sort of development speed issues C++ has. I never felt like it was taking me a long time to add a new feature. Quote Link to comment Share on other sites More sharing options...
historic_bruno Posted September 9, 2013 Report Share Posted September 9, 2013 Personally I am not sure what sort of development speed issues C++ has. I never felt like it was taking me a long time to add a new feature.Never seen a dangling pointer, double free, heap corruption, memory leak or platform specific compiler error? Lucky you! But this discussion isn't really productive, nobody is offering to write the AIs in a different language, and even if they could, without a solid design we would run into the same problems, and others that are more annoying to troubleshoot thanks to C++. If you think C++ is always "fast enough", take a look at our pathfinder. Bad algorithms give bad performance, it doesn't matter the language or the hardware involvedBecause of JS garbage collection and the fact it's slower than native code, we know we shouldn't be processing a lot of data in JS. That's possible to solve, and we can still get the benefits of a.) new AIs and mods not requiring rebuilding the engine (even if you made them modular, in C++ they become unportable binaries), b.) possible AI script hotloading, change a script and it could instantly reflect the change in-game, c.) lower learning curve to begin developing AIs, if you have a text editor and basic programming knowledge you're ready to go and unlike C++, you don't worry about the machine the code will run on.Based on contributions to 0 A.D. that I've seen over the years, people find JS (as a scripting language) more approachable and comfortable than C++, and that drives AI, random map, gameplay and UI development more than one guy who knows everything about C++. 1 Quote Link to comment Share on other sites More sharing options...
RedFox Posted September 10, 2013 Report Share Posted September 10, 2013 Never seen a dangling pointer, double free, heap corruption, memory leak or platform specific compiler error? Lucky you! To be perfectly honest, the first four are issues that a modern compiler can easily catch and doesn't hamper development. I've never seen a dangling pointer error without getting a crash beforehand, thanks to VC++ Debug Runtime.The last issue though - platform specific errors - have been a bane of my existence for the last 2 months. Code that works on Windows, doesn't on OSX/Linux due to driver and compiler differences. Quote Link to comment Share on other sites More sharing options...
Sonarpulse Posted September 10, 2013 Report Share Posted September 10, 2013 (edited) Ha! I thought I was the only one that thinks we should have used Haskell!Us Haskellers are slowly becoming more prevalent! Edited September 10, 2013 by Sonarpulse Quote Link to comment Share on other sites More sharing options...
gameboy Posted September 14, 2013 Report Share Posted September 14, 2013 Over a long period of time, the new Aegis AI can released? Quote Link to comment Share on other sites More sharing options...
Don Posted September 14, 2013 Report Share Posted September 14, 2013 I don't think you can write on in C++ now, so you have to do it in Javascript. However we're planning to move some things to C++ for performance, so there might be a day when this is possible.OK, so if I were crazy enough to proceed with developing my own AI---which I assure you, I'm only considering because I don't want to mow the lawn---how would I turn off the fog of war to watch what the AI is doing? Quote Link to comment Share on other sites More sharing options...
wraitii Posted September 14, 2013 Author Report Share Posted September 14, 2013 You could check that by activating the developer overlay (alt+d by default I think) and checking "reveal map".As for the new AI, I've fixed an important bug regarding naval transport this week but have lacked time. I'll try to work on it more tomorrow, and try to commit it sometimes next week. We'll see. 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted September 15, 2013 Report Share Posted September 15, 2013 Nice job, I have a question: whether the new release of Aegis AI can save and load archive files? Quote Link to comment Share on other sites More sharing options...
jcantero Posted September 15, 2013 Report Share Posted September 15, 2013 If you plan to to change the scripting language, please please consider Lua prior of any other language. It's the preferred one of the game industry for these type of things*, and for good reasons. Also, it's very efficient and easy to integrate with C++ (enough to copy the sources in a directory of the project). It is used mainly for AI scripting, but it can be used for anything. Of course it's open source (MIT license).* The list of games that use Lua is quite big, including a pair of the more recent Total Wars, Civilization V, SimCity 4, Crysis and World of Warcraft, to name a few. It's also used in well-known open source games. 1 Quote Link to comment Share on other sites More sharing options...
scroogie Posted September 16, 2013 Report Share Posted September 16, 2013 jcantero: I think this was discussed several times. I would have chosen Lua as well, but apparently there were reasons against it. Just saying that people were actually aware of Lua. Quote Link to comment Share on other sites More sharing options...
gameboy Posted September 21, 2013 Report Share Posted September 21, 2013 This week released a new AI, why did not it? :unknw: Quote Link to comment Share on other sites More sharing options...
alpha123 Posted September 21, 2013 Report Share Posted September 21, 2013 Us Haskellers are slowly becoming more prevalent!I admit to snickering a bit while they talked about dangling pointers and whatnot up there.... This week released a new AI, why did not it? :unknw: Because it's not finished. Expect it in the next few weeks/month, I guess. Ideally we'd like to have it in for Alpha 15.gameboy, developing an AI this complicated is hard work. I think you underestimate how much effort is involved in something like this, especially since the underlying APIs are still changing while we experiment to try to find something that works well and quickly.I'd say the current AI works well enough though, at least for the time being. I haven't encountered any particularly weird issues with it in Alpha 14 (although I don't play the AI much any more). Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted September 21, 2013 Report Share Posted September 21, 2013 Apeven next year, he can do it thing more important for now. May be with lobby you can enjoy more,less lag and more tactical experience. Quote Link to comment Share on other sites More sharing options...
gameboy Posted September 25, 2013 Report Share Posted September 25, 2013 Today is September 25, okay, let us continue to wait for its arrival! Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted September 25, 2013 Report Share Posted September 25, 2013 Next year guy XD. Quote Link to comment Share on other sites More sharing options...
wraitii Posted September 25, 2013 Author Report Share Posted September 25, 2013 Sorry guys, I've been a little stopped this WE (had a very fun WE with fellow students, but I had to rest for a bit). I think I'll be able to work on 0 A.D. properly this WE though. Quote Link to comment Share on other sites More sharing options...
gameboy Posted September 25, 2013 Report Share Posted September 25, 2013 ok, my friend, I hope you come back soon start 0 AD's work on the preservation of the game whether the problem can be solved loads of it? I want to know about this problem has been solved or already have the solution?Please forgive me anxious mood! :hi: Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.