Archived

This topic is now archived and is closed to further replies.

anandt4u

Newbie help reply please

Recommended Posts

Hi i am newbie to AI/game programming and to this forum. I need some help 1) Can I program games using C#. I did not actually find anyone here using c#. 2) What exactly is AI (Please explain me with some simple eg or algorithm) 3) What do I exactly need to do a project in AI. 4) Can AI only be implemented in Games?? Please answer Thanks Bye Anand. T

Share this post


Link to post
Share on other sites
You should learn how to program first, and then ask these questions.

Most people use C/C++. I''m not sure about C#. I would learn C/C++ if I were you. You might find Visual Basic easier to learn at first though.

Good luck,
Will

Share this post


Link to post
Share on other sites
1) Can I program games using C#. I did not actually find anyone here using c#.

So far as I am aware, yes. Almost any language can be used to write games of some sort.

2) What exactly is AI (Please explain me with some simple eg or algorithm)

Stated very simply it is the resemblance of intelligent behaviour or decision-making by a computer based upon real time scenarios. For example a hunting bot will hunt for prey, a prey bot will hide or run from a hunter.

3) What do I exactly need to do a project in AI.

An idea that requires decisions which would be hard to code completely.... poker, chess are examples.

4) Can AI only be implemented in Games??

No. Some methods are used by automatic pilots in civilian aircraft. Handwriting and speech recognition, natural language translation and weather forecasting use AI methods.

Hope this helps a little.




Stevie

Don''t follow me, I''m lost.

Share this post


Link to post
Share on other sites
1) Can I program games using C#

Yes, you can program games in anything you want. Most shrink wrap commercial games are written in C++ and most Web games are written in Java or Flash but you can write a game, like any program, in any language you want. And with C# you can write a game just as good as any commercial game you would buy although you''d have issues selling it as the customers would have to have .NET installed on their PCs

2) What exactly is AI

AI or game AI?

AI is a tough one and doesn''t really have a good (agreed upon) definition. AI is a field filled with people who want to do AI. The best description i''ve heard is that AI is whatever people in the AI field are doing. Which can be pretty much any CS topic not covered by another field (languages, OS, databases, etc.). But for me the definition i use is that AI is the study of how to make decisions. Game AI is how to make decisions in games. In my opinion, the topics and tools game people work with and the topics and tools used by the AI community are pretty different. Goals are pretty different too since game programmers have more emphasis (proportionally) on making human like decisions while AI people prefer to work on things that need good decisions. After all, who wants to build a calculator that adds as slow as a human and makes human-like math errors?

Examples. What spell should i use? What piece should i build? Should i buy boardwalk? Should i fight or run away? Should i mine that ore to my left or the ore to my right? Which enemy should i attack next. Which route should i take to get over there? Those are some common issues faced by game AI programmers and there are quite a few different methods and tools used to address each one

BTW, some people consider writing IF THEN statements to be AI. Some don''t. Most game programmers i know don''t really worry about the names of things, they just try to get their program working and shipping on time

3) What do I exactly need to do a project in AI.

Write a program. Have it be required to make a decision. Very few people write 100% AI code. Most AI programs do a lot of things in which some "AI" is required. Most programs don''t need or use AI

4) Can AI only be implemented in Games??

Nah. i''ve implemented things that i guess you could call AI in a health insurance system (claim adjudication determines whether to pay your bill or not), sales (to help customers determine which PC is right for them to make sure that certain PCs can be built) and scheduling (determining who has to come into work on which days). i''m right now writing something for a mortgage company''s internal support staff to walk them through the process of fixing a problem

-baylor

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Thanks for those replies guys. But I get one more question

"Stated very simply it is the resemblance of intelligent behaviour or decision-making by a computer based upon real time scenarios. For example a hunting bot will hunt for prey, a prey bot will hide or run from a hunter."

Such situations such as explained require coding!!. Does that mean we code many situations and the system takes one code which it chooses right at that particular situation??( Is my interprettation of AI correct??)

Please do reply
Thanks
Bye
Anand. T

Share this post


Link to post
Share on other sites
First of all, you seem to be a newbie, in the future, ask such questions in the beginner forum.. however, I might have some help for you:

1. Yes, a concrete example is 3dState Developerstudio. That one is for beginners, and you could try to write some simple 3d games in it together with Visual C#.

2. Choise selection. "Should I shoot the player in the head or should I lay down on floor crying? Ohh.. fuck that, I''m hungry!"

3. A program that makes choises of some kind.

4. I don''t think anyone has created a real "AI". But for the thing as we know as AI today, games are just a small part of all usage. Robots uses AI too.. also spellchecking in MSWORD has to use simple(?) AI.

Share this post


Link to post
Share on other sites
quote:
Original post by anandt4u
Such situations such as explained require coding!!. Does that mean we code many situations and the system takes one code which it chooses right at that particular situation??( Is my interprettation of AI correct??)



Yeah, pretty much

IF (this.State = Fighting) AND
(this.Enemies().Count > 0) AND
(this.Weapon.AIValue < this.Enemies[1].Weapon.AIValue)
THEN
this.State = RunAway
END IF

Something like that. You end up writing an awful lot of code. In games, the game doesn''t have to be intelligent, it just has to act like it

There are a few techniques to make it a little easier but writing a lot of code is generally how it''s done (as far as i know)

-baylor

Share this post


Link to post
Share on other sites
Baylor touched on a very good point when doing AI programming. How it comes up with it''s decisions is completely irrelevant, as long as the outcome is good. When deciding what target to aim for in a dart game, you could have 100''s of lines of if''s and conditionals and point/difficulty ratios and linerally interpolate between my score and your score, but in the end, if it just makes the AI''s choice of target appear random, then you''re better off just using a simple random number to determine the target. Key is it only has to APPEAR to be intelligent.

Share this post


Link to post
Share on other sites
Something I did to help me learn about AI was download the Quake3 game source. Its a bit time consuming to dredge thru the code, but its worth it. Somke of the functions are like
"DoesEntityWantToAttack(...)"

but if you dont know how to code, it may be a bit hard to learn from it, but it can atleast give you ideas.

Share this post


Link to post
Share on other sites