By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 1,032 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

Programming AI in C++

P: 24
Hello all, I'm new here, now down to business, XD

I am making a very difficult program, and i can't really find the types of info i need to continue, I need a mentor to help me, a mentor that is going to stay with me until i finish, if you are interested please email me at xxxxxxx@xxxxxxx.xxx

If you can tell from my email, yeah, im gonna take a whack at AI, and i know how to do it too, so if you could help me out, that would be great.
*What I'll be using;
Text boxes
Submit buttons
most likely a server
C++
A 3D navigator(person DOING the AI commands)
and about a year of your help.

I have the executable's window up, but so far it is just gray, and i don't know what to do from here. so if i could get some help, it would be great, And i thank you 10000x in advance.

Remember, xxxxxxx@xxxxxxx.xxx




_________________

EDIT:
I 4got to say, I don't have any money at the moment, however, if this plan goes through, we might not have that problem, im sorry, but IF i do get donations, you'll be the first to know.
Aug 6 '07 #1
Share this Question
Share on Google+
32 Replies


P: 93
Hello all, I'm new here, now down to business, XD

I am making a very difficult program, and i can't really find the types of info i need to continue, I need a mentor to help me, a mentor that is going to stay with me until i finish, if you are interested please email me at xxxxxxx@xxxxxxxx.xxx

If you can tell from my email, yeah, im gonna take a whack at AI, and i know how to do it too, so if you could help me out, that would be great.
*What I'll be using;
Text boxes
Submit buttons
most likely a server
C++
A 3D navigator(person DOING the AI commands)
and about a year of your help.

I have the executable's window up, but so far it is just gray, and i don't know what to do from here. so if i could get some help, it would be great, And i thank you 10000x in advance.

Remember, xxxxxxx@xxxxxxxx.xxx




_________________

EDIT:
I 4got to say, I don't have any money at the moment, however, if this plan goes through, we might not have that problem, im sorry, but IF i do get donations, you'll be the first to know.
Don't worry!!! Just go head; I will definitely hold you, If you get styumble.
You can proceed and let me know If you got stuck any point of time.

Take care bye ...

Regards,
Girish.
Aug 6 '07 #2

P: 24
alright, so is that sayin that you are good with C++?
Aug 6 '07 #3

RedSon
Expert 5K+
P: 5,000
It is against site rules to post email addresses. Please refrain from doing it in the future.
Aug 6 '07 #4

P: 24
k, well i STILL need help with the C++ thing.
Aug 14 '07 #5

Expert 100+
P: 671
You can always ask for help on forums. But to ask a random stranger to be a personal mentor is a bit too much. I won't even accept that request from close friends, let alone a stranger. I think that is the case with any knowledgeable person here. Countless people have had to figure out programming and computer science on their own. What makes you warrant such special attention?

This is not because we are being rude or snobby. We would love to help the entire world, but we've got lives as well. We can't dedicate time to helping random people one on one.
Aug 14 '07 #6

RedSon
Expert 5K+
P: 5,000
If you have a question you can post it in the forum. If you need help with your C/C++ code then ask it. No one is going to do your research for you, and no one is going to do your work for you. You can think of this whole site as your mentor. Just ask in the proper forum and someone will be there to answer it.
Aug 15 '07 #7

sicarie
Expert Mod 2.5K+
P: 4,677
Changed the thread title - now you can post your questions, and people who are interested in AI will look! (amazing how that works)
Aug 15 '07 #8

P: 24
ok then, i have many 8^)

1) Where can i find the C++ Color wheel? (such as in html, 000000 is black, FFFFFF is white)

2) I want to make a text box with a submit button, how?

3) I have a windows exe file already made, but it only has a gray screen when i double click on it to start it. If you have a prog called dev-cpp, then you should know what to look for. What i want to do is change that background to a picture called...."pic1"
can someone tell me how to call this picture as a background? it would be located at...lets say C:\pictures\pic1

4) I want to make a button that takes me to another place, first off, i want to click a button that says "Website" on it, and it takes me to an .html document. how do i do it?
another one will take me to the actual A.I. prog.
and I want to make an "About" button, it should open up a new window inside the program, (i also want to know how to put stuff inside this window) so i can drag it around and have a little "x" to close the window.
and finally, I want a button which will close the whole program, "Exit" will be on it.

5) Buttons. say i make the Website, exit, prog, and x button. I rename them pic "2, 3, 4, and 5"
How would i call these pics to be used in the program? is there an X Y axis that i can put them EXACTLY where i want the buttons to be?
i also want a mouse over and a button down pic to be called when i put my mouse over the button, and when i click down on the button.

6) People say that winRAR takes all of the files you need, and puts them into one .exe file, i tried looking, but i could not find it out. is there some sort of program that will let me pick the files i want to be installed? I do want an installer.

that is all for now, but there WILL be more. ;)

Thanks in advance.
Aug 15 '07 #9

Expert 100+
P: 671
Where can i find the C++ Color wheel?
C++ has no notion of colors. Nor does the C++ standard library. How you input colors depends on any third party libraries you use (or if you develop your own).

I want to make a text box with a submit button, how?
Pick a GUI toolkit and learn to use it.

I have a windows exe file already made, but it only has a gray screen when i double click on it to start it. If you have a prog called dev-cpp, then you should know what to look for. What i want to do is change that background to a picture called...."pic1"
This is a Win32 App and not a console app? If you have a bitmap, you can blit it onto the drawing canvas. If it's a third party format like a jpeg, png, gif, whatever, then you'll have to decode it first, ideally with a third party image decoding library like libpng, libjpeg, and so on.

Honestly, this comes down to you doing your due reading. An entire book covers these topics: http://www.charlespetzold.com/pw5/ . Are you seriously expecting us to type a book's worth of response here?

People say that winRAR takes all of the files you need, and puts them into one .exe file, i tried looking, but i could not find it out. is there some sort of program that will let me pick the files i want to be installed? I do want an installer.
You couldn't find WinRAR? Not with a Google search? If you want an installer instead, look at http://nsis.sourceforge.net/Main_Page or actually, just google for installer script or the like. Or look it up on Wikipedia.

You're asking questions on broad topics. You might want to do some reading, and asking something specific. Chances are, if you can't get even attempt to write a bit of code, you didn't Google enough.
Aug 15 '07 #10

P: 24
I thought i could ask a question and have it answered staight forward....i just need the answers nothing else, i am very capable of learning things fast, i just dont like researching and reading.
Aug 16 '07 #11

RRick
Expert 100+
P: 463
Nobody likes researching but its part of the job. I think you'll have better luck if you change your inquires from 20 questions to more specific topics.

As to your first question, its not C++ that has the color wheel. Its up to the system/ide that you are using. Your example is a 24 bit color variety made up of 3 bytes, one each for RGB (red,green,blue). Each color varies from 0 to 0xFF. You're right about the extreme ends of the values, 0xFFFFFF is white and 0xFF0000 is bright red.
Aug 16 '07 #12

RedSon
Expert 5K+
P: 5,000
In case this thread turns into a bit of a flame war, please be advised that I am watching it closely. Chessman, these other people have good points, try to listen to them and take their advice seriously. The book by petzold is on every Win32 developers desk. Its the Bible of Windows programming (apps that is). Check it out from your library or local university.

You also need to take a look at what you are trying to do. Creating an AI program in Win32 that lets you click on buttons to take you to websites is mixing two separate paradigms. If you want to make and app, make an app. If you want to make a website, make a website. But don't make an app thats a website.
Aug 16 '07 #13

100+
P: 110
i recommend you start by learning basic programming first (not the language basic)

go to google and type 'introduction to programming'. choose a language and stick with it.

for a more structured approach, check out University of Waterloo's distance ed courses. $175 CAD...
Aug 16 '07 #14

P: 24
In case this thread turns into a bit of a flame war, please be advised that I am watching it closely. Chessman, these other people have good points, try to listen to them and take their advice seriously.
erm...Please dont think of me as a flamer, because i am that in the lease, I am new to C++, and i have come to find, IT WILL be a long way to go until i have a functioning AI, I understand that now. As for the website/app thing, you might have misunderstood. I meant to say, "I want a button that SAYS website on it, and when you click it, it opens up IE/FF/Opera/Safari/whatever (>_>) and takes you to my website xxxx@xxxx.xxx.x in case you didn't understand.

I am very sorry if you thought i was on my way to flaming, i wasn't. As for the C++ "color wheel" (0xff) Is there any reference as to where it is?

and, as for the other questions, i will go look further for them. I will ask questions here, but i dont want to be victimized as one of those flamers ;)

thanks in advance.
Aug 16 '07 #15

Hunderpanzer
P: 60
erm...Please dont think of me as a flamer, because i am that in the lease, I am new to C++, and i have come to find, IT WILL be a long way to go until i have a functioning AI, I understand that now. As for the website/app thing, you might have misunderstood. I meant to say, "I want a button that SAYS website on it, and when you click it, it opens up IE/FF/Opera/Safari/whatever (>_>) and takes you to my website xxxx@xxxx.xxx.x in case you didn't understand.

I am very sorry if you thought i was on my way to flaming, i wasn't. As for the C++ "color wheel" (0xff) Is there any reference as to where it is?

and, as for the other questions, i will go look further for them. I will ask questions here, but i dont want to be victimized as one of those flamers ;)

thanks in advance.
Hello

I have a C++ function that I use to make my colors, and I've mapped them out until the pattern is noticeable.
I must admit, it's not MY own creation, I found it off a program a long time ago, and I've forgotten where and what.

C++ Text colors I can help you with, though I'm not sure you would understand it. . .Do you have any programming experience ?

Sorry your other questions are beyond my knowledge.
Aug 16 '07 #16

arunmib
100+
P: 104
hmm....I expected a healthy discussion on AI (in C++).....hmm.....

Anyways, Books are good mentors than people. Start reading them, For getting a good idea about AI, Expert systems algorithms try "Artificial Intelligence Application Programming - M.Tim Jones". This book is pretty neat with example programs(in C).

Colorwheel - I think it comes as a dialog with Visual Studio. Since you are building an windows executable and in starting stage of the project you can switch to a visual studio (if possible) instead of Dev-Cpp. The reason I am suggesting is many of the windows features comes for free with it (visual studio).

Other than that, go through good books for windows programming for eg: as one of the previous poster mentioned try "Programming Windows by Charles Petzold" . Another website for good C/C++ reference would be "www.cprogramming.com" .

I hope my post is of some help to you.....
Aug 16 '07 #17

sicarie
Expert Mod 2.5K+
P: 4,677
hmm....I expected a healthy discussion on AI (in C++).....hmm.....
Arunmib-

Perhaps you can share what challenges you have run into (and hopefully spark the type of conversation you hoped for), experiences you have had, general thoughts/ideas?
Aug 16 '07 #18

RedSon
Expert 5K+
P: 5,000
erm...Please dont think of me as a flamer, because i am that in the lease, I am new to C++, and i have come to find, IT WILL be a long way to go until i have a functioning AI, I understand that now. As for the website/app thing, you might have misunderstood. I meant to say, "I want a button that SAYS website on it, and when you click it, it opens up IE/FF/Opera/Safari/whatever (>_>) and takes you to my website xxxx@xxxx.xxx.x in case you didn't understand.

I am very sorry if you thought i was on my way to flaming, i wasn't. As for the C++ "color wheel" (0xff) Is there any reference as to where it is?

and, as for the other questions, i will go look further for them. I will ask questions here, but i dont want to be victimized as one of those flamers ;)

thanks in advance.
Just to clarify I didn't think you were going to start the flames. So no worries.
Aug 16 '07 #19

P: 24
alright, i'll search for vs, but i can't download it from the microsoft official website because i am on a mac and cant download a lot from the microsoft website...see? any of you have any good websites that have a lot of microsoft stuff on it, but doesn't require you having a windows computer
thanks again.
Aug 16 '07 #20

Expert 10K+
P: 11,448
I don't understand what colour theory has to do with artificial intelligence?

Colours described in a 3 dimensional sRGB space are quite easy to understand.

kind regards,

Jos
Aug 16 '07 #21

daJunkCollector
P: 76
Why are you partial to Waterloo's distance education program? I ask because I have my Bachelor's Degree and am interested in pursuing an online education for Programming (particularly web development, but I am open to suggestion).
Aug 16 '07 #22

P: 24
color is going to be used in the text, background, and probably used on the navigator i mentioned earlier, as for the waterloo thing, i have no idea what it is. :\
sry, never heard of it.
Aug 16 '07 #23

P: 24
*bump

Can i bump? :\ nyway i still need help, what is the waterloo?
Aug 18 '07 #24

arunmib
100+
P: 104
Arunmib-

Perhaps you can share what challenges you have run into (and hopefully spark the type of conversation you hoped for), experiences you have had, general thoughts/ideas?
Challenges I ran into may or may not be of use here, but nevertheless if required I will share them. But what a good programmer would do (in my belief) is spend considerable time in choosing an algorithm for the problem. So if the guy can give a glimpse of his project's essence and his algorithm, his design methodology to achieve it may be people in here can chip in their ideas. We all can have an constructive discussion about it. It not only enlightens him, but also SIMPLE guys like me. This is what I expected when I opened this thread. Hey this doesn't means he must ask the questions he has asked here, it's just the thread title and the way discussion was heading made me use those words.

Moreover the guy was using some BIG words like MENTOR, since a single person here without some personal contact can't be one, but the whole THESCRIPTS website can, I think....

P.S : Please don't start a discussion or reply post for this post of mine. Lets get to programming business people we all are GOOD mainly in it. Sorry, for the late reply I was OUT for the weekend ...
Aug 20 '07 #25

P: 24
I dont know what algorythm i could use, but im sure with everyones help, i'll make a good decision...maybe not :\
Aug 24 '07 #26

P: 24
finally found a good question, in this sequence of code, i am trying to change the background to an image...bmp if it matters...just look 8^)

Expand|Select|Wrap|Line Numbers
  1. #include <windows.h>
  2.  
  3.  
  4.  
  5. /*  Declare Windows procedure  */
  6.  
  7. LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
  8.  
  9.  
  10.  
  11. /*  Make the class name into a global variable  */
  12.  
  13. char szClassName[ ] = "WindowsApp";
  14.  
  15.  
  16.  
  17. int WINAPI WinMain (HINSTANCE hThisInstance,
  18.  
  19.                     HINSTANCE hPrevInstance,
  20.  
  21.                     LPSTR lpszArgument,
  22.  
  23.                     int nFunsterStil)
  24.  
  25.  
  26.  
  27. {
  28.  
  29.     HWND hwnd;               /* This is the handle for our window */
  30.  
  31.     MSG messages;            /* Here messages to the application are saved */
  32.  
  33.     WNDCLASSEX wincl;        /* Data structure for the windowclass */
  34.  
  35.  
  36.  
  37.     /* The Window structure */
  38.  
  39.     wincl.hInstance = hThisInstance;
  40.  
  41.     wincl.lpszClassName = szClassName;
  42.  
  43.     wincl.lpfnWndProc = WindowProcedure;      /* This function is called by windows */
  44.  
  45.     wincl.style = CS_DBLCLKS;                 /* Catch double-clicks */
  46.  
  47.     wincl.cbSize = sizeof (WNDCLASSEX);
  48.  
  49.  
  50.  
  51.     /* Use default icon and mouse-pointer */
  52.  
  53.     wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
  54.  
  55.     wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
  56.  
  57.     wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
  58.  
  59.     wincl.lpszMenuName = NULL;                 /* No menu */
  60.  
  61.     wincl.cbClsExtra = 0;                      /* No extra bytes after the window class */
  62.  
  63.     wincl.cbWndExtra = 0;                      /* structure or the window instance */
  64.  
  65.     /* Use Windows's default color as the background of the window */
  66.  
  67.     wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
  68.  
  69.  
  70.  
  71.     /* Register the window class, and if it fails quit the program */
  72.  
  73.     if (!RegisterClassEx (&wincl))
  74.  
  75.         return 0;
  76.  
  77.  
  78.  
  79.     /* The class is registered, let's create the program*/
  80.  
  81.     hwnd = CreateWindowEx (
  82.  
  83.            0,                   /* Extended possibilites for variation */
  84.  
  85.            szClassName,         /* Classname */
  86.  
  87.            "Windows App",       /* Title Text */
  88.  
  89.            WS_OVERLAPPEDWINDOW, /* default window */
  90.  
  91.            CW_USEDEFAULT,       /* Windows decides the position */
  92.  
  93.            CW_USEDEFAULT,       /* where the window ends up on the screen */
  94.  
  95.            544,                 /* The programs width */
  96.  
  97.            375,                 /* and height in pixels */
  98.  
  99.            HWND_DESKTOP,        /* The window is a child-window to desktop */
  100.  
  101.            NULL,                /* No menu */
  102.  
  103.            hThisInstance,       /* Program Instance handler */
  104.  
  105.            NULL                 /* No Window Creation data */
  106.  
  107.            );
  108.  
  109.  
  110.  
  111.     /* Make the window visible on the screen */
  112.  
  113.     ShowWindow (hwnd, nFunsterStil);
  114.  
  115.  
  116.  
  117.     /* Run the message loop. It will run until GetMessage() returns 0 */
  118.  
  119.     while (GetMessage (&messages, NULL, 0, 0))
  120.  
  121.     {
  122.  
  123.         /* Translate virtual-key messages into character messages */
  124.  
  125.         TranslateMessage(&messages);
  126.  
  127.         /* Send message to WindowProcedure */
  128.  
  129.         DispatchMessage(&messages);
  130.  
  131.     }
  132.  
  133.  
  134.  
  135.     /* The program return-value is 0 - The value that PostQuitMessage() gave */
  136.  
  137.     return messages.wParam;
  138.  
  139. }
  140.  
  141.  
  142.  
  143.  
  144.  
  145. /*  This function is called by the Windows function DispatchMessage()  */
  146.  
  147.  
  148.  
  149. LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
  150.  
  151. {
  152.  
  153.     switch (message)                  /* handle the messages */
  154.  
  155.     {
  156.  
  157.         case WM_DESTROY:
  158.  
  159.             PostQuitMessage (0);       /* send a WM_QUIT to the message queue */
  160.  
  161.             break;
  162.  
  163.         default:                      /* for messages that we don't deal with */
  164.  
  165.             return DefWindowProc (hwnd, message, wParam, lParam);
  166.  
  167.     }
  168.  
  169.  
  170.  
  171.     return 0;
  172.  
  173. }
all this code is is just a windows application, standard 800x600 window with a grey background.
I am guessing at "(HBRUSH) COLOR_BACKGROUND;" I can change this around and make it into a picture background. How exactly would i do this, i researched and researched and tried merging different open source codes together, but nothing came out the way i wanted. how would i change "(HBRUSH) COLOR_BACKGROUND;" into a picture?
I actually have 2 pics, so how would i make it automatically switch from one pic to another on a timed scale.

Thanks so much, and it will probably be a long while till i fully understand C++.
but inside this first month i am getting it so much more. thank you.
Aug 26 '07 #27

RedSon
Expert 5K+
P: 5,000
finally found a good question, in this sequence of code, i am trying to change the background to an image...bmp if it matters...just look 8^)

all this code is is just a windows application, standard 800x600 window with a grey background.
I am guessing at "(HBRUSH) COLOR_BACKGROUND;" I can change this around and make it into a picture background. How exactly would i do this, i researched and researched and tried merging different open source codes together, but nothing came out the way i wanted. how would i change "(HBRUSH) COLOR_BACKGROUND;" into a picture?
I actually have 2 pics, so how would i make it automatically switch from one pic to another on a timed scale.

Thanks so much, and it will probably be a long while till i fully understand C++.
but inside this first month i am getting it so much more. thank you.
Actually you can't change that to a bitmap. Once you create your window you will need to draw your bitmap on the window. I'm not sure what you are trying to do by drawing a bitmap on the background of the screen so can you describe what you are trying to do a bit more and we'll see if we can't help you? In the mean time you can search MSDN for WNDCLASSEX and CreateWindow and also Using Bitmaps.

Try this link http://msdn2.microsoft.com/en-us/library/ms532276.aspx
Aug 27 '07 #28

P: 24
Here's the problem, I dont even know where exactly in that code i can draw the bitmap pic, so if you could help me out that would be great >_>
Aug 28 '07 #29

RedSon
Expert 5K+
P: 5,000
Here's the problem, I dont even know where exactly in that code i can draw the bitmap pic, so if you could help me out that would be great >_>
You will probably want to look for the WM_PAINT message and then paint your bitmap at that time. Did you look at thelink?
Aug 29 '07 #30

P: 24
I found it out, so i got the bmp to work. :\ thanks anyway
Aug 31 '07 #31

RedSon
Expert 5K+
P: 5,000
I found it out, so i got the bmp to work. :\ thanks anyway
Want to share what you found?
Aug 31 '07 #32

P: 24
At the moment, sorry, i actually have a friend making a program to help me start out, i'll share the color code with you some other time :(
Sep 1 '07 #33

Post your reply

Sign in to post your reply or Sign up for a free account.