C# AI Interface, and Proof of concept C# AI - Page 3

C# AI Interface, and Proof of concept C# AI

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Chojin
Posts: 141
Joined: 04 Oct 2006, 11:22

Post by Chojin »

The requested URL /csai/CSharpAI-20061028.zip was not found on this server.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

Chojin wrote:
The requested URL /csai/CSharpAI-20061028.zip was not found on this server.
Whoops. Corrected.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

I keep having a crash, "incorrect global AI DLL" with a path given of AI\Bot-Libs\CSAI.dll
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

Ok, when you choose the bot, can you try selecting "csailoader.dll" as the bot?

You can delete CSAI.dll and CSAI.pdb from AI\Bot-libs . You could move them to AI\CSAI, but the easiest could be to delete them and run the setup.exe from the CSharpAI zipfile.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

I've gone through and nixed all of the old files and let your installer do it, but the problems persist. I am using the csailoader.dll now. It crashed before commander started to move with "an unhandled exception occured in the global ai dll, please contact the author of the ai." Tried changing maps to a small one and that didn't help.
silv
Posts: 30
Joined: 25 May 2006, 07:24

Post by silv »

hughperkins wrote:
silp wrote:csai (newsest and 25th of october version, also the new loader dll) crashes for me instantly ...
silp,

Could you download manageddreams.com/csai/CSharpAI-20061028.zip , unzip it, and run setup.exe then try running spring again?
ty, worked like a charm and crushed me on the first try (core_faf), mostly bc i didn't anticipate it playing so aggressively :)
User avatar
Gabba
Posts: 319
Joined: 08 Sep 2004, 22:59

Post by Gabba »

Hey, I'd just like to ask the OP and especially Jcnossen: why the choice for C#/mono? I don't like much the fact that it's not really cross-platform. Why not Lua as in supcom, or Python or something similar?

I understand that these new bindings are a pet project, but it would be nice that they benefit all Spring users, not only the windows ones.

The question is even more important in the case of the new OSRTS, because if the new dev team uses many C# features unavailable in mono, the project may never get on Linux or always lag behind. Which would be sad, since all the other librairies used are cross-platform.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

osrts is partly developed by linux users (tobi, trepan), so we'll notice it directly when something is not implemented in mono (you won't find anything big lacking in the actual runtime / C# compiler though).
Hey, I'd just like to ask the OP and especially Jcnossen: why the choice for C#/mono? I don't like much the fact that it's not really cross-platform. Why not Lua as in supcom, or Python or something similar?
This thread is about hugh's AI, so if you want to discuss it further please go to the osrts forum.

There are some arguments for the .NET platform choice in the ML discussion as well: http://lolut.utbm.info/pipermail/taspri ... 01623.html

Basically... .NET rules, and you can still execute Lua or Python (using IronPython) on it.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

As stated in the other thread, if people have problems using this AI then make sure your virtual memory size is dynamic. I couldn't get it to run with 2 gigs of RAM and another 4 gigs of swap. It really has to be dynamic for some reason to be stable.
Chojin
Posts: 141
Joined: 04 Oct 2006, 11:22

Post by Chojin »

I just tried the new CSharpAI_20061031.zip on Darkside Remake versus AAI. The game finished successfully, although in the end I was spammed by

Code: Select all

Stumpy: Can't reach destination!
Stumpy: Can't reach destination!
Stumpy: Can't reach destination!
Overflow when sending to local connection 1 0 39995 15 40000
Overflow when sending to local connection 1 0 39990 15 40000
Overflow when sending to local connection 1 0 39990 15 40000
Overflow when sending to local connection 1 0 39990 15 40000
The game was like 10 minutes... but the replay file is 150mb. There still seems to be something wrong with the amount of commands given to the CSAI units.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Madrat if(Ramsize==VRAMsize) performanceslowdown();

vram should be a minimum 3x the size of physical ram, so a 2gb swapfile for 2gb ram is a disaster for getting the max out of 2gb ram.

Also, python is much slower than C#, and lua is an annoyance, that doesnt even support proper classes natively, just work arounds involving metatables, among other lacking features of the lua platform.

And what about windows suers? I cant imagine that the vast majority of windows users knwo what python is nm where to downlo\d and install it from, or why they should install it, especially when the .Net framework is more and more commonplace, even supcom requires the .Net framework and I wouldnt be surprised if it was using lua .Net rather than the old lua.
Chojin
Posts: 141
Joined: 04 Oct 2006, 11:22

Post by Chojin »

And what about windows suers? I cant imagine that the vast majority of windows users knwo what python is nm where to downlo\d and install it from, or why they should install it, especially when the .Net framework is more and more commonplace, even supcom requires the .Net framework and I wouldnt be surprised if it was using lua .Net rather than the old lua.
Same old reasoning as always...

Google: "python"
* First link: http://www.python.org
* First sublink: http://www.python.org/download/

Google: "lua"
* First link: http://www.lua.org
* Second sublink: http://www.lua.org/download.html

But.. what is Google exactly?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Ok would you rather we ended up with a horde of python or lua devs?

Or a horde of C# devs?

Considering the latter are more likely to switch to C++, and considering I find C# easier than python or lua as a C/C++/Java coder, and as C# is faster than laua dn python, and sicne tis a much mroe pwoerful language, and since by default using C# opens up VB .Net IronPython, lua.Net, J#, F#, ruby, tcl, and a load of other languages, doesnt it seem that going for a linux orientated dynamically typed scripting language thats much slower would be a bad idea?

From where I'm seeing it python and lua have no advantages here, .Net has mono for crossplatform, comes by default via windows update , runs faster, has a bigger featureset, and already has support for compiling .Net assemblies via IronPython and lua.

And personally I wouldnt bother with OSRTS if it was all lua or python, which arent exactly good choices for a game engine anyway considering how much of the engine is planned as being in C# and not C++.

Also, a common design ethic is to assume the user is dumb, which throws out downloading python immediatly, it'd have to be integrated into the engine itself.
Chojin
Posts: 141
Joined: 04 Oct 2006, 11:22

Post by Chojin »

considering I find
That's what it's all about, right?
[The rest...]
Is related to the topic in what way?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

erm, I'm not aware of any succesful games written in python, and indications are suggesting lua in supcom is not lua as in lua.org but lua as in http://www.lua.inf.puc-rio.br/luanet/ afterall making you install the .Net framework for a flimsy autorun.exe is a bit odd.....

However I find this particularly indicative of your attitude:
Chojin wrote:
considering I find
That's what it's all about, right?
[The rest...]
Is related to the topic in what way?
Ad hominem circumstantial.
http://en.wikipedia.org/wiki/Ad_hominem ... umstantial

You have put forward no logical arguements to support your point, all you have done is insist your point is how it should be done, try to make a mockery of the people who disagree with you, and you have not logically challenged any of my points at all, rather tried to undermine them with logical fallacys and assumptions. So please stop trolling.

As for overflow error messages , they are not because CSAI is in C# but because of the way spring cant handle masses of commands sent at once. Human players can generate this error by chainbuilding huge rows of construction commands very quickly, and the c++ AI's had this problem too and implemented work arounds in the form of command caching(OTAI & NTai) or reducing voerall commands sent(AAI).

However I think hughperkins is already aware of this as I emailed him the source to NTai command caching among other files a few days ago.
hollowsoul
Posts: 665
Joined: 06 Jun 2006, 19:49

Post by hollowsoul »

Eve-online might get back & start playing.
uses stackless python.
7.4 How is the game logic implemented in EVE?


EVE uses a special Stackless version of Python for both the server and the client. This makes for a much simpler creation of game logic than what was available in the past. The control structures provided by Stackless allow for a more ├óÔé¼┼ôprocedural syncronous├óÔé¼┬Ø model, rather than an ├óÔé¼┼ôevent driven asynchronous,├óÔé¼┬Ø or thread pooling.

In more simplified terms, this means that a large number of actors can perform tiny tasks without the added complexity or overhead of the other two execution models. Our game logic scripters are thereby freed from many of the mundane tasks associated with models that don├óÔé¼Ôäót benefit from the control structures provided by Stackless. The creative process of writing interesting game behavior is no longer bogged down by software or system limitations.

This approach also means that making changes to the game is much easier than it has been historically. Many improvements or tweaks can be added even when the world is online and going strong without the need to reboot the servers. This process is called a hot fix.

Please help us support Stackless Python and the excellent contribution it is making to online gaming.
http://www.eve-online.com/faq/faq_07.asp

Best online game ever imo no shadders userbase split over servers.
Pretty much complete freedom todo anything ie want to be pirate / hauler / producer / all out killing / mercerancy group for hire. Or even be a spy against a major alliance / corp spy

Be going on for years & only 1 company based in iceland makes it & is pretty much there all they do.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

Civ4 has Python embedded and uses it for both base game and mods.
http://www.sthurlow.com/cvDocs/

BTW Python has recently (as of 2.5) acquired coroutines which make it extremely suitable for doing event-based stuff, such as unit behaviour.

PS what happened to pyai patch/dll/whatever it was?
Chojin
Posts: 141
Joined: 04 Oct 2006, 11:22

Post by Chojin »

You have put forward no logical arguements to support your point
I made a point somewhere? wow... didn't realize...

I stated the fact, that I have heard your reasoning over and over again. Not even judging it...

And I mentioned, how someone with a keyboard, a mouse and access to google.com will be able to install python/lua within seconds.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

My sister had a keyboard and mouse yet was baffled and puzzled over how she was supposed to save her essay to a usb drive. And I know a lot of freinds who have come to me baffled and confused asking about installing activeptyhon. And lua.org isnt too nice about howto setup lua to run arbitrary lua scripts either.

I've even had people ask me how do I use an installer program, where do I extract it to, the user is always dumb when your designing because there will always be a user who just hasnt got a clue.

Simply put lua and python dont have the necessary featureset and speed for AI necessary. Hence why the only binding that has succesfully managed to support any AI at all has been hughperkins C# bindings. There just wasnt any desire by anybody to code in python or javascript for Spring AIs.

The only people who seem to benefit from using python are linux users who usually have it all preinstalled anyway.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

Installing Python is arguably easier than setting up Spring lobby, besides, any smart Spring installer would come with whatever dependencies required and/or download and install them. NSIS has such functionality AFAIK.

Lua is so small it's usually distributed with the app itself.

Any talks about speed are worthless. You can compile a C module for Python and import it in your ai (or even make a usual dll/so and access it via ctypes) IF it's really too slow and that you can't tell without benchmarking it first.
Post Reply

Return to “AI”