Monday, February 13, 2012
I exist....
Friday, December 30, 2011
In Profundis design (12/30)
The tool itself exists in one cell of the world. That cell "is" the tool for purposes of recollecting and destroying. A rope hanging from a piton "is" the cell containing the combined object. Spannners, portable, extendable platforms (not what are sometimes called wrenches -- maybe I should find a better name) have a central point from which they extend, and that point "is" the spanner. Make sense?
Once placed, "shadow" objects get placed through the CA system. I call them shadows because they are "cast" by the primary objects, but to the CA they can still have interactions.
On the primary object's turn, it checks in the spread directions (down for rope, left and right for spannners) and sees if it's empty and suitable for spreading. If so, it places the appropriate object (rope tile, extended platform for spannners) in the place. It also sets a "strength" value on the tool.
When a shadow object's turn comes up, it first checks in the direction to grew from, to see if a matching source object or stronger matching shadow object is there. If it is, and has a strength greater than 1, it tries to spread itself, and if it can produces a clone of itself at one point less strength. If for some reason it doesn't have a matching object, it removes itself from the game world, the "source of the shadow" has gone away, it isn't casting anymore.
Advantages to this system:
- Quick. The processing required for each cell remains light. While tools will probably not become very common objects in the game world, it's important that, if the player were for some reason to buy lots of them and string rope everywhere, the game engine could handle it. This avoids a particular Minecraft problem; there, liquid is handled in a similar source-and-shadow manner, but when a source tile is removed, on slower systems the computer becomes very laggy for a while, while dependent fluids are recalculated. (When I shut off or on the water flow in my multi-story mob grinder, which has many forks, long cascades of liquid, and collecting streams at the bottom leading to the output trough, it's several seconds before I can do anything else.)
- Self-correcting. Every shadow object checks for a source every turn; if the source disappears for some unexpected reason, it does to, and so thus do objects that depend on it.
- Fun to watch. Multi-tile objects don't appear instantly, but over a short period of time as the shadows propagate through he world.
- Has a certain elegance.
- Respects 'c', which is important for avoiding subtle CA calculation problems. 'c', or the "speed of light," is a bit of cellular automation jargon -- it refers to the maximum rate at which changes may propagate through the system. In Profundis' speed of light is one tile/frame. At the moment, no tile can affect the game world more than one immediate space in each direction. If placing a rope instantly placed all the rope tiles into the world, it would break the speed of light. Currently, In Profundis calculates its world in a square spiral pattern emitting from the player's location, skipping every other square, but starting on an even or odd square in successive turns. The result is that a checkerboard-like layout of tiles is calculated every turn. Since no tile can produce and effect that extends out further than one tile orthogonality, we can be sure that changes aren't propagated too fast, producing results like instantly-falling water. This doesn't matter so much for example tools, but might be important for other tools later.
Disadvantages:
- Inherently tile-based. I was worried before about the game's strict grid-based presentation; I've brainstormed ways to effectively implement sloped rock tiles that still handle water effectively for instance. I've spent too long trying to figure that one out however. The project has gone on long enough, and I think now I'm not going to worry about the limitations of the grid-based CA. It certainly hasn't hurt Minecraft any.
- May result in circular, self-dependent shadow objects if those objects aren't designed well. Could a situation arises where multiple-placed primary objects interact in a way that a self-reinforcing system of shadows could set up? Not in the simple situations I have described, I think, but more complex objects might have branching shadows, and if somehow a shadow object can produce another shadow of greater strength than itself this situation could arise, where all sourcing primary objects could be removed but surviving shadows keep each other refreshed.
- Has a certain lack of realism. Imagine a case where a spanner platform extends several cells out into the air, and a boulder falls through the middle of it. When it falls through the platform (spanners aren't strong enough to support such weight) the next platform over will no longer have a source, and will vanish the next frame. But the boulder will then continue to fall, and so the spanner it destroyed will be recast the next frame. The result is a one-tile gap that moves down the spanner like a wave, a behavior that isn't mirrored in real life. Similarly, what if gravity affects spanner sources? If the source is unsupported, it will effectively create a V-shaped platform shadow through the world as it falls, as it created new platforms around it as it descends, while those left behind it by its fall both spread and disappear outward through the route from where the spanner passed.
Still though, I think the mechanism solves more problems than it causes, especially if I keep tool designs under control, and it may be applicable to simulating non-tool objects as well. Remember, it's always best to keep CA effects as simple as possible; the more work you do on each cell, the more likely the whole simulation may, in some situations, start to drag.
Thursday, December 29, 2011
In Profundis progress
Saturday, November 19, 2011
In Profundis Progress: Tools, Inventory and personal coding deficiencies
Monday, November 7, 2011
In Profunds ideas: Flags
So here's something big that I'm playing around with....
In Profundis gives you a limited inventory for carrying around equipment. You tend to use up resources while you're exploring the game world, placing pitons, hanging ropes, and so on. Eventually you have to travel back to base and resupply.
A concern that I have for the game is that this travel back and forth, between base and the frontier of exploration, could get annoying, or worse, boring. But the resource and time costs of getting around the game world are the primary obstacle to exploration. How do I reconcile the two?
My idea is a special inventory item: flags.
After you explore for a while and figure it's time to return to base to resupply/get some rest/buy new stuff, what you can do is plant a flag at a place you'd like to return to later.
After this is done, the challenge is this: return to base without using any other items in your inventory, in order to "establish" the flag. It's like a mini-game in a way. It is okay to use items you've already placed, so you can sort of pave the way for your return trip. If you're forced to use an inventory item the only thing lost is the establishment run. In that case the flag remains where it is, and you can try it again just by returning to it.
The reason this has to be done is because the game is recording how long it takes the player to do it, in order to figure out a realistic travel time, and using resources along the way that might not be available later would spoil the experiment. (It's possible that this might just be "shallow travel" equipment, like jetpacks, rather than things that change the game world to make it easier to traverse, like pitons and spanners.)
After you've established the route, you can later "instantly" warp between base and the flag. Instantly is in quotes because this is only immediate to the player -- the game clock is set ahead by the amount of time it took to make the trip. Since the expedition is charged rocketship rental by the amount of time spent on the planet, this is a substantive cost, but it's your character who has to pay it, not you. The character is still making the trip, in effect, on autopilot. (In fact, I'd like there to be a "montage" of still shots of the trip, that takes a few seconds to play out, whenever warping.)
Continuity of the game world is very important I think. The problem with teleporters is that they basically make a mockery of the spatial extent of the world. I consider this bad because, as the player makes longer and longer expeditions, the increasing time required to get from base to the exploration frontier is, itself, an increase in difficulty. Exploring the other side of the map takes more time, which incurs more spaceship rental costs, which means the player can't afford to waste as much time.
Some of you are no doubt reading this and thinking something along the lines of: WTF? I think I can understand that. But I look at it this way: I've played hundreds, if not thousands, of video and computer games, and I've never known a game to do something like this. Maybe there's a reason for that. But it's a very interesting game mechanic to think about, and I think that will transfer to play. What do you think?
Sunday, October 30, 2011
In Profundis Problem: Continually flowing water
In Profundis uses a cellular automation system for flowing water, yet because of the closed nature of the game world, most flow is ultimately user-initiated. Liquid tends to pool and collect and remain as low as it can get, and remain there collected. It doesn't actually end up flowing much except at the start of the simulation. Once it gets to the lowest point it can reach, there it remains until something disturbs it.
This is not particularly interesting from a gameplay perspective. What would be more interesting is if water could enter and leave the map, or at least flow through two locations in the world, repeatedly and endlessly. Then the player might have to find some other way around it, or maybe divert the liquid to give himself a safe path.
The problem is that, because of the size of the game world, we can't compute the whole thing every frame and keep within an acceptable speed. Some distance outside of the visible screen we have to abandon calculations. This causes liquid to "pile up" when it flows outside the border. If we recycle liquid between two "portals," unless both of them are within the calculation region at the same time, the flow will stop. And as the player scrolls around the map the calculation region changes, meaning while approaching the area there will almost always be a time when one portal is in the region and one is outside. If they are far enough apart, there could result in instances where the player is suddenly beset by a rush of liquid that has "backed up" because of the simulation border, then suddenly uncorked by the scroll. (This could actually be interesting from a gameplay standpoint, but it goes against the philosophy of the game.)
I'm not sure there is a viable solution to this problem, but here are some possibilities:
* One thing I could do is consider the region between the two portals an "all-or-nothing" region for calculation; if one cell of the rectangular region between the pair is calculated, then do the whole thing.
* The larger the simulated region, the less evident the problem becomes. If we work on enlarging that area (maybe by slowing down the rate at which fluids flow, which I've been considering for a while), the problem will become less visible.
* It's possible that the problem won't be perceivable to the player most of the time. Because his range of vision is limited, even on-screen backups won't be too apparent so long as they're outside his field of view.
* The real-world solution to this would be a evaporation/condensation cycle, but that would probably require a scale larger than what we're looking for here.
In Profundis Progress (10/30): Tools and Flags
What do I mean by a tool? Tools are objects the player can interact with, place in inventory, but also change the world to his liking. Changing the game environment is a major theme of the game; the pitons and ropes you place to get around don't go away over time unless something removes them. Since you can only carry so much at a time, exploring is an iterative process of placing equipment, over multiple expeditions, letting you get further each time.
One thing I'm worried about is that the process of traveling back and forth in the game world, between base for resupplying and the edge of exploration, could end up being boring. One solution to this problem I'm considering is the use of player-positioned checkpoints. The idea is, the player could obtain "flags" that he could place in the field. After planting a flag, the idea is to then "validate" the flag, by traveling back to the base without placing any more equipment. If this is done, the flag is validated, and the player can then warp from the flag to the base at the cost of the amount of game time it took to make the trip. Likewise, the return trip can also be validated for reverse travel.
This system isn't perfect; after a flag has been validated going one way or the other, it is possible for the terrain between the two to change and make the route impassible. This could be partially solved by keeping a list of the cells traversed in the route, and upon teleporting checking each of them to see if they've been modified since the route was validated.