Request to access gamecamera, raycasts etc.

  • To be able to give some more immersion to the game, I'd like to create some plugins that would enable "head bobbing" while walking or running. This would require access to the game camera.

    Another idea that I have in mind is drawing outlines around mouse hovered objects that you can pickup. As some objects, like branches, tend to blend into the environment so much that you can't see them, this would be a great addition. Especially for visually impaired players. This would probably require access to raycasts or at least a hover object event and get the object, then draw upon it.


    Normally I'd be able to do these things quite easily with Unity based games using BepInEx, but as the game seems to use IL2CPP, that's not really feasible. It's probably too much to ask that you release the game in Mono instead, but that would definitely open up many doors to modding for those that are used to modding Unity games.

  • To be able to give some more immersion to the game, I'd like to create some plugins that would enable "head bobbing" while walking or running.

    Don't you think that players should decide for themselves whether they see head bobbing or not (as they can do in the settings). ;)


    Another idea that I have in mind is drawing outlines around mouse hovered objects that you can pickup.

    :thumbup:

  • Don't you think that players should decide for themselves whether they see head bobbing or not (as they can do in the settings). ;)

    I honestly haven't found the setting to enable this or not. If it's there and I've simply missed it, my apologies. That being said, I never said a plugin should enforce anything. Whenever I write plugins / mods, I always include configuration files that allow users to enable / disable anything they want themselves. It's also easy to implement a UI where things can enabled / disabled or adjusted exactly the way a user wants. As a final note: Plugins are by definition optional. You're not forcing anything onto anyone with plugins that you develop. It's the user's choice to install it or not :)

  • It's in the settings under "Verschiedenes/Miscellaneous" and "Barrierefreiheit/Accessibility."

    I just wanted to point out that the head-bobbing in particular causes problems for many players, and I'm not telling you which plugins you should or shouldn't program.

    Quite the opposite; I admire anyone who can write plugins... and the more available for the game, the better.:wow: :thumbup:


    But if you can configure something in the game itself, turning it on and off in a plugin would be unnecessary, right?:thinking:


  • Hmm, the only thing I can see underneath it is "disable camera shake". Enabling or disabling this unfortunately doesn't seem to make any difference at all. Hence I thought this just wasn't in the game. You're right that it makes no sense to implement something that the game already has of course.

  • Enabling or disabling this unfortunately doesn't seem to make any difference at all. Hence I thought this just wasn't in the game.

    I thought it would make more of a difference, but after changing the settings I have to say, I can't tell the difference either; neither when walking nor running, nor with or without an item in hand ..... so I don't understand this setting either. But I'm sure red51 will be able to contribute something. ^^

  • i believe camera shake is for things like thunder and explosions. you should be able to use BepInEx to some extent. there is no hoverobjectevent exposed to the API tho Raycast's are.

    Thank you! This was really useful information that allows me to get the in game objects / items. Unfortunately it seems Post Processing on WorldItems isn't available. Only on de main camera. So drawing a highlight around a drop when hovered using shaders or anything like that isn't (currently) possible. The only possible solution would be to extract the 3D models from the game. Then create new models with highlighted features. Finally get the hovered world item's location + rotation. Destroy the WorldItem en instantiate your own prefab in the same location / rotation. But you'd also have to reverse it on hover leave and make sure that picking up the custom prefab still gives the correct items etc. Seems a lot of work for something that shouldn't require it.

  • I am just throwing in my two bits.... I play RW because it is a nice quiet slow moving games. These days the effects you are talking about icecub would make me hurk all of my screen<X<X


    When Red came out with screen shake for the storms I mentioned that I could not play the game any more.


    A couple days later Red came out with switch to turn off the storm effect. I thought that was great of him!!!!

    That is what I like about this game Red listens to the players and makes changes if he can.:):)

  • Thank you for your input. Rest assured, like I mentioned earlier, whenever I develop a plugin or mod, I always include configuration options to enable / disable things and, where possible, allow users to fine tune them themselves. So if you think the highlighting of dropped items when hovered with the mouse would be great, but the head bobbing would trigger motion sickness for me, you'd be able to just disable the head bobbing and keep the highlighting.


    I've got motion sickness myself. Though with me the field of view matters more than the camera movement. I'm very much aware that everyone has their own preferences and not everyone likes the same features. That's why, as a dev, you always strive to find a balance, or make things optional where possible.


    I started developing game modifications because certain games lack features that I personally like. Later, I started making those modifications available to others in case they would like to have those modifications as well. But as that progressed further, the amount of people using my mods were growing as well. That's where I inevitably ran into the problem of multiple people wanting different features. Some wanted me to develop a flying mount. Others wanted me not to do that as it would make the game too easy. So how would I be able to keep both parties happy? I made it optional. And that's how I approach all my mods. Make things optional. Everyone happy :)

  • It's definitely not a bad idea to expose the camera to the Plugin API, but if you want to implement something like head bobbing, you will probably have to modify the camera every frame... unfortunately this wouldn't work well with the Plugin API, since it's designed to only run serverside (when thinking of it as a multiplayer game). So any changes done through the API will be applied to the client with a certain delay (typically the ping between client and server). Ofc there is no server when playing in singleplayer, but you still have a minor delay (typically a few frames), which makes any frame-critical operation impossible.


    The API can only circumvent that by providing certain helper methods, e.g. something like a method to set a camera position/offset smoothly (so the game performs the smooth movement under the hood). This way you're still more limited compared to having direct access to the camera, but it should work in most cases. Not sure if that would help in this case?


    Drawing outlines around elements is more difficult though, especially since the game is using Unitys HDRP. Passing custom shaders to the client is actually possible through the API, but the HDRP also requires you to write a custom pass to achieve such an effect. Unfortunately this isn't something that could be exposed to the API, even if the API would run clientside...


    So that definitely requires classic modding. Currently we have no plans to switch to Mono unfortunately... we might reconsider this in the future, but we ran some tests back then and things like chunk generation were up to 6 times slower in Mono compared to IL2CPP...

    However, there is an ongoing effort @Unity to switch to .NET CoreCLR (which would even provide better performance than IL2CPP), but unfortunately there is no ETA (and many people who were originally involved in this process no longer work at Unity, so I'm afraid this switch won't happen anytime soon)... :/


    However, BepInEx also supports IL2CPP games. Ofc it's more difficult to write mods (due to the lack of easily accessible source code), but it should be possible to create a mod for the game this way :)

  • Thank you for this insight! I understand the reason for using IL2CPP with such a huge performance difference of course. However, there could be a middle road. Like right now there are a few beta versions available on Steam. It would be possible to release a Mono beta version intended for mod development, not actual gameplay. Mods can easily be made for IL2CPP if you have most of the source. The only problem with making IL2CPP mods is because you don't have the source. Not because it's IL2CPP. The game Schedule 1 uses this approach as well. Another, perhaps simpler option would be to just give a C# version of RisingWorld-Game.dll.

  • Thank you for your reply but I got to ask why the highlight for dropped items?

    This would be a helpful feature for visually impaired players such as myself. I'm often unable to see the items on the ground because they blend in too much with the terrain. The only indicator that tells me there's an item is when I hover it with the mouse and the mouse icon turns into a pickup icon. A highlight would make the item far better visible and therefor solve this issue for people like me.

  • Ahh I "see" :) I got some issues with vision myself LEDS kill me. I use the microsoft program night light & twilight program with my monitor brightness set to about zero! Of course then I cannot see reds and some greens...


    PS the game use to have a command wireframe but that does not seem to work any more/

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!