ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
vc++ bot (Sdk)
vc++ bot // Sdkbuilder mDec 8, 1999, 10:16pm
I finaly got my vc++ bot to work thanx to byte me's page
http://www.awcommunity.org/awbot But I was wondering how do I make vc++ bots reaspond to a chat measage I tried the c command but it came up with errors, how do I make a gui interface, how do I make my bot roam around, how do I make my bot act like a tornado, and how can I make a bot that shoots missles in world from differnt places to set coords?? seracDec 8, 1999, 11:29pm
> I finaly got my vc++ bot to work thanx to byte me's page
> http://www.awcommunity.org/awbot > But I was wondering how do I make vc++ bots reaspond to a chat measage I > tried the c command but it came up with errors, how do I make a gui > interface, how do I make my bot roam around, how do I make my bot act like a > tornado, and how can I make a bot that shoots missles in world from differnt > places to set coords?? Are we a bit ambitious? ;-) * Chat messages . . . Simply use the AW_EVENT_CHAT event. (From the SDK documentation...) ==== static char* char_type[] = { "said", "broadcasted", "whispered" }; void chat( void ) { printf( "%s %s %s\n", aw_string( AW_AVATAR_NAME ), chat_type[ aw_int( AW_CHAT_TYPE ) ], aw_string( AW_CHAT_MESSAGE ) ); } . . . aw_event_set( AW_EVENT_CHAT_, chat ); . . . ==== * Graphic User Interface . . . You have several options: + Writing directly to video memory, draw your own interface + With Windows GDI functions, draw your own interface + Using the Windows API, let Windows draw your interface + Using MFC, let Windows draw your interface Options one and two are really jokes. Unless you are using DirectX, you will be better off using the Windows API or MFC. Both of them are quite confusing. You will probably spend 80% of your time debugging windowing problems and 20% on actual logic/algorithmic problems. If a graphical interface is really important, I would suggest a new alternative: + Use VB. VisualBASIC has progressed to the point where is CAN compete with programs written in C/C++. With "Native Code Compilation" options, VB programs can run just as fast as C/C++ programs. Designing graphical interfaces is much easier in VB. If you really need a GUI and don't want to waste time with debugging, go with VB. If you don't care how long it takes to write your program, VC is still a good choice. You will find you have greater control over Windows API when you use VC, but with that control adds a great amount of complexity. The choice is more about which language are you more comfortable with. * Roaming (Grazing ?) Bots . . . This depends greatly on the desired complexity of the "roaming" algorithm. There are many existing algorithms out there that will simulate "roaming." I added "Grazing" as there was a program/algorithm that basically added virtual "grass" (food) to a world. The virtual "cow/sheep" would then be instructed to eat. As it got full, it wouldn't search for food as much. I'm not sure where you could get the source code (if there was any). But this algorithm isn't too difficult to implement. Take a look at what the people did who did "The Phantom Menace". Before the pod race, all of the people (from the aerial shots) were CG'ed. They made algorithms to have people running/walking. Sometimes a person would become "attached" to another and they would walk together (like they were talking or something). It's an interesting approach. (BTW, this is for the people on the ground. The people in the stands were multi-colored "Q-tips" being blown by a hair dryer. ;-) * Not Twister again?! . . . Enjoy trying to do this one. Basically this ALSO depends on the desired complexity. I would suggest you look at a particle simulator for the best effect. Realize that there has been a lot of research on figuring out what makes a tornado do its thing. Do a little research before you just program any old algorithm. NOTE: I want to see this when you get it done. :-) * Missiles?! I'm staying out of YOUR world! . . . I don't enjoy being blown to bits, but some people do. ;-) This AGAIN depends on the desired complexity. Trajectory calculations are needed for proper flight paths of the missiles. There's not much more that I can say, because it depends on what effect you going for. * Done. I think . . . It's truly great that you are wanting to do so much. To make it easier for you, try not to do them all at the same time. Pick one and try to perfect it. Then as you get stuck or get tired of it, move on to another. For reference, you will want to look at the AW_EVENT_OBJECT_* events and then the aw_object_* methods. You will be needing most of them for doing object modification. Good luck. ==== Aaron Hill (Redmond, Wash.) Electronic Mail: serac at lightmail.com IRC Nickname: serac (on EF-Net) ICQ UIN: 46803963 ActiveWorlds Citizenship: serac |