Next Broadcast

Table Top RPG Weather Forecasting

Blue Hawk Code and Eng DK30 Quarantine 2020 1 3

Description

The aim of the project is to produces an automated system to generate a weather forecast for my D&D game, mainly because I don’t like having to make it up whenever a player asks. After receiving recommendations the project is going to be done in Python. I’ve not done meaningful coding before so it’ll be an interesting learning experience.

Recent Updates

Blue Hawk 6 years ago

Update 7,

Turns out getting RimWorld was terrible for my productivity.

Still, I plan to continue the project on and expand the scope of what it can do. The current program does what I set out to do, minus any user interface. And the codes will allow easy additions for different biomes that might come up in my D&D game, so overall a success I feel.

Blue Hawk 6 years ago

Update 6 addendum,

I change the program I was using to write the program, I’m not using Atom which is much more friendly on the eyes, I’m also using the Anaconda prompt to run the program.

Blue Hawk 6 years ago

Update 6,

So I managed to complete the week two goal, which is great.

I have set the program logic up in classes. This means that there is a central logic class that selects weathers and the amount of day the weather will last for. There is then additional classes which will contain the unique weathers lists for any given area, in this case temperate. The practical upshot of this is that I can add different climates as classes without having to copy the logic again and again.

Having a central class that other classes inherit from also allows unique weather systems to be made. What these might be I don’t know. Maybe it’ll be winds in a desert will allow a sandstorm to come along, or a hurricane in an ocean.

All in all I’m about a week in front on my project main goals. This will allow me to begin working on a user interface. I expect this to be a bit of a stumbling block, while I knew a small amount about logic for programing before starting this project I have no idea how to transfer this knowledge to making a user interface.

Blue Hawk 6 years ago

Update 5,

A few days have passed since the last update. Progress has been made. I implemented the sub list idea from update 4.

One difficulty was figuring out how to get the program to take the amount of days left in the sub list and generate a new result for each of those days.

This was solved by using a while loop. While the amount of days is above one randomly choose a new result from the sub list, then decrease the value of the amount of days by one. This produces a result as seen below.

![(https://imgur.com/5iFMJ8x)]

Now, under the advice from a friend who is assisting me by answering my (probably very simple) questions, I am trying to set the logic up as a class to make future modifications easier as well as making the future aspects of the DK30 easier.

Blue Hawk 6 years ago

Update 4.

This includes an image of how the code is currently structured.

[https://imgur.com/A4N7zbf]

I’m already thinking of changing how the system works. Having a hierarchy of different lists to generate the weather from. Say, have three weather types (rain, cloud, sunny) which then inform the next list to use.

For an example, if ‘sunny’ is picked the next list that is used contains [‘moderate cloud cover’, ‘light cloud cover’, ‘sparce cloud cover’, ‘clear skies’]. This idea came up in a discussion with one of my D&D players where the idea of having one long list containing all types of weathers doesn’t make much sense.

Where would you put hail on the list? It’s a weather type that occurs infrequently when it rains and usually only for short periods of time. So would it go between light rain and heavy rain or does it go between heavy rain and stormy?

I think it makes more sense to use the sub-list idea rather than having one universal list. This is probably more work but hopefully it’ll make a better end product.

Blue Hawk 6 years ago

Update 3.

This is an image of the flow chart for how I think the logic will work.

[https://imgur.com/Iu2mNQg]

Blue Hawk 6 years ago

Update 2.

This is a bit overdue. This update is an image of how I think the logic should work.

[https://imgur.com/4COOHLZ]

Maybe this worked, maybe it didn’t. Updates are going to be a pain if I can’t put screen grab or images of my notes in.

Blue Hawk 6 years ago

Update 1.

I think I’ve sorted out how the logic is going to work for the program. I’ll try and add a photo of the flow diagram I’ve done in the next update.

In terms that I’ve figured it out.

  1. The program will generate a random number (No. A) and use that to pull a result from the list of weathers.
  2. The program will then generate a second number (No. 2), this will be the amount of days that the weather lasts for.
  3. For each integer that makes up No. 2 a new number is generated (No. 3a though to end).
  4. For values within a range the weather stays the same on each day, for values outside of that range a new weather is taken from the list of weathers at -1 or +1 on the list depending.
  5. If a new weather is generated the program will ignore any remaining integers in No. 2 and generate a new value for No. 2.
  6. Step 4 and 5 are then repeated until no new weathers are generated.

Hopefully this will produce a more dynamic change in weather rather than flipping between clear skies and heavy rain (which while does happen it isn’t something that should be happening all this time).

If this makes sense to anyone who might read it, great. If not, hopefully adding the flow diagram will help.

Estimated Timeframe

Apr 24th - May 23rd

Week 1 Goal

Week one will be spent figuring out how to transfer a series of rollable tables I’ve made into a programme. Initial research shows me that I’ll be dealing with lists and random number generation, so I’ll need to figure out how to generate a result from one list and use that result to inform the next list to be used. I plan on sticking to weather from a temperate zone for now.

Week 2 Goal

Probably a continuation of the previous week, I’m not sure on time scales given the lack of experience around the topic. If all is going well I’ll expand to allowing different weathers to form the list via an input from a user of the programme.

Week 3 Goal

This week will hopefully be expanding out to allow unique weather formations and climate types to be used. If the progress is going well I’ll start looking into developing a simple user interface, though this will predominantly be research into how to implement something.

Week 4 Goal

Maybe working on the user interface, maybe still figuring out the tasks from week one. Who knows. I want to be able to understand why the code works and this could take alot of time.

Tags

  • Coding
  • Python
  • RPG
  • D&D