Wednesday, September 28, 2011

Functionaly mad : Playing with snakes 5 slither harder

Been a while since I've touched on this so here we go playing with snakes. For this one I'll be trying my best to explain what is seemingly a confusing subject, functions and scope. I would just do functions but scopes and functions go hand in hand. There is one thing they are very useful for but that's more advanced and saved for later.

Functions are very useful for programing in python. First they cut down code. For instance you could write.

print (1*1)+(2*2)
print (2*2)+(2*2)
print (4*4)+(2*2)

Yes I know there is inbuilt things for powers but might as well go whole hog here

 So the age old A squared + B squared to get a number that would be the last part of a right triangle. Lots of finicky stuff you do over and over while being easy to screw up but there is a simpler way and it's called a function and you can write one in the shell. Write the following

def right_triangle(a,b):
Now with annoying color
 return (a*a)+(b*b)

Hit enter twice and you'll be back to "ground level" in the shell. Now we're going to have some problems here due to blog not doing tabs right. Python for functions and scopes require indentation with whitespace, for blog code I'll use spaces, for real coding my preference is tabs. Either way I'll include what I did to the right so I can explain it a bit with graphical aids.

First you have to use def, underlined in red I'll explain why it's important latter, to create the method. After that is your methods name, it can be any thing as long as it is "one" continuous block of characters and avoids some special characters. Dashes are fine though otherwise not so much and I haven't tempted fate enough to learn the results. A space after that is your parameters or arguments underlined in green. In it's simplest form you can use as many as you want or as little as you want, even none you just put (), but you have to give them a name like any other variable and separate them with a comma. Trailing this is the colon which is the first indication of a change in scope. What this means I'll get back to later.

The right_triangle method we created is rather simple. It only has one line of code after it with a return statement followed by things I underlined in yellow. I'll get to that in a second but first lets use the method. Please type the following.

with the power of cropping you'll not see the mistake!
print right_triangle(1,2)
print right_triangle(2,2)
print right_triangle(4,2)



Admittedly this would be more impressive if the text to invoke right_triangle was less than the straight up code with the numbers that it produces. Methods allow you to reuse code and return results. Before there was the underlined piece of code with the variables a and b in it. The a and the b were the arguments passed when right_triangle was invoked in the code. The reason you have to use all the variables is that the code expects them. In the scope after it a will effectivly be whatever is passed first while b is whatever passed second. Now they don't have to be named a,b,c or any sort of sequence. Like the functions name you can name them whatever you wish as long as you separate with commas and enclose with parenthesis.

Now this doesn't have to be one line long. It can be multiple lines as long as the indentation is correct. For example.

The red line is what I called "ground level" for the code. This is where we've been typing everything out. Variables can be used and changed after we type them but now the rules are changed. Inside the function is a different scope as seen by the blue line. It is indented one more than where the def is, hence why I pointed it out before. The arguments passed through the parameter will only exsist as the variables in there and any new variables made inside will only exist until the scope ends. Scope ends by the indentation returning to normal or return statemtn is used, regardless if it returns something ro not. This functionality of return will be important later but for now it's just a neat trick.

Now this wasn't a very useful function. As I said before you could type out what it was doing in less typing than it took to make it, but once it starts getting lines long or used for other things that involve later ideas it'll start looking like a good choice. Till then hopefully I didn't butcher this idea too badly.

Sunday, September 25, 2011

Some things actualy "completed"

Well I stayed up far too much the past two days to try and "reset" my sleep pattern to a better time. Seemingly works as I wasn't tired at all when I woke up early this morning. During those two days I manged to do a bit of programing which surprisingly worked out.

A while ago I had some results of a simple roguelike. It worked out on my end but for whatever reason no one I knew could get it to work for some odd reason. This was annoying and pretty much made me stop working with pygames. Though I had some inspiration working with Tkinter even though I had some bad experiences with it due to a friend and got into some interesting things.

Look ma no pygame.
I looked into the canvas widget which is for drawing polygons and what have you to itself. A bit more reading and I found you could do the same for text. Without too much rigging and reusing some code from the other version I got effectively the same thing down and even went so far as to add some stupid AI to it. May have some bugs but its' done and can be gotten here. Since it's just using Tkinter an inbuilt module of python it shouldn't have errors. Even if it's an earlier or later version I don't think it'll break with how consistent they have kept Tkinter which is very nice.

That said I have looked into Combat Project too with some mixed feelings. For one the code has gotten very long, and very unorganized. I did not plan adding AI well at all. I do have some minor results with it and a lot of time behind it but it's a headache currently trying to add the new features to it. I think I may be putting it on hiatus or taking what I have and working from the ground up around it, because as it stands it's not quite as workable as I like. The system itself may benifit from being moved to something with a GUI as it stands it wouldn't be fun to test. So for now Combat Project is dead until I have a better grasp of how to throw it together. Hopefuly not too long but I stared at it for a half hour just getting my bearings after taking a little break from it and that's a bad sign. Mostly due to my part of not planing ahead. Code can grow like a bad cancer of spaghetti if not thought through and this is a result that I started organizing too late.

To take it's stead I think I will be trying something a bit simplifier. With the current roguelike system in place the "How to Write a Roguelike in 15 Steps" has popped into my head. While I skipped a few things I may start working on a simple roguelike, not that most roguelikes are simple but I'm not going to be trying to reinvent the wheel here. So project 'Simple' Roguelike is go. Though looking at the steps it seems I've skiped a few like saving. Mostly due to just wanting to get something to hit as any roguelike should have but we'll rectify that later.


I could put up a cleaned version of Current Combat project though if anyone wanted though it doesn't have much without the attack AI for the enemy fully functioning.

Friday, September 23, 2011

Thoughts about older RPGs

Combat project has sorta been on hiatus with all the job junk but I've been thinking about turn based games. Asking a question akin to "how would you make turn based RPGs competitive" to some people got a few answers. Some not so worthwhile to me as they were subjective such "awesome graphics" and "Epic plot" but a few managed to get my attention.

Pre-battle Tactics
This one got my attention, though not much of an explanation, as I may have never seen this explored. In most traditional RPGs the most you did before a battle was buy then equip the best items, maybe use some monster repel to keep random encounters down, and recover. That's it, quite little you do that does have an impact in battle but not much of a choice until you're low on supplies. While I didn't get a proper explanation there was a few thoughts on this. The most overwhelming thought was of "buff" spells.

In most old games, I say most as I haven't seen them all, enhancement spells only last until the end of battle. After that the only thing that sticks with you is a number of negative status effects like poison. While this could have been due to memory issues it may have been a hold over from earlier games. The thought upon hearing Pre-battle tactics was a very simple idea of "everyone gets to cast a free enhancement spell". Using some menu you could set up your battle strategy and get all your buff spells or possibly abilities cast. Personally in every RPG I never used buff spells besides bosses for the simple reason that the turn you spent casting them could used defeating the enemies, it only served to make the battle one turn longer for the random encounters to me. How true this is I'm not sure but given a system of setting up some insurance on battles would tempt me into using them, a good strategy for making MP more valuable as it could be expended a lot more.

Beyond that I'm not sure. I'm not the most creative thinker in this sort of thing but for a more traditional Turn based RPG this seems like very unexplored territory so it's gotten me interested in it. Maybe something to look more into for later musings.


Menu System Reduction
I had mixed feelings on this but it's true. There are a lot of menus in RPGs. Often you'll go through a few sunscreens to do something other than the basic attack, even then you'll have to select the enemy which might as well count as a menu. It's a hard thing to solve for me though there may be a few ways to go about it.

While I have not played Mass effect I have seen it in action. The ability to pull up your non standard attack actions with one button then use a mouse/direction to select which one and target at the same time hides a lot of the menu systems without taking away from the number of it. Excuse me if I'm misremember a bit here though, it's been a bit over a year since a viewing of a Mass Effect game in action was seen here. While it may just be hiding the steps it's a lot better to look at.

This is sorta something that I was beginning to realize in combat project, 4 to 5 options every attack was seeming to be a lot. May be ways to reduce this as skipping some of them but at minimum you need to do 2 selections unless some sort of macro system was in place to automate a few decisions. More work needed on that thought though if that gets done soon you guys may not benefit from it.


Either way some lite thinking going on. I will try to get back to putting something up here but it may be hectic till I get an understanding of the situation. Though with how it goes I tend to do more little things like my own projects or drawing the more work I need to do. Either way if you have seen games which do some of these things I'd like to hear about them to look into it.

Wednesday, September 21, 2011

Still alive and looking at things

Haven't been posting for the past few days with mandatory drug tests, pre job paper work, and getting transportation set up. Between that just been trying to keep it cool as I'm going to probalby have a tough first few weeks.

To prepair for that I've looked into some "advanced python programing" on a whim not sure what It'd spit out. And got this video on youtube. "Advanced Python or Understanding Python"is presentation hosted by google for "advanced" topics on python. The quotes are there as I'm not sure where advanced starts and guts of the system begins. It's one of those things that even with the amount of time I've spent with python haven't really gotten into. I can get the gist of most of it especially the objects, some of which I've used such as generators, but some of it went over my head. Some things blow my mind such as the ability and execution of functions inside functions and the possible ability to contain more functions within.

Though there is a positive note to this. While I know that I am not the best python programer out there if this is labeled "advanced" and seemingly things that may never be used by me I might do alright. Beyond that a friend of mine is tentivly looking to try and make a game and I've been trying force him into python using tkinter to help him out with it. Playing with snakes post I made are me trying to refine what the points I was trying to get to him when I tried to "teach" him for giggles at one point.

Other than that been sleeping in as much as possible because the days I can do that are soon to come to an end. Though I'll finally have a job programing which is what I've been after for a long time. But for tonight it's Wings night, wonderful yet horrible for you buffalo wings from Pizza hut. Their "WingStreet" wings have a deal every Wednesday which means I can grab a box of them for nearly 4 bucks. For that price I'm up for getting take out.

All rights for this image owned by pizza hut, please don't sue me.
 While not the best wings I've gotten there isn't much choice around here. Not that many restaurants in the area though there are quite a few bars but doubt they are known for their chicken wings. I've had a quite a few failed attempts at cooking good chicken. Either way it's a nice spicy thing that I do enjoy even it's bad for my health. So with this a question for you guys. Anything you get regularly that's horrible for you but eat/drink it anyways?

Saturday, September 17, 2011

Busy past few days.

Well it looks like Combat project is being delayed but this time not of my own laziness entirely this time. I had gone in for an interview about a week ago and was calling in to see if I was passed up and told to come in and talk, figured it was a very formal and nice "well this is what we didn't like" thing. Long story short is that I manged to squeek into the place and will possibly be working in about a weeks time.

I'm posting this here because I do not know what I will be doing with this blog. I was having this as something to work on regularly while unemployed and now that I'm getting employed I do not know if I'll have time for it. I may end up cutting back on posts do to work but we'll see. I'll try to finish up Combat test and maybe a few other musings though but we'll see. For now I have to get prepared for some of the job things, buy a few more articles of clothing as the dress code is a little higher than I thought it would be. Either way it's an exciting time right now, I may actually get to program in a professional degree and python was actually the thing that got me in the door.

Thursday, September 15, 2011

Planing ahead

Got framework for ai punisher use for combat project done. I may or may not get it out monday but I'm close. I just need to refine a bit more but am happy how close I am. I will have to do a grammar check or something cause as it stands it has some intentional and unintentional phrasing that looks like it came out of a bad translation.

Other than that I have been making some plans for more M&M. Last time we tested a very odd character design against something that was plainly created from my experience with group fights. So something that may not be soloable at all being fought by something that abused a bit of the energy system we were using. So to make a more fair test I'm making something that isn't quite as gimmicky for both sides.

While I have some tricks for the "boss" it isn't quite as bad as the other one. Last one had some healing mechanics, position ones (knocking PC down and away so they'd take a full turn to get back), and just a lot of toughness to get through. A lot was learned but it wasn't quite a typical case. This one is more "standard" some defense tricks with psuedo summons but nothing quite as bad as the other. Throw on some standard and slightly non standard attacks and it should work alright. For the test PC I have something that is called a "blaster" in M&M's ideas. Ranged attack and nothing too fancy.

It'll be interesting to see what the energy expenditure is. For the real game the idea was you defeat monster to get energy from them, run out bad things happen. Defeating these monsters is the only way to get such energy so DM would need a good estimate on what a regular character uses in a fight. I think he vastly underestimated it with original ideas but by how much I'm not sure. It'll be an interesting experiment if we could set aside the few hours for it.I might come back here with results, I like working on M&M but have few people to talk to about it with them being DMs or players of mine.

Other than that I have one game finishing up and another that could use a bit more work on. A sandbox horror game with lots of "surprises" for my players to find. Far too many NPCs for me to keep track of and I really need to define all their quirks and relation with other NPCs. They were generated from tarot draws a while ago and have some simple back story on each one but with around two dozen even a bunch of simple back stories takes  while to flesh out.

So that's my long term entertainment. What are you guys looking forward to working on?

Wednesday, September 14, 2011

progress and doodling

I think I have my variables double checked now. Even noticed a glitch with the attack tags which I fixed. Now I need to do a few more tests and finish up implementation of AI punisher move use. After that some difficulty check and I'll just have this test be "pick a guy and beat him up". Not too involved but should be a good test to see if this idea was worth it.

Other than that I've been trying to do some more drawing and revisiting some of the things I used to do. There is a little exercise that we had in class doing "gesture drawing". The basic idea is we get a model or have a picture shown via projector for 30 to a minute and we try and get down as much as possible. Mostly an exercise for few but accurate and descriptive lines as we can't rely on a model or a scene staying the same for any extended amount of time. I did decently well with this sort of thing, in fact before formal classes I used to do something I called ten minute drawing with some guy I knew online.

Basic idea was we'd throw the other an idea and see what we could get done with it in ten minutes. Results were usually laughable and over ambitious but I always found it good practice. Tried doing some last night with friends and while the results were laughable it was good to get back into the habit so I'll see what I can get done later in it and with some gesture drawings nightly.

A tool I have abused is this site. Posemaniacs is from what I know an English translation of a Japanese site. it has a lot of 3d render models of mostly a muscle layer in various poses for both genders. The thing I used the most was the gesture drawing tool of "30 second drawing". This was practicalyl made for testing your gesture drawing skills as it will go for 30 seconds than instantly change to another random picture from it's library. I've seen a few around that do this but I like this sites. You can even shorten or lengthen the amount of time up to 90 seconds if you are just getting started at the whole thing and don't have a teacher to yell "stop" and force you to draw quicker.

That's about it, any of you doodle in your free time? Or if you're particularly brave/bored apt to throwing a link to something that you throw down in the 30 second drawing flash ap.

Tuesday, September 13, 2011

debuging and things that could use some debug

I think I found the first of my problems in combat test. Good old variable mess up. For example block has a block_wait and a block_change and parry, and dodge have similar. The X_change is how many turns at max it can wait to change and block_wait is the actual counter for it. Easy change but showing that you should always make variable names you'll get exactly what they mean on viewing. So going to work on fully testing that out and getting the AI using punisher things itself.

Other than that my Friend finally got me to get the minecraft pre release files as we could try out a server. That didn't work too well. For whatever reason I would log in, load for a while, move around ineffectively then get timedout. Seems to be a reported occurrence with no real work around so we're left with rolling back to stable version until a real update comes out. It's annoying but it's something I can expect.

Though I did make a single player world. Which happened to be an island. With one tree. No farm animals spawned but there was some tall grass. So after carefully harvesting the tree in hopes of saplings I made a farm. From there I hit tall grass for seeds to receive one. This did not seem good with the newly implemented food system. So I left the island a bit to find a few other small islands with tall grass and nothing on them and returned to plant it and do some tree management. Before the wheat was fully grown I found out that you can starve to death in game, now I made the mistake of jumping into the ocean to see if I could get in the seemingly glowing holes at the bottom before I died which I didn't make it too. This messes up my evaluation of "Starving" because I swore it left me at .5 a heart before suffication under water took that away, but I could be wrong.

After that I made another world with more trees and the hunger problem came again. I had plenty of sheep around and got lost getting other meats through hunting. Raw meat I found out does next to nothing for hunger which proved anoying when I started wolfing food down on the last food indicater. Though I have a little wheat farm growing in the middle of a lake and want to get some pumpkins or watermelons to see how they work in game.

While buggy as hell I'm actually very interested to see how food will now play in the game. I also want notch to leave the option of "classic" play style where food doesn't matter but I doubt that'll happen. It'd be a shame though, as he did say there would be ways to ignore food and Creative omnipotent mode isn't quite the way to do that.

Monday, September 12, 2011

Strange day

Currently putting in debug code in combat project in hopes of figuring out why my AI is jumping the gun on switching defenses. My guess is this is going to take a lot of debug code and watching and will be something laughably simple as that's how these soft bugs go. The second guess I have is that a less than sign should be a greater than sign. This debuging would have started this sooner but today was an odd day.

So as I have nothing else to say, the strange day. Monday is trash day here. I'm never up before my father who takes it out to the curve on the way to work but I'm always up by the time the trash men roll around in early afternoon. I figure instead of being a bump on a log I'll be the one to bring it in out of the fact I get my online job hunting done in roughly a fruitless online hour and pounding the pavement I save for a monthly basis if I don't get tips on who's looking. Beyond that I decided I had enough laundry to do a load of laundry and planed for the rest of the day. So after getting this done and figuring I have enough food to eat for the day and such I decide to take the trash can into the shed and get back to the door. To find it locked.


There has been a general rule at the house as we both come and go at laughably different hours to assume the door is always locked. It saves the other from having to check if the other is home, asleep, or taking a walk and may be back any minute if they're going out or to bed. This works well for us it however has given me the habbit of lockign the door the instant I open it up to head out.

With the fact I was planing on not going anywhere that day I didn't have my phone or wallet attached to my person. So after scouting every window on the house to find that it would take me ripping open some screen and probably a rock to a window I gave up on breaking into my own house. With the searching I guessed the time was getting a bit past when he would usually return home so I figured waiting it out wouldn't be long. I realized quite quickly that it was very humid out and I was quite wrong.

For a while I stayed around the front door before going off to the "club house" the little area has that we get our mail at. Finding a chair that faced the road my father would come down I sat there for roughly 40 minutes. Sitting there I had view of the local soda machine that spits out a can for 60 cents, not the worst deal for a nice cold can on a hot day when you don't really have access to water. When waiting I seem to get very thirsty very quickly and that machine was not helping. I even had the bright idea of seeing if people threw away 6 cans so I could take a 10 minute walk to the grocery store to return them and come back to my seat with a freshly gotten can of soda. Sadly not a single can was waiting to be return for deposit and the passive waiting was getting to me and I took off for my friends house who was an hour and a half walk away.

A good 20 minutes into that I realize how stupid it was as my father would probably be home by the time I got there so all I was accomplishing was getting to a friends house to call him up for a ride from half way across town and turned around. Getting back didn't change the situation at all so I hunkered down and just started waiting till I saw a neighbor watering the plants. Figured I might as well ask if I could use the a phone. He gave me his cell and a bit of directions and I tried to think up some numbers. It only took a few seconds but I realized I flat out didn't know any numbers, years of having to just use quick select on my phone had erased all but one number so I called that, to find out I remembered it wrong. So the nice guy invited me inside to use his phone book, after a good few minutes of paging through it I hear the tell tale noise of his truck coming in and thank the man for his help to be let in.

It seemed to be a few hours since I took in the trash can. After changing some laundry around I decide to finish off one task and gather 60 cents. I went back to the club house and got a soda to at least feel like I accomplished something in this comedy of errors. With horrible Mountain Dew in hand I came back and lounge on my bed with a fan on where I remained for longer than I probably should have.

Still not quite as bad as when they changed the lock on the front door of the house without telling me when I came back from college in the winter, granted I was used to hiking through snow for long periods of time.

Friday, September 9, 2011

Random musings

Yesterday went well thought this week is seemingly wash for Combat project so I'll extend the projected date a week and take it easy this weekend. So just a bit of random musings.

Though I have found out a few things about python. I managed to get multithreading working though it seems the python language is not the most thread friendly language. I managed to use that with a bit of socket work for a simple echo server test. It was interesting to do something that had some non game programing.

I have done work in other languages in a higher end capacity but python has mostly been my personal amusement code. Simple little programs or games of no real value to anyone else. It's easy to transport, quick to set up, and isn't too much of a pain to work in beyond self and whitespace issues so it works well for that. On the professional end I have no code in it, and that was what the people were looking for the other day.


It was a little rough but at least it was something to show the people who were interviewing me along with some older code. It could use a lot more polish and I did cope out with some timeout functions instaed of perfectly avoiding deadlock which would only appearing in 4+ thread cases where something would get stuck on listening for a reply. I considered it a win though getting it all done in one night.


While on that subject, have you guys done anything quicker and more proficiently than you expected when you needed it?

Wednesday, September 7, 2011

further delay on anything interesting

It seems I won't have anything interesting today to offer either. After some poking around I got a quick interview to show up to. While this all well and good I have little current programing examples. To remedy this all day I have been producing some newer examples of my competence in coding.

Namely some multithreading and server client code. Then combining the two. It's going along decently well as this is territory I have covered quite a bit in my schooling days but I have never done it in python so there is a few language hurdles to overcoming though hopefully it'll help out in the end. I may attempt to get some SQL examples done but I don't think that will happen if I want sleep.

Tuesday, September 6, 2011

ai brain problems

Took yesterday off to play some games and check some job things. Though today I have been hitting the code hard for the past few hours. In those few hours I've set up all the variables and have been starting to test the ai defense switching in response to getting hit with attacks that punish it for the defense it's in.

variables variables everywhere and I'm this close to needing to watch all of them
The above image is all the default values, I'll be making a monster creator method to tune them to values needed. As it stands it's both due to me trying to do too much at once and not planning correctly. There are probably quite a few things I could reduce or find a more elegant solution to implement but it's eluding me. Though I will say that I did discover a bug in my previous tests as I was only using the default randumb AI pool on accident and that was sorted out.

I'm unsure what it is at the moment due to my AI being a mess of variables. Sorta stumped and more than a bit frustrated though I'm slowly worming my way through it. Not much else to say beyond tomorrow I'll try to think up things more interesting to say. The situation at hand is taxing me a bit and I have some mundane things I was going to work on as well as this that are leaving me a bit brain dead for writing an interesting post.  So nothing interesting till tommorow.

Saturday, September 3, 2011

The mini project results

well it works
Some success and some failure. Mostly stupid failures and mind destroying anoying failures but I'll get into that.

So in yesterdays post I talked about a minor break in Combat project to try and do some roguelike programing as fast as I can under pygame along with a friend who was trying to make something to get him out of a slump. So we worked on it yesterday for a few hours.

Things went well for me at first, basic class creation  and ideas for the "board" along with some methods to do movement and collision and it was all looking good. Then I started to try and draw to the screen and all the trouble started. Movement code was working wonderful until I realized moving above the test wall would cause it to vanish. From then followed a lot of debugging that didn't do much.

Cut to four hours later with lots of cursing and "knowing" what the problem was without actually knowing how to fix it and I had my friend look at the code. He knew "draw square" functions in java worked off an odd scheme of top left corner coordinates with a height and width variable to fill the rest out. Getting lost in how python works for it I assumed it was top left and bottom right corner to fill out the square so I was ending up with an increasingly bigger error. Fixed it and everything worked fine, the underlying system worked fine it was my misuse of graphics that messed it up.

After this I made a basic room and decided to send it to a friend. After a lot of trouble we failed to get it work which is why I don't like modules. This really put me off but I did add a bit more so I could prove the concept of me being able to set up roguelike things.

For those intersted you need to get

python 2.7.2
pygame 1.9.2a0 for python 2.7
and the demo itself as I won't call it a game

You just install python first then pygame after. From there you should be able to just execute the demo but I'm not entirely sure due to all the problems I have had with trying to get other people to use it.

As it stands you just move around with arrow keys and can kill defenseless goblins. After you're bored you can just exit out.

Either way it's something to keep around as it is a base for me to make roguelikes with.

Friday, September 2, 2011

Continuation on AI and mini project

More progress is being made with AI. I have successfully gotten it to choose it's pools under basic conditions, one problem is I have no error checking so all stats must be properly entered. Anything that is less than the total pool or possibly more than will cause an infinite loop. I could add error checking but it will seemingly bloat an overcomplicated and possibly fragile system I have set. So that is being put in the done column.

Now is working on a complex spaghetti code of checking about 12 different variables to determinate the next action. It's going along but I'm doing bad things in not testing it every step of the way but it's coming along. With that said I think I'm going to try something else at the moment.

Currently at a friends house as I type this up and his long running programing project has been wearing him down like mine has been. So we decided to make a short game, something we'll try and get done in the next few hours and possibly tomorrow. I have no clue what bizarre creation he's going to create but I'm going to try and throw together a simple rogue like for pygame practice. May not be more than a floor but you'll move an @ symbol around and possibly kill g symbols so it'll be something. I'll throw it up on here to finally put out some finished code.

So wish me luck and hopefully we'll have something more than me complaining about debug code and overly long posts tomorrow.

Thursday, September 1, 2011

Mutants and Masterminds foe and friend design.

A little late for me but it seems Wednesday is the weekly bug friends day. Project combat test is in debug and low level code work right now. With that said there isn't much that may be interesting so I think I'll talk about something else. As I've mentioned before I play and run Mutants and Masterminds second edition. So today I'll talk a bit about making characters from the DM side of the table.

There are three things to consider when making NPCs in Mutants and Master minds 2nd (and 3rd) edition. What it can do, how does it stay alive with pesky players attacking it, and what makes it interesting. The first two are relatively easy as there mechanic based so I'll start there.


What can your being of pure evil do?
The question we ask ourselves in the morning, it's less about what it does and more about what it can do to your Players. This is is more or less the characters "Attack". This does not necessarily mean it's brute force abilities to cause players pain but more often does. In some games it could be the NPC social connection or even it's ability to enable others to be the big problem with them staying the background. Those social ones can be covered in a few skills and feats or if you get fancy emotion control and some sort of boost system if you don't just hand wave it for the sanity I seem to lack. After that we have the "main" power that work wonderful for refluffing what it can do.


The offensive powers in question are Damage, Fatigue, Nauseate, Paralyze, Snare, and Stun. While this isn't all the attack flagged powers it's the ones I see most useful as apposed to trip and dazzle which have a more limited use. First thing I would like to say which is odd is that third edition had a real good idea which I will explain in a second. first every attack in mutants and masterminds is resisted by a "save" on the targets side, how much you fail by chooses the effect. In Second edition the effects listed above had two or three stages of failure of varying degrees of severity but were set based on the type chosen. In 3rd edition they combined everything but damage and let you choose the effects beyond the powers name. This allows for a lot more customization and more fitting effects. Though either way it should be aimed at some how taking someone out of combat. Which isn't too hard for damage, the non damage abilities have a harder time of sticking though they have the benefit of "stacking" and increasing the severity of their effects if a player has failed a save earlier. Either way these should be kept near the "Power level cap" or how much the game allows you have them at though this is to taste for a Game master and their musings.

While this list isn't impressive it is all based on your execution and proper extra use. For example Paralyze is slated in game as some sort of debilitating attack on a persons ability to react be it having to work through the confusion of some sort of poison or some monsters attack that saps the strength away from them. I have taken it's frame work and used it for an ice based attack from a foe that tries to encase in a layer of ice. I could have also used snare for the effect or even stun for this idea but paralyze was an interesting choice as it could slow players down. The only change was making it a "fortitude" save. I could get into a lot more on this but the bread and butter of any person making something in mutants and masterminds is using the same thing in different manner or even just a different weakness.


What can't your being of pure evil do?
The flip side of what we just discussed. It being inconvenienced, its defense and possibly an Achilles heel in the design. There are less things to consider here but they are very important. The first is do you want this to be a boss or a group of enemy encounter.

There is a big difference, the mutant and masterminds system runs on saves against everything, and a low roll means you fail and possibly takes you out of the fight. For players this is mitigated by hero points which can reroll the save around a "safe" zone or even higher for most attacks they would take. If you make a solo NPC to take the players on it is going to be thrashed by each one of them. Taking the group route hopefully means a division of attention as his buddies will be taking up the slack even if he goes down. Before I can go into the intricate parts I have to talk about saves in Mutants and Masterminds, if you played 3rd or later D&D they should look familar.

Saves in Mutants and Masterminds are Toughness, Fortitude, Reflex, and Will. From a mechanical standpoint they have more to do with the offensive powers above than what they mean in game but I'll go through the general explanation of each one. Toughness is effectively your HP in Mutants and masterminds, it allows you to shrug off attacks like nothing and take a lot of hits. For the most part only straight up damage. This one should always be near "Power level cap" for a villain because damage saves are rigged to have a higher chance to fail and plainly mess up a character than anything else. Other saves have roughly a 55% chance of succeeding if you are matched with it, damage saves have a 30% chance of passing so it is key that these are up to limits or the character in mind will go down far more easily than would be imagined. For this reason I tend to call everything that isn't Toughness a secondary save as they aren't the primary means of ending combat in a mechanical sense. Fortitude is the "strength of body" save, things like poison or shocks to the system go here. Reflex is actually one of the more import of the secondary saves, some powers may target it directly but it covers area of effect avoiding. Willpower is the flip side of Fortitude as it is the "strength of the mind" save that generally allows overcoming illusions and pain among other generic slated things.

Unlike Toughness these secondary saves are probably not the best thing to cap. In mutants and masterminds second edition there was an odd design decision to allow these to go up to PL+5 which when completely maxed out allows for a 70% chance of passing the save in question, I believe this is more from 3.X D&D than anything and actually makes things a bit difficult in designing solo encounters or boss battles where the villains are a higher PL. There is also the fact that it is kind of cheap to just cap these, as unlike toughness there are only a few powers that can take a character out of combat like toughness and last like an unconscious condition. So in general I follow the Mastermind Manuals "level based progression" of the D&D good and bad saves. One of the secondary saves is chosen to be "good" which means it's roughly double the bad saves values. There is a formula to this equation of good and bad save but it would probably be too long and pointless so I'll post up a small mock up chart here which is effectively what I use anyways. A thing to be mentioned is M&M is assumed to be played around Power level 10, it can be played higher or lower but it's assumed to stick around 10. The result is a character that isn't a brick wall for non damaging powers to get through. These aren't quite up to cap and will have a little variance when attributes are figured out due to save calculation. It also adds a bit of flavor when the big huge monster has a higher fortitude save, the small nibble melee fighter has a higher reflex, and the psionic powerhouse has a higher will save though it may not always be the case.

Why is your being of pure evil interesting?
Hardest question to answer. At the end of the day you will have a pile of numbers to throw at the players but why about this one over the last one is always a challenge. I commonly refer to this as the gimmick portion of the character and it can either be in the power set or its flaws. This one I can't really answer but it should be a theme to the character and how it's powers work, it doesn't even have to be blatant just something to tie the numbers together. I have made bosses that have abilities that drain down and on depletion give them a nasty complication (players never saw this happen) and ones that had reactive effects to show their prowess in ability. Though I will admit over the year or so in this game I've gotten a lot better and faster at this. Early bosses and such were a horrible situation that were often far too easy which was fine in learning a system. There is a lot of mechanical potential just in the books for interesting situations with a bit of thought into what the NPCs.

Well this was far too long and possibly convoluted for people that don't know much about D&D. So as a question for those that have stayed through all of this have you played any table top games?