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

Author Topic: [Revived] Before the Reign  (Read 15429 times)

0 Members and 1 Guest are viewing this topic.

Jany

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Before the Reign
« Reply #45 on: May 24, 2012, 04:18:44 pm »
Hey :) Yeah along with the current preview I'll be adding a journal which shows the current quest and maybe completed quests. As for the source code, I might upload just the Quest part of the code, unless you wanted just this part of it?
Hey, yea thats what i mean :)

aBallofWin

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: Before the Reign
« Reply #46 on: June 05, 2012, 05:00:50 pm »
Update: Been working on an inventory system, check it out if you wish!

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: Before the Reign
« Reply #47 on: June 06, 2012, 05:14:54 am »
Hello. I checked out the game and I saw you had a fair bit of code there. I wasn't sure if you were looking for feedback, but I thought I might make a few suggestions.

I think going forward your main obstacle for expanding the program is going to be the fact that a fair bit of the coding is specific to the game's quest. That is, your code cannot be easily reused for a different game that features similar content without rewriting code.

My suggestion would be to consider how you might turn parts of your prototype into reusable modules and to separate game details into data files. It may not be easy, but one thing you will find as you spend more time writing software is that productivity and modular code tend to go hand in hand.  Although it may take a little bit more time to design something to be reusable, it will save you tons of time later on.

You should also replace the switch statements used to produce "number" strings with formatted strings either using sprintf style or stl stringstream style. Another option might be although less efficient to use std::string and to_string like:

string mymessage = string("You did ") + to_string(DamageAmount) + string(" damage!");

This is not the most efficient way of doing this, but I sometimes use less efficient methods that produce easier to read (and maintain) code in situations where performance and efficiency are irrelevant.

Finally, the game crashed 90% of the times I tried to run it. I checked code and found this:

class Game_city : public cScreen
{
private:
    int movement_step;
    int posx;
    int posy;
    sf::Sprite Sprite;
...
};

Game_city::Game_city()
{}

And noticed that you failed to initialize non-class values in the constructor. Although the assumption might be that movement_step, posx, and posy are initialized to zero, in reality their initial value is undefined.

To prevent random unexplained crashes all of you constructors should initialize all non-class fields to zero or another safe value. For example:

Game_city::Game_city()
{
    movement_step = 0;
    posx = 0;
    posy = 0;
}

or

Game_city::Game_city() : posx(0), posy(0), movement_step(0)
{
}

If you don't assign values, the initial values may be zero, or it may be something random.

-Steven


aBallofWin

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: Before the Reign
« Reply #48 on: June 06, 2012, 01:52:28 pm »
Cheers for the feedback steven :) I think for programming this I will keep the quest system as is, but I will definitively keep that in mind for future projects.

As for the battle scene code, I do realise that it's extremely sloppy and when I get round to redoing it, it'll be a lot more efficient!

With the cScreen class, I've removed that from the game completely. When I first started on the game, using different scenes really helped but now that I look back at it, it really hindered the game.

One more thing, which version did you test? Version v1.1.0, or the indev version which is included at the top of the OP?

Cheers,

Jake.

StevenC

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Corona Soft Development Blog
Re: Before the Reign
« Reply #49 on: June 07, 2012, 01:34:09 am »
One more thing, which version did you test? Version v1.1.0, or the indev version which is included at the top of the OP?
Hello Jake,

I tested the indev version. I managed to get it to run once, and after that I went looking into the source code for v1.1.0. I didn't try compiling it though to see if the issues in the indev were present in the v1.1.0. I assumed they were fairly close, but it sounds like you may already be in the process of rewriting it.

-Steven


aBallofWin

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: Before the Reign
« Reply #50 on: July 11, 2012, 02:21:32 pm »
My last update for this page, I'm going to work on a side scroller shooting game (like metal slug) but obviously not as good! :) I'll be learning SFML2 first, then work on this new game, you will hear from me within the next few weeks!

Stormblessed

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Before the Reign
« Reply #51 on: July 21, 2012, 12:06:23 am »
I don't know if I'm doing something wrong, but your download link in the OP doesn't seem to work.  It just takes you to the filedropper.com main page or something, any chance you can fix the link?
Embrace success, don't condemn it.

aBallofWin

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: Before the Reign
« Reply #52 on: July 21, 2012, 02:26:27 am »
I don't know if I'm doing something wrong, but your download link in the OP doesn't seem to work.  It just takes you to the filedropper.com main page or something, any chance you can fix the link?

Updated :) The codes a little bit messy though

aBallofWin

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: [Revived] Before the Reign
« Reply #53 on: December 15, 2012, 03:01:48 am »
I'm a back.

Roose Bolton of the Dreadfort

  • Full Member
  • ***
  • Posts: 113
  • Full-time Procrastinator, Part-time programmer.
    • View Profile
    • Personal Portfolio/Website/Blog
Re: [Revived] Before the Reign
« Reply #54 on: December 15, 2012, 03:55:47 am »
Abertay Uni?
Trying so very hard to finish at-least one project.

Watch out for the RAII police, they will get you.

www.bantersaurus-games.com

aBallofWin

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: [Revived] Before the Reign
« Reply #55 on: December 15, 2012, 04:31:59 am »

 

anything