TeamPorcupine / ProjectPorcupine

Project Porcupine: A Base-Building Game...in Space!
GNU General Public License v3.0
484 stars 278 forks source link

Traveling on open space #264

Closed kd7uiy closed 8 years ago

kd7uiy commented 8 years ago

Just noticed something quite odd when building my first floor, that the worker can travel on spots with no floor. This seems odd. I would suggest permitting it, but have it be slower. It'd be great to have an animation of floundering when this is happening as well, to explain the slowness.

Novido commented 8 years ago

Yes I've noticed this also. I assume it's a bug in the pathfinding code.

polak-jan commented 8 years ago

That can be fixed by returning huge cost from empty tiles.

NogginBops commented 8 years ago

@satch3l This is not a bug, it's intentional to allow for expansions and building a initial room. It's kind of placeholder for some kind of space system with spacesuits etc.

Though I like the idea of having the character moveslower on empty tiles.

koosemose commented 8 years ago

With the intent being that areas with no tiles are empty space, I'm not sure that slower movement is the right answer. However, the right answer also requires more systems in place, the primary one being a differentiation on if the character is in a space suit or not, and appropriate penalties if they're not in one and in a place with no oxygen (such as empty space) or in a place with no floor traction (this being 2D, it is perhaps best to assume that floor tiles somehow provide gravity). No Oxygen would presumably be them being damage (suffocating), and it would perhaps be nice if there's no floor they just drift (presumably in the direction they were going), if they were mostly in the station they would just drift to the other side, where presumably there's flooring somewhere, but if in empty space they would presumably just drift off until someone rescues them.

But perhaps I'm overthinking things at this stage.

kd7uiy commented 8 years ago

The space suit idea is a good thought. For the short term, we should add it as a fairly high movement penalty, say, 5, to discourage such movement.

As for the space suit, if there isn't a discussion about that, we should start one. Or we could use this one I suppose. It needs to be a state of some kind for the character. I could imagine there might be different kinds of suits, so it might be a clothing string or something? Maybe use it for tools that aren't consumed? Not really sure here. Hmmm...

NogginBops commented 8 years ago

I think that spacesuites should in some way be implemented as items.

koosemose commented 8 years ago

I just kind of feel like, at this stage of development, the movement penalty would be more of a hinderance, there would be no way at this point to avoid it, and if I were to, for example, do a test involving picking up all the steel plates that currently spawn on the "asteroids" or to test the mining that someone is doing in a PR, it's just going to take that much longer to actually test it out.

Look at it the other way, our poor little alien friend is already in his space suit, we gotta make him comfortable enough to take it off inside the station. ;)

alexanderfast commented 8 years ago

Increasing the cost of tiles wont prevent workers from walking on them. The pathfinding finds the cheapest route, not matter how expensive it its. If the only path is through space that path is found.

Maybe split the worlds into two parts? Two graphs that are not connected that can be searched. Airlocks seems to be a big thing anyway.

koosemose commented 8 years ago

Unless the pathfinding system has been changed (it may well have been) the cost of moving into a tile directly translates into the speed one moves, so with the example of interacting with the asteroids, it will take 5 times as long. Though if those are still coupled, it may be time to look into separating them, so we can have tiles that people don't want to walk through but can walk through at full speed (such as a trap for example, or even empty space so that they don't go into it unnecessarily, but don't go super slow).

kd7uiy commented 8 years ago

Walking on empty spaces might be okay, but it shouldn't be the same as unhindered space.

I think walking on open space should require a jetpack, and walking in a vacuum a space suit.

koosemose commented 8 years ago

I'm not sure if there is a situation where you could have open space that isn't a vacuum. But you could conceivably have spacesuits that don't have jetpacks in them, like an emergency flight suit or something you make your people wear if you're paranoid about sudden hull breaches, or have them put on before fixing said hull breach.

I have, however, started a separate discussion in #268 regarding how to handle gear in general and spacesuits in general, since this is only tangentially related.

abackwood commented 8 years ago

Not entirely sure if this is the right place to bring this up, but I'm experimenting with making a special ZeroG Ladder floor type that lets characters "walk" normally on the outside (where there is presumably no artificial gravity).

Normal floors on the outside would provide no friction to characters so be useless for walking, though they can be used to build furniture on. Ladders don't support furniture. (Note: all this would only be fully implemented when a definite solution is found for outside travel, for reasons stated before in this discussion)

This obviously does nothing to make the character not suffocate so a space suit would still be required, but no jetpack.

Thoughts?

abackwood commented 8 years ago

I had a thought about open-space movement.

Realistically, a character would start floating in a straight line and only be able to change direction if carrying a jetpack or somesuch. This doesn't play nice with pathfinding. I think I know a middle ground between realism and ease of understanding/control:

The outside still uses A* but has a different graph

This way, characters can still do pathfinding ahead of time on their journey and not a completely different system is needed. Characters without jetpacks can't change direction. However, they will have a direction of travel right out of the airlock so they'll still float. What this allows too is that charries without jetpacks can still hop from one building to another if it's in a straight line. When they hit a wall they can spidercrawl to another door if they need to.

Things that would need to change about the A* algorithm as is:

vogonistic commented 8 years ago

Sounds like instead of A*, you need a navmesh. Unity has it built in, but I don't know how to integrate into it.

abackwood commented 8 years ago

I dont recommend having a completely different way of moving outside and inside. Having fundamentally the same movement patterns is easier to understand for the player and also easier to work with. Characters still move from one tile to the other following a path as before.

vogonistic commented 8 years ago

I'm not entirely sold, and need to feel how it works.

The part I like is that I think being outside the base should be terrifying and of uncertain success. If we add this, and a chance that asteroid mining causes a blowout that the character might or might not be able to recover from. Maybe terrifying is a bit rich, but it should be uncertain and dangerous. You could be hit by anything.

kd7uiy commented 8 years ago

Straight line travel isn't really that realistic if you think about it. Line of Sight travel is what is important. In reality you can go any direction, straight severely limits that. I think it would just be better, however, to require a jetpack to go in open space.

Of course, some of this depends on what the world for the game is (#1023).

kd7uiy commented 8 years ago

I'm going to close this one for now. I don't think we are ready for the discussion yet, but I will be considering it when we have more added features soon!