xinfinite33

Member
  • Content count

    18
  • Joined

  • Last visited

Community Reputation

204 Neutral

About xinfinite33

  • Rank
    Member
  1. 2D Arcade Fighter Game

    Hello aanthonyz1   I've also been thinking about how to handle collision detection in fighting games, so I did some research about it and I found some pretty cool results. Some games use the pixel perfect approach as DpakoH mentioned, But there are others who use a collection of "Hit Boxes" for each frame of animation. The fighting game Skullgirls uses the Hitbox method. Here is a link so you can get an idea of how it works.   http://wiki.shoryuken.com/Skullgirls/Hit_Box_Ref   While hitbox detection is most often faster than pixel perfect collision detection, you have to manually create the hitboxes for every single frame ,of every single animation and for every single character in your game, while the pixel perfect method only needs the image data. But in my opinion I think hitbox detection is the way to go. It makes it very easy to specify which parts of your character are Hurt areas (Areas that can be hit by attacks, such as the torso, head ,etc.), and which areas are Attack areas (Areas used in attacking, such as, fists, legs, weapons, etc.). Though the downside is that it will most likely be tedious to set up, unless you make some kind of external program to make editing the hitboxes for your characters easier. But then again the same thing could be done with pixel perfect collision detection if you use a separate set of images along with the original image data that specifies the hurt and attack areas. For example you could color the hurt areas blue and the attack areas red. Then when you do the collision detection, you just get the color of the pixels that are colliding and determine if its a successful hit or not. But this would make your game take up more space due to the extra image data.
  2. Custom window GUI system

    so far you guys are only pointing me to libraries. are there really no tutorials / discussions on how to go about creating your own GUI system? id rather learn the basic idea on how they work and then design around that because if i ever decide to use another language for a project and need a GUI system, i can have enough knowledge to create a fairly basic one, then if i need more advanced features that i cannot create myself, then id use a GUI library. i just need an understanding of how a system would be structured, so i could add on the individual tools such as the buttons, checkboxes,sliders etc. myself.
  3. Custom window GUI system

    im using C++ and SFML
  4. hello everyone! I made a simple game and I came across a problem, editing levels. I made my game so that it stores the level data in text files, so levels have to be built manually by directly editing the text file, this was rather tedious so i started working on a level editor and I'm having one problem, the GUI. I would like to  create a GUI system that can create windows with buttons, sliders, check-boxes, etc. and I've been trying out different methods but its harder than I thought it would be. I don't want the GUI code to be platform specific so I chose not to use third party libraries. can someone give me an idea of how a GUI system should be structured or point me to some articles/tutorials about the subject? any help at all would be greatly appreciated.
  5. smoothed lines

    ive been trying to find a way to take a set of points and draw a "smoothed" line that passes through all the points. i tried bezier curves and they do a good job at smoothing the line, but the line doesn't pass through the points,it passes between them. so is there a simple algorithm i can use so that the line will actually pass though all of the points but at the same time make it so that the line is smooth and not rigid?
  6. CodeBlocks and SFML Confusion?

    I also had alot of trouble getting SFML running the first time. what i had to do was rebuild SFML using a program called Cmake. It fixed everything and it works fine now. if you mean that you had trouble understanding how it works, and not trouble getting it running, i suggest reading the tutorials on the SFML website.
  7. 2D tile map collision detection

    the way i would do it is to just do a bounding box collision check, then if there was a collision i would correct on the axis with the lowest penetration value. the penetration value is how far one bounding box has penetrated another . so you get the penetration value of both the x axis and the y axis. and correct for the smallest penetration value. you can get the penetration value by taking the distance from the center of the bounding box to the edge of the bounding box "width/2 or height /2". for both bounding boxes, and then subtract it from the distance from the center of box 1 to  the center of box 2:   int Xpenetration=( ( Boundingbox1.width/2 + Boundingbox2.width/2 ) - (Boundingbox2.centerX-Boundingbox1.centerX) ); int Ypenetration=( ( Boundingbox1.height/2 + Boundingbox2.height/2 ) - (Boundingbox2.centerY-Boundingbox1.centerY) );     then you compare the absolute value of both the Xpenetration and the Ypenetration, and just correct for the smallest value:   if( abs(Xpenetration) > abs(Ypenetration) ) { // correct on the y axis using Ypenetration value. } else { // correct on the x axis using Xpenetration value. }
  8. smart pointer trouble

    I've been trying to work with smart pointers pointers and i'm having trouble.  if you have an object that has a pointer to another object, for example, my object stores a pointer to the closest object relative to itself, this makes a pointer cycle ,object 2 pointing to object 1 and object 1 pointing to object 2. how can i make it so that if an object gets deleted, all pointers pointing to it get set to NULL? iv'e tried this with shared pointers and auto pointers but i cant get anything to work how i want it. here's some code for a better understanding. #include <iostream> #include <memory> using namespace std; class person { public: int value; shared_ptr<person> buddy; static int Count; person(int v) { this->value=v; Count++; } person(const person & other ) { this->value=other.value; this->buddy=other.buddy; } ~person() { Count--; } }; int person::Count=0; int main() { shared_ptr<person> test(new person(5)); shared_ptr<person> test2(new person(37)); test->buddy=test2; test2->buddy=test; cout<<(test->buddy)->value<<endl; cout<<(test2->buddy)->value<<endl; test=NULL; //destroy the first person and set all pointers pointing to it to NULL here. how do i do that? if(test2->buddy==NULL) { cout<<"null pointer detected. do nothing"; } else { cout<<"person detected, print value: "<<test2->buddy->value; //this shouldnt happen, it should detect null because test 1 was destroyed } return 0; }      
  9. Need some advice...

    lol hey there. well just so you know. don't expect to be creating anything of borderlands quality as a beginner. things like that take teams of people and alot of time. but yeah i  would suggest unity. that would be  the easiest way to get to where your'e going. start off with smaller projects and work your way up. lots of beginners make the mistake of starting too high and getting discouraged. I should know, as im also a beginner lol. But yeah, ive used unity before and its pretty solid. but i moved to c++ because i like the thought of building "from the  ground up" and understanding whats going on so i can tailor my game engine to do exactly what i want. But if you're looking for an easy to use 3d engine then yes unity is definitely what your'e looking for. 
  10. static std::deque inside of template class

    Yeah I know its buggy, I was mostly experimenting with templates and pointers as a way to make my own memory management system. It failed, miserably. I guess i should research things a bit more before jumping in head first  . The "rule of three" and the "non-copyable" articles were helpful, as I had no knowledge about those either. But thanks for the comments and suggestions! 
  11. im having a problem with a static deque inside of one of my classes. i know that you have to initialize static members of a class before you can use them but i cant figure out how to initialize a static deque inside of a template class. a little help please?   #include <iostream> #include <deque> using namespace std; template <typename T> class jar { public: T * value; static int jars; static deque<jar*> jarlist; template<typename S> jar(S obj) //constructor { this->value= &obj; jars++; jarlist.push_back(this); } void destroy() //destroys a jar { { typename deque<jar*>::iterator iter; for (iter=jarlist.begin();iter!=jarlist.end();iter++) { if(*iter==this) { delete (*iter); jarlist.erase(iter); } } jars--; } } }; template<typename T> int jar<T>::jars=0; template<typename T> deque<jar*> jar<T>::jarlist; // <---------------------PROBLEM HERE--------------- int main() { int integer=3; jar A(integer); cout<<*(jar::jarlist.front())->value); return 0; }   any help would be greatly appreciated
  12. Looking for a study partner at C++, SDL and OpenGL.

    everyone whos interested feel free to add me as well on Google talk. xinfinite33@Gmail.com looking foward to talking with you guys on monday
  13. simple 8 way direction finding algorithm?

    loool I know it Isn't that much of a difference when it comes to optimizing since we can do millions of operations a second. I cant remember where but I read somewhere that division was the slowest operation out of all the others, excluding the case where your'e multiplying numbers less than one, then division is faster. I apologize for my novice assumption as I am still fairly new to programming .
  14. simple 8 way direction finding algorithm?

    thanks for the replies guys! @SiCrane thanks for the suggestion about precalculated normals. I'm surprised I didn't think about that sooner. @ifthen thanks for your reply, as well as the advice about premature optimization. and yes I coded my own simple vector class "which wasn't as hard to do as I thought lol". this is my first time seeing the method you suggested before. I'll benchmark test it a few times and keep it for future reference! thanks [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img] @Álvaro Thanks for the code! That's a very elegant way to handle it lol. and since Sine and Cosine can be precalculated that makes it even more useful. and again thanks a lot guys!
  15. simple 8 way direction finding algorithm?

    Thanks SiCrane. thats a really nice way to do it, even tho you have to use division and square root to normalize a vector, but its much cleaner than the way I was doing it. thanks alot!