digitalmars.D - I made a specific yet advanced game playing AI but I want to bring it
- Gan (25/25) Dec 31 2015 I've written an AI to play a game in Objective-C on Mac. The AI
- Rikki Cattermole (14/36) Dec 31 2015 I'll start out by saying, this is more appropriate for D.learn not the
- Gan (6/22) Dec 31 2015 The shared library wouldn't be cross platform. I'd have to write
- Rikki Cattermole (4/28) Dec 31 2015 Not really.
I've written an AI to play a game in Objective-C on Mac. The AI bits are mostly C++ code for performance. I want to make the AI cross platform because the game has a huge windows user base. My hope is to get other programmers interested in helping out because it is very time consuming to make perfect screen detection and AI decisions. My question is, to write the Mac and Windows specific code in and input simulation; can I have that code be usable from D? I don't know much about shared libraries or importing DLLs so I have no knowledge on the possibility. I would like to write all the AI code in D but have all the OS specific code written in their own languages that I can call from D. I am very familiar make them all play nice. Maybe there's a way to compile the OS specific code in libraries and D can call them depending on which OS the D code gets compiled to? Would anyone know how to do this? Or have basic examples? To start I'd just like to write a D program that can call some window but maintain full control in D such that D could issue further already compiled commands. Also receive input, like a button is clicked and that button sends an event notifier back to D. Is this plausible?
Dec 31 2015
On 31/12/15 11:20 PM, Gan wrote:I've written an AI to play a game in Objective-C on Mac. The AI bits are mostly C++ code for performance. I want to make the AI cross platform because the game has a huge windows user base. My hope is to get other programmers interested in helping out because it is very time consuming to make perfect screen detection and AI decisions. My question is, to write the Mac and Windows specific code in their simulation; can I have that code be usable from D? I don't know much about shared libraries or importing DLLs so I have no knowledge on the possibility. I would like to write all the AI code in D but have all the OS specific code written in their own languages that I can call from D. know how to make them all play nice. Maybe there's a way to compile the OS specific code in libraries and D can call them depending on which OS the D code gets compiled to? Would anyone know how to do this? Or have basic examples? To start I'd just like to write a D program that can call some specific maintain full control in D such that D could issue further already compiled commands. Also receive input, like a button is clicked and that button sends an event notifier back to D. Is this plausible?I'll start out by saying, this is more appropriate for D.learn not the main D Newsgroup. What you have here is two separate issues. - Interacting with Objective-C which over the next few years will become very easy (WIP currently). Otherwise you can interact with it via extern(C). do-able with the help of extern(C). You'll need to get good at interacting with unmanaged code from there, which I cannot help with One thing to remember D is a native language meaning an exe cannot be ran on Linux and vice versa. It won't be as simple as compiling as a shared library once and using it everywhere.
Dec 31 2015
On Thursday, 31 December 2015 at 10:29:42 UTC, Rikki Cattermole wrote:On 31/12/15 11:20 PM, Gan wrote:The shared library wouldn't be cross platform. I'd have to write one for each platform I target. So what I got from this is that in theory it's possible but is there a lack of resources about the process?[...]I'll start out by saying, this is more appropriate for D.learn not the main D Newsgroup. What you have here is two separate issues. - Interacting with Objective-C which over the next few years will become very easy (WIP currently). Otherwise you can interact with it via extern(C). still do-able with the help of extern(C). You'll need to get good at interacting with unmanaged code from there, which I One thing to remember D is a native language meaning an exe cannot be ran on Linux and vice versa. It won't be as simple as compiling as a shared library once and using it everywhere.
Dec 31 2015
On 01/01/16 10:15 AM, Gan wrote:On Thursday, 31 December 2015 at 10:29:42 UTC, Rikki Cattermole wrote:Not really. Since you'll be going over extern(C) you won't have any trouble. It may just be a bit big the bindings.On 31/12/15 11:20 PM, Gan wrote:The shared library wouldn't be cross platform. I'd have to write one for each platform I target. So what I got from this is that in theory it's possible but is there a lack of resources about the process?[...]I'll start out by saying, this is more appropriate for D.learn not the main D Newsgroup. What you have here is two separate issues. - Interacting with Objective-C which over the next few years will become very easy (WIP currently). Otherwise you can interact with it via extern(C). do-able with the help of extern(C). You'll need to get good at interacting with unmanaged code from there, which I cannot help with One thing to remember D is a native language meaning an exe cannot be ran on Linux and vice versa. It won't be as simple as compiling as a shared library once and using it everywhere.
Dec 31 2015