My task

This was a project was part of a university module where we had to develop a site based off a brief. The brief I chose focussed on "Developing an online solution to something which is usually done offline". I chose to focus on Dungeons and dragons and developped a website which would allow the user to host a character sheet.

We were asked to look into exisitng competitions in order to find a brief to submit this project to. I found a few available tasks which were in the field I wanted to gain some experience in, web development. The best one I found, however, was one by w3awards.




One of the first things I did was look into existing ways of playig dungeons and dragons online. I discovered there are a few different ways, though the best free one I could discover is called roll20 After discovering this, I decided to contact some of my friends who I knew played and ask them some questions. I also put out a google form in order to get a few more responses than the limited amount I was able to get otherwise. Much of my information was sent in the format of messages back and forth.


I organised these into a table so that I could easily look through all the responses. The responses offered a wide variety of features that I could and should implement. I think If I were to continue with this project outside of the course/competition environment, I'd definetly attempt to incorporate most if not all of these into the web-app.

Starting to code.

One thing I wanted to have for this site was a way of users being able to log in to an account so they can easily access their sheet once they create it. This because excessively difficult and my time over-ran by quite a lot due to struggling with this, I was repeatedly running into the same problem. After a couple weeks I managed to allow users to register but not login, this was significantly thanks to this tutorial by codingcage. I decided it would be best to move onto something else so as to note waste any more time.

Dice (Number of sides)



I moved onto working on a dice rolling system and came up with an incredibly basi javascript way of doing it at first. (Just put in some numbers into the boxes.) You first put in the number of sides on a dice, then add whatever modifiers and your character's proficiency to it.

The character sheet

At this point I came back to my login struggles and with the help of my lecturer Steve I found out what my problem was, In my php file I had already declared a header and so attempting to redirect kept failing when you would login, with this solved I could move onto what turned out to be the biggest challenge of the project, the character sheet.

This was the biggest challenge for me as it seemed no matter what I did, I encountered some form of problem but after powering through I managed to get it done. The biggest of these challenges I faced was connecting one table in the database to another, then getting all the information to echo into the input fields on the sheet.
This was such a problem because every time I made progress I would almost immediately encounter another problem. This was very frustrating, but I think it also helped me to learn and develop my knowledge of php.
Once I got that working, I moved onto putting all of these together. I used javascript to calculate the modifier based off of what stat the user puts in, then applied the modifier and proficiency to my rolling code so that a user could click one button and roll a weapon attack.


Click here for download!
This will require you to set up a localhost and import the SQL file.