Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WF] Create an overlay to display weather forecast and season #12

Closed
theSeb1979 opened this issue Nov 7, 2016 · 131 comments
Closed

[WF] Create an overlay to display weather forecast and season #12

theSeb1979 opened this issue Nov 7, 2016 · 131 comments

Comments

@theSeb1979
Copy link
Member

theSeb1979 commented Nov 7, 2016

This should be an overlay which is displayed on the screen. Possibly above the vehicle hud, or below the time hud. If it's below the time hud, then it will conflict with the Livestock manager mod.

But, looking at livestock manager, it adds itself into g_currentMission, so we can check for its presence and move the hud down, if necessary.

@theSeb1979 theSeb1979 added this to the Weather Forecast - display forecast info milestone Nov 7, 2016
@ian898
Copy link
Contributor

ian898 commented Nov 8, 2016

I can confirm my mod does attach itself to g_currentMission for this exact reason but we can also shift things around to work together even though I had pointers from CBModding Team all the FS mods are completely mine so I have full creative control over them.

Also been looking through WIKI at temp notes is hub only accessible on foot as k would conflict with loader functions if in vehicle.

@theSeb1979
Copy link
Member Author

Idea that I have is to have the a rectangle subdivided into 7 columns with thin lines. Then each day can be in a column with Day of week, in game icon to represent the predicted weather state, low temp, high temp.

K is just a key that I chose. I use the gamepad so I didn't realise there would be a conflict. Does anybody have any other suggestions?

@joskuijpers
Copy link
Member

The key should be configurable anyways. So it doesn't really matter for now.

How important is the weather itself? Or at least, the forecast?
My prioritites lie with costs/income/growth correction. And then with realism -> feel like winter/summer (shorter/longer days)/snow/rain

@ian898
Copy link
Contributor

ian898 commented Nov 8, 2016

I don't really think it matter which comes first it would be good if we can get season rolling over then from there we can build forecast as would be good to be able to see that from ingame.

@joskuijpers
Copy link
Member

To get the current day, g_currentMission.SeasonsUtil:currentDayNumber()
To get current season: g_currentMission.SeasonsUtil:season(). It automatically 'changes'.
Now all we need to do is monitor the value and do stuff with it.

@akuenzi
Copy link
Contributor

akuenzi commented Nov 8, 2016

This is fascinating discussion watching guys who know what they are doing converse. I'm just the little mouse in the corner watching all this and taking notes. :) This is my first attempt to comment on github, so here goes...

If it's all right with everyone else, I was thinking of asking FSModding_Gary on FS-UK to create a hud for the weather forecast, based on what Seb said above: "Idea that I have is to have the a rectangle subdivided into 7 columns with thin lines. Then each day can be in a column with Day of week, in game icon to represent the predicted weather state, low temp, high temp." Unless I hear differently, I'm assuming the 'squares' should be the same size we see in-game now...

@ian898
Copy link
Contributor

ian898 commented Nov 8, 2016

I believe me I am just looking through all code making notes so I can get a readable road map for myself haha, I can probably do the forecast overlay we should be able to pull the default weather hud images "dataS2\menu\hud" , "hud_cloudy.dds" "hud_fog.dds" "hud_hail.dds" "hud_rain.dds" "hud_sun.dds" and then just a background.dds through some text in for each day shouldn't be to hard but its up to you, I will admit I am not that good with hud backgounds lol.

Its still completely akuenzi if he doesn't mind doing hud then I am all for it as it saves me a job a will look at some other things start doing some problem solving haha.

@theSeb1979
Copy link
Member Author

The key should be configurable anyways. So it doesn't really matter for now.

How important is the weather itself? Or at least, the forecast?
My prioritites lie with costs/income/growth correction. And then with realism -> feel like winter/summer (shorter/longer days)/snow/rain

It's a quick win to get something out and if we get the weather manipulation working, then the weather forecast will be super high priority. Ian and I have also started a separate discussion on how cold weather (winter) will affect animals in terms of more bedding and more food required, since they should be in sheds. I'll take a moment to organise the issues more and so forth either tonight, or tomorrow, so that we have a clearer road map. It would be good if you could look check if manipulating the weather is possible. Now that we know how to change growth times, we have to do a bit of thinking about what the growth times should be to fit in with the seasons. Like barley planted in autumn, will be ready for harvest in summer.

This is fascinating discussion watching guys who know what they are doing converse. I'm just the little mouse in the corner watching all this and taking notes. :) This is my first attempt to comment on github, so here goes...

If it's all right with everyone else, I was thinking of asking FSModding_Gary on FS-UK to create a hud for the weather forecast, based on what Seb said above: "Idea that I have is to have the a rectangle subdivided into 7 columns with thin lines. Then each day can be in a column with Day of week, in game icon to represent the predicted weather state, low temp, high temp." Unless I hear differently, I'm assuming the 'squares' should be the same size we see in-game now...

Yes, indeed. It's basically the same thing as the forecast in FS15 :)

I believe me I am just looking through all code making notes so I can get a readable road map for myself haha, I can probably do the forecast overlay we should be able to pull the default weather hud images "dataS2\menu\hud" , "hud_cloudy.dds" "hud_fog.dds" "hud_hail.dds" "hud_rain.dds" "hud_sun.dds" and then just a background.dds through some text in for each day shouldn't be to hard but its up to you, I will admit I am not that good with hud backgounds lol.

Its still completely akuenzi if he doesn't mind doing hud then I am all for it as it saves me a job a will look at some other things start doing some problem solving haha.

You did alright with the one in your mod. hahaha. Let me get organised, guys, and start creating more issues and projects and stuff. I didn't expect all of you to jump straight in. Don't forget you can always create your own issue to show what you're working on and use the labels. If you're stuck, for example, tag the question label and so forth.

@akuenzi
Copy link
Contributor

akuenzi commented Nov 8, 2016

On the hud -- I'm leaving a PM with FSModding_Gary right now on FS-UK to see if he'd be willing to create one. With his talents, I can't imagine something like this would be difficult... and if it frees someone up for the coding, then that would be a good thing. :)

@ian898
Copy link
Contributor

ian898 commented Nov 8, 2016

Seb its an awesome mod of course we are all going to jump in lol, I am still trying to get used to using github again haven't used it for ages lol, As far as animals food rates and all that its really easy to modify there values for example:

g_currentMission.husbandries.cow.animalDesc.foodPerDay
g_currentMission.husbandries.cow.animalDesc.waterPerDay
g_currentMission.husbandries.cow.animalDesc.strawPerDay

akuenzi exactly what I was thinking lol if he doesn't want to or doesnt have time or whatever I am happy to do it but like I say it will free me up to do some other stuff.

@akuenzi
Copy link
Contributor

akuenzi commented Nov 8, 2016

Yipee! Gary agreed to help with this... though I do know he's pretty strapped for time with real life work at the moment (as am I). But he did ask for some additional information:

  1. "all i need to know is what images you require and how you need them, like the weather symbols all in 1 image / Separate images, Background hud etc.."
  2. "...and Sizes of them, 64x64 or if you want them all on one image maybe 256x256"

I'm happy to continue working with him on creating this. I basically gave him what Seb mentioned above:

Idea that I have is to have the a rectangle subdivided into 7 columns with thin lines. Then each day can be in a column with Day of week, in game icon to represent the predicted weather state, low temp, high temp.
I also encouraged him to build it so that it "looked" seamless with the game, as if it was made by the GIANTS developers themselves... and just forgot to put it in. ;)

What I'll do is run through the game and make screen prints for the existing icons: sunshine, rain, hail, cloudy, etc. I'll also have him make a new one for snow. With all the talent I see roaming over this github now, it's just a matter of time before one of you figures out how to make snow fall! :) Are there any other weather-related icons we should have him build while he's at it? In addition, on the icon sizing, I don't know anything about that. I'll have him run with what he's proposed, unless someone objects.

@theSeb1979
Copy link
Member Author

I wonder if it's not possible to use the ingame icons that display the weather and weather change in the top right, like Ian was suggesting? But, if we have somebody keen to help us, then we might as well also get all the weather icons as well as a snow icon and icons to represent each season. I would think individual files would be better than just one.

@joskuijpers
Copy link
Member

I think we should keep with current game icons, but add icons for each season. (In the style of the current icons)

On 08 Nov 2016, at 22:16, theSeb1979 notifications@github.com wrote:

I wonder if it's not possible to use the ingame icons that display the weather and weather change in the top right, like Ian was suggesting? But, if we have somebody keen to help us, then we might as well also get all the weather icons as well as a snow icon and icons to represent each season. I would think individual files would be better than just one.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub #12 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AEyN0AWBkPYdtQjb39jcIX475A_gwRpKks5q8OaYgaJpZM4Krk9k.

@ian898
Copy link
Contributor

ian898 commented Nov 8, 2016

I have all the original files weather icons for FS15 I dont even no If they were changed in FS17 I haven't really paid much attention lol.

@akuenzi
Copy link
Contributor

akuenzi commented Nov 8, 2016

@ian898

I have all the original files weather icons for FS15 I dont even no If they were changed in FS17 I haven't really paid much attention lol.

Here I'll put my ignorance on display. How do you get these icons? I know they must be buried in the data somewhere, but I don't think they are readily available... at least not to someone of my limited skills. I was just making some now by doing screen prints in-game. I'm cropping them to get down to the icons that appear in the upper right hand corner so that Gary has material to work with... but is there a better way to get these, so that they are the best possible quality?

@akuenzi
Copy link
Contributor

akuenzi commented Nov 8, 2016

@ian898
From a quick comparison to the screenshots I took in-game, it appears the huds have not changed between FS '15 and '17. I'll talk to Gary about that when I send him my cropped screen prints, which are below:
big-cloud
big-cloud_little-sun
big-hail
big-rain
big-sun_little-cloud
little-cloud
little-hail
little-rain

Okay, another question. Where in the world have you guys been hiding all this time?! I could have been learning from all of you on FS-UK this whole time, lol...

@akuenzi
Copy link
Contributor

akuenzi commented Nov 8, 2016

@joskuijpers

I think we should keep with current game icons, but add icons for each season. (In the style of the current icons)

Could you please elaborate on this a bit. What do you mean by adding icons for 'each season.' Are you meaning that the 'sunshine' icon, for example, would appear differently depending on if it happens to be summer versus winter?

Otherwise, in addition to the above icons, I was going to ask him to make one for snow... but that might be all we need, unless someone can dream up some other distinct kind of weather. What are we going to think of next, designing a tornado to come through the farm? :)

@joskuijpers
Copy link
Member

I suggest you remove this, because it is probably illegal.

On 08 Nov 2016, at 22:52, ian898 notifications@github.com wrote:

I cant remember now I think some gave me a link ages ago.

FS15 DataS2
https://www.dropbox.com/s/8pzoxectnu71dly/dataS2.zip?dl=0 https://www.dropbox.com/s/8pzoxectnu71dly/dataS2.zip?dl=0

You are receiving this because you commented.
Reply to this email directly, view it on GitHub #12 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AEyN0E8qQaBFnwE-zvcdeBrgZChgsTUoks5q8O8MgaJpZM4Krk9k.

@ian898
Copy link
Contributor

ian898 commented Nov 8, 2016

Well believe it or not i have been around since 2008 but only just recently start messing around with Lua, before now its just been i3d, xml and just fixing other peoples mods. But i agree i have reached the limit of what i can teach myself so discussing things with you guys is helping me leaps and bounds i have also been talking to Xentro a fair bit lately lol

@ian898
Copy link
Contributor

ian898 commented Nov 8, 2016

Your probably not wrong but i could pull files from the game if i had the time so technically its no different they and its also not like we are using them else were as i guess that would be full on copyright.

@joskuijpers
Copy link
Member

No but you just put DRMd files openly on the internet, so just remove them from your dropbox. Just to be sure.

On 08 Nov 2016, at 23:13, ian898 notifications@github.com wrote:

Your probably not wrong but i could pull files from the game if i had the time so technically its no different they and its also not like we are using them else were as i guess that would be full on copyright.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub #12 (comment), or mute the thread https://github.com/notifications/unsubscribe-auth/AEyN0I625fh8YO0Idc5sfUgkfdTwoYfKks5q8PQZgaJpZM4Krk9k.

@ian898
Copy link
Contributor

ian898 commented Nov 8, 2016

I have removed them but you can find them all over youtube lol

@akuenzi
Copy link
Contributor

akuenzi commented Nov 8, 2016

i could pull files from the game if i had the time so technically its no different

I don't know how to do this... but given that this is true, does that mean they are then 'okay' to use in creating mods? If I shouldn't forward them to Gary, then I won't.

@joskuijpers
Copy link
Member

Could you please elaborate on this a bit. What do you mean by adding icons for 'each season.' Are you meaning that the 'sunshine' icon, for example, would appear differently depending on if it happens to be summer versus winter?

No, just an extra icon that shows the season. So some sun (summer), a leaf (autumn), a snowflake (winter), a flower (spring) or so. A visual indication. Is nicer than text.

Otherwise, in addition to the above icons, I was going to ask him to make one for snow... but that might be all we need, unless someone can dream up some other distinct kind of weather. What are we going to think of next, designing a tornado to come through the farm? :)

Isn't there one for snow? The one with the dots?

@akuenzi
Copy link
Contributor

akuenzi commented Nov 8, 2016

@joskuijpers

No, just an extra icon that shows the season. So some sun (summer), a leaf (autumn), a snowflake (winter), a flower (spring) or so. A visual indication. Is nicer than text.

Okay -- I see what you mean. I'll add that to the list. :)

Isn't there one for snow? The one with the dots?

No, I think that one is for hail. So far as I'm aware, I've never seen snow fall in game -- only rain or hail. So, I'm assuming he could make a hud for snow by adding a snowflake or something. Makes me wonder if it wouldn't be all that hard to make snow fall in-game... but getting it to "stick" and "pile up" on the ground is another thing entirely! :)

@ian898
Copy link
Contributor

ian898 commented Nov 8, 2016

I think we should let you or gary create your own we can always choose to change them at a later date.

I also agree with different season icons ect, my misses plays the sims 3 a fair bit lol and they have a dark leaf for autum and snow flake for winter and sun for summer and a nice green leaf for spring.

@akuenzi
Copy link
Contributor

akuenzi commented Nov 8, 2016

One more question: Would it be worth it to ask the GIANTS themselves (assuming someone has a contact there) about using their weather icons? I'm sure they are well aware that their files have been opened on this, and that they are available on places like YouTube, as ian898 mentioned above. It'd be respectful, at the very least, and the worst that could happen is that they'd say 'no,' which they likely will do.

On the other hand, is it a simple matter to access these files through coding anyway? I've seen many instances referring to this data2 file in xml files, so maybe in our weather stuff that's how we access these huds anyway... so maybe permission isn't needed from that perspective.

Again, just don't want to get anyone in trouble.

Here's an example pulled at random from the Deutz AgroStar 661 xml file (for the icon):

< wheelConfiguration name="$l10n_configuration_valueTwinWheelsBack" price="800" icon="$dataS2/menu/hud/configurations/config_wheel_twin.png" >

If it's this easy to reference the $dataS2 info... then maybe we can do that with the weather mod, and have Gary just create the stuff we don't have?

@ian898
Copy link
Contributor

ian898 commented Nov 10, 2016

fsscreen_2016_11_10_20_03_11 - copy

@akuenzi
Copy link
Contributor

akuenzi commented Nov 10, 2016

@ian898
Nice! Well... what does everyone think?

@ian898
Copy link
Contributor

ian898 commented Nov 10, 2016

I am a bit uncertain both sets are good, My personal opinion we should set it up so the user can choose.

@akuenzi
Copy link
Contributor

akuenzi commented Nov 10, 2016

The only icon I wonder about (to my non-artist eyes), is the Autumn icon. It looks awesome by itself, but definitely a bit different when it's embedded as you show above. Wouldn't have a clue what it might need, though... and it might also be just fine.

Pardon my ignorance, but are these threads completely open to the public? If so, maybe I'll just send Gary a link, and he can see how it looks, and he might have additional suggestions.

@ian898
Copy link
Contributor

ian898 commented Nov 10, 2016

Yes anybody can see these threads. :)

I know what you mean but i think it all depends on your screen size also.

@garyh2012
Copy link

garyh2012 commented Nov 10, 2016

The attached image From @ian898 looks funny Because your Scaling them Down alot, if you need smaller Images, i can make them, they will look much more Crisp and Clear if we make them Almost to the Sizes You Require Them and again thankyou all for the Invite to help..

@ian898
Copy link
Contributor

ian898 commented Nov 10, 2016

I think we should really be thanking you, Yes they are very small in game I would say try 32x32 maybe 64 but in this case I think 32 would be fitting but your the true artist not me lol.

@garyh2012
Copy link

garyh2012 commented Nov 10, 2016

No problem, i will get to work on them ASAP, ill try 64 x 64 which is 4x smaller than the Originals, these should fit well.. ill recreate them as a vector First so when i scale down i wont loose any details it will just take me alittle longer.

Are you wanting the Coloured Versions for the Seasonal icon, or the Greyscale Ones ?

@reallogger
Copy link
Member

We cant differentiate between heavyness of rain (only the length). So what woul the icons do?
What we CAN do is show some number that indicates the mm of water that will fall. (Length of rain)

@joskuijpers Know we can't differentiate between "heavyness", but a partly sunny+rain icon could show exactly this. A day where it will be partly clouded, but rain can be experienced. An icon with a cloud and one blue line instead of three might indicate a day mostly clouded with a chance of showers.

@garyh2012
Copy link

garyh2012 commented Nov 10, 2016

An icon with a cloud and one blue line instead of three might indicate a day mostly clouded with a chance of showers.

Would be Easy Enough to Make if you require One, also would any One have any Objections to Me making some type of Logo for Mod ? or to use in any WIP topics?

Edited to Make it Clearer to understand, its been along day

@akuenzi
Copy link
Contributor

akuenzi commented Nov 10, 2016

also would any have any Objects to Me making some type of Logo for Mod ?

Gary -- that would be awesome! When all this got started, I was just trying to help someone in a post on FS-UK make a tiny script to accomplish an objective. In order to package it together, the mod demands an icon, of course, so I threw that ugly green one together (which I'm sure you saw in a post above). If you have time, by all means -- have at it. Even a two year old could improve on what I did. Never let an accountant touch something related to artwork! 😝

@garyh2012
Copy link

Not 100 Finished Just need some thoughts, Shall i continue in this style, or Would you like it More towards the FS 17 Logo Styles ?
wipseason

@theSeb1979
Copy link
Member Author

Looks awesome. I quite like it, but I'll let others comment too. The hud looks absolutely amazing too. Some great stuff here.

@ian898
Copy link
Contributor

ian898 commented Nov 11, 2016

I agree with Seb this is all coming together nicely and Gary that looks amazing, but I am having a few issues as I said before I am new to Lua and I know I can get more out of the overlay class I just need to know how to implement it I have been searching for documentation but doesn't seem to be anything around. Ideally I wand to use something like this.

This is what Xentro said to me about Livestock Manager Hud but here I am not sure how to implement it.

This is the way you should be loading your hud element and you feed your position and size into the getNormalizedScreenValues() function.

local x, y = getNormalizedScreenValues(x, y);
local width, height = getNormalizedScreenValues(width, height);
self.overlay = Overlay:new(self, name, filename, x, y, width, height);

This is however only step 1, next is the rendering part which you do like this
self.overlay:render();

and lasty we want to clean up after us in the delete function with this
self.overlay:delete();

I think I am just going to push changes and If anyone else knows how to do the above they can have at it and then I can also learn from my mistakes here.

Edit: Actually I might be on to something just looking through a few new mods and I think I might be getting somewhere lol

@garyh2012
Copy link

garyh2012 commented Nov 11, 2016

After Looking at the Huds you guys have put together, it got me thinking of a Simplified Version, im no scripter and Dont know how Hard it would be to implement this as an Addition, so we can toggle between your Hud and the Simplified Version which i have a quick Photoshop Job..

simplified hud

Here i just tacked onto the left of the Original Hud making it Look Very Natural, Like it was always part of the game..

@joskuijpers
Copy link
Member

I actually think that is pretty nice:)

Ian, if you have concrete questions you can ask me.

On Nov 11, 2016, at 9:39 AM, garyh2012 notifications@github.com wrote:

After Looking at the Huds you guys have put together, it got me thinking of a Simplified Version, im no scripter and Dont know how Hard it would be to implement this as an Addition, so we can toggle between your Hud and the Simplified Version which i have a quick Photoshop Job..


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@ian898
Copy link
Contributor

ian898 commented Nov 11, 2016

@joskuijpers
I will sync up so you can see the original code I used for sample its ok if everyone was using screen resolution of 1920x1080 but use anything else and placement is screwed so I have been messing around with g_screenAspectRatio, g_uiScale ect to get screen size to basically place it on the screen but if think i am just grasping at straws tbh

@ian898
Copy link
Contributor

ian898 commented Nov 11, 2016

Its up there now, excuse my code its shocking compared with yours and Sebs haha

@joskuijpers
Copy link
Member

All right I'll take a look but I dont have a computer till at least 3 hours from now (and it doesnt run FS yet).

What you might do best is use branches. Make your own 'branch' and work in that, then you never have merging ('sync') problems.
Then I can update your branch with the latest code from the others when you want me to (when you have no chanes on your side anymore). That way you can also not accidentally break stuff ;) Is that a good idea?

On Nov 11, 2016, at 12:10 PM, ian898 notifications@github.com wrote:

Its up there now, excuse my code its shocking haha


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@joskuijpers
Copy link
Member

I looked at your code and it doesn't look bad at all ;) I don't know the APIs yet so I'll do that later today.

My resource for 'good code' is de SoilMod, it is on github as well. They also display something, take a look at that ;)

On Nov 11, 2016, at 12:10 PM, ian898 notifications@github.com wrote:

Its up there now, excuse my code its shocking haha


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@ian898
Copy link
Contributor

ian898 commented Nov 11, 2016

I did think about creating a branch but the I just created it in another mod which has lots of console commands for shifting positions in game once I am happy with layout I have a console command to out put the renderOverlay strings. which I just pop in the latest code so nothing gets broken.

But I will use branches for bigger parts of code in the future thats not a problem.

@ian898
Copy link
Contributor

ian898 commented Nov 11, 2016

After taking a look a the soil mod overlay I have used something similar to it, Its just the initial placement of the hud itself I am struggling with.

@theSeb1979
Copy link
Member Author

Looks good and I like the idea of the small hud. I just hope you didn't lose my bug fixes in weatherforecast..lua :)

@ian898
Copy link
Contributor

ian898 commented Nov 11, 2016

I synced github 3 minutes before updating lol, so the only way anything would get lost is anythin that was submitted in those 3 minutes lol. I like the idea of the smaller hud I am just banging my head on a wall with the bigger one first lol

Edit: You had me worried then and got me checking, but you alright everything synced perfectly.

@ian898
Copy link
Contributor

ian898 commented Nov 11, 2016

So I think I have fixed placement.

@ian898
Copy link
Contributor

ian898 commented Nov 11, 2016

We should also see if we can move the the income/expenses text down when hud is active forgot to mention that before.

@garyh2012
Copy link

season

As requested !! 📟

@joskuijpers joskuijpers modified the milestone: v1 Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants