Showing posts with label Games. Show all posts
Showing posts with label Games. Show all posts

2012-11-14

(Programming) Thinking up a turn system. (Part 1)

To get something out of the way real quick, I think I monitor my words a little too much while typing.  I mean it's good to make sure things come out as intended, but...it's already a bit of a time eater on top of sharing things, which could be time spent working.  It's a silly thing to gripe over when there's so many other activities I spend time that feel wasteful.  Another point is when I monitor my speech I don't think I convey my words the way I'd like to anyway.  I see people out there with much more colorful ways of expressing themselves, and I look at myself and...well, I can only be me, right?  But no, it's something I can and should learn to change if I really feel the need to.  For now I'll try not to pause myself too much to write down what's on my mind.  However, I'd like to cut down on "things" and "stuff," among other things.

So I put up programming as a description for this blog, and...what programming "stuff" have I talked about anyway?  I don't fancy myself to be an individual of ideas; I'm merely going through the book to know more and hope it magically qualifies me for a job.  Awful.  What ever happened to going above and beyond?  At least I'm capable enough to follow a book.


So about that RPG I brought up before.  After the initial rush of writing up whatever I could to stuff in there it's finally slowed to a crawl.  Burst of inspiration then run out of fuel, a common pattern.  The same could be said for my initial desire to learn to draw.  I guess the main thing that's stopping me is teaching myself to make something that's interactive and not stuck in the console or simple text boxes.  Sure there's other things that need working on, but...yeah.  That's where my passion slammed headfirst into a wall.

Programming is largely about using preexisting code.  I think that's what they say.  And I suppose you'd have to balance using other people's code while also knowing how it works to an extent.  Which I'm not doing right now.  Instead of searching for other works I wanted to think it up.  It certainly won't work like that all the time.  Let's see what this slow mind thought up, then?

Initially (way back then) when I was playing with the battle system I had an 'if' statement for whether or not the player is faster than the enemy.  If so the player gets to execute the commands first followed by the enemy.  Otherwise...I copied the entire block of code and flipped it so the enemy could go first.  Pretty clunky, and soon after when I got the idea of facing multiple opponents or even having a party system it would be guaranteed to be really ugly.  The idea for a queue system crept up, but I didn't feel I was ready to read up on that section.  It's a shame; I probably would have had fun thinking up how to do it with the arrays I had, but that code will inevitably become a relic when replaced with a proper class.  Just like my old inventory system that would shift back for removed items.

A few weeks ago I returned to the game to tinker with the battle system after learning about queues.  What kind do I want?  This is where it would help to have a lot of exposure to the type of game you want to work on, but I've holed myself up too much.  Even then I'm surprised at the number of games I've played, but that's by my standard.

At first I thought of the Pokemon games.  Each participant gets a single move each turn, to be spent in an order determined by speed or priority modifiers.  No, let's not stop there!  How about people who can execute more actions than others?  Golden Sun (only played the first) came to mind with certain bosses who could attack twice in the time it takes all four party members to make a move.  Won't it be tougher on balancing?  Sure, but who needs to worry about balance in a non-competitive game like this.  Plus it would be fun to see how it could be broken, and if no one is around to play it to even find out as is likely the case, well, at least I didn't spend all that time tweaking it.  A corrupt thought process, perhaps.

A visible queue system like in Final Fantasy X would be awesome (where the idea first came to mind).  It even shows the impact actions would have on the list when you have certain stuff selected!


If I was clever I'd put something clever here.

I forgot it had purple bars.  Let's read into the game later.

Next source of influence came from the semi-roguelike Elona.  Nice, plain speed stat.  Plenty of freedom.  I don't know the inner workings of it but since it had an ingame clock I think you'd be running on "standard" time with a speed of 100.  If I was brave enough I'd ask the people who worked on porting it.  In Java, no less.

Okay, we have a turn-based battle involving people of various speeds, some who can take more turns than another.  The first thought was to include an initiative stat that starts at 0 and is modified by speed.  Let's say you have:

Player 1: Speed = 50
Player 2: Speed = 25         

The first turn passes and player 1 will have an initiative of 50, and player 2 with 25.  This is sort of done on paper in the program so it's still figuring out who gets a turn.  We'll have an 'if' statement to check if either player has an initiative of 100 (the turn's standard), and if so that player will be added to the queue and have their initiative reduced by 100.  If more than one player is eligible for being added to the queue we'll go by their initiative levels in descending order.  If any of them have matching initiative levels we'll break the tie by speed.  If their speed is tied we'll flip a coin/roll the dice or give preferential treatment to the player.  And if we want to be super nitpicky we'll have the system remember who won the coinflip and give it to the other party next time.

Let's try again:

Player 1: Speed = 200
Player 2: Speed = 150

We'll represent them in parentheses (player1, player2) which will display their initiative levels.  The player who gets to be added to the queue will have their name printed in front and their initiative level will be subtracted.  Initiative level must be greater than or equal to 100 to qualify for a turn.

(0, 0)

<Turn 1>

(200, 150)
Player 1 (100, 150) wins by initiative
Player 2 (100, 50) wins by initiative
Player 1 (0, 50)

<Turn 2>

(200, 200)
Player 1 (100, 200) wins by speed
Player 2 (100, 100) wins by initiative
Player 1 (0, 100) wins by speed
Player 2 (0, 0)

<Turn 3>

(200, 150)

And so on.


Now let's try something more extreme:

Player 1: Speed = 600
Player 2: Speed = 300

(0, 0)

<Turn 1>

(600, 300)
Player 1 (500, 300) wins by initiative
Player 1 (400, 300) wins by initiative
Player 1 (300, 300) wins by initiative
Player 1 (200, 300) wins by speed
Player 2 (200, 200) wins by initiative
Player 1 (100, 200) wins by speed
Player 2 (100, 100) wins by initiative
Player 1 (0, 100) wins by speed
Player 2 (0, 0)

Okay, at least player 1 gets twice as many moves in a turn but it's sort of bad to let so many of them be up front.  So I was stumped on this for a few minutes (those were some long minutes) wondering how I could get the distribution of turns to properly scale. 

All right then, if we're basing this off of how many actions someone can perform in a given turn then why not let the person with the fastest speed set the pace?  If we have someone with 600 speed then everyone (including the turn which runs at 100 speed) would have to reach that before they can do something.  So it's like executing mini turns inside the actual turn because of relative speeds.

Player 1: Speed = 600
Player 2: Speed = 400
Player 3: Speed = 100
Turn: "Speed" = 100

The standardized initiative level to perform an action is set to the highest speed: 600

We'll have the format as (player 1, player 2, player 3) - (turn)

(0, 0, 0) - (0)

<Turn 1 begins>

(600, 400, 100) - (100)
Player 1 (0, 400, 100) - (100)

(600, 800, 200) - (200)
Player 2 (600, 200, 200) - (200) wins by initiative
Player 1 (0, 200, 200) - (200)

(600, 600, 300) - (300)
Player 1 (0, 600, 300) - (300) wins by speed
Player 2 (0, 0, 300) - (300)

(600, 400, 400) - (400)
Player 1 (0, 400, 400) - (400)

(600, 800, 500) - (500)
Player 2 (600, 200, 500) - (500) wins by initiative
Player 1 (0, 200, 500) - (500)

(600, 600, 600) - (600)
Player 1 (0, 600, 600) - (600) wins by speed
Player 2 (0, 0, 600) - (600) wins by speed
Player 3 (0, 0, 0) - (600) wins by speed*

(0, 0, 0) - (0) turn completes  

<Turn 1 ends>

*For all purposes the turn will always be dead last when initiatives are tied, even if the
player is slower than it (would come into play over the course of multiple turns).

The spread looks better now, doesn't it?

Actually, the very, very first idea was to have a large counter of sorts incrementing all these values at different rates, but that's sounds more suitable for realtime stuff.  I guess this would be comparable to an imaginary race to cross a 100 meter lap as many times as possible in 10 seconds.  You have one going at 50 m/s, another at 20 m/s...they'll cover different distances after a second (or fractions of a second if we want a smooth motion).  The second, minute, and hour hand on a clock would work, too.  Why didn't I think of that earlier?  

Cutting it off here.  I didn't intend for it to be this lengthy but then those examples came up.  Perhaps I should reformat the blog to be wider or figure out how to create a text area with a scroll bar to save space.  A few more things come to mind to cover.  There's the case of initiative levels "spilling over" because the speed of the turn didn't divide evenly into the standardized initiative.  And what if the player with the highest speed dies somewhere in there?  I've thought about it briefly but haven't put it into code yet because I'm forever a slacker.  I should have some to share when I post the second part.
  

2012-08-17

Dream Log (2012/05/08): Touhou Scoring Replay

 A little introduction first.

I'd say last October/November was the last time I sat down and concentrated on producing a series of scores in general.  Most of it was in October with the final PCB Extra run with Reimu-B finishing up November 7th (wait no, I went back and updated Reimu-A and Marisa-A again a few days later).  About a week after that I felt shooting for two billion in PCB Normal which had been on my mind for a while, but I've been barely motivated for a long time already (I wouldn't have refreshed my Extra scores if not for HS参謀 introducing a new route for Reimu-A).  So I'm playing a little each day with Marisa-A, improving...right up until I get a good run where I take notice that I failed to set up Flowery Soul to graze inside the explosion (because I didn't practice properly), and when I finish the run I end up with 1.997B.  I don't think that run was the cause, but for one reason or another I didn't feel like playing anymore.  Also, I think 2B with Reimu-B would be easier (I'm more comfortable playing with her anyway), but I always do this thing where I cycle through all the other shot types so my experience culminates at the Reimu-B run and I can make it extra good.  Playing with Marisa-A was nice, though.  Always good to try something new.

Way later starting on May 5th this year I feel like going for 2B again.  I play for an hour to two hours each day and feel bad when I die to silly things.  The pressure (and delayed gratification) starts mounting.  I hear dreams tend to be about stuff you've thought about recently so I guess the subject matter of this one was inevitable.  And they seem to be more prevalent at a time you don't normally sleep.


2012/05/08, before 19:10 (evening nap)

Watching the PCB Normal/Marisa-A record set by HS参謀.  Something happens after Yuyuko’s third spell or fourth noncard where it ends as though it timed out.  The bullets disappear and nothing happens for a few seconds, then the battle resumes as usual.

As he’s finishing up with Resurrection Butterfly I look at his score and notice there’s still over 300M to go to match up with the record (so it's in the 1.7B range).  After the endgame bonus is tallied the score is only 1.79B.  While I’m sitting there confused at the score the game hasn’t ended yet, running for about 20-30 seconds.  And then the announcement for Resurrection Butterfly starts again and I immediately realize that he picks up the remainder of the score from bugging out Yuyuko.  I was a little disappointed because the old score I made was 7M over his (except it was really 1.997B, not 1.797B) without ever bugging the fight and I heard the question echo in my head, “Did I really surpass his run at some point?  At least in stage four I’m still behind.”  No items spawned during Resurrection Butterfly, and after capturing it his score was 1.815B.  In my mind I’m thinking that there’s still two spells to go before he reaches 2.137B.

Next up is Deadly Dance, and he doesn’t employ the usual circling tactic.  I’m thinking it’s because the pattern is now backwards (but that means you should still be able to do it, but you know how dreams are).  The pattern he employed was making long slightly curved sweeps across the screen, shooting the entire time and slowly being pushed down.  I knew there were more bullets but my focus was only on two parts for each sweep which served as markers for me.  One of them is simply passing by a wave of five arrowhead bullets lined up, and the second involved some sort of squeeze between another wave like that and a lone arrowhead bullet.  Like you’re supposed to push through them before going in the other direction.  I thought it was taking a while for the spell to end even if he’s not shooting Yuyuko directly all the time.  I look at the spell bonus and see it at 26M and counting.  Still a bit of a way to go before the sweeps reach the bottom of the screen.  Dream ended there.


I had another dream of this type that would crop up in the middle of a playing streak, back in 2010.  I'll get to it some other time.

I still remember how this version of Deadly Dance looks, but I'm still too lazy to do a sketch of it.  I'll put that off for later as well.

On May 11th I reach the target and feel another amazing high I didn't think would surface from a goal like this.  Jumping, fist pumping, all that stuff I don't normally do.  I guess the creeping nervousness helped with that, performing less confidently during the final battle and suffering a few close calls.

Of course in retrospect you'll realize how bad the run really is, but at least it doesn't take away from the initial moment.  Like this fatal mistake in the beginning of stage five where I die and the entire first half of the heavy point-carrying fairies get away.  All because I didn't practice the move, and that's unbelievable.  Oh, I guess I got to that stage once the other day and pulled off the trick so I expected to wing it, but not this time.  I can't believe it never crossed my mind to practice that.


The climb to 2B this time was mostly a matter of catching up to the level of execution I held in the 1.997B run.  The only thing I chased after was the status on stage four before the boss fight since most of the deviations will appear at that checkpoint.  573M, 877 point items (wait, I didn't include the CherryMax?).  After that I could catch up with better milking on a few spells.  The situation with the score transition from stage four to five is interesting because of that stupid mistake in the 2B run, but I did get a higher score from Youmu's midboss spell (still not as good as previous runs and a little close to the edge), and I forgot that I died to her final spell in the old run.  The cherry value penalty was felt during the stage six item spam and both scores evened up after that.

For the sake of this post feeling complete I'll put in links to the replay files.


And then I'm still perturbed by the bad Yuyuko fights.  Obviously, practice mode is where it's at.  This is what a stage six run should look like:

PCB Normal/Reimu-B Practice Stage Six 475M 
(I sort of run around with different handles)

I think it could at least go for 484M.  T (who motivated me through competition) did a better job with Flowery Soul, pulling off extra explosion grazing in the middle of the spell.  I only squeezed ahead because of Resurrection Butterfly.  I also forgot to pull off his redirection method for Yuyuko's opener to make it more graze-friendly.  Then there's other little minor things that add up, and some missing tactics. 

2012-08-08

Dungeon Siege II Underway

First time not posting at 3:00 or 5:00 in the morning.

Act 1 was just as difficult if not worse than I remember.  Sure you could work towards whatever specialization you'd like with anyone, but I think I wanted to stick to their initial preferences back then.  Which means I'm running around with two melee characters, the main one wanting to be a tank (by my own preference) but lacking the feats and gear to last more than a few seconds in a group of mobs.  I eventually give him a bow to kite everything and finish burning down the rest of the towers.  As I leave town for the next quest I run into the next party member who defaults as a ranger, and I have to wonder if she was there the first time.

I ran into some difficulties with group management after picking up the healer.  I don't remember what I did last time, but I thought the rampage formation worked pretty well.  Now some of them (like the main character) will move back to the group as soon as I issue the command and stand there, maybe taking a few hits before retaliating.  In the end I went with the mirror formation and controlled the ranger most of the time.  Otherwise, if I were moving back with the melee characters and started attacking again it would drag the healer to the middle of the battle since the active spell was a healing one, and the autocast healing spell wouldn't override the initial command to move to that spot.  After picking up the mage I controlled her more often due to the shorter range of her spells putting her near the heart of the battle and pulling enemies.

The game really picked up near the end of Act 1.  By then the tank was a real tank and I wouldn't have to run back so much.  Shortly into Act 2 after picking up the mage I had my old group composition back, but during Act 1 I considered discarding the tank role and turning him into another ranger.  I think I would have soon grown weary of all the kiting, though, and there would be competition for drops.  Maybe not that much competition; I wouldn't mind equipping more defensive items among all the members.  Still, one character who ridiculously outranges everything is enough for me.  And I like the traditional composition.


Get the ranger to engage then continue watching the Olympics.

The other members just happened to be female, really!  The order is like male warrior -> female ranger (bow/x-bow) -> female healer -> male ranger (throwing, shorter range) -> male warrior -> female mage -> female warrior...and I think a male ranger with bows shows up later.  Then I used him when I had an extra slot while playing a little bit of the next difficulty, but I could buy another right now since I'm trying the beta 4s hotfix mod.  Act 2 is nearing completion.  One more to go.

The question is why am I even conscious about gender preference / balance unless I had something to hide.  Heck, what about this name I'm using (not the guy in the game; I called him Isaac)?

Tried out Skyrim for a few hours the other day.  One freeze a minute into the beginning but no other issues so far.  A little bummed out over the lack of attributes and the clunky interface.  It'll just have to be fixed up with mods as usual.  I tried out SkyUI and it's an improvement, but I'd like to see if there's anything else out there.  When I think about Morrowind's inventory system it might supposedly be worse because you aren't presented with the names upfront, so I can't tell if it's nostalgia that's preventing me from really believing it.  I miss the item icons, and the ones in Oblivion look too simple.  Oh, I guess Skyrim has a model for you to look at but you need to have the item selected.  The interface in Morrowind just felt more homey.  Just right click and bam!  Numbers and stats and stuff to look at everywhere.



I don't have any saved games in this one again so I picked it up from Google Images, and then I saw that the site it came from had a rant about the very thing I'm talking about.

Still, what I'm looking for hasn't gone anywhere.  It's right there in Morrowind, and with a better computer I can take advantage of the graphical overhauls (always played without mods, save once) out there as well as explore new areas, including ones I haven't seen that have been there since the game was shipped out.  Just a matter of time before I rotate back to it.

Also took a walk the other day and enjoyed the nice, cloudy skies.  Quite humid still.


pic name

pic name

pic name

pic name

pic name

2012-08-05

Which Game to Play?

Starting late June I stopped playing games for a about a month.  I think most of it can be attributed to focusing on the coursework near the end of the summer semester and reading from the programming book during my free time.  After a while of that the desire went away...but a week after class ended I felt too dull to continue my days reading the book.  I had no drive to do anything else and boredom settled in.  In an effort to dispel those feelings I played a single credit of Perfect Cherry Blossom which I hoped would feel like a beginner's experience after not touching that genre in over two months, but it was too soon and the effect was spoiled.

A few days later (7/28) I built my first computer (with some help from my father deciding on a few of the parts).

$700(ish) rig, not counting old components.

I wouldn't consider myself to be someone who plays a wide variety of games or picks up new titles as soon as they're released (with a few exceptions).  World of Warcraft aided in consuming my free time and keeping my interest in one spot, and after abandoning it in the middle of 2008 and drifting for a few months I found Touhou Project as a substitute for my singular focus.  That slowed down as early as late 2009, but I still played more than I should have.  With the discovery of programming this year I'm finally ready to enjoy it (more) casually, clocking only around 30 hours these past eight months compared to over 2,000 spent overall playing/watching replays.

Aside from those crazy instances I usually rotate between titles.  Play for a few days, probably finish the main story, put it up.  That sounds normal, maybe?  I don't think it's the right time to dump a list of all the titles.  They're usually PC games and RPGs.

To kick off the test run I installed S.T.A.L.K.E.R.: Call of Pripyat.  Maximum setting goodness.  Installed Fallout 3 after that.

I'm one of those people who didn't play the first two Fallout games.  I also never experienced the Elder Scrolls games prior to Morrowind, or Might and Magic before VII, or Heroes of Might and Magic before III, or Final Fantasy before VII.  Well, I did watch my father play FO2, HoMM2, and all of Might and Magic VII.  Anyway, thanks to all this, hearing that Fallout New Vegas is more faithful to the Fallout universe didn't mean much to me as I cared more for the exploration and atmosphere of FO3.  At least, based on someone else's opinion that FO3 is more centered on exploration.  I think the preference is heavily influenced by Morrowind.  Also, I haven't experienced more than an hour of New Vegas because I still want to finish up FO3.  The older computer had a say in that (NV, not FO3).

I'm just a sucker for urban settings with cloudy skies and dirty streets and sidewalks.  I didn't pick up and play FO3 until last November, but I watched a relative play it on the Xbox during fall of 2009.  And I had this to help keep my imaginations afloat:



I was overjoyed when I was able to get it to run on the older computer.

Picked up Skyrim the other day; by sheer coincidence I told myself I'd start checking regularly for deals and it so happened to be 50% off.  I would have liked a physical copy, but soon enough I'll forget I ever worried about it.  Haven't touched it yet (I guess I should make sure it starts at least).

In a few days I plan on starting a new playthrough.  The first time around was quite vanilla with a few tweaks, but this time I want to include an overhaul mod.  And then the dilemma...what sort of character to play?  Sure, let's be another goody two-shoes.  Let's be another cookie cutter build with the exact same race (maybe switch gender) in Morrowind.  Let's start another fire/light/cold sorc or summon necro.  I decided on a not entirely evil unarmed specialist knowing that I still have my first character's save file where mostly everyone isn't screwed over.

But first, it's postponed for a few days because of an urge to play Dungeon Siege II.  Not much else to say about that; I'll probably only do the first difficulty again and probably won't pick up the expansion.  And I'll use the exact same party composition.  Nevertheless, it holds a special memory.  I don't remember when we got it but I remember being put off by the graphics.  Didn't proceed much into the first act after my melee party of two got beat down.

For some reason or another I picked it up again in the summer of 2007.  The house was sold and we were ready to move; just waiting on my father to finish his last year in the service for a bonus.  Rather than stay in the regular-sized housing on base (where we lived before buying the new house) we moved into billeting.  The order when moving to the US would be billeting -> apartment -> on-base housing -> real house -> billeting again.  Two rooms; the bedroom and kitchen/living room space.  There I played the game with laptop and mouse on my couch bed (it doesn't extend into a bed).

It wasn't just the game that made it memorable.  A few things were happening at that time (maybe I'll cover it later), and it was a humbling experience to live in small quarters again, with its own scent.  Doing laundry outside the house.  I had long walks on the field, appreciating the massive, detailed cloud formations displayed magnificently with little to no obstruction.  One of them one late afternoon spanned across with tops standing high.  It could be the makings of an empire.  I enjoyed those last days before we moved out of state.  It was all my fault.