Got into talks with oneminusone over making a Silent-Hill-style camera setup in SOMA, so I decided to see how possible it was. Turns out, it was a lot easier than I thought it would be.
I based the camera-switching mechanic on the bullet-loading segment of Phi, which incidentally ended up being only about 7-8 lines of code (if that) to get the camera part actually functional. Oddly enough, the actual player avatar is going to be much harder.
For starters, rotating an entity in SOMA is bizarrely difficult. As it turns out, rotating an entity can only be done by setting the rotation parameters of a transformation matrix, which by itself wouldn't be that huge of a deal except the creation and management of a matrix is also really difficult to figure out.
Ultimately though, I ended up using the cLuxAgent class rather than the iLuxEntity class, because unlike the other entity class types, the Agent class has an iCharacterBody field which does support simple rotation. And to be fair, when you're making a complex character entity, it should be an Agent entity anyway.
In any case, you can see from the video that this system is far from being suitable for a complete product just yet, but by itself the fact that HPL3 allows for this sort of stuff makes me excited to see what future mods come up with.
Here's a bit of an update. Decided to look into the collision problem a bit more before I headed off to bed, and ended up finding an unexpected fairly elegant solution.
So with that, I think the only thing this would really need to be put into a mod is some custom content. Like, for example, a character model with idle, walk, and perhaps walk_backward animations. (Unless of course you like the perpetually walking businessman look.)
Thanks for this! In a mod where I present puzzles to the player to solve (similar to Portal), I was going to have a point in time where the player has to control a monster or someone to a particular area while avoiding contact with certain entities.
I'm glad that it can be done though - that's the best relief xD should be great fun to tackle such a task when the point comes around.
(12-05-2015, 06:20 AM)Abion47 Wrote: Final update (for now) on the camera control. I try out the system in a level more closely resembling a mod-ready level layout.
Interesting approach, I assume the monsters all try chasing the camera, so you may require extensive rescripting of the behavioral AI, but I am loving the idea of making third person Soma mods... considering the death animations provided by the old Penumbra assets, you could conceivably play as a monster hunting other creatures down, circumventing the AI issue entirely... would you mind posting your code when your done? This is kind of awesome,
(12-14-2015, 07:47 AM)Myster Stranger Wrote: Interesting approach, I assume the monsters all try chasing the camera, so you may require extensive rescripting of the behavioral AI, but I am loving the idea of making third person Soma mods... considering the death animations provided by the old Penumbra assets, you could conceivably play as a monster hunting other creatures down, circumventing the AI issue entirely... would you mind posting your code when your done? This is kind of awesome,
I've actually since come up with an approach that treats the character as the player, and as such has the monsters chasing it instead of the camera, letting you use any of the existing AI types. That being said, the existing AI types were designed for first-person in mind, so I can't say whether they would require rescripting anyway.
(This post was last modified: 12-14-2015, 08:11 AM by Abion47.)