AIInterface:C: Difference between revisions

From Spring
Jump to navigationJump to search
Hoijui (talk | contribs)
No edit summary
Hoijui (talk | contribs)
No edit summary
Line 1: Line 1:
{{AIInterface|C|hoijui|v0.1 (spring SVN)|C & C++|working|GNU GPL v2+}}
{{AIInterface|C|hoijui|0.1 (spring GIT)|C & C++|working|GNU GPL v2+}}


=== Description ===
=== Description ===
Line 8: Line 8:
=== Currently supported AIs ===
=== Currently supported AIs ===
* '''[[AI:KAIK|KAIK]]'''
* '''[[AI:KAIK|KAIK]]'''
* '''[[AI:RAI|RAI]]'''
* '''[[AI:AAI|AAI]]'''
* '''[[AI:NTAI|NTai]]'''
* '''[[AI:NullAI|NullAI]]'''
* '''[[AI:NullAI|NullAI]]'''
* '''[[AI:NullLegacyCppAI|NullLegacyCppAI]]'''
* '''[[AI:NullLegacyCppAI|NullLegacyCppAI]]'''
* '''[[AI:RAI|RAI]]'''


=== Download ===
=== Download ===
Line 16: Line 18:


=== Known Crashes ===
=== Known Crashes ===
*None
* None


=== How to compile ===
=== How to compile ===
* include directories: ''{spring_source}/rts/System {spring_source}/AI/Interfaces/C''
'''The easy way'''
* source files: ''{spring_source}/AI/Interfaces/C/*.cpp''
Use Scons or CMake (refer to [[Building_spring|Building spring]]).
 
'''The hard way'''
* include directories:
** {spring_source}/rts/System
** {spring_source}/AI/Wrappers/CUtils
** {spring_source}/AI/Interfaces/C
* source files:
** {spring_source}/AI/Interfaces/C/*.c*
* create dynamic loadable shared library (module)
* create dynamic loadable shared library (module)
* should compile with all C++ compilers
* should compile with all C++ compilers (tested with: MinGW, GCC, Intel)
tested under Linux32 and Win32


=== How to install ===
=== How to install ===
from source at ''{spring_source}/AI/Skirmish/NullAI/'' :
from: ''{spring_source}/AI/Interfaces/C/''
* copy libC-0.1.so, libC-0.1.dylib or libC-0.1.dll to ''{spring_data_dir}/AI/Interfaces/impls/''
to: ''{spring_data_dir}/AI/Interfaces/C/{C-AIInterface-version}/''
* copy InterfaceInfo.lua to ''{spring_data_dir}/AI/Interfaces/data/C-0.1/''
* copy ''lib*.so'', ''lib*.dylib'' or ''*.dll'' to ''.''
* copy ''data/*'' to ''.''


''' [[AIs|<- Back to AI page]]'''
''' [[AIs|<- Back to AI page]]'''
[[Category:AIInterface]]
[[Category:AIInterface]]

Revision as of 15:44, 14 January 2009

C
Developer
hoijui
Version
0.1 (spring GIT)
Language Support
C & C++
Status
working
License
GNU GPL v2+
<- Back to AI Interfaces

Description

This AI interface is written in C++ and allows spring to load AIs written in C and C++. Thes AIs may be compiled with any compiler, as long as they export some C functions in the correct way (see {spring_source}/AI/Skirmish/NullAI/AIExports.h for reference).

If you plan to write your own AI interface library, it is recommended to use this one as a template, or at least for reference ({spring_source}/AI/Interfaces/C/).

Currently supported AIs

Download

It comes with spring (SVN version).

Known Crashes

  • None

How to compile

The easy way Use Scons or CMake (refer to Building spring).

The hard way

  • include directories:
    • {spring_source}/rts/System
    • {spring_source}/AI/Wrappers/CUtils
    • {spring_source}/AI/Interfaces/C
  • source files:
    • {spring_source}/AI/Interfaces/C/*.c*
  • create dynamic loadable shared library (module)
  • should compile with all C++ compilers (tested with: MinGW, GCC, Intel)

tested under Linux32 and Win32

How to install

from: {spring_source}/AI/Interfaces/C/ to: {spring_data_dir}/AI/Interfaces/C/{C-AIInterface-version}/

  • copy lib*.so, lib*.dylib or *.dll to .
  • copy data/* to .

<- Back to AI page