Star Wars: BattleCry

Development forum for Star Wars: BattleCry
 
HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log in  

Share | 
 

 AI Programming

Go down 
AuthorMessage
Ben2356



Posts : 83
Join date : 2012-11-05
Location : In a galaxy far far away....

PostSubject: AI Programming   Tue Mar 12, 2013 11:25 am

Hello guys, its been a while but between working on the textures, which I have been taking a break from (if that's okay Smile ) and I have become really interested in AI programming after playing the new Crysis 3. I have taken a deep look into the Crysis 2 AI scripts and such and have been trying to understand and learn how the AI does what it does and why. As sort of a beginner programmer (although I have progressed quite a bit and know some stuff) I have been researched and attempting to build a simple AI script and was wondering if anyone who is a programming pro out there is willing to collaborate with me as I try to tackle this and create a good base point for this game in terms of AI. I want to try my hand at doing some scripting, although I don't know if I chose something that is too out of my league Rolling Eyes
Back to top Go down
View user profile http://www.moddb.com/members/starkiller2356
Schlechtwetterfront

avatar

Posts : 446
Join date : 2012-11-05

PostSubject: Re: AI Programming   Thu Mar 14, 2013 3:35 am

I might know a bit about programming but I have not the smallest clue about AI. And AFAIK no one of the current programmers has.
But go ahead and try it anyways. If you never choose something out of your league, how should you learn? We'll try and assist you as good as possible. Wink
Back to top Go down
View user profile https://sites.google.com/site/andescp/
Ben2356



Posts : 83
Join date : 2012-11-05
Location : In a galaxy far far away....

PostSubject: Re: AI Programming   Fri Mar 15, 2013 8:09 am

Ok, I'll try my best to learn and figure out it cause for some reason I woke up one morning and I was like I want to learn how to program (or at least change) AI in Crysis 2. Kind of weird but if I have any questions I'll post them in this thread, thanks!
Back to top Go down
View user profile http://www.moddb.com/members/starkiller2356
sceluk
void Work();


Posts : 364
Join date : 2012-11-07

PostSubject: Re: AI Programming   Fri Mar 15, 2013 10:22 am

Actually..I do. My Uni course is about AI and I know quite a bit about learning algorithms, decision trees, Markov Models and all that crap. I've made a 'human body gesture' (sitting, running jogging etc), with 50% sucess rate. Not very good, but for a first try with limited budget (i.e 0). Training Data was the problem and lack of time to refine the algo. Also made a custom OCR with about 98% succes, and basic learning thing (not complete)
But do we really need to program the AI? IMO the AI in Crysis 2 is better than many games I've seen (doesn't mean its awesome though).
And we can't really change the AI itself, since we don't have access to the actual AI code.
What we can change are the scripts, which control bits of the AI.
Anyways, I say we get the Vehicles and Abilties working first, since they are not implemented at all.
We can always make do with CE3 AI for now, and since its Multiplayer its not that important anyways.
Back to top Go down
View user profile
Schlechtwetterfront

avatar

Posts : 446
Join date : 2012-11-05

PostSubject: Re: AI Programming   Fri Mar 15, 2013 10:34 am

I think he meant using the AI system, not writing his own. Or basing his AI off of the C2 one and thus 'changing' it. From what I saw the AI we have access to is quite high-level, so I assume it's nit that hard for a programming newbie, as opposed to creating new vehicle movement systems or whatever.
Back to top Go down
View user profile https://sites.google.com/site/andescp/
Ben2356



Posts : 83
Join date : 2012-11-05
Location : In a galaxy far far away....

PostSubject: Re: AI Programming   Fri Mar 15, 2013 12:16 pm

Right now I am using the AI system in Crysis 2 until I figure out how the process works so I can write some simple scripts and look like a pro Cool . Hopefully once I get good enough at that I will be able to make my own AI system (that is a very complex field and right now confuses the heck out of me), so like Schlechtwetterfront said, I am using the high level scripts for the AI. I think someone will have to code the deep systems and stuff of the AI and I can create the scripts.

I personally find the AI of Crysis 2 to be sort of lacking and horrible at times so it originally started as a personal project to create advanced AI mod for Crysis 2 but it seems most of the problems lie in the system itself such as the pathfinding. I am probably doing the most basic thing right now with AI since the limited modding on Crysis 2 Smile
Back to top Go down
View user profile http://www.moddb.com/members/starkiller2356
sceluk
void Work();


Posts : 364
Join date : 2012-11-07

PostSubject: Re: AI Programming   Sun Mar 17, 2013 5:10 am

My point still stands though.
We need to focus on systems that are needed for the beta. We have a working\stopgap AI which will not be used much anyways, as the game is MP, not SP.
Like vehicles (which I'm supposed to be doing, and I have a couple of prototypes), and abilities (Ande)
hoth without walkers will be bad, eh?

And to change the pathfinding, I think that will require low access, and that's the part of the code that does not come with Free SDK (it comes with commercial though).
We could make better threat detection\assessment scripts and things like that, though.
Back to top Go down
View user profile
Ben2356



Posts : 83
Join date : 2012-11-05
Location : In a galaxy far far away....

PostSubject: Re: AI Programming   Sun Mar 31, 2013 2:42 am

sceluk wrote:
My point still stands though.
We need to focus on systems that are needed for the beta. We have a working\stopgap AI which will not be used much anyways, as the game is MP, not SP.
Like vehicles (which I'm supposed to be doing, and I have a couple of prototypes), and abilities (Ande)
hoth without walkers will be bad, eh?

Is there any really basic scripts that are needed to be coded that a beginner could do because other than AI I'm not really sure where to go. Also for flowgraph scripting, I was playing a lot with that in the Crysis sandbox editor (2 and 3) so I think I am pretty good at flowgraph scripting for gameplay right now if that is needed.


Also in the scripts for the Crysis games they always reference to objects/classes and functions that have parameters, how do I know what is available and what there is as far as these go? I think that is my biggest setback right now is determing what is available and what the arguments are and such.
Back to top Go down
View user profile http://www.moddb.com/members/starkiller2356
Schlechtwetterfront

avatar

Posts : 446
Join date : 2012-11-05

PostSubject: Re: AI Programming   Sun Mar 31, 2013 3:24 am

If at all Flowgraph will only be used for individual map stuff (and possibly some UI things).
There's nothing really basic for you to script right now but when I'm back I'll see if I can find something for you. The documentation on crydev has some Lua functions with arguments etc described but many are missing or incomplete. In most cases it's easier to just search the Cpp code for the scriptbinds because you can see the exact amount of arguments and their type. This will only work for some classes though as not all scriptbinds are accessible. If you know that another entity has similar functionality, just look at that entitys lua file.
Back to top Go down
View user profile https://sites.google.com/site/andescp/
Ben2356



Posts : 83
Join date : 2012-11-05
Location : In a galaxy far far away....

PostSubject: Re: AI Programming   Sun Mar 31, 2013 4:07 am

Alright thanks, I really wish there was a more complete documentation but I'll try to figure it out like you said.

Another question I have is why some things like entitys are coded in LUA while other things are coded in C++, is it because of script speed? Also is the C++ code the code that is stored in the crygame.dll file or is that just referencing?

I am such a noob Neutral
Back to top Go down
View user profile http://www.moddb.com/members/starkiller2356
sceluk
void Work();


Posts : 364
Join date : 2012-11-07

PostSubject: Re: AI Programming   Sun Mar 31, 2013 4:11 am

Well we'd need FG scripting for Hoth for sure, all those special events we discussed (Orbital bombards, opening and closing doors, blowing holes into the mountain (Echo Base), control point controlling the Ion Cannons and auto turrets, Ion Cannon shots)
You could try experimenting with those.
The gameplay flow of Hoth is written in the GDD in the shared folder and also in the Hoth thread.
http://starwarsbattlecry.forumotion.co.uk/t62p50-reqieumthefallen-s-hoth-layout-idea-and-intro
4th post from bottom.

And yeah, I agree CryDev's doc sucks ****.

Yep, the dll files is what you get when you compile the C++ source.
AFAIK, C++ is used when you want to hardcode stuff, and use low level engine stuff efficiently, like hook into the AI, handle physics, do other logic things (they can all be done from Lua or FG, just slower).
Lua is used for higher level stuff like coding quick functions for weapons and editing the parameters. Like for example you want grenades to stun, you put that in Lua so you don't have to recompile and its easier to test and remove if you don't like it. Actual damage values and stuff are in the XML.
Ande correct me if I'm saying BS, you know the Lua thing stuff better than me.

For example, I'm supposed to be coding the Walker vehicles and Melee weapons systems (I swear I will, just need to finish this goddamn thesis, just 1.5 more months,).
Back to top Go down
View user profile
Schlechtwetterfront

avatar

Posts : 446
Join date : 2012-11-05

PostSubject: Re: AI Programming   Sun Mar 31, 2013 4:46 am

All reusable 'systems' should either be coded in Cpp or Lua. And cpp is the base of everything, so you can only do things in lua or flowgraph if they are exposed via cpp flownodes or scriptbinds.
Opening and closing doors already exist, but I don't know how extensive they are. I already have an idea of how to do locking/opening doors via destroying a control table (by using links in sandbox) but this is the wrong place to discuss this.
Back to top Go down
View user profile https://sites.google.com/site/andescp/
Ben2356



Posts : 83
Join date : 2012-11-05
Location : In a galaxy far far away....

PostSubject: Re: AI Programming   Sun Mar 31, 2013 4:57 am

Thanks for the clarification guys, very well explained!

Is there anyway I can get access to the C++ source through the .dll files in high level scripting?
Back to top Go down
View user profile http://www.moddb.com/members/starkiller2356
Schlechtwetterfront

avatar

Posts : 446
Join date : 2012-11-05

PostSubject: Re: AI Programming   Sun Mar 31, 2013 6:39 pm

How do you mean access through high level scripting?
If you only want to see the code you can look in the Code folder in your CryENGINE installation. There you can find the source of the CryGame.dll. You can only access the header files of the other .dlls (physics, rendering, etc) though which won't give you any insight of how they work.
If you mean something like calling functions in the .dll from lua, that's not possible unless they're exposed via scriptbinds.
Back to top Go down
View user profile https://sites.google.com/site/andescp/
Ben2356



Posts : 83
Join date : 2012-11-05
Location : In a galaxy far far away....

PostSubject: Re: AI Programming   Mon Apr 01, 2013 1:33 am

I worded that really confusing, sorry, I meant find the C++ (cpp) files with the source code in them, but for some reason when I was looking through the files the code folder flew right over my head.

Also I was wondering about the compatibility between the languages as in LUA it seems to have functions from C++ and was wondering the cross relationship of the languages and how they were compatible. So what I am getting is that scriptbinds link the two languages together, but in what language are they programmed in? I'm going to look this up in further detail cause it seems kind of strange to link two different languages together in a special script that uses only 1 language.


sceluk wrote:
Well we'd need FG scripting for Hoth for sure, all those special events we discussed (Orbital bombards, opening and closing doors, blowing holes into the mountain (Echo Base), control point controlling the Ion Cannons and auto turrets, Ion Cannon shots)
You could try experimenting with those.
The gameplay flow of Hoth is written in the GDD in the shared folder and also in the Hoth thread.
http://starwarsbattlecry.forumotion.co.uk/t62p50-reqieumthefallen-s-hoth-layout-idea-and-intro
4th post from bottom.

I think I'll work on this and try to get a prototype working cause I already have some ideas of how the whole process will flow.


Thanks guys for clarifying my questions, you are a really big help to me!
Back to top Go down
View user profile http://www.moddb.com/members/starkiller2356
Sponsored content




PostSubject: Re: AI Programming   

Back to top Go down
 
AI Programming
Back to top 
Page 1 of 1
 Similar topics
-
» Do anyone have programming card ?
» THE GAMES FACTORY 2
» where the hell is the remote programmer?

Permissions in this forum:You cannot reply to topics in this forum
Star Wars: BattleCry :: Development :: Development discussion :: Coding-
Jump to: