找回密码
 注册
X系列官方授权正版
搜索
查看: 1592|回复: 7

[转帖] Docking continued: The Multiple Pods Problem

[复制链接]
发表于 2012-11-2 13:31:28 | 显示全部楼层 |阅读模式
HarvesteR's Dev Blag

by HarvesteR , Yesterday at 18:43 (4193 Views)
Hi again,

As many of you already imagined, docking makes it possible to have multiple command pods in the same vessel. That creates an interesting problem in which only one of these pods must be the active one, otherwise things just wouldn't make much sense.

This might sound weird, but as far as KSP is concerned, the command pods themselves have nothing to do with how a ship is controlled -or didn't, until now, but I'll get to that. The player Input is handled by an external component that processes all keyboard and joystick input, and provides a FlightControlState object, which is sent to all the parts in the vessel. That control state object can be thought of as a snapshot of the controls on the cockpit, and each part will then read it and respond in its own way to the given input.

That means command pods don't really have anything to do with how a vessel is controlled. A vessel with two command pods would work just the same as a vessel with one, or twenty, or none.

So, why is there such a thing as a multiple pods problem? Well, even though pods aren't important to ship control by themselves, there is one part on every vessel that is 'special'. That is the vessel's root part. The part around which all other parts are connected. The vessel is centered around that object, and it defines the orientation of the vessel. How do we know which way is forward to a ship, or which way to rotate when you pitch down? We use the root part as our reference.

So, up until now, the root part and the command pod just happened to conveniently be one and the same for all designs. That was because the editors wouldn't let you do it any other way. You placed a pod on the building area, and that became the main, undeletable part for that ship forever.

Docking kind of ruins that notion though, because we are now allowing vessels to exist with multiple command pods, and those not necessarily as the root of the vessel. That creates a problem in that you'd logically expect your command input and your instruments to work relative to the command pod, and now not only the pod can be rotated in any way in relation to the vessel's root part, there might be more than one pod to choose from.

So, the multiple pods issue is largely a UI one. The game itself doesn't really care about which particular way is forward, as long as one is, but it wouldn't make sense to the player to orient the ship right side up to the surface, only to find that the cockpit is now upside down and facing backwards.



An interesting problem, definitely.


The solution was thankfully a simple one. If the game doesn't care about which way is forward, that means we can arbitrarily set any way to be forward, and the game would be ok with that.

So that's what we did. Now, instead of assuming the vessel's root part will be our reference, vessels keep a reference transform that can be set to anything. That not only solves the problem, it creates a feature.

When you dock to a vessel, a reference transform is selected by default to the first "command" type part available. That's just a suggestion though, because now, CommandPods and the like have a right-click action to let you "Control From Here".



That means you get to choose where you want to control a vessel from. And more interestingly, that also means you get to place cockpits in weird rotations, and have multiple ways to control a vessel by. Want to control a stricken Apollo 13 CM replica from the LEM? Just make sure the LEM is manned and select "Control From Here" on it. Your instruments will be reoriented so that all controls and gauges are relative to the LEM part.


Also, if you go to internal view and cycle around, your reference will be set automatically, depending on which Kerbal you're currently focusing.


All this effectively solves the multiple pods problem then. This means there is also no reason now to require you to place a single pod on a vessel in the editor, and so we are also removing that limitation. Expect a pods tab in the parts list on 0.18.


Cheers
Tags: docking
Categories Developer

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
 楼主| 发表于 2012-11-2 13:35:07 | 显示全部楼层
本帖最后由 柳三公子 于 2012-11-2 13:50 编辑

大致意思就是,为了解决对接中的多指挥舱问题,在0.18更新中,会允许玩家在设计飞船的时候,直接添加多个指挥舱。并且在飞行中可以在多个指挥舱直接切换,而相关仪表都会根据你当前的指挥舱进行调整。(主要是决定哪里才是向前,哪里才是向后)
回复

使用道具 举报

发表于 2012-11-2 13:58:45 来自手机 | 显示全部楼层
Fantastic and awesome improvement!Cheer for the developers!
回复

使用道具 举报

发表于 2012-11-2 14:07:30 来自手机 | 显示全部楼层
And thank for 2L...Without which I could hardly get the most important point in my current English level.....
回复

使用道具 举报

发表于 2012-11-2 19:07:31 | 显示全部楼层
KSP0.71的吧
回复

使用道具 举报

 楼主| 发表于 2012-11-3 00:27:27 | 显示全部楼层
严航 发表于 2012-11-2 19:07
KSP0.71的吧

是0.18

0.17.1我已经在用,仅仅修复了一些小bug,不是很有必要升级,因为升级之后所有用到dll的plugin都不能使用了,需要重新下载新版本,但是插件作者好多都还没更新呢。
回复

使用道具 举报

发表于 2012-11-3 10:28:18 | 显示全部楼层
看来Dev顶不住n多fans的压力,还是准备在0.18里搞出Dock了么?
回复

使用道具 举报

发表于 2012-11-3 17:28:30 | 显示全部楼层
HoneyFox 发表于 2012-11-3 10:28
看来Dev顶不住n多fans的压力,还是准备在0.18里搞出Dock了么?

         正统阿波罗 登月系统  准备好了么~~


  狐狐 乃个 异端~~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

Archiver|手机版|小黑屋|DeepTimes.NET 太空游戏站