Implementing artificial intelligence in C#

Hy everybody!
Can I use C# codes for Panda3D? Or can I programming in C# in Panda3D?

This would require writing a wrapper for c#, meaning either:

A. Hand building some sort of wrapper, so that c# has access to panda3d’s native c++ code. (for example this)

Another idea would be to extend Interrogate (The panda3d program that automatically generates the Python wrappers for panda3d)
This would likely be hard and very time consuming, Interrogate is likely complicated for it to work well. And also It’s highly undocumented.

You’re only other option would be to build some sort of low-level (C or C++) bridge between the native Python and C# area’s… meaning that you’d do something like the project Jpype does.
(for example this or this)

Panda3d is built to be cross-platform, and C# is owned by Microsoft, meaning it really only works on Windows (Reliably and normally anyway).

I’m going to advise you that all ways of getting this to work would be:
Hard.
Non cross platform.
Probably no where near worth it if you’re only goal is AI.

I would advise you firstly look at PandaAI, it could be of use to you. (Find that in the manual pages here)

If none of that AI suits your needs, I would advise building your AI in C++ or even in python depending on how simplistic it is (otherwise python’s speed could be an issue due to general lack of speed during algorythm’s compared to C or C++)
There is plenty of tutorials on the internet about wrapping C++ code for use in Python, one example would be to look up SWIG, or perhaps Cython could be of use to you.

Hope this helps,
~powerpup118

So it’s better if I search for another engines, like Unity3D.

I was under the impression you where asking if you could use a C# Artificial Intelligance program you’d written inside of Panda3d + Python.

If you’re asking if you can program applications using Panda3d and C# then the answer is almost certainly no.
As stated before, it’d be terribly difficult to write and maintain wrappers for C#.
Especially since nobody around here enjoys C# due to the fact that it’s highly non cross platform.

You should look into Python though, I would bet it’s actually easier to use than C#.

Otherwise, yes I would advise you to look at other game engines.

Panda3d is designed to be used from C++ or Python.
That’s probably how it will stay for a long time, Panda3d + Python is a great combination and allows for fast and easy game development.

It’s up to you though, sounds like more of a personal opinion to me. (as far as choosing a programming language)

~powerpup118

I agree with powerpup118, if C# is a project requirement then you’d better use other engines.

I would enforce the powerpup118’s words. I prefer the Panda’s approach which allows the use of C++ and Python, because you’ve the best of both worlds: you can code the high-level parts with Python and the required-to-be efficient parts with C++.

So, the resulting code will be both high-level and efficient. With a compromise choice (a not-too-high-and-not-too-low level language) your code will be less high-level and less efficient globally.