Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Hello, I'm new here... my first project and my questions  (Read 15463 times)

0 Members and 1 Guest are viewing this topic.

GreenFlame

  • Newbie
  • *
  • Posts: 20
    • View Profile
Hello, I'm new here... my first project and my questions
« on: September 05, 2010, 03:25:51 pm »
Hello everyone, my first post here! =D

Some intro:
I'm a beginner in game development, I wanted to create games since my childhood but i had no idea how to do that...(i think you are familiar with this kind of story).

So, in school i had some programming practice in Visual Basic at lessons and i finished an additional 2 week programming course(which repeated school material) before my graduating exam. I graduated from the school and now I'm a student.

I have been enjoying write programs since i've understood how to do that =)
I decided to learn C++ to make my dream become reality, so with time i came here.

Sorry for my English and
Good Luck, everyone! =D

GreenFlame

  • Newbie
  • *
  • Posts: 20
    • View Profile
Hello, I'm new here... my first project and my questions
« Reply #1 on: September 05, 2010, 04:01:31 pm »
Here is an exe of my first serious project, obviously using SFML
the link(748.69 kB)
http://www.megaupload.com/?d=SVXK2A31

If i may compare, the gameplay is going to be similar with Battlefield game series(usage of classes, vehicles, also some special abilities etc.)

I know it has bugs and doesn't look like game yet, so i need some help:
1)First, i'd like to ask about pathfinding, what algorithm is the best for such type of game?
2)Second, i'd like to ask about collisions, i've made my own rectangle-to-rectangle collision detection, but i'd like to have something more advanced, i've heared about Box2D and Cmake, could anyone tell me a little more about them?

Thanks in Advance =)

Finn

  • Jr. Member
  • **
  • Posts: 90
    • View Profile
Hello, I'm new here... my first project and my questions
« Reply #2 on: September 05, 2010, 04:37:01 pm »
We have a nice class in the wiki for collision-detection! Just take a look at it :)
What do u mean about pathfinding?  For example enemys following your sprite?

GreenFlame

  • Newbie
  • *
  • Posts: 20
    • View Profile
Hello, I'm new here... my first project and my questions
« Reply #3 on: September 05, 2010, 05:36:00 pm »
If you mean this
http://www.sfml-dev.org/wiki/en/sources/simple_collision_detection
then i already know it, i tried it and rectangular collision looked bad for me, pixel perfect test is perfect but takes too much resources, may be i used bad algorithm... but it works very fast with my own rectangular collision.
So, when i tested collision form the link it approximately looked like this:

Code: [Select]

if(window.GetInput().IsKeyDown(sf::Key::Up) &&
  !window.GetInput().IsKeyDown(sf::Key::Down))
  {
     sample.sprite.move(frameTime*speed);

     if(Collision::PixelPerfectTest(sample.sprite, sample2.sprite, 127))
      {
        while(Collision::PixelPerfectTest(sample.sprite,sample2.sprite,127))
        {
          sample.sprite.move(-1*frameTime*speed);
         }
       }
   }


Also i've just realized that i can jsut remove the while loop)


And about pathfinding. Yeah, for example following, or moving from point A to point B, it is simple if there is only moving object, but what to do if, for example, there are some obstacles or other moving objects?

And thanks for reply =)

Xorlium

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Hello, I'm new here... my first project and my questions
« Reply #4 on: September 05, 2010, 06:36:48 pm »
The best (and really, only) algorithm for pathfinding is called A* (A star). It's pretty simple to explain, but not trivial to implement.

I wouldn't pretend to explain better than wikipedia: http://en.wikipedia.org/wiki/A*_search_algorithm

GreenFlame

  • Newbie
  • *
  • Posts: 20
    • View Profile
Hello, I'm new here... my first project and my questions
« Reply #5 on: September 05, 2010, 06:55:49 pm »
I got some material about the A* a few days ago when started to search for algorithms, started to read, but looks like it is good only for tile based environments... or no? :roll:

So will it work with continuous environment(i use such type in my project) or is it worth to make my project tile-based?
Is it good for real time game?
Is it good for kind of project i'm working on?

You can run the project if it'll help to answer, here is the link from the 2nd post:
http://www.megaupload.com/?d=SVXK2A31

Thanks in Advance =D

Xorlium

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Hello, I'm new here... my first project and my questions
« Reply #6 on: September 05, 2010, 07:26:38 pm »
Hello,

Yes, it's very good for non-tile-based environments. The thing is to construct he graph "on the fly", not have it constructed beforehand (since it might be way too large to store), and that's one of the advantages of A*: it doesn't need to look at the whole graph or keep it in memory, just a function that for each node, it returns a list of neighbors.

I'm using it in my own game, and it works beautifully (and quickly!) and I'm not using tiles.

I recommend that you add a visual element while you program it. For example, render a little white dot for every node expanded, that way you can see exactly what it's doing.

BTW, the link doesn't work, it says it's deactivated.

GreenFlame

  • Newbie
  • *
  • Posts: 20
    • View Profile
Hello, I'm new here... my first project and my questions
« Reply #7 on: September 05, 2010, 07:40:06 pm »
Construct on the fly...hmm I'll read an article from my book about A* and then re-read your message =)
Thank you very much for reply, you gave me some inspiration! =)

Quite stragne, i uploaded the file 3 times but still it gives the same link...
http://www.megaupload.com/?d=SVXK2A31

Here is a rapidshare link, but looks like server is overloaded atm
http://rapidshare.com/files/417254555/The_First_Real_Project_v_0.0.6.rar

So, what's better for file hosting? =)

Xorlium

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Hello, I'm new here... my first project and my questions
« Reply #8 on: September 05, 2010, 08:02:27 pm »
Hmm, I downloaded it, but it's for windows only...

GreenFlame

  • Newbie
  • *
  • Posts: 20
    • View Profile
Hello, I'm new here... my first project and my questions
« Reply #9 on: September 05, 2010, 08:14:55 pm »
Oh, yes, it's for windows, i'm sorry... btw how can i set my MVC 2008 to make Linux builds?
And what link worked for you?
Sorry for an avalanche of questions and thank you! =D

GreenFlame

  • Newbie
  • *
  • Posts: 20
    • View Profile
Hello, I'm new here... my first project and my questions
« Reply #10 on: September 05, 2010, 08:14:57 pm »
Oh, yes, it's for windows, i'm sorry... btw how can i set my MVC 2008 to make Linux builds?
And what link worked for you?
Sorry for an avalanche of questions and thank you! =D

Edit: accidentaly double posted, sorry, can i delete the post?
there was a checkbox with delete option...or no?

Xorlium

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Hello, I'm new here... my first project and my questions
« Reply #11 on: September 05, 2010, 08:27:50 pm »
Heh, well, I don't know anything about cross-compiling, but I don't think it's easy at all. The link that worked was the last one you posted on megaupload.

If you post the source code I can compile it myself.

GreenFlame

  • Newbie
  • *
  • Posts: 20
    • View Profile
Hello, I'm new here... my first project and my questions
« Reply #12 on: September 05, 2010, 09:09:33 pm »
Here is the source code, i hope i sent all the required files:
http://www.megaupload.com/?d=R2DK88SO

Any comments on code are welcome =)

And it looks like megaupload works only time to time, so... any suggestions on what to use for file sharing?

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
Hello, I'm new here... my first project and my questions
« Reply #13 on: September 05, 2010, 09:13:11 pm »
Quote from: "GreenFlame"
Here is the source code, i hope i sent all the required files:
http://www.megaupload.com/?d=R2DK88SO

Any comments on code are welcome =)

And it looks like megaupload works only time to time, so... any suggestions on what to use for file sharing?

64digits.com

Xorlium

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Hello, I'm new here... my first project and my questions
« Reply #14 on: September 05, 2010, 09:43:42 pm »
Hello,

I took a look. I'm using sfml 2 instead of 1.6, so I had to change a few things (easy things) to make it work, such as the names of some functions and so on, but now there are a few bugs.

Change:
Code: [Select]

if (window.GetEvent(evnt))

to
Code: [Select]

while(window.GetEvent(evnt))


And aslo, if I click with the mouse button many times on the screen to make many... mm... tanks? well, it freezes.