TheWeatherPony / TheSeasonsMod

A repository for tracking issues in The Seasons Mod
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1285986-the-seasons-mod-
7 stars 0 forks source link

[Enhancement] Simulate the passage of time in unloaded chunks #36

Closed jredfox closed 7 years ago

jredfox commented 8 years ago

Time Stamps mod: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/2129479-time-stamps-mod-better-time-in-minecraft-wip-oss

Contact: http://www.minecraftforum.net/members/4HeadTiger

Problem: It doesn't snow in unloaded chunks this creates multiple issues such as if it snowed lets say 2 blocks high and you go to an unloaded chunk and it has no snow. It seems weird if you are in summer and you go into an unloaded chunk that still has snow and your like Haven't I seen this last year. Also there is an issue with textures In unloaded chunks. If you are in the season fall you go out into the worlds it's winter and you go back and you see this fall texture with no snow there. Ok by know you get my point so let me present my possible solution.

Solution1: Create Time Stamps Mod and ask the original owner for advice and development. the mod is totally gone and off the thread so we are going to have to create this from scratch. According to the original person who created this it doesn't cause, too much lag simulating the amount of time since the chunk has passed. So after we get that done with the api We need to make an addon so it works with seasons and we get the best of both worlds.

How this works (less technical explanation) time stamps simulates the chunks from the amount of time gone from the unloaded chunk. so if you go to the nether and come back your crops will be done and your furnaces will have cooked your food and your modded buildcraft stuff will have mined away all day.

So what does time stamps have to do with seasons? Time stamps mod can be modified to simulate the seasons and handle everything. It can handle what season it will be in so you never see the previous chunk updates, instantly melt all the snow if it's summer, simulate the amount of time that snow has melted or snowed, basically everything you get my point by now hopefully. Sorry if I am starting to sound like an add where it takes 40 minuets to get to the point.

Solution2: Create a chunk simulator without time stamps mod. Have it handle everything; melting unloaded chunks, simulated snow accumulation, snow melting what season it is without time stamps mod.

Solution3: Surprise everybody

Solution4: Ignore everything I just said because, this is an optional to add to your mod. It's not mine I can't control what you add / don't add.

jredfox commented 8 years ago

Thanks for closing that one issue I have been away. Also thanks for changing the title. I will put the replace default beaches/river biomes by adding a new hot beach/river biome in the suggestions document for the 1.0 suggestion seasons list.

jredfox commented 8 years ago

this could be done with biome decorators like you had in winter but, doesn't have to be done. it would be really nice to have it though

PitchBright commented 8 years ago

In a nutshell… Biome decoration occurs when a block is "ticked". If it is a "grass" block, it gets decorated (by whatever you have in your config file). Ticks occur as time passes. Check out the minecraft wiki to learn about ticks. Right now, biome decoration takes places as fast as the game will allow, so it's not like it can decorate biomes fully and completely (all the grass blocks) without a lot of ticks happening… and that takes time.

In summary, biome decoration can't simulate the passage of time. Biome decoration happens AS time passes (chunk MUST be loaded and active and the blocks in it MUST be ticked).

jredfox commented 8 years ago

I will read up on it. not saying to simulate time. saying like the snow generation. I don't suggest that at all it's fake time stamps mod did the same thing that weatherpony had already done. I don't thinks it's possible to simulate time in chunks but, might be possible to create an illusion. would it be better if I closed this and opened a new suggestion or should I leave this open?

TheWeatherPony commented 8 years ago

Just leave it open and leave it in the list of unresolved reports as a reminder for me until I think of a way to do it that plays nicely with everything else. If and when it becomes feasible, I'll start working on something. ;)

jredfox commented 8 years ago

ok cool if you need help with logging talk to elix_X.

jredfox commented 8 years ago

I thought of a way that might be possible. what if you have generation decorates like vanilla but, replaced not only in new chunks but, also in unloaded (saved) chunks as well. for new chunks it will only generate snow/ice if it is winter. if it is winter it would generate your biome decorator. How it would be simulated globally for the client/server would be; the 1. snow would instant melt replaced with air or 2. somewhat melted(\ 1 =replaced generation with airblocks 2= melt based on inttemp,intday,intseasons,inttimestamp(inttimestamp=a time stamp once every quarter of a day if the mc time is at a certain point)gen air gen your snow. if necessary it would generate snow replaced the exact generation with it's new snow tile generation if you do dynamic seasons.)It also will be based on what season it is and if you choose two (somewhatmelted method described above) then it would also depend on what day it is of the season. intday=int day of season. More detailed examples: for somewhat melted if the season is higher then summer and the temperature is greater then 33% then it should instant melt all of the snow. if the replace all snow tiles method (1) when generated chunks doesn't work if there is any snow tiles, then make a logical operator that would grab amount of snow chunks 1 time every 20 ticks (1 time a second), on the amount of snow tiles and they way there are placed then; make it generate from that template. you could even optimize this by making it only grab the chunk 1 time (20 ticks) and it will be 0 after that unless a new chunk is loaded (this time new chunk = new or unloaded chunk) that way it wouldn't be too rough on the servers. I know how all of these are possible and I think the very first 2 I mentioned are your most likely to choose choice. I am intro to computer programming and I would say this is possible. now whether or not you would have to override some vanilla code one one of the operators is unknown to me. but, if it's all in a separate java package and stores the data all separate it should be fine. I had to override the vanilla / forge fuel handler to add fuel into minecraft. It was not against mojang's eula because, it was all separate. now for something like overriding or replacing chunks with blocks in even with pml live I would double check to see if that would be ok with their eula. besides the eula's things I think you should be fine on getting one of the methods I just thought up of today easily. now if you don't have a new computer that properly works with eclipse(I know some people with linux) then , I would wait to go get one because, I bet you you will have hundreds of crash reports before you would get it right.

I just thought of another way. I think instead of generating the entire melting dynamically then replacing with air and then again with melted snow gen it would, replace snow based on your melting system except it would only use the math for the melting system. it would replace the snow blocks with air based on int chance of snow blocks melted , season , biome , if has sky, and day. this is just an optimized way of the first dynamic idea I gave you.

these principles could also be applied for dynamic textures to. the 1st option is the most optimized but , not realistic. the 2d option is realistic yet optimized my primary choice. the 3d option is just plain out insane on the amount of work for the logging system(it is for the last resort choice). the principles based on variables could also make the leaves fall at atumn. they would fall and have a leaf pile block. now whether or not the leaf texture is replaced with a branch or if the leaves are just plain out gone is up to you for when the leaf pile event happens. if you do the branches make sure the leaves only fall if the leaf texture is not the branch texture for winter. if you do the leaves actually falling then you would have to make them grow back in spring and with your principles have them gone(leaf tiles)auto generate if it is spring with airblocks. if it is summer or winter then the fall generates won't generate the leaves back to the trees. if it is atumn a certain day or day 1 winter all of the leaves will be on a tile on the ground. and leaf fall could be on inttemp, intday,inttimestamp, intseason. inttime resets every day at every quarter and if timecount >= 24000 then inttimestamp = 0. I physically know how to do this it's just I don't know excatically what to code for myself and after that I would have to learn pml to which I don't want to learn because, it's too complex for me :( .

jredfox commented 8 years ago

I have given more details on how to do this with the most optimization. inttimestamp is optional for the simulation process the rest I highly recommend if you choose choice 2. if choice one ignore. if choice 3 it's unoptimized even it's optimized version is unoptimized. so choice 2 I highly recommend , but, I recommend testing to see if it is possible first with choice 1. if choice 2 all works with or without inttimestamp then you could use these principles/blueprints for dynamic textures, and of course falling leaves if you so choose to add them. @TheWeatherPony

jredfox commented 8 years ago

Don't mean to be rude but, what do you think of these possible fixes? I think it could be done without editing base class files through pml just as you have before.

jredfox commented 7 years ago

Rather then simulating passage of time as said previously with nbt since this is seasons and not time stamps why don't do something else? Something like using nbt or something to a chunk to make it once it's entered based on the time directly modify those chunks to have no snow tiles on top of the ground.

This enhancement I think could be done and shouldn't be too much more leggier then the current setup for generating more snow in new chunks during winter.

This should be done by starting at the world height scanning for snow tiles and once it hits a block that isn't snow tile it moves on the the next possible section to remove it. How much snow it removes will be based on seasons (eventually day get season working first). If the chunks loads to fast simply don't do the process (for mod compatibility)

This would be the eventually full enhancement list of things to do

Seasonal Biome Event Chart (after accomplished do tropical weather (flooding) )

All Seasons: snow tiles winter (melts/adds new snow based on weather, time, and biome temp)

if the config snow blocks/ice blocks is set to true melt them same way as above.

Spring___

  1. generate foliage based on what is suppose to spawn there (get it from biome obj or world?) do this only in new/unloaded chunks. You already have it simulating it for loading chunks (chunks your currently in).

  2. if fall "A" regenerate leaves in loaded chunks and unloaded chunks.

  3. flash flooding chances (a new block like snow tiles only water and entities can drowned in them)

Summer:_____

  1. flash flooding chances
  2. drought chance

Fall___

  1. Leaves Change Color(multiple forums, purple, yellow, brown, red, mixtures)
  2. Leaves Fall and form piles
  3. Based on A,B,C choices will determine if the colored leaf block will get effected

leaves pile blocks(adds during fall of biomes that have trees (you would calculate if the biome has trees the same way you would calculate if the trees leaves need to generate yellow)

How it works after a leaf pile develops : A: replaces block with air (left to make tree look bare) B: Changes that specific leaf block to a branch texture C: No Changes leaf piles are purely ascetic blocks during fall.

Have a defined whitelist for pine trees their behavior won't do this and remain green all year with a tinge of brown during fall. (this will then proceed to drop pine needle piles) to the floor.

Winter_____

if "A:" from fall: Tree is already bare if "B:" from fall: make all trees have a bare texture (do this by changing all defined / auto found leaf textures to bare branches) if"C:" from fall: do nothing

if leaf piling is on: Get rid of all leaf piles in loaded and unloaded chunks if the leaf block hasn't been picked up by a person (If picked up the leaf should drop a different block that extends the current one so it won't be removed during winter)

make sure to add snow drifting in so trees are not bare underneath. also fix bug with ice not developing if it can't see the sky


For Unseasonable/Hot biomes:

Desert/Tropics : make a new weather type for the special unseasonable biomes that only occurs in those biomes when the rest of the world doesn't have to be raining nor any other world(Weather Event)

Desert Like Biome:

  1. rain period chance (70-80%) once a year and forms puddles and mini rivers
  2. cacti bloom if it rained
  3. sandstorm (graphical effect)
  4. drought chance

you should already know how to calculate if it's a desert like biome since you had to fix a bug with specifically only hot desert like biomes upon spawning.

Tropical Biome:

Wet Season 1.rains all the time

  1. has a high chance of flooding<small, medium , or large> during wet season (sets flood tiles)

Dry Season:

  1. dry season drys up the flooded area and by the end global season summer the rain flood tiles should be completely removed

  2. drought chance

Note: you should know it's tropical based on how green it is, it's rainfall should be normal when untouched by your mod, and it should be warmer then seasonal biomes also calculated the original temperature of the biome. or if it is hot enough too hot for seasonal define it as a tropical biome

Winter Biome:

  1. chance of blizzarding and also goes same process as seasonal but, the temperature will be the same as last time the .json will remain untouched

  2. chance of aurora lights

Conclusion:

You might ask well wouldn't this be laggy during each chunk load, and even when not loading new chunks? It shouldn't be laggy if your calculations are only done when loading new and unloaded chunks into the equation grabbing the data from each chunk such as (day, seasons, year your own int tags) . A self biome decorator you could say. Shouldn't be too much more then the current simulator for winter's new chunks. For information on how this could be done efficiently see setblock method in the world.

jredfox commented 7 years ago

I think this would be best as a separate mod with seasons support maybe an addon if you want to make it one. I can't code this if I knew how to right now I am busy