Showing posts with label bugs. Show all posts
Showing posts with label bugs. Show all posts

Tuesday, September 16, 2014

Civ V: Brutal Trading Bug

I read about a trading bug in Civ V multiplayers games a while ago but didn't give it much thought. It's incredibly abusive if you want to cheat but I figured no one I'm playing with now would be abusing it. And I guess if they were and got caught we'd just stop playing with them. But then earlier today I got hit by a side effect of the bug in a game with Robb. He wasn't trying to be abusive or anything and it only cost me a turn of scouting but it was still annoying and it now makes me think everyone should know about the bug so we don't get hit by any side effects.

The bug is pretty simple. When player A proposes a trade to player B it pops up on B's next turn. B can accept the trade, reject the trade, or modify the trade. The first two work fine but the third one has the bug. You'd think that modifying the trade would be a way to send a counter-proposal to the other player and that's exactly what Robb tried to do in our game. I was trying to bribe him with 15 gold and some horses to get open borders between us so I could go meet a city state behind his borders. He didn't want my horses and wanted more gold instead so he modified the trade to be open borders each way with me throwing in 30 gold. That was fine by me, but when it got to my turn I couldn't accept the trade. You see, the trade was modified by Robb but it was still my trade and that means Robb is the one that needs to accept it.

He doesn't even need me to see the modified trade. He can modify the trade and then accept it.

...

...

He could have, for example, modified the trade so I got nothing and he got my 3 cities and all of my gold.

...

...

Yeah, that's not cool.

Modifying trades is actually a way to speed things up with outside game communication. If Robb had asked me about it in Skype instead of just sending the offer then we could have haggled over the gold amount, he could have modified it, and then accepted it and we'd both be happy.

But outside of that edge case you really shouldn't ever modify a trade. Reject and send a new one of your own if you want. Talk about it on a message thread. But don't modify a trade and expect the other guy to be able to accept it. He can't, because of the bug.

And obviously don't modify a trade and accept it without talking to the other person. There is a log of completed trades so it's pretty easy to check if someone is abusing the bug. Certainly if you steal a city this way we just roll the turn back, kick you out, and move on with our lives.

Friday, May 30, 2014

Civ V: Dangerous Bug Abuse

I decided to see if I could pull off the research bug I talked about yesterday in an actual game. So I started up a 12 player highest difficulty game as Venice with the goal of just sitting around setting up the bug and hope I was ignored until I had infinite tech. I wasn't sure how I was eventually going to win but I wanted to see if I could make it happen.


It turns out that yes, I can totally make it happen. I may have gotten lucky (I got to make a proposal at the first council meeting and was able to get scholars in residence through) but no one even looked at me funny the entire time. There's just so much space on a pangaea that it seems like if you never expand you don't get anyone's attention. My capital was truly terrible though, and I couldn't even increase my hammer production because I was skipping mining, but I got it it work.

Oops.
And then disaster struck. I don't know the exact value but one turn I was carrying more than 200000 beakers over between turns and the next turn it wrapped around into the negatives. Not only was I not learning a tech per turn anymore, I'd broken poor chemistry. Even if my position was otherwise playable I'd never be able to progress beyond chemistry. (Actually I may have been able to build the national university wonder for a free tech to fix it, but stalling out with less tech than everyone else was not playable.)

What I needed to do was force a path to new techs. I'd picked up all of the cheap stuff but since the bug only applies on techs with a discount if I could have opened up a 'new to me' tech then I could have started actually spending science when I had 100k or so. Or maybe I just didn't need scholars in residence at all. Or maybe I could have started earlier with a smaller start-up value from my great scientist.

I'm going to give it some more thought about how to transition from infinite tech into a victory and how much set-up I actually need. Maybe I can just use the sailing side of the tree and can afford to at least get mining and masonry to build up my capital. Maybe I can even afford to expand a little bit? And I can probably find a better civ to play... I'm actually think Mayans for the early great prophet (I couldn't see any other way to get a religion in this game unless you can get a huge faith pantheon) and the also free great scientist which might let me get started without waiting for the university workers to generate one for me.

I did learn that I don't need to waste time using scouts to find all the other civs. As long as someone else does it the council will introduce me to everyone else and unlock all my discounts.

Friday, January 27, 2012

Final Fantasy IV: Bugs

One of the interesting things I've been learning as I've been playing through the Final Fantasy games is just how many weird bugs exist in the games. Final Fantasy had a lot of bad pointer related bugs. It had some local variable bugs. Final Fantasy II had a pretty brutal cancel bug. Final Fantasy III had a dupe bug for sure (though I played on the DS which seemed pretty decent). Did they get any better for Final Fantasy IV? Of course not!

Perhaps my favourite of the FFIV bugs has more to do with not enough edge case testing... Here's the situation:

In combat you can change which weapon/shield you have equipped in each hand. You go into your item menu, select a hand, and then choose what you want to put in that hand. But how are you, the player, to know what you could equip? Well, the system iterates over all items in your inventory when you pick a hand to swap. Anything you could equip gets highlighted. Anything you can't equip gets faded out. Then when you go to select a faded out item you get an error. This seems like a reasonable system, right?

When you select a highlighted item should it recheck if the item is a legal option? If you're coding robustly it probably should but then you're adding an extra check in which seems unnecessary. You already validated every item in your inventory seconds earlier. Why bother revalidating? We're talking about a game that had to have plot cut out to fit it onto the cartridge! Any extra checks are probably unwise...

Now, what if you wanted to unequip an item? Well, you'd 'equip' a blank slot in your inventory. This seems like a reasonable case to build in. Let's just flag the empty slots as valid equips. No sense treating them any differently, right?

How about when we derive our current stats? Should we validate our gear then? Seems wasteful. As long as we're robust in only allowing valid gear to be equipped in the first place this should never come up.

So, what's the bug? Well, it's a timing bug. Get into a fight with a monster which drops a weapon or a shield as its common drop. Have Edge input the steal command (which will steal the weapon or shield). Then quickly get to the person who can't legally equip that item. Have them go into the item menu and start switching items. This will cause a validation of your inventory as it stands when you start. While doing this the steal command will resolve and you'll get a new item. It will go into a blank slot in your inventory. A blank slot that has already been validated as a legal equip. Pick the new item! Huzzah! Rydia can put on a shield! Rosa can use a spear.


There's a similar timing bug which lets you use berserk while unequipping arrows which results in duplicating any item you can legally equip. You end up with 255 copies which is great for making cash or for throwing with Edge.

Berserk is also buggy with Edward and his auto-hide ability. Apparently you can set it up so he can't be attacked but is berserked and beating down.

A final timing bug revolves around the spell stop. It takes out all other timers on the person, completely. Have a temporary paralyze? If you get stopped it will never wear off. A virus? There forever. Unless you reapply it then the timer will get fixed. And if you screw with the timers on monsters with stop? The game will often freeze. (I'm glad I never used that spell!)


In the inexplicably weird category... The sylph spell is free if you put it in one spot (upper right hand corner) in the spell list.

In the mad cheats category... At one point you're in a fight in the dwarven castle underground. You fight some dolls and then you fight Golbez. He almost kills you when Rydia shows up and saves the day. Golbez still manages to run off with the crystal. A future plot point is to go get the last dark crystal from the sealed cave... If the first thing you do after Rydia joins your party is cast warp you'll get warped back to the dwarven crystal room. Complete with dark crystal for the taking. Which counts as the dark crystal from the sealed cave! So you can skip that dungeon!


Now for a bug I think I was hit by... The moon is circular and you can find a path to do a complete circuit. But your spaceship only exists exactly where you landed it. So if you do a full circle around the moon? You lose your spaceship. You need to go back the other way the exact number of times to get back to the precise spot you left your spaceship.


There are a bunch of fights with conditional triggers to do things. The biggest example of this is when you fight the 4 fiends in one fight. You beat up Milon for a while and then when he dies Rubicant steps up. They coded these triggers as counter attacks. So if you kill Milon off with attacks that don't trigger a counter attack, he won't tag in Rubicant. You'll just win. One way to do this is to cast wall on your team and then bounce attack spells off the wall and onto him. Cheats!


Finally there's a bug that certainly afflicted me on probably every playthrough but which I didn't really notice. Thinking about it in retrospect I can see it happening but I didn't notice at the time... Weapons have flags on them. Metallic, so they paralyze you in the magnetic cave. Back row, so you do full damage from the back row. And, for some reason, no-crit. These weapons simply can't get a critical strike. The metallic flag works fine but the other two are buggy. If they ever get set on your character they are never removed. So if you ever put on a whip, for example, you can never get a crit again for the rest of the game. And you do full damage from the back row with any weapon. Axes, whips, and the best paladin sword all have the no-crit flag.

That's not the only way to lose the ability to crit. Apparently if you ever start a fight dead you lose the ability to crit. And sometimes the game has battles which run without player input. Tellah vs Edward in the 'YOU SPOONY BARD!' scene. Tellah vs Golbez. FuSoYa and Golbez against Zemus. If in one of those fights the team on the left dies then everyone in your party which occupies an 'empty' slot for the right hand team loses the ability to crit. So after the FuSoYa and Golbez vs Zemus fight at most two of your characters can still crit. The other 3 will permanently lose their ability to crit if they somehow kept it up to that point!

How... Dumb.

Friday, October 14, 2011

Crazy Final Fantasy Legend Bug

Final Fantasy Legend has less of a following than Final Fantasy does, at least in terms of availability of information about exactly how things work. I'm trying to find information about how critical strikes work since they seem really brutal and have come up blank so far. I'm going to keep surfing the web since I'm sure it's out there somewhere, but I did stumble across an awesome bug that I wanted to share...

Humans can use a bunch of different types of weapons and they coded them all differently. There are weapons based on strength, some based on agility, and some based on mana. Some do fixed damage, some scale with your stats. All weapons have limited uses just like my monster skills and you need to go buy new ones when the old ones run out of uses.

One type, martial arts, has two weird components to the amount of damage it does. First of all, you subtract the number of uses left on the item from the damage. As such, the more you use an item the more damage it does. I guess this is supposed to simulate getting better at punching? The second part is that on the attack that lowers your uses to 0 you do triple damage. Ka-pow! I've mastered punching and go out with a bang!

The bug comes in with how the game determines the number of uses left in your item... It doesn't store the uses in the item when you first use it. Instead it iterates over your inventory to find the item again and looks up the number of uses that way. (The programmer apparently started with swords and made the rest of the damage routines based on the sword one. Swords don't care about uses left so it wasn't stored?) Ok, that seems dumb, but what does it do? Well, the look-up is based on the name of the item and you can actually have multiple items with the same name in your inventory. So it checks the number of uses left in the top item in your inventory even if you actually used one lower down. Since uses left is subtracted from damage done you can do extra damage by leaving a punch with 1 use at the top of your inventory and actually attacking with another one.

Ok, we can do an extra few damage per attack this way... But what about that triple damage? It turns out you can get that too. When you fully use an item it disappears from your inventory but they didn't actually delete it from your inventory. They actually wrote in code to hide empty items from view in the menu! They're still there until you put something new in the empty slot. And the iteration to find the used martial arts item? It knows the spent item is there. Welcome to triple damage!

Wednesday, June 08, 2011

Nintendo 3DS SD Card Issue

I've had a Nintendo 3DS for a while now (my old DS was on its last legs and I wanted to have a console to play FFIII on when I got there in my marathon) and one of the apps it came loaded with was a rudimentary music player. It comes with a 2G SD memory card so I was able to move my mp3s from my ancient mp3 player to the SD card through my laptop. I was then able to play the music fine in my 3DS, but every time I opened the music or camera app it would yell at me. The claim was that the SD card was set to write protected mode and therefore nothing could be saved to the card. I took it out and looked at it... Not write protected. I put it back in my laptop... Not write protected. I stopped caring at that point since it would play my music at least and went on with my life.

Nintendo released a patch on the 6th which added in a web browser and a game store. Great! Only problem, it wouldn't let me update with a write protected SD card. (Well, it didn't tell me as much, but I updated and it failed.) Mark had linked to an FAQ describing a bug in the update which broke the Ridge Racer game. (Want to keep playing it? Don't update your 3DS.) In the same sub-section was an SD card FAQ. It didn't describe my error at all, but it did advise that the SD card can only hold 100 music files per folder and 1000 folders total. That got me thinking... I have more than 100 mp3s, right? And I remember searching through trying to find a specific song I _knew_ I had on there but couldn't find it on the list. (Simple & Clean by Utada Hikaru) So I took my SD card out, split up the mp3s on my laptop, and tried it in the 3DS. Worked perfectly. Downloaded the update. Worked perfectly. Got my free copy of Excite Bike 3D. Woo!