Monday, October 8, 2012

Cause and Effect

I was working late tonight.  Much later then usual...

I felt like I was untangling a thick knot that didn't seem to end.  Initially I was trying to get the text for events to display in the text box at the bottom for the last screenshots I threw up.  I had in mind something like this,

[] - Darkness has fallen.
[] - You dash off in the East direction.
[] - You are attacked by a Succubus!
etc. etc.

Before I could get to this part, (and I still haven't) I needed to actually setup the progress of time and events for the game.  Moving, performing actions, and the sorts all result in some kind of turn action, or at least that's how it works in most games.  I see some games make it so that any action translates into one turn.  Whether you are doing something that should be taking a long time to do, such as sleeping or eating, is the same as a minor task like taking an item out of a container, or attacking.  I'm not a big fan of those type of time systems.

The idea I had was to make it so that each action will progress time differently, they all won't be lumped together in one turn, or 2 turn sequences.  The actions themselves will be timed differently each time you perform it. (but it can be more precise if you increase a certain attribute)  Here was along the lines I was thinking.

Run with no weight  = 30 time passed (top speed)
Run with some weight = 40 time passed (fast speed)
Run with a lot of weight = 60 time passed (slow speed)
Run with overload = 120 time passed (super slow speed)

Now to explain what I said the last paragraph.  So let's say you run with no weight.  The fastest you can perform the task is 30 time passed.  I'm thinking I will make all actions randomly select the fastest time and 20% of that and RNG it each time.  For instance, 30 * 20% = 36

So running with no weight can take anywhere from 30-36 time.

Or like this,

Run with no weight  = 30-36 time passed (top speed)
Run with some weight = 40-48 time passed (fast speed)
Run with a lot of weight = 60-72 time passed (slow speed)
Run with overload = 120-142 time passed (super slow speed)

Then I thought, hmmmm.... what else does it need?  I know!  Attribute dependent factors to make it a more complex.  I managed to whip up a few good formulas that I feel satisfied with.  Speed is dependent on the weight of the items you're carrying, and the lower the level of certain stats means the weight will be more severe on your speed.

After finishing the math part, I needed to setup another menu selection to pick the attributes.  I went overboard and tried to pimp it out.  Definitely liking the layout of it after I finished it a few hours ago though.  :)         

Another thing, I ran into a nasty bug that kept doubling CPU usage over time.  After leaving it running for 30 seconds, my computer froze pretty bad.  I got to the root of it though, so it's fixed and won't happen again. 

So summary,

Make a time system
^Make it more complex
^^Attach attributes to time system  [In process]
^^^Play with Math [Done]
^^^^ Kill Bugs [Done]
^^^^^Make a new game menu to select stats [Done]

Here is the Result

Also, I should mention during tonight's programming binge, I nearly somewhat spilled on my keyboard the yolk from an egg, sandwiched between a bagel, that I made for a late night snack.  LOL.   

No comments:

Post a Comment