Jump to content
  • Advertisement

darrylsh

Member
  • Content Count

    65
  • Joined

  • Last visited

Everything posted by darrylsh

  1. darrylsh

    A probably simple yet large C++ problem

    You really should put your includes in your header file if that is what uses them and not rely on putting the standard includes ahead of your header include in the cpp file. If you ever need to use that header again in another project, you will always have to remember to add the includes where if you put them in the header where the dependency is then you won't
  2. darrylsh

    Noah's Ark Found?

    Quote:Original post by Strider_Hiryu Not that this whole Noah's ark thing is my forte, but to have a boat that carried two of every base species of animal, not to mention food for 40 days to sustain the diets of each animal. Given the proposed dimensions of the boat, It just doesn't seem... likely. It only rained for 40 days, the ark was adrift like 150 days ( or longer depending on which verses you use)
  3. darrylsh

    Normal C++ on VC 2005 EE

    First off it's int main and not void main... although some compilers might (wrongly)allow void I am almost certain VS2005 does not. To your question, VS2005 will compile the simpler "Hello World", You just need to create an empty project or turn off pre-compiled headers setting. By default VS will use precompiled headers which then require the extras you speak of.
  4. Quote:Original post by thannett Your not linking with the correct libraries. EDIT: Try linking with OpenGL32.lib and GLu32.lib Correct, he's not linking with the correct libraries, but it's the windows libraries he's not linking too. You must have skipped that step in the instructions for installing the psdk with vc express. There a configuration file that you need to hand edit.
  5. darrylsh

    We are obsolete.

    As far as becoming a standard goes, directx and opengl have become that way because they are royalty free, high quality APIs with a lot of support behind them. When a game engine can make a similar claim, it might just become that defacto engine. Another thing is that game engines can be difficult to understand/use/learn except for the expert programmers out there. The average programmer I think is overwhelmed by the complexity and therefore chooses to write their own to have a full understanding what is going on.
  6. The steam results are gamers, so more than likely they have a decent to above average video card. From what i've seen, outside of the gamer crowd are these inexpensive systems with the on-board video, typical by Intel that can only handle like DirectX 6.
  7. darrylsh

    Sudoku Puzzle Contest

    Contest It's basically a contest(c/c++) to generate a completed Sudoku puzzle in the fewest amount of tokens possible... see link for details. Thanks, Darryl
  8. darrylsh

    DirectX with Visual Studio 2005

    Win32 project, however, if you didn't know that, you might be getting ahead of yourself diving into Directx
  9. darrylsh

    Best compilers around!

    Regarding Intel vs MSVC, if you are interesting in taking advantage of the hyper-threading of some of the newer Pentium chips, you'll have to get the Intel or wait for the VC 2005.
  10. Hi all, Although I am pretty familiar with c++, I mostly avoided using STL, but as of late I have found it to be very useful and invaluable, however, I find the documentation for it to be quite cryptic. Anyways, I want to create a standard map using a alternative sorting function. I understand that a map is by default sorted by the key value, However, I'd like to sort it by it's data value, for example: Suppose I have a map of names (key) and an int (data) Tom 10 Dick 20 Harry 30 Darryl 40 by default the map will be sorted alphabetically by name (key) I would like it to be sorted as listed above, by data value. I have looked at using the value_compare member, but am lost as to what I need to do and have not found any simple/clear examples on the net. Any assitance would be appreciated. Thanks, Darryl
  11. Quote:Original post by Fruny Sheeesh, you've not even tried, have you? Nothing is stopping you from creating a priority queue of pairs with a custom comparison functor. ... There almost always are ways to plug things together. [smile] Well no I didn't try, but as I sort of explained in the first post, I am not so familiar with STL and the Docs are pretty cryptic to me...I mostly have learned STL from looking at examples of their use, so after you suggested priority queues, I went to the docs and ofcourse, was unable to put it together the way you did, but then again if I could had done that, I probably wouldn't had needed to ask in the first place ;-). But your example is very useful and I will tuck it away for future reference, if you had included it originally, I probably wouldn't had written of Priority queues so quick :-) I did however implement what I wanted using the multimap because I am familiar with the similar map class...but let me ask this real quick. Are [] defined for multimap? For map I can insert using mapobject[key] = value, but this didn't work for multimap, so I used insert, but I would had preferred the other way. Don't see why it wouldn't be defined, maybe has to do with there not being unique keys...hmmm Anyway, thanks Darryl
  12. Quote:Original post by Fruny Use a std::priority_queue Don't see how priority_queue would work, it doesn't take a map container, only something like a vector or a deque(any container that supports front(), push_back(), pop_back()), but as I need to store the pair of values, those won't work. Though I guess I could make a vector of maps first, but it would be easier to just sort the map into a vector directly. I think dalleboy's suggestion of multimap will work directly as I can use the distance as a non-unique key that will automatically be sorted as I want and provide back the location. Thanks, Darryl
  13. Quote:Original post by dalleboy But I think you're biting your self in the foot. You could have a std::multi_map<int, std::string> that maps the age to the name. What are you trying to do? I am open to suggestions...the above was just an example, below is closer to the actual program, though simplified a bit. basically I have a program that maps a custom enum "location" type variable and a int enum location{a, b, c, d, e . . . z}; location DesiredLocation = c std::map<location,int> DistanceToDisredLocation for( int i = 0;i <= z; i++) { DistanceToDesiredLocation[static_cast<Location>(i)] = Distance(i,DesiredLocation); } // Sort Map here so now I want sort the map by distance from the closest to desired, to the farthest. Darryl
  14. Quote:Original post by Coder Quote:Original post by johnnyBravo visual c++ 6 has a few annoying things, one of them is you cant do this: for(int i=0;i<4;i++) { } for(int i=0;i<4;i++) { } it will return a redefinition error. As a workaround, you can do this: #define for if(0); else for which fixes the issue. a better work around is to enclose the whole loop in braces, making the loop a local scope as it should be. {for(int i=0;i<4;i++) { ... }} {for(int i=0;i<4;i++) { ... }}
  15. First, I am not at liberty to post all code. I currently have working code using an Array of maps as below: Would I would like would be to make PlayersCards a Vector instead of an array of CardStatusList as created in newGame() I have tried declaring vector in class definition and then reserve(NumberofPlayers) in newGame but I end up with iirc out of range exceptions... any help would be appreciated. Darryl class DANPlayerV2: public Player { int NumberofPlayers; // status of card with regard to each player enum Status { HaveIt, DoNotHaveIt, Unknown }; typedef std::map<Card,Status> CardStatusList; //list of cards - 1 list for each player CardStatusList* PlayersCards; // pointer to array tracking each players'card list. public:// void newGame() { NumberofPlayers = (int)(20/hand.size()); PlayersCards = new CardStatusList[NumberofPlayers]; //initialize each players list to unknown. for(int index = 0;index < NumberofPlayers; index++) { for(int i=0; i < COMPUTER_COUNT; ++i) PlayersCards[index][static_cast<Computer>(i)] = Unknown; for(int i=0; i < SUSPECT_COUNT; ++i) PlayersCards[index][static_cast<Suspect>(i)] = Unknown; for(int i=0; i < WEAPON_COUNT; ++i) PlayersCards[index][static_cast<Weapon>(i)] = Unknown; } [/Source][/source] [Edited by - darrylsh on September 6, 2004 2:48:27 PM]
  16. Quote:Original post by Jubulani Try this, it might work: ... snipped I think this is what you want. Let me know if it isn't. hmmm this name "Jubulani" looks familiar, you're not to be looking at my Clue code :P I got it working though, thanks, Darryl
  17. Quote:Original post by snk_kid it maybe better off doing it in the constructor then, 2 phase initialization can be a bad thing. Yea I would had preferred that but i won't have a hand or be able to figure out number of players in contructor (and I can't change base class or framework only my derived class). I ended up using something similar to the 1st method you suggeted, it works fine now. Thanks darryl
  18. Actually newGame, won't be called more than once. I figured I had to do a pushback, but I can't figure what to push back? If I do it in newGame, then would those be temp objects or do I new the maps I am pushing into the vector? and if I new them, do I have to delete them? I want to create X number of "Empty" list. Here's how I changed the code and the error I am getting: note:changed newGame to beginGame class DANPlayerV2: public Player { int NumberofPlayers; // status of card with regard to each player enum Status { HaveIt, DoNotHaveIt, Unknown }; typedef std::map<Card,Status> CardStatusList; //list of cards - 1 list for each player //CardStatusList* PlayersCards; // old way std::vector<CardStatusList> PlayersCards; public:// void beginGame() { NumberofPlayers = (int)(20/hand.size()); //PlayersCards = new CardStatusList[NumberofPlayers];//old way for (int i =0;i< NumberofPlayers;i++) { PlayersCards.push_back(CardStatusList); //ERROR: error C2275: 'DANPlayerV2::CardStatusList' : illegal use of this type as an expression c:\Documents and Settings\darryl\Desktop\cl\dan_player_v2.hpp 52 } } ... ~DANPlayerV2() { //delete[] PlayersCards; //old way } };
  19. If you are meaning source using the .net framework like c# or managed C++, then use SharpDevElop instead of Dev-CPP. D.
  20. darrylsh

    Evolutionary AI

    I have been thinking about trying to program an evolution based AI program and was hoping to get some feedback on my idea. I have looked at various "life" programs and genetic algos and don't care to go that route because they are too high functioning. I want to create something at a very basic level that will mimic a one cell orgranism evolving into something more. Anyway here's my idea: Create a basic program that copies itself byte for byte and then execute the new program. For the evolution I would add a slight probability for a mutation in the copy process. OK that's the basics, now some of the potential problems and solutions I see. 1. This willy nilly execution of randomly created programs could hose up my computer. So I will use a dedicated computer 2. The hard drive will quickly fill up. I will created limits in offspring and execution in the original but there is no guaranteed that they will be maintained in the offspring, but hopefully it will. These limits include having a progam only produce 10 functioning children and delete any non-functioning children. After it has completed creating the 10 functioning children, somehow delete or mark itself for deletion. 3. Naming: I need to institute some kind of unique naming system that is meaningful (ie Not a GUID naming system). Something that could identify generation and "line". Are there other problems I havn't thought of? Has anyone done anything like this or know off any similar efforts? Thanks, D
  21. darrylsh

    Evolutionary AI

    Quote:i think hes just interested and wants to play about with some interesting technology and ideas. Yes this is the case, thanks for the support. Quote:Original post by Anonymous Poster What you are describing is basically Genetic Programming without the good bits. IMHO it's a pretty dumb idea to ignore GP on some strange personal principle; as has been noted before, you can say what you like, but you are merely describing GP with an "unusual" fitness function. It's a dumb idea because I will get unpredictable or no worthwhile results, I can accept that. But to restate, when I look at many GP problem they evolve program that for example solve some mathematical equation. The problem i see that makes me not want to follow that route is this; What is the mathmatical equation for life? Quote:I hope that you're aware that life on earth took quite a few years to evolve eh? Yea, I thought of that, but I figured my programs would mutate at a faster rate. Quote:I would also very strongly suggest you use a language which has some form of innate security - for instance java, or C++ ... howabout when you randomly generate two programs OK, but the third one kills the main process and you get no more generations? hmmm...If one program killed another...Eureka, a success!!! btw I am doing it in C++, but Java is a thought, then I'd only hose the JVM Thanks for the feedback everyone, even the negative comments are very helpful. The bottom line is I am trying to make a representative simulation of the first life to appear on earth. I am not dismissing GP and it's established methods just on principle, but on the fact that I don't see a fitness test I could use. Maybe one can be suggested. As one of the previous post stated, I do have a basic test; Does the offspring function? Once a program has created 10 functioning offspring it dies. I imagine that it may take thousands( or less because there is also a chance for no mutation) tries before 10 is achieved but I wonder how many time that first single cell organism(and offspring) had to duplicate itself until something new came along. Again thanks for the feedback D EDIT: I was just taking another look at the Tierra program and this *IS* what I am doing...maybe I'll just see if I can join that project. Take a Look at this page: http://www.his.atr.jp/%7Eray/pubs/images/index.html [Edited by - darrylsh on August 25, 2004 10:44:07 AM]
  22. darrylsh

    Evolutionary AI

    Tazzel: It's not my intention that the programs "compete" for computer resources, that is just a side-effect of their environment "The computer". My only intention is that the programs will reproduce itself with mutations. The best way to think about this I would say is to imagine the very first organisms on earth. There was not much of a competition for resources, I would guess, because resources were plentiful. So they just multiplied with random mutations and became plentiful and diverse. Now we have become so plentiful that there is an competition for earth's resources, but that is just a side effect of overpopulation. ragamuffin: yes it would be unsafe, hence I would use a dedicated computer. Though I am not sure if it should be a stand alone one or network connected. Theoretically, a connected computer could create a virus or at worst SkyNet :-0 Hmmm I wondered if it did create a virus on it's own if I would be held liable. On one hand that would be a major computer science breakthrough, worthy of a Nobel prize :-), while on the other a virus is a virus and just as much a nusance. Anyway, the ideal situation is that it could somehow gain the ability to learn and then connect to the internet to gather information. But ofcourse I realize that this is a big long shot and a lot of high hopes, but still one never knows what may happen. D.
  23. darrylsh

    Evolutionary AI

    Quote:Original post by ragamuffin http://www.his.atr.jp/%7Eray/tierra/ http://www.edarwin.net/darovr.html Thanks for the links Tierra looks similar to what I want to do except not on a virtual OS but on the real OS. Darwin is similar to many life simulation program where virtual programs compete for survival. Mine would not directly compete for things like "food" but indirectly they are competing for computer resources and control. Although I don't have an explicit goal for my programs to evolve to, I would like them to evolve to a point where they a) show some sentience, b) have control over there reproduction, with the ultimate goal that they can consistantly produce "better" offsprings.
  24. darrylsh

    Evolutionary AI

    Quote:Original post by InnocuousFox Quote:Original post by darrylsh Create a basic program that copies itself byte for byte and then execute the new program. For the evolution I would add a slight probability for a mutation in the copy process.That sounds an awful lot like the genetic algorithms that you are deciding not to use. No the Genetic algos are more "guided", usually with the goal of figuring out a specific problem, where mine is unguided with the attitude of lets see what happens. D
  25. darrylsh

    A*Reverse or The Stinky Player

    The problem I see with this is that if the player stands or moves around in a small area he "stinks" it up. When the creature gets close, the player runs away, the creature will now stay in that stinky area as it will be stinkier than the newly created runaway path. D.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!