Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

170 Neutral

About algumacoisaqualquer

  • Rank
  1. algumacoisaqualquer

    Game economy

    Are you familiar with the game golemizer? ( In essence, it is a morpg with a player guided economy. The economy of the game is somewhat complex, and you can only get the raw materials from the world... everything else must be crafted by skills or bought from other players. Quite a cool concept, until you realize that the great part of the game is done by crafting... so everybody wants to craft things and almost no one buys it... and the few ways to play dungeon crawling (and getting gold) are boring in my opinion, so these things kind of limit the game. Also, you have very few tools for automation in the game, so a lot of the selling stuff has to be done manually (you do get to place an NPC with goods to sell at a fixed price, but that is the best you'll get) However, don't get the game wrong by my harsh review, it is at least a nice implementation of a very complicated idea.
  2. algumacoisaqualquer

    C++ Vector problem

    As far as I know, when you call siSprite=m_vSprites.erase(siSprite); the vector might be reallocated, so it makes your iterator no longer valid. Actually, why do you have the 'siSprite=' part in that expression? I'm not sure what that part is doing, maybe you should wait until some of the clever guys shows up :D
  3. algumacoisaqualquer

    Problems with C++ UT Simulation Program

    One thing I noticed is that there isn't any kind of output calls in (you know, functions like cout, that print things on the screen). So how do you know that the function is being skiped? Unless the Player functions do something, of course.
  4. algumacoisaqualquer

    making a c function

    Ok, but is there any particular reason why you moved to C? The problem is that you are using a "char*" as if it were a complete string class. It is not, it's just a pointer to an array of chars. Anyway, the simpler way to make this work is to make char *patient_string[20] a global variable (well, and some others), and then detaching the code you want into a separate function. This is a very poor solution to your problem (if you make everything global, soon you will be left with a great mess), but is the one I can think that doesn't deal with pointers. Actually, don't do the global thing, try to learn how to make a simpler function, and build up from there (do you know how to make that in C++?).
  5. algumacoisaqualquer

    making a c function

    Before I answer, is there any particular reason you are using the C language? I ask it because you seem to be having quite a hard time dealing with strings at C. Take your patient_string array for instance. You are initializing each element as a "h" string. But this means that each one of those strings can only be one character long, or you will get quite some problems. Also, you are using k = 40, but iterating by a 20 element array. Anyway, if you want to pass an array to a function, you will have to either pass it by a pointer or by reference. But before you learn these, maybe you should try to make simpler programs, things that don't need so much strings like the one you are trying to do.
  6. algumacoisaqualquer

    Squareroot trouble

    Well, by using double you get a good precision, I just don't know how to make std::cout show you the number with more digits after the dot. Even then, this is probably not as much as you want, but then I don't know how to make it... Also, I was playing with your code, and the lines Under = Number-1; Over = Number+1; Well, while they are working, this is not very efficient. When I replaced them by Under = 0; Over = Number+1; // maybe just Number could make it, but I'm not sure Things got much faster. I mean, if you think about it, Number-1 is more then the square root of most of the numbers. However, I tested it for numbers in the range of [4, 4000], if you are using this for the square root of 2, then this is probably not going to make any difference.
  7. algumacoisaqualquer

    Squareroot trouble

    I haven't tested yet, but it looks like that, when you exit your first while loop, Under*Under is now bigger then Number, while Over*Over is smaller then the number. I guess that you will have to swap their values, so that in the next iteration of do{}, Under is still under the value, and over is still over the value. Basically, if you #include <algorithm>, and place std::swap(Under, Over); right before the line } while( Dif > Epsilon ); that should do the trick. EDIT: well, I just tested, and there is another problem: the epsilon you are using is too small, and I believe that the float type doesn't have enough precision for it. To make it work, you should either use double or reduce your precision. Also, that's actually a nice algorithm!
  8. algumacoisaqualquer

    Code design in C++

    Well, thank you all for the answers! I don't have a very good idea for what I'm going to make right now (some non-related boring work that I have to do first is keeping me busy), but at least I have a better idea for what not to do. Actually, I'm thinking about making a class that just places the whole file in a char stream or something like that (I'll take a look if something like that doesn't already exists in the std), than another class takes that stream and converts into a actual bitmap. The OO part is probably on how I make that arrangement work, but that is going to have to wait. Oh, and another thing: I considered using throws, since I really wanted to learn how to use them, but I heard that the palm compiler that I'm using doesn't support try/catch properly, so I decided to ignore them (well yes, not the brightest idea on the book but...) Anyway, thank you all for the answers!
  9. algumacoisaqualquer

    Code design in C++

    First off, I have been programming in C++ for some time, but not really in the right way... so what I'm trying to do right now is to learn OO programing, as oposed to "C with classes". Basically I have a c_bitmap class that is a fancy array of the s_color struct. I can build it from another bitmap or from the ground up, and I can paint other bitmaps on top of it. But now I wanted to have a way to build my bitmap based on a filename. My initial idea was to have a overloaded constructor that simply take the filename and a bool by reference (bool& success), but I was wondering if that's a nice solution. Particulary, I was hoping to some day reuse this code in a PalmOS program, and I'm not shure if file reading works differently in that plataform. However, doesen't that breakes encapsulation? I mean, I keep thinking that my bitmap class shouldn't care about loading files, but if that class doesen't care, then who will? Anyway, my other idea was to have a function returning a c_bitmap with the file already loaded, but this doesen't make much sense to me, as that function would need access to pretty much everything inside the c_bitmap class. Is there something I'm missing here? Or I'm just overreacting about my initial problem? Thank you!
  10. algumacoisaqualquer

    My game just went live -- giving away Game Maker + Civ 4

    Hey Kirby, I just saw that you have started the SpaceBall beta... congratulations. I haven't played much, but I noticed that the sound effects are a lot better now!
  11. algumacoisaqualquer

    Object Oriented NeHe

    Well, and also, if you look at this post, you will see the work the new NeHe team has been doing, wicth is actually OpenGL with C++. Personaly, I was really amazed by how Object Oriented really worked, it was when I realised how bad my own code has been all this time. Anyway, it's OpenGL and it's Object Oriented, so maybe you should take a look.
  12. algumacoisaqualquer

    Announcement: Beta code release

    I know that the F5 was in the debug mode (well, I discovered the difference very recently actually =D ), what I meant is that I - as a avarage lazy guy that wanted everything to work with a click of the mouse - noticed that. Solving it was very easy, and I don't really think you guys should bother with it - I'm just pointing that other people will eventually run into the same problem that I did. But explaining the difference between debug-mode and actually compiling will work, I believe. Of course, I believe you guys are more interested in things more critical right now - I'll see if I find anything... EDIT: I was playing a little with the Lesson5 code, and then I realised that the method void CNeheLessonFive::OnResize(int w, int h) was calling OnInitialize(); in the last line - I think this is why the texture was loaded multiple times. That function was not nescessary over there, because OnInitialize(); was already called somewhere else. EDIT2: Actually, this didn't solved it, because the function is also called when the screen is set to fullscreen (or reset to windowed mode). Pressing spacebar calls the function CNeheWIN32Window::CreateGLWindow(...), that in turn will call CNeheWIN32Window::Initialize(), and then Initialize() will call CNeheLessonFive::OnInitialize() - every time we hit the spacebar. Just don't ask me how to solve this! [Edited by - algumacoisaqualquer on July 6, 2007 9:00:52 AM]
  13. algumacoisaqualquer

    Announcement: Beta code release

    I've had a few issues with the code, but I'm not shure if it's the kind of feedback you guys want right now. First, in Lesson 4, the cube will get translated to a variable value that increases over time - the efect is that, eventually, the cube will disapear from the screen. I'm not shure what was the idea when that was made. The problem is on function CNeHeLessonFour::OnRender(), and the only way I could get it working was by replacing glTranslatef(0.0f,m_Trans,-9.5f); with glTranslatef(0.0f,0.0f,-9.5f); - but that's porbably not what you guys want. Also, in Lesson5, I don't know why but the cube doesen't spin (EDIT: I assigned an initial value to m_rot, and it started spining - but I'm not shure if this should be done in the constructor or in Initialize();). Plus, if you compile by simply pressing F5 (or ctrl+F5, I'm not shure) in Visual C++ Express 2005, you will get a error of texture not found - the texture should be in the same directory as the project - well, that's how I got it working at least. EDIT: in this lesson, the TGA texture is loaded each time I resize the screen - I tried to figure out what was causing this, but I couldn't figure it. Again, I believe you guys are more worried about the bigger picture right now, but I'm just pointing some minor problems I had. Overall, this thing looks incredible! Maybe this is because I'm mainly interested in leraning C++ right now then OpenGL, but the bonus "OOP in action" thing was just awesome - it looks like I can learn a lot from it. The open and compile thing was also something really helpful. Now, if you don't mind, I'll try to port my glut-based project into Lesson5 - let's see if it works. Congratulations on this! [Edited by - algumacoisaqualquer on July 4, 2007 8:09:33 AM]
  14. algumacoisaqualquer

    Dev C++ inline assembly error messages

    Quote:Original post by nick22891 Sorry guys. I'm a chatroom addict so i guess i've grown impatient in some respects. Plus i'm new here. Didn't mean to double post by the way. I clicked refreshed because the page that came up was blank and that happened. I'll check back some other time. He, don't worry, we all make mistakes sometimes. It's true that sometimes you will get answers pretty fast in this forum, but that will depend on how easy your question actually is. I mean, since you just replied to me, I really wanted to answer you, but the truth is I still have no idea of what is going on... so yeah, this may take a while.
  15. algumacoisaqualquer

    Dev C++ inline assembly error messages

    Well, you posted 30 minutes ago. There has been 15 page views considering both your posts. So yeah, my guess is that no one that knows asembly has looked your post yet. For the record, I have no idea about how assembly works. Also, complaining no one answered is not very polite, especially in such a short time span.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!