Comments (10)
Right. There was talk about this on our irc channel. I suggested that we could plug in a Lua interpreter, and we could write the bot AIs on Lua. This would gain us:
- A clearly set API
- Easy to write & test; no need to recompile and restart the game
- Easy for people to add new AIs
This would of course add one more dependency, though.
from openomf.
We should probably have #123 working before we start with AI.
from openomf.
We should allow the AI to be written in both C and Lua because not everyone is comfortable with Lua.
from openomf.
I think we should only pick one, either C or Lua. If people are more used to writing in C, then let's use C. I don't want to start supporting multiple ways doing this when one ought to be enough for everybody :)
from openomf.
I'm "more comfortable" programming in C personally, but there is benefit to coding in LUA as mentioned - iteration without recompiling. Although the initial dependency will likely be annoying to add, it'll make future additions/modifications easier. Several other games already use LUA for these systems, which will be useful.
As mentioned on the forums I'll try to get all the logistics info from OMF: BG how the logic is handled for the bots - no time frame though as it depends on my limited free time. My primary goal is to get all the pilots out first, which shouldn't take too long as I have all the pretty webify-ing stuff in place already for it so people can easily view it.
Malfrex
from openomf.
tb2097: Thanks. I don't know how much of that information we can actually use in openomf, but it would at least give us some insight on how AI can be handled in fighter games.
from openomf.
About Lua vs. C ... Since most people are in favor of C, it might make sense to just reveal an API for the AI's and load them as DLL's. The API i was thinking (from DLL perspective) would be something like this:
- Function for registering/unregistering HAR event callbacks (using the new API rewritten by Vagabond). The events would be stuff like "you were punched/kicked", etc.
- Function for registering/unregistering Arena event callbacks. The events could be stuff like, combat starts, combat ends, arena ends, etc.
- HAR data needs to be revealed to the DLL (eg. type, armor, leg/arm speed/power, stun res, etc.). This could probably be done by just letting the DLL grab a reference to the structs ?
- Pilot data needs to be revealed (tendencies, agility/strength/etc. values). Could possibly be implemented the same way as above ?
- Anything else ?
from openomf.
Would it not be easier to just implement a simple AI and generalize the interface from there, if we ever needed another AI impl?
from openomf.
After some experiments, I've successfully implemented a very dumb AI by creating a new controller.
The things I used are:
- HAR events (API by Vagabond)
- Move data (af_move*)
- HAR data (har*)
I believe those items above are the bare minimum that should be revealed to the DLL and LUA scripts.
from openomf.
We have a basic AI implemented in master...... so closing.
from openomf.
Related Issues (20)
- CI/CD pipeline improvements HOT 1
- More compiler warnings
- AI HARs sometimes (rarely) get stuck on loop, executing the same move over and over. HOT 1
- AI does not capitalize on stuns HOT 2
- AI problems with scrap/destruct. HOT 4
- AI could take advantage of arena specialties
- Clang-Tidy HOT 1
- Clang-Format HOT 1
- In demo games, HARs sometimes get stuck on top of each other
- Proper handling of braces with clang-tidy
- Flatpak? HOT 2
- Feedback Tournament mode - openomf_0.6.6 HOT 1
- Game crashes if saved player is not in a tournament HOT 1
- Arena button stays disabled if you open and close "new" menu in tournament HOT 1
- Feat.req. OMF2097 1.0 preview demo version support HOT 3
- Name Enter Dialog only accepts kick button and not Enter key HOT 1
- Consider also supporting libopenmpt for music playback HOT 1
- OpenOMF is unstable after latest SDL_Mixer merges (segfaults) HOT 12
- Demo mode can't be stopped with using only gamepads / joysticks HOT 4
- Had a Segfault related to scripts and scraps in demo mode HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openomf.