Jump to content

  • Log In with Google      Sign In   
  • Create Account

slayemin

Member Since 23 Feb 2001
Offline Last Active Aug 24 2016 08:27 PM

Posts I've Made

In Topic: What to consider for an RPG damage formula?

24 August 2016 - 08:24 PM

Your first iteration is never going to be perfect. You'll have to do a lot of play testing to see if the damage and armor formula you're using matches the vision for how you want the game experience to feel. So... just implement it and try it out! Does it work? Is it fun? What kinds of interesting doors does it open up in design? Don't overthink this stuff too early. Get something working so that you can iterate on variations of the idea until you land on something you really like.


In Topic: Best book(s) for learning to program game mechanics?

23 August 2016 - 09:47 PM

In my humble opinion, it's about 10% programming, and 90% design and approach.

The simplest example I can think of is reducing a health value when a character takes damage. The code is really straight forward:

Health -= DamageAmount;

This is a game mechanic and the programming to implement it is pretty straight forward.

One thing that might help is to rethink how a game works on the backend. Rather than thinking of a disconnect between code and mechanics, think of the code as an implementation of a model. Like, a real time simulation. How that model / simulation should look and behave should be defined somewhere else, such as in a design document (ideally), or in your head. The goal of the code is to faithfully create the model, in a mathematical and logical sense. Technically, you don't even need graphics to have a robust working model (see: dedicated servers). The graphics are just a visual representation of the current state of the game model. Input is a way for people to change the state of the model. Networking is just a way to communicate the state of the model to other connected systems, and to send input requests to change the model state on the server. UI is entirely an aesthetic used to communicate to the player the state of the game model. Inventory is just a part of the model, which may or may not play a part in the game, depending on the design (does a bag weigh you down if you have too much inventory? etc).

So. With all of this in mind, I encourage you to create a text based adventure game. No graphics. Just text in a command prompt. This will force you to spend 95% of your time building out the conceptual model of how the game model works. Maybe if you just have a knight fighting a goblin, you'd be able to build enough structural scaffolding to understand how the backend model should look, behave, and interact with its components. Once you get this down and working well, you can optionally add graphics. But the mechanics and implementation will already be there. You'll eventually understand that the model you're using to represent the game state is view independent and doesn't need screen output. This is pretty much what most game programming is, and there's a lot of math to help create the model (think of calculating the trajectory of a projectile: 95% math, 5% graphics).

Lastly, this stuff mostly comes from lots of experience and practice. There might be books that might help with this, but it's kind of hard and silly to write out a concrete list of rules on how to do this because every case is different. It's more about adopting a good working practice. For me personally, I generally write out how my model should work, generate any necessary sketches of how the output should look, and come up with some idea on what kinds of numbers the model should output. Then, I come up with a code approach which creates the model and those numbers. The coding part is pretty much trying to create a logical model / simulation of the problem. Then I run the model / sim and see if the game output matches my model output. If the game model matches the design model perfectly, I am done. If the game model doesn't match the design model, it's time to ask two important questions:
1. Is the game model a correct implementation of the design model?
2. Is the design model a correct model of what I intended?
Sometimes, a game model is a correct implementation of a design model, but the design model is flawed and you have to revise the design model -- which I think is fun, because you learn! You discover you made some wrong assumptions! 

Another example to drive the point home:

You could create a model / simulation of our solar system and try to get it to be as accurate as possible. You can easily lookup all of the planetary data, such as size, distance from sun, orbital inclination, orbital period, etc. All of the mathematical models are available online. Then, you can run the simulation for an accelerated time period. Where are all of the planets positioned after 365 days? Do the simulated positions match up with the positions in real life? IF the numbers match up very closely, you have a good, working model. Then, things can get interesting and you can start asking some interesting questions, like "What happens to the model if I change the universal gravitational constant?" or "What will the solar system look like in 10,000 years, or 1,000,000 years?"

So, yeah... I hope this gives you enough to chew on for a while.

In Topic: Distinct quadtrees for static and moving objects

17 August 2016 - 03:45 PM

I used to have an octree which tried to keep cells "hot" on the cache by putting in a short delay before removing a cell. The idea was that if someone shoots a machine gun with lots of little, fast moving bullets, it would be a waste of memory to delete and recreate the cells. It worked, but the implementation was messy and probably caused more overhead costs than savings. Back then, I didn't even take careful measurements of my timings, so it was impossible to know if I made an improvement or a regression.

 

If you really want to make a distinction between static objects and movable objects, you could just create two quad trees. One is for static objects and almost never changes, and the other is for moveable objects, which have to check against other moveable objects and against static objects.


In Topic: The Problem With Capitalism

05 August 2016 - 05:00 AM

 

The age old model of a financial transaction and exchange of goods is necessarily going to become unsustainable when production costs approach zero.

 

The thing is, production costs will never reach zero. There will always be something that needs producing, and when it gets to the point where TVs are so cheap to produce they no longer become a luxury item and become a commodity item, and the price drops to near zero, other devices which require more resources and more skills to produce will replace it.

 

Take for example the TV itself. In the office yesterday we were discussing with some of the older staff how TVs used to be rented and the actual cost of a TV to the consumer was near £8000 in modern money, inflation adjsuted. That's as much as a small car!

 

This being the case we can see how much easier it has become to produce a TV due to advances in manufacturing technology. Things that were impossible 50 years ago are trivial now. What about the PC you are typing on right now? 50 years ago any form of computer would have been domain of big blue-chip companies and universities only with multi-million dollar budgets regardless of that computer's actual processing power.

 

I can imagine that within 50 years something new will take the place of whatever we think is expensive and high tech now, and that will be expensive and demand a lot of human and manufacturing resources. It could be (just theorising here) personal space or air travel, or made-to-order genetic modification, a new form of personal power generation. We just don't know, but we do know that history shows it will always be more complex to build than whatever came before.

 

Standing on the shoulders of giants, and all that...

 

You're right, and you're making my point for me. Production costs will never reach zero, but I do think that the cost of production per unit is asymptotic and approaches zero. Each increase in production efficiency is a slide down the asymptote, closer to zero. 

The "cost" of an item is always going to be greater than zero. If even one person expends a minute of energy thinking about a product to make it exist, it has costed someone energy. When you look at an expensive television set, there are hundreds or thousands of engineering hours put into designing it, the electronics, the hardware programming, testing, etc. For the sake of argument, let's say that the development costs were 20,000 man hours. If we have mastered the raw resource acquisition, the refinement of those resources into usable components, the assembly of those components into a product, and the shipping of that product to a market, and we've streamlined this whole process to such a level that the actual human effort cost is about 2 minutes per product, then producing and selling one million units gets cheaper and cheaper on a per unit production scale. The more televisions we can produce, the more the 20,000 hours spent on R&D begin to look like a drop in the bucket.

Take the automobile assembly line as another example to illustrate my overall point in regards to technological progression and its relationship to capitalism. At the turn of the 20th century, Ford came up with his first automobile. It was assembled by hand and took a long time for it to be constructed. Demand increased. In order to keep pace with demand, Ford increased the speed and efficiency of production by inventing the assembly line. By lining up a bunch of people who performed the same task over and over again, he could pump out cars very quickly with a standard and consistent level of quality. The assembly line employed a lot of people, so the city of Detroit became a boom town fueled by the auto industry. It was one of the most prosperous cities in America for many decades. Over time, increases in assembly line efficiency eventually meant that fewer people were needed to produce the same car. So, they could either create additional lines or reduce the labor. They did both. In the last 20-30 years, auto assembly lines have been almost all but automated. A majority of a car is built by robotics. Robots are superior to people because they don't ever get bored, they never get tired, and they excel at performing the exact same task, exactly the same, every time in a controlled environment. The production of an automobile on an assembly line now consists of just a few people, and their job is mostly to just oversee the robots. Without a doubt, there has been a technological progression in the production efficiency of automobile manufacturing. Today, Detroit can pump out thousands and thousands of new cars every single month with a near skeleton crew of people relative to the turn of the 20th century. But, what about the economic outlook of Detroit? Surely a city which builds most of the cars in America would be extremely prosperous, right? Nope! The city of Detroit is a shithole where you can buy a rundown house for $10,000. There are no jobs in Detroit. 

The auto industry and Detroit are just a microcosm of the grander fate of capitalism itself. Detroit is just one city, and the auto industry is just one industry. On a larger, global economic scale, increases in production efficiency reach closer and closer to an asymptote of maximum minimal cost. Human beings get replaced in manufacturing, and gradually, an economy shifts from a producing economy to a retail and services economy. Drive through most towns these days and look at the businesses. It's almost all strip malls and service industry jobs. It's depressing. Each service industry job is a leech on the economy. It doesn't produce anything which can be exported abroad to bring in an influx of fresh capital. Instead, the service industry just survives off of the existing capital in the local region. Gradually, even these service industry jobs will face efficiency improvements or go out of business because they can't compete against those who do. This means less jobs all around and capital in the local economy gradually gets siphoned off.

 

Let's get really, really far out and crazy for a moment. Like, really nutty. Let's imagine that someone, somewhere has managed to create an artificial intelligence which brings about the AI singularity. The AI goes into an infinite loop of self improvement and learns how to do even our knowledge based jobs which we'd all thought were safe from automation. The AI learns how to design beautiful sky scrapers. Build bridges. Do urban planning. Design electronics. Write code. Paint pictures. Anything a human can do, this AI can do better. Everyone in the knowledge based industry is out of a job because we can't compete. Much like the robots in the auto factories, it doesn't need sleep, doesn't take vacations, can work 24/7, doesn't get tired, doesn't fight with co workers, doesn't ask for raises, doesn't get sick, etc. It can run a whole corporation all by itself. I know this is crazy, but just play along with this thought experiment. So, the end result is that all work done by humans is obsolete and inferior. What is there left for human beings to do? You can't get a job because a machine does it better, you don't have any money, and if you wanted to "purchase" a product, it could be on your doorstep in an hour at next to no cost to you or anyone else.

Now, we're like, "What's the point of my life if I can't work? That kind of defines who we are! We've spent our entire lives preparing ourselves to work a career, and then working that career, retiring with a pension, farting around for a few years in retirement, and then dying. But now, all that's pointless, so am I now worthless?" It's kind of an identity crisis in a way, and we'd be forced to come to terms with the idea that maybe we aren't defined by the work and jobs we do, but by something else, and maybe there's more to life than what was once called work? Do we spend more time with friends and family? Do we take up hobbies and recreations? Do we travel the world? Do we create human crafts, such as writing books or painting pictures? Do we play video games and watch television? Without work and a high quality of life, what makes us who we are? Note that we'd all face this problem without an AI singularity if everyone in the world was a billionaire (without the negative economic effects of inflation).

It's interesting to think about what a post-work, post-capitalist world would look like. It probably won't happen within our lifetimes, but the negative downsides of technologically based improvements in efficiency and capitalist consequences are starting to show themselves and that does affect us.


In Topic: The Problem With Capitalism

04 August 2016 - 05:22 PM

 

those working in their companies may barely be able to afford food, rent, and clothing, let alone being able to afford things like vacations, travel, or reasonable retirement.

.

You are making a bold assumption that a company can afford to do that.

Since every one likes to pick on McDonald's .... they employ 420,000 people. If they game everyone a $2 raise, that would equate to $1,260,000,000 in extra expenses every year.

Now let's throw in 'cheap' health care for another $1,890,000,000  .

If every one who worked McDonald's made $15 an hour that would be about $4,410,000,000 in extra expenses ( $9,450,000,000 for total employee wages ).

 

( I am assuming a 30 hour work week to get these numbers )

 

In a pure capitalistic free market, minimum wage wouldn't even exist. A wage would start at the very bottom ($0.01 per day!) and pretty much be an auction until the wage value reaches an acceptable amount for someone desperate enough to take the job. In India, you can hire a security guard to protect your business for $0.04 / hour. If your labor is a commodity, it is also subject to the forces of economics. The more common your skill, the less it is worth because supply is high. The problem is that there will always be someone more desperate than you to take a lower offer until eventually, you are the most desperate one and will undercut everyone else.

 

The problem with the $15 minimum wage is that it ultimately becomes the same baseline in terms of purchasing power. If McDonalds pays all their employees $15/hour, then in order to cover the costs of the wage hike, they increase the prices of their product (they won't let this mandate shrink their margins). If you currently make $7/hour and it takes you 35 minutes of work to purchase a hamburger, then when you make $15/hour, it'll still take you 35 minutes of work to purchase a hamburger. Hundreds of other businesses do the same thing, until everything is slightly more expensive (yay, inflation!). I'm in Seattle, where the city has passed at $15/hour min wage law to be gradually phased in, and one of the interesting things we're seeing is minimum wage workers are intentionally cutting their hours so that they still receive welfare benefits from the state. Their earnings have to be below a certain cutoff value, so they're incentivized to work less hours to get more value rather than working the same hours to get more value (which is less after benefits). Whoops :)


PARTNERS