• Content count

  • Joined

  • Last visited

Community Reputation

118 Neutral

About Davaris

  • Rank
    Advanced Member
  1. Is this code bad?

    >Note that ALL_CAPS_WITH_UNDERSCORES is reserved by most coding standards for preprocessor definitions. Using it for class names is probably A Bad Idea™. Yes this is a very old engine. I'm trying to bring it and myself out of the dark ages. :) So I have to get Boost as well? Man I've got a lot to learn. :) You put everything in the same list. So when I destroy something I'd have to delete it. Would there be any problems with memory fragmentation? Hmmm... Perhaps I could add another variable to the entity class indicating whether or not it is in use.
  2. Is this code bad?

    So how would you guys do it in STL? I have many lists for each object type and they all inherit from the ENTITY class. ALLOCATOR <ENTITY>* Base; ALLOCATOR <ITEM_ENTITY>* ItemEntity; ALLOCATOR <SOLDIER_ENTITY>* Soldier; ALLOCATOR <PROJECTILE_ENTITY>* Projectile; ALLOCATOR <CYCLE_ENTITY>* Cycle; ALLOCATOR <BINARY_ENTITY>* Binary; ALLOCATOR <DOOR_ENTITY>* Door; ALLOCATOR <CONTAINER_MAP_ENTITY>* ContainerMap; ALLOCATOR <TRIGGER_ENTITY>* Trigger; ALLOCATOR <VEHICLE_ENTITY>* Vehicle; What I want to do is use functions like: ENTITY* Spawn (const int e_type = ENTITY::BASE) { ENTITY* e; switch (type) { case ENTITY::BASE: e = Base->GetNewItem(); break; case ENTITY::SOLDIER: e = Soldier->GetNewItem(); break; // etc... } } // and ENTITY* Select (const int e_type, const int scrn_x, const int scrn_y) { // Search through List[e_type] for a match... } If I have to search through the lists separately (Base, ItemEntity, Soldier...) I wouldn't be able to write a general purpose search routine for all of the lists.
  3. Is this code bad?

    It is a list class. You can store any type of item in it and check the contents later. What I'm really interested in is this line: List[ITEM] = reinterpret_cast <ALLOCATOR <ENTITY>*> (ItemEntity); It compiles and runs but will it crash later? Here's a bit more info on ALLOCATOR: template <typename ITEM> class ALLOCATOR { private: int MaxItems; int NumberAllocated;// Never decrement, this is the number of items allocated ITEM** Items; TAG_LIST* Tag;
  4. What is your opion of this code? Is it unsafe? Can something similar be done using STL? ALLOCATOR is a class that stores any type of object //*************************************************************** enum LIST_TYPE { BASE, ITEM, SOLDIER, NUMTYPES }; // Lots of lists with different types all inheriting from the base class ENTITY ALLOCATOR <ENTITY>* Base; ALLOCATOR <ITEM_ENTITY>* ItemEntity; ALLOCATOR <SOLDIER_ENTITY>* Soldier; // One list to hold them all! ALLOCATOR <ENTITY>* List[NUMTYPES]; //*************************************************************** //*************************************************************** // Constructor code //*************************************************************** Base = new ALLOCATOR <ENTITY> (1); List[BASE] = Base; ItemEntity = new ALLOCATOR <ITEM_ENTITY> (1); List[ITEM] = reinterpret_cast <ALLOCATOR <ENTITY>*> (ItemEntity); Soldier = new ALLOCATOR <SOLDIER_ENTITY> (1); List[SOLDIER] = reinterpret_cast <ALLOCATOR <ENTITY>*> (Soldier); //***************************************************************
  5. C++ and reinterpret_cast

    Yeah this is some old code from a Vis C++ 5.0 compiler. STL never worked right on 5.0, so the code has linked lists in it. :(
  6. C++ and reinterpret_cast

    Thanks for that Enigma. It did the trick. I really need to get up to speed on this stuff. :)
  7. Hi Everyone, I have this code in my engine and the list pointer is messing up at the reinterpret_cast line. I was wondering if anyone can tell me what I've done wrong. Am I using reinterpret_cast incorrectly? If so what should I change it to? Thanks! :) class ENTITY : public SCREEN_OBJECT, public WORLD_OBJECT, public FILE_OBJECT { // class stuff here }; class WORLD_OBJECT { // class stuff here WORLD_OBJECT* AddObject (WORLD_OBJECT* list); }; WORLD_OBJECT* WORLD_OBJECT::AddObject (WORLD_OBJECT* list) { if (!list) return this; otherwise do other things... } ******************************************************************** The crashing code is below ******************************************************************** ENTITY* list = NULL,* e; // create e and fill it with data... // add e to list list = reinterpret_cast <ENTITY*> (e->AddObject (list)); // it crashes when add object returns this.
  8. >The text is pulsing, yeah, it looks cool, but after a while, it's getting annoying. Would be better if the text don't pulse at all, and the highlighted text (such as buttons, etc) pulse only. Yes you're probably right. It would get annoying after a while. >It only played in a small window of my computer, and while in the game I clicked on "options" to see if I could change the game to go to full screen mode. I crashed and I can't run the game again. I get the developer logo screen, then I get "Error: Access violation.." Thats not good. Did it give you a crash address? I can use it to find the cause. Even better if a crash.txt file was created in the same directory as the executable, can you send that to me? >I wasn't too crazy about reading a film script intro to the first mission. The letters were tiny and I just skipped it. Yes I think it would be a lot better with a comic book style intro made with Poser or something similar. But getting an artist to do it? Forget it. If I could team up with an awesome artist I could hit the big time. But I gave asking them years ago. :)
  9. Hi Everyone! :) Thanks for testing it. Its been a while since I last visted these forums because I was busy with another game. I found and fixed one bug in the sound manager that was the cause of a mysterious crash and have also released half of the editors. *********************************************************************** RPGeezus: >You did a very good job on the graphics. It must have been a lot of work! Thanks. :) It was an iterative process over a long period of time. I did some of it, got free help from some people and paid others. *********************************************************************** Thanks for giving it a go Bossk. :) >I got to the elevator, then when I tried to use it, the game crashed to desktop... I'm assuming that wasn't supposed to happen. Yup. It would make my life a lot easier if what worked on my computer, worked on all other computers. :) >I'd love to give you some more information about what happened... does your game create any sort of crash log I can send you? I looked in the main program folder, but didn't see one. It iss supposed to create one, as I am using the PopCap Framework. Sometimes it creates one and sometimes it doesn't. It should be in the same directory as the executable. *********************************************************************** Thanks for testing it Anon! :) 1) the graphics seems too blurry and dark, looks like the tile set have been heavily blurred/antialiased during creation. Hard to made out any detail. Yeah I magnified the screen to make it all look bigger. :) I really should convert it to a tile based game so I can make huge mazes quickly. :) >3) transition to inventory while opening chests or searching body takes too long, is kinda dishartening to find out that the chests are empty after having to wait 2~3 seconds everytime you open them. Yes this must be a bug. It should immediately fade out and then in. >4) too many empty chests/dead body...kinda make me wonder why they bothered to put them there, kinda wasting my time, since I tend to leave no rocks unturned. Fallout seldom disapoint me in such fashion, either they put in some ammo or junk drug or simply made an un-openable version of the chest. Yeah getting art is tough. Artists don't seem to care about games as much as programmers do! If I had a good artist in my dungeon, I'd chain them to a computer and force them to make inventory art. ;) Also I didn't fill all of the bodies with ammo/guns, because I thought it might unbalance the demo area. >5) why the overly long hallway with no door along it for exploration? It seem kinda wierd to have a stucture designed in such manner. Rooms are so far apart that, players have to make very long journey to reach a room at the end of a hall. maybe you guys should add some small miscellanous rooms like a store room, cafetaria or even toilets along the hallway. I figured there would need to be sizeable separation between the rooms in case there was an explosion or some kind of a biohazard accident. Also getting the art for the other rooms isn't possible at this time. >6) the control is a bit clunky, i.e. when I want to move Max along the looooong hallway, naturally I'll point as close to the edge of the screen as possible - since the camera is not auto-centered to Max, and this triggered a screen shift. in the end, my click became a selection square instead of the movement command. some selay in deciding it's a click or a drag will be nice, or even better, make the camera auto center to Max (maybe made it an option so each player can have whatever way they like) Yes this is an excellent suggestion. I'll put it on my to do list. :)
  10. Well I've given up on FMod and am using Bass and the Sound Manager in the PopCap Framework. So if any one (that tested it before and got a crash), could you please give it one more try? I'd really appreciate it. Thanks! :) http://www.ausgamedev.com/omegasyndrome/files/OmegaSyndromeDemo.exe If it works this time, I can get on with my next game. :) EDIT: Oops! I officially released it and forgot to update the link. It will work now. [Edited by - Davaris on April 12, 2006 5:32:38 PM]
  11. >the pin on the gernade. What gernade though? I was scrolling though the text and did not ever see a mention he had a gernade, so mabye you can make that stand out a bit more. Yeah I'll definately put that in. He's been driven mad by the horrors he has witnessed. :) The idea is to listen to his rantings and get a few hints as to what happened before you arrived. [Edited by - Davaris on April 9, 2006 11:53:52 PM]
  12. I just made this executable with the sound library disabled as I suspect thats where the crashes are occuring. If you tested it before and got the crashes could you please give this one a try? www.ausgamedev.com/omegasyndrome/files/OmegaSyndrome_NO_SOUND_EXE.zip
  13. Hi Everyone, I have just finished converting my isometric RPG (The Omega Syndrome) to use the PopCap framework and I was wondering if a few people would be kind enough to test it and let me know if it works? http://www.ausgamedev.com/omegasyndrome/files/OmegaSyndromeDemoTest.exe This has the executable with the sound library diabled. So please give that a whirl if you get the crashes. www.ausgamedev.com/omegasyndrome/files/OmegaSyndrome_NO_SOUND_EXE.zip Last time there a crash was occuring on 50% of machines in the sound manager which uses the FMod dll and that's why it wasn't giving a crash address. So I rewrote that area and I'm pretty sure it will behave itself now. :) If there are any crashes, a crash.txt file should be created (this time) in the same directory as the executable. [Edited by - Davaris on April 9, 2006 7:48:25 PM]
  14. Help with CrashFinder

    >To use it, you must have compiled your program with the debug symbols in an external file, which I'm guessing you didn't do. Yes I followed the instructions to the letter and set all of the compiler switches. :) >You load the debug symbol file This is what I'm not sure of. The program lets you put the executable image into the project. But what about the .pdb file? Does it find it automatically?
  15. I'm using Vis C++ 2005 Express and one of my users is reporting a crash on his machine and has sent me the address of the crash. The problem I'm having is line numbers has been taken out of the code generation in Express, so I can't use map files to find the line number. I found something on the net called CrashFinder 2.1, but the page is down so I can't download the program. I've found older versions of it, but they don't work. So if anyone has CrashFinder 2.1, could they please send it to me so I can see if it works?