Primary tabs

Comments by User

Sunday, June 23, 2013 - 14:48

Throwing in a fprintf, I see that Settings::loadMiscSettings() is only being called for one of the two misc.txt mod files, the one in fantasycore.  The one in alpha is being skipped entirely.

 And yes, I have the following in mods.txt:

fantasycore
alpha_demo

 

Sunday, June 23, 2013 - 14:10

I uninstalled the package back when I started looking at the code so there should be no system-wide mods.  If there were left behind, where would they be?

 

 

Sunday, June 23, 2013 - 14:00

Gold as an item was working for a while.  But just recently I lost my saved games and this happened.  I tracked the lost games down to the names being .local/share/flare/default/save1.txt where they used to be flare0.18_save1.txt.  Could this have anything to do with having polymorphable in a different directory?

Let me try it with zips directly from the main repo just in case something got wierded up on my fork.

 Edit: Same issue even after wiping out the directories.

 

Wednesday, June 19, 2013 - 21:25

I just realized you could do this (part 2) with objects.  Will objects work on NPCs and walls?

Example:  A fiery crown floating over the head of Vesuwio?

Example: A vine climbing up one of the buildings in town?

Pur

 

Thursday, June 13, 2013 - 22:12

No crashes yet except for leaving out the default mods directory.  :P

By the way, I finished off the brothers before I ever heard about blowing up the pillar.  I thought it was obvious that since I had teleport (and anyone could go buy the boots) that that was the way across.

/shrug

Pur

 

Thursday, June 13, 2013 - 22:05

Hmmm... correct me if I'm wrong, but it sounds like you could take a schematic and generate any number of areas with it simply by using a different tileset?  So it could be a cave where the paths are tunnels or a swamp where the paths are the only dry land or a city where the paths are roads between the buildings.  If you pick a tileset that looks sufficiently different, it will not be immediately obvious that it uses the same schematic.

Especially if you also rotate it 90 degrees.

So reuse of schematics sounds like a fast way to increase the number of areas in the game.

As to the original post, a map generator (random or otherwise) sounds like a class instance to me rather than a set mod file format.  How difficult would it be to put the class name in the mod file and have the engine run that class when it needs the info?

Pur

 P.S. A perfect example of a need for a "random map generator" is a forest-fire zone.  Each time you enter, different trees are on fire, forcing you to find the path that will get you safely through.

 

Thursday, June 13, 2013 - 22:00

Cool.

So what bugs are you looking for amd where do I post them?

Pur

 

Thursday, June 13, 2013 - 21:26

By the way, Pur was taken on GitHub so I had to make do with puros.

 

Thursday, June 13, 2013 - 21:24

I did some of both.  The first post (above) was done by changing Miner enemy file to give a few mil XP.  That way I could see how the XP bar behaved as it advanced, as well as what happened when it hit the hard limit.

More recently, XP was changed to unsigned long, so I just edited a save file to 3B XP.  When I log them in the XP bar tooltip shows -1294967296/-256.

One thing that I do know is that if you give out code, there is no guarantee as to what people will try to get it to do, so a test suite is pretty much mandatory in my experience.  I won't mention a certain MMO that started with code for a MUD.  :P

On another note...

If you are open to suggestions on improving the quest line in the alpha...

  1. Have Sir Evan Maddox give a quest when he dies, "Avenge me..." that leads to the old (wo)man hiding from the undead in the Avergard Complex.
  2. In the complex the old (wo)man nods and says they remember the young man who betrayed the lord.  He fled to the mines and hasn't been seen since.
  3. That leads obviously to the Necromancer Apprentice who betrayed his lord in turning to the dark side then fled to the mines.
  4. This apprentice in turn could drop a clue leading to the brothers.  (Can the engine handle things like note and maps objects?)

I have plenty of ideas, but little in the way of artistic flair unfortunately.

 Pur

Wednesday, June 12, 2013 - 11:45

Changing XP to unsigned long (https://github.com/clintbellanger/flare-engine/pull/697) will re-introduce the issue fixed in the stat bar (https://github.com/clintbellanger/flare-engine/pull/696) because a long * int gives up to 96 bits result which will not fit into a 64-bit long.  Also, MenuStatBar::update() requires an int, and you'd be sending it an unsigned long value.

The problem I was pointing out was that at the hard limit of XP, when you gain more XP, it will roll over when it should just stick at that limit.

Suppose for the sake of oversimplification that XP was unsigned byte.  You go out and kill a zombie and go to 1 XP.  254 zombies later you are up to 255 XP.  One more kill and you end up with 256 XP.  But you only get back the BYTE value which in this case is... (byte)256 = 0 XP.

My solution posted above would check to see if there were a rollover and if so, just reset it to max XP.

Of course what I posted would fail for an unsigned, and would be a serious "hack" if there were some way for a starting character to loose XP.

A better solution would be to use longs for the math, then use the min() of that and (long)std::numeric_limits<int>::max()

If you wish to keep unsigned long for the XP, then anything dealing with stats needs to be able to handle unsigned longs.  It's easy enough to find these places; just go into your save file and set your XP=3000000000 (3 Billion) which will show up as negative anywhere you haven't dealt with unsigned long values.

To fix just the overflow, something like the following should work (untested):

void CampaignManager::rewardXP(int amount, bool show_message) {
    unsigned long max_gain = std::numeric_limits<unsigned long>::max() - hero->xp;
    unsigned long xp_gain = ((unsigned long)amount *
           (100 + hero->get(STAT_XP_GAIN))) / 100;
    hero->xp += min(xp_gain, max_gain);
    hero->refresh_stats = true;
    if (show_message) addMsg(msg->get("You receive %d XP.", min(xp_gain, max_gain)));
}

 

Pages