Showing posts with label gameplay. Show all posts
Showing posts with label gameplay. Show all posts

Wednesday, June 8, 2016

Factorio!

So, as a general rule, the type of games I like to play are not the ones my friends do. Because of that, today I'd like to share one game that I rather enjoy with those friends, precisely because I know that they would never play. Maybe they'll enjoy the writing, at least. If you find yourself ever interested in playing, it's sold on Steam for a round $20. (Exactly $20. They're weird in more ways than one) and it's one of the few games I've seen with a demo. It does have a multiplayer option, as well.

Factorio is a game about making a factory, or more precisely turning ever-increasing amounts of raw goods into finished products, all for a nebulous goal. This is not really a game that you can "win" in the classic sense, and even the goals and background are kind of senseless. It is most assuredly a sandbox game, one which I'd put in the "zen garden" genre of games. There is no goal, aside from managing and creating something, and in the process gaining peace. While it may be strange that my sense of peace is a massive, polluting mess of machines that exist only to create more machines may be strange, it is still peaceful.

The bright orange stuff to the top is mineable copper. This world has abundant surface deposits, lucky you!
This is you. You start on an alien planet, crash-landed with few supplies. The emergency supplies are pretty standard for the sci-fi genre. You come with a pistol, a few magazines, some random parts you were able to scrounge from the wreckage, along with an automated mining drill and furnace. And a super-suit that gives you super strength and has nano-bots capable of constructing nearly anything that doesn't involve heat or liquids.

Yep. Standard. How will you ever survive with just the bare essentials? Much less make the rocket to serve as a flare for people to rescue you?

Not only are you able to easily carry the wood from this entire tree, but you go through it in 3 seconds.
Your first step is to gather fuel. Easiest option is to chop the entire forest down. 50 trees later and we're good to start drilling. There are 5 main raw resources you can collect from the environment. Iron is used to make anything structural, and is the bulk of what we need early to make what we want. Copper is used for anything electrical, and is mostly used later when circuit production begins in earnest. Stone is essential but only used in a few recipes and is relatively scarce. Oil is very useful, but complex enough that we can't even mine it yet. Then there's coal, which we'll use as our main energy source, supplemented by oil if needed.

Each tree gives 4 wood. We're carrying 50 trees while running at full speed. Don't take this game seriously
Now we get to the actual factory portion. Our burner drill (as in, it burns it's own fuel to power the drill) will work automatically as long as it has fuel, an available resource, and empty space to put the ore it mines. In front we'll drop the furnace, which takes fuel, along with some material to produce a more refined product. In this case, our drill produces iron ore, which will be turned into iron plates. We only have the one mine, if we want more mines, we'll need to gather stone as well.

A quick bit of stone gathering and waiting, and we've produced 2 more mines. One to get us more stone, and the other to produce copper ore, which is promptly made into copper plates. Our steady, though slow, supply of copper, stone, and iron will allow us to start the next step: electric power. Electricity is used for the vast majority of machines in order to run (How surprising!) It's only in the strict beginning of the game that you use fuel directly. Aside from furnaces for which the electric version is far away.

The pump has a wheel on the side to get things started, if you wondered
With our initial supplies, we've created the first real new thing: a steam engine. Water is pumped up, fed into a boiler, then into the steam engine in order to create electricity. Super suits and space travel, and the most efficient form of electricity generation is still boiling water. Now that we have electricity, we can start our research to go down the tech tree and expand our budding factory.

To give a sense of how good your nano-bots are, it took 9 seconds to make and get it operational
Our new drill is all around better than the previous. More efficient, faster, though a little larger. It's fast enough that we can almost run two furnaces off of one drill. Look closely and next to the mine you can see 2 arm-contraptions. They're called inserters, and work off electricity to move things from one square to another. They're programmable to interact with the nearby objects if necessary. In this case it will take items from the box that the furnace needs, making sure not to overfill or give it the wrong item.

The research material the lab requires a copper plate and an iron gear, to create a red beaker. I have no idea how this works
Most objects of any complexity are made from multiple intermediate objects. In this case, we want to build our lab to begin research. The lab requires 10 electronic circuits, each requiring a metal plate and 3 copper wires, with each copper plate being made into 2 wires. An iron gear takes 2 iron plates, while the transport belt requires an iron gear and an iron plate. Luckily our nano-bots can take care of everything, once we've collected our iron from the furnaces.

I have a mod to increase research time and materials by a factor of 3, it doesn't normally take this much

Finally, with our lab done we begin our research. Our first item is for basic automated factories. Each factory we make can produce items continuously without our input, which is useful consider the number of items we'll need. Making 4 belts ourselves to create the lab is fine, but making hundreds of belts we'll want for our entire factory would take far too long and be far too tedious.

I should note that the intro bit here is abnormal for the rest of the game. Most of the time later is spent building the factory instead of bootstrapping the beginnings. They even recommend for anyone that does videos to skip the first 15-20 minutes precisely because it's so tedious. The good part about it is the introduction it gives to basic mechanics. Hopefully the silliness of the entire concept helps make it more interesting for a reader.

Let me know what you think too, if you ever get this far down.

Tuesday, March 15, 2016

Game Combat Basics

I find myself building a small thing with combat as a creative exercise. It's not something I'd ever want to share, especially on here, but talking a little bit about specifics helps. If nothing else, writing about it helps clarify things for me, so even if no one reads this, I've still benefited from it.

Let's start with the basics. The goto basic combat system is the Dungeons and Dragons combat system, specifically version 3.5. Why? It's basic, understandable, and easy to calculate. You don't want to use a calculator for tabletop gaming, nor do you want too many numbers in the way. It works like this: Roll a d20 (a die with 20 sides, with values 1-20) and add your attack value. If this sum is greater than your opponent's defense, you hit and then deal with damage. Simple, straightforward, and easy to implement. So you drop it into your game, try it out, and find that it isn't a very good system at all for a computer game.

There's a few reasons it doesn't work well in a computer game. Chief among them is that DnD is designed around rolling dice. Rolling a die and seeing the result is an intrinsically fun action. Having a computer roll the dice for you and it's not nearly as fun. Whereas in a DnD setting you'd watch that die bounce and either come up short and succeed for you, all you see on the computer is your character whiffing or hitting, and if you're using values like those found in DnD, he'll be doing a lot of whiffing. Now you're wasting time watching the computer duke it out with itself as both parties whiff ~40% of the time. What fun.

There's other issues too, mostly relating to how offense versus defense scales. The main defense in this system has you avoiding full damage more often. Specifically, each point of defense makes you 5% less likely to be hit. Each point of attack increases your chance to hit by 5%, effectively cancelling out a point of defense. Which means if your attack scales at the same rate your opponent's defense scales, nothing will change in this system, even as both of you get stronger and stronger. Actual damage dealt and maximum health might scale as well, but the fight still looks similar. There's also issues when attack and defense values vary widely from each other. What happens if you have 100% chance to hit? 0% to hit? Could I reasonably make a monster that still stands a chance if it only hits 5% of the time? If you hit most of the time anyway, why still have this system?

(Note: DnD also has the suggested house rule that a natural 1 always misses and a natural 20 always hits. Setting a minimum and a maximum like that certainly works as a solution, but is not necessarily a solution that solves the problem)

This system as a basis for making things work doesn't do well in a computer game setting. Luckily, there are other alternatives. Instead of hitting or missing, we can take that out entirely and have defenses reduce damage. Again, we keep things simple and deduct our armor amount from any damage we take. 10 damage against 5 armor means that 5 real damage is dealt. This system works, but runs into other funky problems. Most notably that damage taken depends heavily on how much damage the opponent does per shot relative to the amount of armor. If the rate of attack can vary, slower attacks will be much stronger relative to smaller but quicker attacks. Designing a proper fight from the developer's perspective can be odd too.

Say I wanted to double the damage taken from my last example. I can't double the original damage, that'd result in the target taking triple damage instead of double. (20-5=15 or 5x3) Instead, I want to add 5 damage. As well, I need to keep damage relatively similar to armor levels. High damage makes small amounts of armor relatively useless. If I'm taking 30 damage already, would 2 more armor really help? The reverse is also problematic. Going back to the original problem, if I add 2 armor there, I'm only taking 3 damage a shot, or a 40% reduction.

All that may not be a problem though. If I have numbers setup right, things should (repeat, should) work fine. It's still a funky system though, and I might prefer some flexibility. Next attempt is percentage damage reduction. It works regardless of rate of attack, works on any number equally well, and dealing with relative increases of power are straightforward. Of course, it has its own issues.

First, it's more complex than the others. I don't need to worry about computational complexity because the computer will handle it, but I do need to worry that the player understands how much his shiny new piece of armor actually helps. I also need to get the math right. Two pieces of armor, each with 10% damage reduction, should not add up to 20% damage reduction. If they do, that means that later pieces of armor are much more valuable than they appear, and lead to silliness. Using terms like "10% damage reduction" also look silly; ideally I'd like to have a term like "armor" that turns into damage reduction after the fact, for which I'll need to tell the player somehow. Or not, and leave it to the wiki.

There's the other problem of small numbers. If I deal 10 damage, anything less than 10% damage reduction doesn't do anything, because it'd reduce by less than 1. I can keep the number as a decimal, but that looks strange if I'm using small numbers in the first place. (And leads to one of the few legitimate times where 2+2=5) It can also seem worse than it is. The rules I originally used had attack and defense values change in increments of 5%. If I'm at 50% damage reduction, an additional 5% damage reduction would reduce damage by 5%, but it'd look like it's only doing 2.5% (assuming I tell the player the total damage reduction from armor) If you don't know math, it then looks like armor gets worse and worse the more you get, even though that's far from the case.

Maybe I'll do another post sometime looking at other problems or issues. Maybe not. If you have any questions, especially about the math in this, please be sure to leave a comment and I'll get back to you.

Friday, December 11, 2015

Kerbal Space Program AAR, The Rescue

After that big mission, we had some good news and some bad news. The bad news was we had learned just how bad our facilities were for sending missions throughout space. If we wanted to do more, we'd need to upgrade them heavily, and that would cost money we didn't have just yet. The good news was, others saw how well we were doing and figured they could set up private companies to take some of our success. It's much cheaper when you don't have to do all the initial legwork to get started, and they were eager to get started. Good for us though that they're really bad at it anyway, and we'd profit off their mistakes.

Our first new mission involves rescuing a poor pilot who was stranded in orbit. An overeager company had decided to try for an orbit as their first mission. All had gone well until they were making the final checks for re-entry. Apparently they had forgotten to put any parachutes on the craft, and so coming back down would be suicide. Really, who does something that silly? As Capt. Kiwi will tell you, parachutes are the most important part of any rocket.
They didn't have the equipment to rendezvous with the stranded pilot, which is where we came in.  Along the way, we signed on a tourist to go up with us. We had the room anyway.
In order to get started, it was time for some more improvements to the facilities. The tracking center was the first to get upgraded. The facility received better equipment, mainly in the form of advanced computing hardware we called "calculators" that would let us calculate farther out how our orbits would look, even with multiple orbital bodies.
Mission control would also get upgraded. We bought a very expensive whiteboard that we could use to make plans ahead of time. It's amazing what proper planning can do for a mission. We'd also have room for more contracts at one time, if we could find any others that were worth taking.

Ms. Health and our tourist suited up for their mission, using a variant of the Spacer rocket series.
The new rocket came with more fuel, and a new scientific invention that would enable us to record the atmospheric pressure at that location. Part of our new study into aerodynamics and working with the air instead of against it.
It was time to launch. Our target was ahead of us and already in orbit. Our first order of business would be to launch into an orbit of our own, matched up as closely to theirs as we could.
Here you can see our wonderful new upgrades in action. The blue line is our orbit, the yellow line our target's orbit. The orange and purple markers mark our next two closest intercepts. The orbit wasn't as close as I'd like, but it was close enough. The problem was our target was very far ahead of us in the orbit, we'd have to catch up to make our rescue. Now came the complicated part.

On Kerbin, if we wanted to catch up to someone we'd speed up towards them until we caught up to them, then slow down to match speeds. In space, the same maneuver would be highly inefficient - too inefficient for our limited fuel reserves. This is because, if you'll recall, speeding up widens our orbit, while slowing down shrinks it. Speeding up to them would throw us off. We'd have to do things a little differently.

Our plan is to speed up, enlarging the orbit. For each time we went around, we'd make the trip faster than them, decreasing the distance between us. Do this enough times, and we'd get close enough for a rendezvous. Then we'd slow down to match speeds.
Here we were in our faster orbit. Now it was time to wait. A few rounds around the planet, and we were coming much closer with each passing orbit. Next we slowed down to match orbits closer; we didn't want to start pulling ahead of them.
The difference in our orbits was slight. We'd only catch up some 6 km each orbit, but we'd catch up. In the meantime, the eggheads wanted us to test the atmosphere in space.
 We confirm what we had already known: there is no atmospheric pressure in space, because it's a vacuum. At least the new science gizmo works.

Finally, we found ourselves only a mere kilometer away, with a 34.4 m/s (77mph) difference in speeds. While we could match speeds with our rocket if we wanted, we chose instead to have the stranded pilot do all the work. His small rocketpack was more precise than our unwieldy rocket.

He stepped off into the void. His little rocket pack contained a surprising amount of delta-vee. It was useless on Kerbin, as it wouldn't generate near enough thrust for lift-off, but here it'd allow him to travel the kilometer difference and match our speeds with no problem. Space is weird.
Final approach to the Space 4. He overshot it a tad, but what can you expect from a newbie?
On board and ready to go. All that was left was the smooth reentry. Which Ms. Health could do with no problems. It helped that we brought a parachute.

Home sweet home, with a nice chunk of change for us. Mission successful.

Wednesday, December 2, 2015

Kerbal Space Program AAR, Polar Orbit

Everyone had returned safe and sound from the last mission, but you wouldn't think that if you looked at Capt. Kiwi. The new pilot walked around the compound dejectedly, as he knew that he would never fly again. Rockets did not agree with him, and no matter how irrational it was, he knew that the specter of death waited for him should he set foot on another rocket.

In an effort to change things, I paid out for improvements to our Kerbonaut facility.

Along with more conveniences such as a free Mountain Dew dispenser, it came with free flags and a kerbonaut bravery course. Now our kerbonauts would be brave enough to venture outside the vessels anytime, instead of only when landed. Caution was still advised, and it was hoped that no kerbonaut would do something too foolish.

Alas, the new bravery course was not enough for Capt. Kiwi, as he still could not stand to enter a rocket. Given his previous accomplishments, we allowed him to stay on the facility until he decided to go home. Though my head researched did leave in a hurry after hearing of the sad tale. How nice of him to comfort poor Capt. Kiwi.

Work must still be done though, and I arranged for two new contracts:
A VIP from Flooyd Dynamics Research Labs had chartered an entire flight for herself, and looking for something different from the past orbits to boot. Along with her, we were to bring our scientist Mant "123" up to take observations of different biomes on Kerbin's surface while outside the rocket. Apparently the glass got too damaged getting into orbit to be of any use.

Ms. Health, Mant "123", and Stelliana all boarded the rocket:

This version slightly modified. The fragile science lab put above the cockpit, and an extra fuel container added to ensure a less optimal orbit could be achieved. Today, Ms. Health would be aiming for the first polar orbit. Instead of boosting straight east like we had for our equatorial orbits, she would instead boost straight south. We wouldn't gain the extra boost from thrusting against the orbit, but the view should be worth it.

The launch goes off without a problem, and the craft soon finds itself winging towards the south pole. By going in such an orbit, they'd be over every point on Kerbin, given enough orbits. This way, we could make sure to get accurate observations of every biome around the planet.

And boy are the images worth it.
The first EVA, with the sun coming around the planet
Rounding the south pole
Even the mountains look small from up here
The craft is coming around, attempting a landing up on the north pole. Seems like we'll miss the mark by just a hair, but the landing should be perfectly safe. Suddenly, Mant yells out "Hey, watch this!" and exits the vehicle as the craft hits the 50km mark.

The atmosphere is still thin enough that she won't be torn away instantly, but it's hardly a safe place to be. "Look Ma, no hands!"

Talk about a red bottom. She quickly gets back inside, and the rest of the voyage went without a hitch. Seems like those bravery courses were a tad too good.


Everyone was brought back, and just before they all arrived, my head researched came to me with a curious invention...

Friday, May 8, 2015

Ship Design

Had a friend say that she wanted to hear something a bit more cheerful this week, so I'm going to talk about how ship design works.  I've always enjoyed making my own designs for ships when playing similar games, and I'd like to bring that to SEAC.  Even if my designs aren't exactly optimized, it's usually nice to give them your own personal flair.  (For reference, I'm a fan of lasers, quirkiness, and defenses)  Hopefully, I'm able to give enough options for players that they're able to make their own fleet that varies enough from others to really be called their own.

Basic idea for ship design (at least for my game) consists of four main topics: the mission, propulsion, consumables, and the miscellaneous options that mostly deal with morale.  Each ship is made up of a hull and a set of components.  Hulls have an available volume, radius (or alternatively diameter, whichever is easier for people to understand), mass, and length.  Components are the objects that do things - lasers or cargo containers, and can be scaled up or down in size depending on how much of the component you need.

The first thing I try to pin down when designing a new vessel is to determine it's mission.  What is this ship's purpose?  Is it a tanker, perhaps a cargo ship?  Maybe it's a combat ship, one built to slug i t out with the opponent's ships, or maybe one designed to maintain a longer range and let the tougher ships in front take all the beatings.  Whatever the mission, deciding it is where I start my design process.

Let's give an example.  I want to design a Cruiser, a type of ship designed to be good at combat and operate independently if the need arises.  I start the design by selecting a medium sized hull, and add some weapons (lasers of course!) and decent shielding.  As I add on components, the program will continually update the side variables to keep up with the new additions.  I don't care how many crew the cruiser has, but I do care if the cruiser has enough crew, and like any good program the easy stuff will be taken care of.  So, the crew and all components keeping them functioning will update, along with other components like power generation and structure.  The player will always have the option of overriding, but ideally these non-decisions should be handled by the base program.

Next up, I need to worry about the propulsion of my cruiser.  I select the engine that best fits my thrust and efficiency needs, and scale it up to fit my cruiser.  For this mission, I'm leaning towards efficiency, to save on propellant mass.  Next, I adjust how long my cruiser thrusts for during transit. (Given as a percentage) The larger the percentage that I thrust, the quicker the ship will reach its destination, but expend more propellant.  I expect most journeys to be made primarily of drifting, rather than accelerating.  Given all this information, I then add on propellant tanks, with helpful bits of data showing how much time the cruiser can thrust, average distance the ship can travel at cruising speeds, and how fast the ship accelerates.

Now for the rest of the consumables; mostly food, water, oxygen, fuel, and ammo.  For now, anything not listed there is labelled a generic "supplies".  The player will set the how long the ship is supposed to last before refueling, along with an acceptable margin of error.  How much material is required is then a simple calculation, given the rest of the design.  Except, depending on your completed research, there's also the option of using regenerative systems.  Why carry food for the entire trip if we can make it ourselves?  In practice, it doesn't provide that much of an increase in space unless we have long trips, and the technology doesn't really exist even now.  About all we currently reuse is water, and even some of that is wasted.

Lastly, the player decides on some miscellaneous options for his ship.  These can vary from which material to use for the structure, to which amenities to use for the crew.  Do you want your crew to have a mess hall with appropriate cooking facilities to boost morale, or would you rather not waste the extra mass and space on useless frivolities?  How sparse are the crew quarters?  Is it a tin can? Cramped like a submarine, or does it have ample room like a modern boat might?  Morale is always important, but it does mean wasting a lot of space and propellant to keep the men happy.

After all that, you've finally got your cruiser design ready for the factories to construct.  Hopefully it performs in a way that's similar to what you planned for.  If you find you're not really interested in all that design work and want to skip to something that's useful, there will always be pre-made designs built.  Each design is also tweakable, able to be upgraded as new components become available, or to change an existing design without starting from scratch if, say, you don't like lasers and would prefer a ship based off of missiles.  Even though we all know lasers are better.

Monday, March 23, 2015

Game Beginning

Let's talk a little about gameplay today, and where best to start but at the beginning? I'm a huge fan of starting at the very beginning and turning a small base into something worthwhile, so you start the game with just the bare essentials; humanity has just entered this new age of space travel, and it's your job to build everything.  (Sidenote: I'll likely put in different start points for those looking to start with more if you're not as interested as I am in beginnings)

You start with a few buildings in your isolated base on Earth, along with a small population and some resources.  Your buildings are:

  • Capitol building, there for administrative purposes.
  • Factory, for building components which will be used in the construction of buildings and spacecraft and everything in between.
  • Research lab, where researchers research new research.
  • Academy, which produces people. (Trains people, at least you hope)
  • Space gate with accompanying loading and unloading infrastructure.
  • Storage and housing, with a good amount of starter goods already stored.
For now, I've got population split into five categories:
  • Leaders.  People with names, stats, and roles that they can fill.  I'm sure some will use them as simple stat sticks, but they're also there to give life and build stories around.
  • Officers.  Those that lead others, but are too low to be really notable to the player.
  • Crew.  The state employees, soldiers, and engineers that crew positions and get the crap jobs.
  • Civilians.  Those not aligned with the state that are paid to do their work and not get in the way.
  • Colonists.  The people I spent two blog posts talking about beforehand who are interested in living on other planets.
To begin with, you'll have enough officers, crew, and civilians to run the operations, along with some extra to get you started.  In addition, you'll start with a few (1-3 I'm thinking) leaders to place around.  You don't however, start with any colonists, as you haven't built any colonies yet.

At any point in time, the player can always buy more resources and people on Earth.  Buying is expensive though, and so the player is encouraged to produce their own resources.  The player begins with a fair bit of cash to start to enable initial construction, but it won't last forever.

Upon taking the gate into space, you've got a small setup that all planetary connections will have, including:
  • A gate leading back to the planet.
  • Small, robotic tugs that take cargo from the gate to the station.
  • A station (or a ship serving as a temporary station) with storage, housing, and useful facilities.  At game start, the starting station is made primarily for storage and has a decent assembly platform.
  • A secondary gate leading into the system network which can be used to transport ships to any other system network gate.  Not actually built at game start.
Along with the standard setup, you also begin with an assembly ship that assists with construction.  (Something had to build that station)

At game start, you have two major goals in mind.  You want to place and maintain a Mars colony, and build a gate connection to another system.  Sure, a Mars colony makes very little actual sense, but it's romantic enough that the politicians in charge want it anyway (Plus, what sort of space game would this be if you didn't colonize Mars?)  Going to another system is a much greater accomplishment, but the colony is easier and more straightforward, so I'll begin with that.

Let's start building! The rough outline works like this: create a connection from Earth-space to Mars-space, create a connection from Mars-space to Mars itself, build some initial infrastructures so colonists can survive, and then send them over.  Pretty straightforward, but let's go into some details.

To build a connection between two areas, you need to build a gate on both sides.  Building the gate in Earth-space is easy.  The components are built in the factory on Earth, shipped up through the gate, and then assembled by the starting assembly ship.  Building the other gate will be a bit more fun.  Gates don't work at all unless there's another gate to connect to; instead, you need to use a jump module.  Unfortunately for the player, these are also one shot devices that are pretty expensive component wise.  So, the player starts the factories up, producing both the components for a jump module and a gate.  The module is assembled out in space before activation, but the gate components need to be carried in some sort of ship storage.  The player will need to build ships as well, and can use either the pre-generated storage ship design, or create one of his own.

So, the ships go through with the gate components so another gate can be constructed to connect the two locations.  Building the next gate is easier than the last.  Another gate is queued up in the factory, components are transported up to the station, storage ships take the components from the station, go through the new gate, and unload their storage so the assembly ship can construct the gate.  A similar process exists if the player wants to build a station in the area, which is recommended if the area sees much traffic.  (You can always abandon it later)

Now for the final gate.  For the player, this one is fairly simple.  A more traditional rocket is built that can land on Mars with the gate payload intact.  The rocket is assembled in space and launched towards Mars.  Assuming everything goes right, the gate is set up, connected to space, additional material and crew can be sent to construct a functioning base on Mars.  Finally, the colonists are sent (in ships designed for a large amount of people) and the colony is constructed.

Of course, during all of this, the player has options to increase industrial capacity and infrastructure in order to make things smoother.  For example, the player can choose to have more/larger factories to make construction quicker or set up a mining base in the asteroid belt for cheaper raw materials.  Hope this beginning example is entertaining and helps with learning about the game.