Stuck in SPELLSHARD? READ THIS!

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
SDHawk
Metal Slime
Posts: 673
Joined: Sun Apr 27, 2008 8:46 pm

Post by SDHawk »

Harlock Hero wrote:Fenrir: You're not the only person to complain about the RNG! A few other people also noted that at times, the enemy attacks seem to disproportionately gravitate to one character out of the four. I had asked James and TMC about this, but neither one of them reported anything strange in the code. I really don't know what to make of it ;_;
I wouldn't be entirely surprised if there's something funky with the RNG somewhere obscure (assuming the battle RNG is the same as the Random() command). When we were working on Transylvania Girls (which mostly uses random() a lot to decide whether events trigger) we noticed a lot of weird patterns in it that would crop up from time to time. When I ported the game to Flash using the same numbers the RNG has been a lot closer to where I would have expected it in my testing.
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Interesting. The OHRRPGCE uses FreeBasic's implementation of the <a href="https://en.wikipedia.org/wiki/Mersenne_ ... ">Mersenne Twister</a> which is supposed to be a very good pseudorandom algorithm

Randomness is a fascinating subject, but it can be mercilessly difficult to debug random stuff, since human ability to detect randomness is subjective by definition, and it is impossible to remove <a href="https://en.wikipedia.org/wiki/Confirmat ... nfirmation bias</a> from any human test. You can have good randomness from a mathematical point of view, and get results that resemble a pattern, and it is impossible to tweak an algorithm to remove the appearance of patterns without-- yep, adding patterns!

That is not to say there can't be bugs in how a random number is used that create real patterns... but I haven't been able to spot any such bugs, and the targetting code is pretty simple, especially in the case where one enemy is picking a single target from 4 heroes.

Code: Select all

FUNCTION randomfoe &#40;byval who as integer&#41; as integer
 IF is_enemy&#40;who&#41; THEN
  RETURN INT&#40;RND * 4&#41;
 ELSE
  RETURN 4 + INT&#40;RND * 8&#41;
 END IF
END FUNCTION
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Actually James, the randomfoe function isn't used anywhere. The actual random target picking is in find_preferred_target, and it's quite correct.

There probably are bugs in the use of randomness in places in the engine; for example picking a random formation from a formation set is purposefully not random (in an attempt to increase variety), but I messed that up, so it might have less variety than random in some cases. However I've just audited the whole battle system and found no problems there.
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Haha! You are right. I need to remove randomfoe and randomally, since they are dead code.

Here is the real code from find_preferred_target

Code: Select all

 CASE 4 '--Random
  search = 0
  DO
   found = INT&#40;RND * 12&#41;
   IF tmask&#40;found&#41; <> 0 THEN RETURN found
   search = search + 1
  LOOP UNTIL search > 999 ' safety
EDIT: oops, tried to fix it, but html & entitiy codes don't seem to work inside code tags :P
Last edited by Bob the Hamster on Wed Apr 11, 2012 2:29 pm, edited 3 times in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

The angle brackets bug strikes again!
User avatar
Nathan Karr
Liquid Metal Slime
Posts: 1215
Joined: Fri Jan 25, 2008 3:51 am
Contact:

Post by Nathan Karr »

Personally I've always had a problem with Random Spell lists choosing later options over earlier ones. Don't know why or how, but it seems to do this to me persistently.

Which is why I was glad that this updated release removed the Thief's second STEAL! command effect (aside from its easy money breaking balance more than anything else and its preventing me from getting most stealable items).

Still in the desert chapter, personally. Can't get through that danged desert.
Remeber: God made you special and he loves you very much. Bye!
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

TMC wrote:The angle brackets bug strikes again!

Code: Select all

   IF tmask&#40;found&#41; <0> 999 ' safety
Whoa! For a moment I was wondering why that even compiles... then I realized the "angle brackets bug" you are talking about is a forum bug, not a freebasic bug :)
beau_rl
Slime
Posts: 15
Joined: Fri Feb 27, 2009 6:03 am

Post by beau_rl »

hey guys, how do I pass the abjurer? He uses his force wave on me and it wipes my party out instantly? is there a trick i'm missing? Love the game!
User avatar
KF Harlock
Slime Knight
Posts: 194
Joined: Wed Oct 22, 2008 10:45 am
Location: East Coast USA
Contact:

Post by KF Harlock »

Thanks, beau_rl!

The Abjurer does have a trick to him that you can exploit for the win.

If you experiment a bit, you'll notice that his FORCE WAVE attack does as much damage to you as you've caused to him over the course of the fight. So if you hit him a lot, it'll kill you outright. If you don't hit him at all, it'll cause you 0 damage though!

So, the way to beat him is to not attack him at all, while he goes through his power-up and FORCE WAVE cycle 3-4 times. Spend this time buffing up your own party instead. Once the Abjurer runs out of energy (the game will tell you), quickly hammer him with everything you've got; he won't be able to counterattack at this point.
SPELLSHARD: THE BLACK CROWN OF HORGOTH now COMPLETE! <a href="http://www.slimesalad.com/forum/viewgam ... 4363">Grab it today!</a>
User avatar
Master K
King Slime
Posts: 1899
Joined: Sat Jun 11, 2011 9:40 pm
Location: A windswept rock in the Atlantic Ocean

Post by Master K »

Ahhh thank you Harlock! I was stuck on that part as well.
That was really difficult.

I got through it on my original file by exploiting Stunning Salts...
XD
beau_rl
Slime
Posts: 15
Joined: Fri Feb 27, 2009 6:03 am

Post by beau_rl »

Thank you!
I've finally made it to Nagasakiwakamasanaginakagawashinakawankansenaka.
User avatar
Master K
King Slime
Posts: 1899
Joined: Sat Jun 11, 2011 9:40 pm
Location: A windswept rock in the Atlantic Ocean

Post by Master K »

Is there any strategy for Blaggenthorg? He keeps beating me...
Damn wizard is too squishy.
User avatar
KF Harlock
Slime Knight
Posts: 194
Joined: Wed Oct 22, 2008 10:45 am
Location: East Coast USA
Contact:

Post by KF Harlock »

BLAGGENTHORG :gonk:

Blaggenthorg's main thing is that if any of the parts other than the core die, he'll transmute the party into slime to rebuild himself. So, you should basically never attack any part but the core.

HOWEVER -- if you take too long in the battle, Blaggenthorg's own attacks will eventually do enough damage to his extra parts that one of them may die. If it seems like this is getting close to happening, it can be advantageous to hit one of the outer parts with one of your weakest attacks, to trigger his heal-all technique (anything that hits for less than he heals will be fine). If you're quick enough in damaging his core, however, it may not come to this.

If he's causing you too much damage, I believe you can use EGO-WHIP on him; it's pretty effective at reducing his physical attack power.
SPELLSHARD: THE BLACK CROWN OF HORGOTH now COMPLETE! <a href="http://www.slimesalad.com/forum/viewgam ... 4363">Grab it today!</a>
User avatar
Feenicks
Metal Slime
Posts: 696
Joined: Tue Aug 10, 2010 9:23 pm
Location: ON THE AIR IN THE AIR
Contact:

Post by Feenicks »

I've been stuck in the sewers for a while now. Don't think I actually have enough money to rest up, which makes things annoying (really, did the costs really have to scale up that much?), and I keep dying to the Giant Piranha simply through the stacking up of the six piranhas all attacking at once.
I'm not really seeing a good way to get through this battle.
User avatar
KF Harlock
Slime Knight
Posts: 194
Joined: Wed Oct 22, 2008 10:45 am
Location: East Coast USA
Contact:

Post by KF Harlock »

Sorry you're having trouble with... THE PIRAHNA:

There's not a lot of strategy with this one, but he's extremely weak to lightning, so smacking him with lightning-based stuff ought to help. The spell SHOCKING GRASP is particularly effective.

By the way, if you're having trouble with money, I would suggest selling some of your consumables; you definitely need to be able to rest and such. However, there is one secret in this chapter that you can use to dramatically increase your money-earning:

In the top-right corner of the town part of the Midh map (not the palace), there's a merchant who will offer to sell you a sword at an extremely high price. Refuse him and he'll lower the rate. Keep refusing him and he'll keep lowering the rate (I *THINK* a total of five times, but not 100% sure, save beforehand). Eventually, you can buy the GOLDEN SWORD for just a couple thousand gold. When you equip this on a character, every time you swing it in battle, you gain around 50 gold!
SPELLSHARD: THE BLACK CROWN OF HORGOTH now COMPLETE! <a href="http://www.slimesalad.com/forum/viewgam ... 4363">Grab it today!</a>
Post Reply