Content: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Background: Slate Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate Marble
Pattern: Blank Waves Notes Sharp Wood Rockface Leather Honey Vertical Triangles
Welcome to TerraFirmaCraft Forums

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    • Crysyn

      Only help if you can be helpful

      Hey All, A topic has come up of late in the IRC channel in regards to the general feel of the forums and the community that supports them. Things have progressed further than I would have liked with out this being addressed more publicly because I would much rather have snubbed this out sooner rather than later.. but I have been busy. Here is the general rule I would like people to follow: Wheaton's Law "Don't be a dick." Those of you from the IRC channel know that this is the only rule I ask people in there to follow and we generally have a good and lively time chatting about all manner of things. This is basic rule that just about everyone understands and I am going to expand it to the forums from here moving forward. If you can not help people in a helpful and polite manner then I simply ask you to stop. Now I generally take a back seat to moderating the forums as I like to participate in the suggestions forum fairly heavily at times and would rather do so as a forums user than a moderator. But I am also fairly well known for being the person who constantly puts their foot down and so I am stepping up and doing so on here. If you find yourself unable to respond to a message politely then I ask that you do not respond. This mostly focuses on the increasing level of hostility found within the Suggestion forum as well as the Server forum. I do not care if this is the 30th some odd time you have seen someone make the same suggestion. Or even if the new post on an older topic is one entry above the old one. I expect the members of this forum to respond politely to the user, new or old, and point to the older topic if it applies and even go the extra step to suggest they either add in new information or to summarize the outcome of the previous discussion based upon the new post's entry into it. That is what we are here for, that is why I close most topics instead of deleting them, so that they can be found and referenced down the road. The next topic is the slew of derailment attempts I have seen as of late. If you want to have fun and joke around that is what the off topic forum is for and pretty much anything goes there. I do not expect to read a suggestion thread and have to go through 3 pages of image memes people have shot back and forth. Quite simply this is a waste of my time to read and then have to clean up. Now for the summary. I am going to start taking a more active role, especially in policing the suggestion forum, and handing out warn levels to people whom I see doing this. These will be indiscriminate and applied not to just the first person who derails or is impolite on a topic or response, but to everyone whom follows the lead of that person. As I do not like doing things with out giving you all warning this post shall serve as that warning. If you have a desire to bring this topic up with me then I invite you to do so on the IRC channel. Lets raise the level of quality and grow the community. Let us not descend into the quality often found on the minecraft or league of legend forums. There is simply no need for that here. Be passionate about things, just do not be abusive.
    • Kittychanley

      Offline Servers

      Recently I've seen a few server listings showing up on the first page of the Servers forum that have been closed for an extended period of time, but have recently gotten a reply from a new member who didn't realize the server is offline. To help prevent this from happening in the future, it would be greatly appreciated if you could use the report function on the original post of any servers that have been confirmed as offline, so that the topic may be locked. If you are the admin of a server and plan on taking the server offline, please use the report function on the original post of your topic to let the TFC Staff know that the topic should be locked. If you are the admin of a server that has a locked topic, and would wish to bring the server back online, please use the report function on the original post of the topic to let the TFC Staff know that the topic should be unlocked. As always, please remember to follow rule #3 of the servers forum and update your topic title to contain the version of TFC that the server is currently running. You can do so by editing the OP, and then clicking on "Use Full Editor."
zomseffen

[Request API Feature]

9 posts in this topic

Hello,

I'm currently trying my hands at a addon that would include a more complex enviromental temperature model,

i.e. rooms can be warmed up by campfires ect.

The problem with that is that currently there is no way, that I could find, to replace or alter the temperature calculation in a way that TFC's original blocks also use it.

I would request a slight change to the class so that there is a protected set-able static instance of the class.

All static methods of the class would refer to the instance and the original code would be shifted into a privat method.

I would attach a file where I did exactly that, but I can't.

If you want it I can send it, but I wouldn't bother with git as it is only one file and I changed a lot of other stuff in my worspace to test stuff.

 

Thanks for reading.

1

Share this post


Link to post
Share on other sites

Current version of the mod is the final version. Devs will no make an update anymore.

It is impossible or very hard to make a complex environmental model even with changes in API and classes accesses. The problem is in temperature cache - it is keeps temperatures in two dimensions: X and Z. So if you'll try to get a cached raw temp in coordinates X Y Z, you'll get the same temperature on the same X Z and any height. Changing current temperature cache model means change value retrieving and calculating methods - that's not possible without ASM or making big changes in the TFC Core. And implementing the third dimension in the temperature cache can affect performance significantly.

0

Share this post


Link to post
Share on other sites

So I guess I will need to make my own fork...

At least if I want to continue with my idea.

 

It would not be that hard to extend the Temperature model.

For the simplest extension, that features actual heat sources I would add a cache containing listed heat sources (i.e. when you build a campfire it registeres itself under its coordinates) and each check for temperature would include a check of nearby heatsources and a heat calculation with those.

The calculation could be as simple as calculating the distance and multiplying this with a heat-factor.

0

Share this post


Link to post
Share on other sites

I was also thinking about mod adding temperature, but after code analysis I think, that fork is a best way.

In my opinion, the simplest method of heat source calculation is to use light level. In TFC most of lights sources are also heat sources, so it is somewhat accurate.

By the way, lava or hot springs should increase nearby block temperature if there is no rainfall (and affect vegetation).

0

Share this post


Link to post
Share on other sites

And just with this comment you said why light level doesn't work.

Hot springs do not spread light.

Also heat distribution in reality isn't as disturbed by non see-through materials as light.

 

For the new heat mechanic to affect vegetation is actually one of the main reasons for my  API request, since it as it is right now would be impossible.

0

Share this post


Link to post
Share on other sites
3 hours ago, zomseffen said:

Hot springs do not spread light.

Also heat distribution in reality isn't as disturbed by non see-through materials as light.

Yes, and it is a reason, why I stated, that it should be taken into account separately. BTW, there is already code for this in TFC, but not in climate, only in player body temperature:

https://github.com/Deadrik/TFCraft/blob/master/src/Common/com/bioxx/tfc/Core/Player/BodyTempStats.java

Probably a reason why lava/hot springs is not affecting vegetation temperature is that worldgen need to know annual average temperature, therefore it cannot take into account variable such blocks.

 

If talking about heat distribution, it goes mainly by IR radiation, exactly like visible light. Convection go up, diffusion is small due to low heat conductivity, therefore using light level is good approximation (except before mentioned hot springs and lava).

 

For the new heat mechanic to affect vegetation is actually one of the main reasons for my  API request, since it as it is right now would be impossible.

I thought, that you wanted to implement body temperature, something like Enviromine for TFC?

0

Share this post


Link to post
Share on other sites

The code in TFC is not fuunctional as extraFoodConsumption and extraWaterConsumption never are set to anything other than 0 (see line 61 and 62 the computation is commented out).

The worldgen would not be affected much (except around lava and hot springs maybe) as everything that would change the temperature from the standard equation i.e. campfires can only appear after it was generated(placed by players).

Just now, ciekma said:

I thought, that you wanted to implement body temperature, something like Enviromine for TFC?

Yes I want to make something like that, but it would make no sense to ignore the existing temperature mechanic as it would seem strange if a plant freezes to death in a room you heated up as to not freeze yourself.

 

0

Share this post


Link to post
Share on other sites

All the body temperature and ambient temperature were half complete. The ambient temperature used to be calculated and displayed in F3. However it was an insane resource hog and when we disabled it in our fork we saw a huge performance boost on our server. So it was disabled in the official version. 

0

Share this post


Link to post
Share on other sites

Yeah I can see why it was a resource hog.

Basically it iterated through each block in a 15x7x15 block around you whenever it wanted to apply local heatsources.

I will try another approach. I will let each heat source register itself to the chunk it is in.

Then I will only need to look for the neighbouring chunks around the player and their registered heat sources, which will be, in most cases, less than 15x7x15 and therefore more effective.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now