# rmsgrey

Member

723

153 Neutral

• Rank

• Interests
Education
Programming
1. ## number of matching chars in 2 strings

Nypyren's solution is a good one. For comparison, my first thought is to sort both strings and then iterate through them (advancing whichever is behind when they aren't equal; both when they are): #include <algorithm> using namespace std; int counthits(string pass, string guess) { sort(pass.begin(), pass.end()); //in place sort - make a copy if you want to keep the original sort(guess.begin(), guess.end()); int i=0; int j=0; int count=0; while (i<pass.length()&&j<guess.length()) { if (pass[i]==guess[j]) { i++; j++; count++; } else { if (pass[i]<guess[j]) i++; else //pass[i]>guess[j] j++; } } return count; } You could get fancier, pad both sorted strings with an extra character to prevent overflow (adjusting the while loop's end conditions to ".length()-1"), and remove the "else"s (replacing the second with the obvious if condition) and potentially advance both i and j twice each time through the loop (for example with a guess of "cad" for pass "bad" you'd compare abd~ with acd~ so count and increment both, then abd~ with acd~ so increment i, then abd~ with acd~ so increment j. I use ~ here for padding because it's ASCII 126, so won't compare less than valid guess characters (if you allow a wider range of characters, you would want to use the last valid character (or greater) - or double-pad the pass string to prevent overflow)
2. ## The Total Beginner's Guide to Game AI

Interesting article, but some aspects of some of the examples ended up distracting me - for example, the FSM has no way of reaching "Searching", which feels like it should be commented on in the text (or corrected in the example). Or, for the Markov model, it appears the sample data was in the form of first sighting and second sighting for independent runs, with second sightings being split 11/14/3 for red/green/blue rooms respectively, which is at odds with the way the data collection was described - as each sighting generating a (last-sighting, current-sighting) pair - which should give the same split of red/green/blue rooms for the next sightings as for the previous sightings (with a possible off-by-one for the boundary conditions). It would be nice if the examples and the text were more congruent with each other.
3. ## Beyond death

In Soul Reaver, "death" in physical just drops you back to spirit world where you need to find a portal and regenerate your health to full to get back to physical. "Death" in spiritual dumps you back at the start location with a long walk to get back where you were (shorter if you've been activating the warp portal devices as you go. Of course, you could also drop back to the spirit world from the physical any time, and many of the game's puzzles required you to travel in the spirit world for a while between manipulating objects in the physical.
4. ## What have been the bad elements of past CRPGs?

Final Fantasy X-2 is probably the most replayable RPG I've encountered. Most plot threads have only one or two alternate versions, though there's one which I think has 6 distinct resolutions (a whodunnit with 5 suspects and a failure case) but the innovation of New Game Plus (carrying over skills and items - but not levels - from one play through to the next) makes it a lot easier both to replay the game (you get to keep the cool gear) and to become stupidly powerful (you can re-run the plot while you learn the boring skills rather than having to run in small circles somewhere)
5. ## What have been the bad elements of past CRPGs?

Quote:Original post by Jiia Only kings and emperors care about how pretty their weapon is. Which ties back into the issues about reputation and combat-centric gameplay. If someone has a really flashy (unique) sword, then they're easier to identify on sight (unless the sword is concealed) and tales of their exploits will tend to accumulate together - having 10 stories about the man with the crimson blade rather than 10 stories about mysterious strangers. On the other hand, if the game revolves around combat, then barely anyone would bother to make their sword visually impressive (then again, one of the "wow, cool" moments in Kingdom Hearts was seeing "Leon" (Squall from FF8) change from his regular weapon to a Lionheart). Equally, people would be disapointed if, in a Star Wars game, lighting up a lightsaber didn't make the familiar noise... *************************************************************************** On the topic of implementing a good reputation system, maybe we can't come up with any noticeable impact on existing games of replacing a slightly tweaked "good enough" system. On the other hand, once you've got a system implemented and can play around with it, it's a lot easier to see just what you can do with it. One (possibly apocryphal) example of a gameplay feature that wasn't designed in is rocket jumping. Without actually playing with a "proper" reputation system, it's very hard to be sure what the possibilities and limitations of such a system would be. *************************************************************************** One of my pet hates in RPGs that I don't think anyone's mentioned yet in this thread is the massive mismatch between the pacing of the plot and the pacing imposed on the player by the basic mechanics - "Oh no! An extinction level asteroid is going to impact soon! We must hurry and spend everal months running round in small circles to get enough random encounters to level up far enugh to be able to take on the final boss!" The number of times in Final Fantasy games where I've got caught up in the tension of the plot, and moved rapidly through several areas, only to find that I'm sufficiently underpowered to not have a chance against the boss at the end of the section, is ridiculous! Having a role-playing game where the only way to progress is to ignore the role the game presents for you and wander off somewhere for a while is just plain wrong. And then people complain that all cRPG players are munchkins. It's because any other approach gets you killed!

7. ## Why is Zelda popular?

It's definitely not nostalgia for me - I met Zelda through Ocarina when I went to uni, and completed it about a dozen times more or less in a row (including once with no unecessary pickups and delaying necessary ones as long as possible - man is crossing the desert without the Eye tough! - also completing it in a single sitting and completing it getting items as far ahead of sequence as possible). By now I must have completed it more than 20 times, though I've long since stopped keeping count. I've no idea what, specifically, drew me to it - the soundtrack's good, the minigames are generally well designed, the basic combat mechanic is fun, the puzzles are generally solvable through logic in advance rather than needing to guess and then realise why (or in some cases guess without a clue why) as can be the case with adventure games. The game-world is internally consistent (though not very realistic) so things you learn in one situation usually transfer across to other circumstances (the most common reason for getting stuck in a Zelda game is probably failing to realise a given item has a given capability) and the path through the game is clearly signposted, but there are also rewards for exploring the rest of the world. The biggest negative about the entire game (for me) is the early tutorial section, where, after a lengthy prologue cutscene which you can't skip, but do have to keep prompting to continue, you keep getting stopped to be told how to play the game - great for a first time player, but increasingly annoying on replay - most particularly the three times you're told to "Pay attention to what the action icon says" (one of which you can avoid). Yes, guidance on how to play the game is a good thing, but if you can't turn it off of avoid it, and have to wait for it to scroll past every single time, it gets a little intrusive. Ultimately, with the exception of Zelda 2, the Zelda series follows a formula, and does it well, with each game being an individual experience, but the entire series having a lot in common - in many ways paralleling the Final Fantasy series (though Zelda might have a single coherent storyline connecting all the games). The formula seems to be pretty successful, and the games implement it well.
8. ## Create life not destroy it!

Dungeon Keeper 2 has "My Pet Dungeon" mode, which is just the base construction/management aspect of the game - with a construction based goal - though you did always have the option of throwing in some heroes if you relf like it...
9. ## RPG character recruiting

Final Fantasy 6? Where you have a vast array of characters, each of whom has their own storyline that can be explored (OK, for some the storyline is "hung around for ages then joined your party", but a lot of the characters have more to their story...) A couple of non-RPG examples of characters: Farah in Prince of Persia: Sands of Time (plot) and the "Barney"s in Half Life (recruit)
10. ## Games of the future

Quote:Original post by Wavinator Even the squad vs. single predator might be dicey, but it might work if the the idea is sold correctly to the player, individual unit investment isn't high, and the AI is ALWAYS active or there is gameplay girding up lulls and downtime. XCOM: UFO's last alien syndrome. Somewhere on the map is one last surviving alien - either one that dodged your initial sweeps, or one that was only stunned and has now woken up (and is wandering around unarmed, not having the brains to pick up its weapon). To complete the mission and salvage the alien craft, you need to spend 15-20 minutes scouring the level to locate this last "threat" and neutralise it. Probably the single most annoying part of the game by a long way.
11. ## You are not Alone

I think for me the key would be for the "others" to be believable as players rather than NPC cheats. If all they do is appear, beat you to the prize, and disappear again, I'd treat them as scripted plot elements rather than rival players. If there are a handful (no more) of NPC "players" that I can interact with throughout the game, they're a lot more palatable (particularly if they're not automatically rivals throughout) than if they just pop up. The other thing I'd look for is seeing them competing with each other, not just with me.
12. ## Character advancement in RPGs

Quote:Original post by Anonymous Poster Everything is based upon chance though. When you raise a skill you have a CHANCE to unblock something, but you also have a chance to have it blocked. To make a quick example, if there were swords, maces, and axes I could train swords until blocked, then switch to maces. Maces can increase without unblocking something. So if maces get blocked, I'm left with axes. If axes gets blocked, ??? Anyhow, I don't mind a system that would force me to learn so much before I could learn more in a certain area, but that amount should be set. I don't want to spend half my career practicing pick-pocket, trying to unblock swords, when I just want to work on swords. Yeah, the chance of blocking everything (or having a stubborn early block in a useful skill) is a potential issue. On the other hand, a sensible implementation will include some way of avoiding total block (or be designed in such a way that it's not a serious impediment when it does, inevitably, happen). The point of having the random element rather than pre-set prerequisites is to discourage munchkinism and give players a genuine choice rather than "to improve your longsword as quickly as possible, gain 30 levels of longsword, then 15 levels of flute, then 25 levels of longsword, then 12 levels of pottery, then another 35 levels of longsword..." A necessary corollary of the system is having a broad range of skills and ways of using them in interesting gameplay rather than being able/required to spend 50 hours hacking at trees/committing goblin genocide and then have absolute mastery of your chosen weapon. If the game is well designed for the system, it should be possible for a character that's become blocked in longsword at a reasonable level to still play out the game using his longsword as a competent warrior. There are a couple of tweaks that could get around the problems of premature blocking and total blocking - have a reasonable minimum level of proficiency below which there's no chance of blocking (possibly tied to relevant attribute scores) or allow blocked skills to still advance, but at a reduced rate - say 1% of the unblocked rate. There is a fairly widespread idea historically that the ultimate warrior (the paragon of Knighthood, or the ideal Samurai) is not only supremely skilled with the sword, but also has at least a passing acquaintance with many other skills, and is master of at least a few skills which are useless in combat. In current RPGs (and other video games), the ideal warrior is recognised solely by his ability to slay his enemies in the shortest possible time. Rather than being accounted superior, the player who has invested points in etiquette or dance or astronomy is regarded as inferior to the musclehead whose only virtue is the ability to kill more Orcs per hour.

14. ## why not hide the numbers?

A couple of thoughts on quantisation: A cap on power needn't mean a cap on level number - for example, if each level gained increases your power by half as much as the previous level, then you will never get more than twice the first increment from your base power, but can keep gaining levels until the computer runs out of memory to store the numbers (or, more likely, you die of old age) For stair-step improvement, one problem with level-based games is that everything improves at the same time - which makes bookkeeping easier for PnP players, but is unnecessary in cRPGs - even with an outright XP driven system, you could have the characters various skills and attributes advance at set XP totals independently rather than in lock-step - achieving a significant blurring of the (necessarily) quantised nature of character improvement. For massive hit points, various PnP RPGs explain hit points not in terms of getting stabbed 100 times by a sword and surviving, but in being swung at by the sword 100 times and managing to just dodge (or ride the blow) each time until you're sufficiently tired and/or bruised that subsequent attacks actually connect - high HP representing your being hard to kill because you're good at avoiding being wounded, rather than hard to kill because you can have your head chopped off and still keep fighting. The issue here is more one of terminology than realism - if you called it stamina or survival instinct points, you'd have a lot fewer complaints...
15. ## Make work - FUN!

A Poul Anderson character once defined either sport or a game as something like "work you don't have to do". With that in mind, the major elements that can make something "fun" (in my opinion): 1) Competition - being measured against other people 2) Free choice - not feeling it's something you "must" do (particularly not something you must do in order to get on to something you want to do) 3) Potential achievement - there has to be some sense of progress - either actual or soon to be achievable.