One of the current assignments is to create a PHP website that can browser televisions, with functions for adding and removing televisions. This should be helpful for improving my abilities with MySQL databases.
While searching for useful functions, I looked into SQL injections and how to prevent them, since they pose a danger to databases. This lead me to prepared statements, which sends the queries and specified values separately. Making sure to use these when necessary will prove to be important for my own project.
One of the most difficult things to add to the assignment was the function to delete database entries. Not because of deleting the database entry itself, but the image linked to it. The images are linked to the database by a filepath, allowing for easy access to the stored image. However, I'm not entirely sure on the best method to access a single value from a single row of a database yet. I got around the issue by using the same method of pulling data used to fill out tables containing the database information, but I feel there has to be a more efficient method available.
After a short period, I got tired of having to update the navigation links in every PHP file whenever I added a new page to a website. The solution I found was to use the include PHP function to add another PHP file containing only the code used in the header. Using these kinds of templates in my own project could prove to be very helpful and efficient.
Friday, 7 December 2018
Saturday, 1 December 2018
Project Update: A Couple Thoughts
Now that the theory assignments are out of the way, I should be able to better focus on the project.
While I started by assuming that most of the coding would be PHP, many features, such as a rating system, may require more JavaScript than previously thought. As such, the Mozilla Developer Community may prove more useful than I had previously considered.
In the last theory assignment, the concept of user accounts came up, and I managed to find a web page that described how such systems work in basic terms, although little in the way of actual coding. The concept of salting and hashing passwords did come up, and should be looked into further to follow basic security principles on the site, along with figuring out PHP sessions.
One idea I had came to me, looking at Steam's workshop URLs. Each file page there ends with the pattern '?id=123456789', a format which is generally added to the URL by a GET request. With this idea, creating individual pages for articles on the website could be unnecessary, as a 'template' page can be created instead, using a GET request to pull needed information from a database.
While I started by assuming that most of the coding would be PHP, many features, such as a rating system, may require more JavaScript than previously thought. As such, the Mozilla Developer Community may prove more useful than I had previously considered.
In the last theory assignment, the concept of user accounts came up, and I managed to find a web page that described how such systems work in basic terms, although little in the way of actual coding. The concept of salting and hashing passwords did come up, and should be looked into further to follow basic security principles on the site, along with figuring out PHP sessions.
One idea I had came to me, looking at Steam's workshop URLs. Each file page there ends with the pattern '?id=123456789', a format which is generally added to the URL by a GET request. With this idea, creating individual pages for articles on the website could be unnecessary, as a 'template' page can be created instead, using a GET request to pull needed information from a database.
Thursday, 15 November 2018
Project Update: Presentation
Currently, I am working on the presentation for the project. With the deadline coming up on it, it takes priority over other aspects of the project. I am also trying to learn more PHP, but with the assignments that are already handed out, I find myself lacking the time to do so.
Currently, the resource I have for learning PHP is W3Schools. While I am not entirely certain on just using this site for learning PHP, I have not had time to search for alternative sources, and the Mozilla Developer Network does not cover PHP. The MDN may still prove useful to me, in making sure any HTML, CSS or JavaScript code I produce is to a high standard.
Currently, the resource I have for learning PHP is W3Schools. While I am not entirely certain on just using this site for learning PHP, I have not had time to search for alternative sources, and the Mozilla Developer Network does not cover PHP. The MDN may still prove useful to me, in making sure any HTML, CSS or JavaScript code I produce is to a high standard.
Thursday, 11 October 2018
HND Computing Project Ideas
Top Down 3D Exploration Game
A simple game where the player explores a map to find items and defeat monsters. Basic mechanics include combat, inventory and a randomly generated map. Could be rogue-like in nature, with no real goal besides get as far and as much as you can.Fits into the standard rogue-like genre and would pull from a similar player base, which is admittedly niche. This project would provide experience with games design software, specifically Unity, along with 3D modelling software, which could be beneficial to have.
Since my PC at home has a considerably weak CPU, meaning I would only be able to work on it within college. That, combined with my distaste of 3D modelling from previous experience, leads me to oppose pursuing this idea
Browser based murder mystery
A text adventure browser based game where the user has to solve a crime. Would use an input region to accept commands and solve puzzles.This type of game would appeal to those who enjoy adventure games, particularly the text-based games from the eighties. It could also find a player base in those who enjoy story-based games, such as visual novels or role playing games.
Idea was inspired by the Game Maker’s Toolkit episode ‘What makes a good detective game?’ which mentions the idea of using a text input to solve a puzzle. I also enjoy the experience of unravelling the story piece by piece, so the concept has appeal to me as well.
The concept itself could conceivably be achieved using JavaScript, although PHP could allow for some supplementary features. Since this kind of project could feasibly be made in a static web page, I don't think I could reasonably use it for the HND project.
Browser based city management sim
A game where the user has to manage a city by choosing policies for buildings and projects to work on. A balance of budgeting, civilian happiness and other miscellaneous factors is needed in order to avoid a game over.The core idea of the game resonates mostly with players of strategy and simulation games, although it is possible to orient the idea towards a more casual audience.
The concept is partially based on Cookie Clicker, and could give me something to play if I get bored.
Similar to the previous game project, this could be made using just HTML and JavaScript with a static web page, offering little in the way of HND level skills.
Java based game
Instead of making the previously mentioned games in a browser or Unity, make them in Java instead.In the case of the Unity project, this would almost certainly mean removing the 3D aspect of the game.
This would replace the reliance on having a powerful PC with Unity or an external web server with PHP. Instead, this is replaced with having to learn Java, a flexible if complex programming language.
The same reasoning for the individual game concepts still apply for making them in Java, but also includes being able to develop skills with Java. Programming is something I have a profound interest in from previous years in the HNC Computing and BTEC Games Design courses.
The main plan would be the city management sim. This provides a balance of code requiring drawing a windowed GUI and the actual game, without requiring too much in the way of art assets. The text adventure works as a decent back-up. The game itself may not get less complex, but technically it would run from the Java console, eliminating the need for graphics code and the subsequent art assets.
While I personally find it a bit of a shame, I am planning to use the next idea as it has a simpler concept and resulting building blocks compared to developing a Java game.
User submitted articles with editor approval
A registered user could submit articles for news or other topics. A moderation account, called an editor, reviews the articles and can approve or deny them. The concept could include a rating system to allow for finding high quality articles, or even to shift the burden of approving articles to the user.The concept shares a lot in common with Reddit, although this concept would remain on-site with more of a focus on long-form text content, instead of linking simple images and videos from external sites.
This idea would appeal to people who are concerned with the current state of news and put it in their own hands, although it could result in the same issues eventually anyway. It may also be appealing to independent and novice journalists looking to get their name out there.
While article 11 of the European Union’s recent copyright directive could cause some concern, it includes exceptions for private, non-commercial projects.
The concept would require extensive PHP to dynamically create and update a database of headlines to display, along with a method of choosing the most relevant headlines depending on popularity and age. Fortunately, PHP training could be very valuable in the future.
As a backup plan, I could strip out the elements mirroring Reddit and create more of a blog site. The system would be comparatively less complex, and I would be able to keep the most important parts of the code and databases.
Subscribe to:
Posts (Atom)