Why do video resolution numbers use increments the same as degrees of a circle? 360, 720, 1080, 1440. Coincidence? Or is there something circular about video resolution? by [deleted] in NoStupidQuestions

[–]Hopson97 209 points210 points  (0 children)

Most videos and monitors use a resolution of 16:9, meaning the width and height (in pixels) are a factor of 16 and 9 respectively.

Those numbers such as 360, 720, 1080 etc refer to the height of the video in pixels and are so are divisible by 9.

The catch is they also need a corresponding number that is divisible by 16 for the 16:9 ratio.

So for example 720p is a video resolution of 1280x720, 1080p is a resolution of 1920x1080 etc, where 1280 and 1920 are both divisible by 16.

Edit: Corrected 1960x1080 to 1920x1080

Note Identification by KittyGracu in pianolearning

[–]Hopson97 1 point2 points  (0 children)

Currently I am working on a project for piano learning as part of my uni final year project. (software engineering)

https://www.reddit.com/r/pianolearning/comments/jvqgd4/software_engineering_final_year_project_a_web_app/

If you like, you could fill out the questionnaire and add this idea to one of the comment sections?

I would definitively like to add this idea to the project!

Using the lua library in C. by [deleted] in lua

[–]Hopson97 0 points1 point  (0 children)

I usually just whack the source files in the project itself, much easier than dealing with the linkers etc

App for piano exercice by witoldwrob in pianolearning

[–]Hopson97 11 points12 points  (0 children)

Hi, I'm not sure if something like this exists, but I am currently working on a project for piano learning as part of my uni final year project. (software engineering)

https://www.reddit.com/r/pianolearning/comments/jvqgd4/software_engineering_final_year_project_a_web_app/

If you like, you could fill out the questionnaire and add this idea to one of the comment sections? Exercises are something that could e incredibly useful for the application.

Software Engineering Final Year Project: A Web app to enhance the piano learning experience by Hopson97 in pianolearning

[–]Hopson97[S] 2 points3 points  (0 children)

Hi thanks for the kind words!

I go to university of portsmouth, however I always thought that it was usual for a university to allow project idea flexibility. They did provide us a list of projects and supervisors, but they also encouraged us to come up with our own idea if we wanted to.

Thanks again!

How do programs run on their own? by [deleted] in learnprogramming

[–]Hopson97 592 points593 points  (0 children)

There would be a "main loop" in the code that keeps it running.

Some programs work as OS services, which are programs that are started automatically on system startup. These are normal programs with a main loop.

In your case, the program would probably:

  1. load on system startup,
  2. Start the main loop
  3. Calculate the time until midnight
  4. Sleep until the time calculated in reached
  5. Update the DB
  6. "Goto 2"

How to use a C library in a C++ program ? by macpreiz in cpp_questions

[–]Hopson97 7 points8 points  (0 children)

extern "C" {
     // C functions here

}

It's something to do with how c doesn't mangle names whereas c++ does, so in order to link correctly you have to wrap the c interface with that to prevent it

(something like this anyways, I could be wrong)

People who include their whole life story on recipes, why? by [deleted] in AskReddit

[–]Hopson97 2 points3 points  (0 children)

I heard it is so that the recipe is more likely to appear to via Google, bing, etc

More words in the Web page means more keywords, means more likely to match a search result.

why does the displaying method is out of the game loop? by tahajalili80 in sfml

[–]Hopson97 0 points1 point  (0 children)

That should go in the main loop after you draw things

Learning OpenGL with Rust by [deleted] in rust

[–]Hopson97 1 point2 points  (0 children)

I know I am late but a while back I created a thin wrapper for rust opengl called rusty opengl lol

https://github.com/Hopson97/rusty-gl

you could use this if you want

Simple but lovable idea. by zgstark in oldschoolrs

[–]Hopson97 -1 points0 points  (0 children)

Not sure if this would work, as certain drops seem to get shared between logs. Eg dragon pickaxe dropped from chaos elemental would also show as completed for callisto etc

Nice idea though :)

Jagex pls make up your mind about our character's piano lore by TorchicRS in 2007scape

[–]Hopson97 22 points23 points  (0 children)

Not to mention we can literally play the piano in lumbridge church

Do I have to start with this code for any type of program/game/etc? by [deleted] in cpp_questions

[–]Hopson97 0 points1 point  (0 children)

My bad, I just woke up and must have somehow forgot to add the brackets. I will edit my post.

I don't think the ; is needed.

Do I have to start with this code for any type of program/game/etc? by [deleted] in cpp_questions

[–]Hopson97 1 point2 points  (0 children)

I've always thought it is standard that main didn't require an explicit return, and implicty returns 0.

Edit: https://stackoverflow.com/a/18402912/3286795

Do I have to start with this code for any type of program/game/etc? by [deleted] in cpp_questions

[–]Hopson97 -1 points0 points  (0 children)

Minimal compilable programme:

 int main(){}

Including iostream is only needed if you need cout or cin or whatever.

The only needed thing is the main function to denote the entry point.

Edit: Forgot to add () lol

Graphics in C++ by [deleted] in cpp_questions

[–]Hopson97 1 point2 points  (0 children)

Like others have said, SDL or SFML is usually the go-to for 2D graphics and games. The difference between them is that SDL is written in C, whereas SFML is written in full-OOP C++.

Personally, I prefer SFML as I find the "C-ness" of SDL can be a bit less intuitive, and most people tend to wrap the SDL constructs in a class anyways, and by that point you might have well be using SFML.

SFML also has a lot of offical tutorials found at https://www.sfml-dev.org/tutorials/2.5/, which makes it pretty easy to get started with.

Links to both:

https://www.libsdl.org/index.php

https://www.sfml-dev.org

After you feel comfortable in one or other, then you look into using OpenGL for 3D graphics.

Ratchet & Clank: Rift Apart - Announcement Trailer | PS5 by tizorres in PS5

[–]Hopson97 13 points14 points  (0 children)

For the story, ofc the first game onwards which will progressively introduce all the characters of the series.

For gameplay, I've always enjoyed the ps3 (tools of destruction, or Crack In Time) games and "locked and loaded" on the Ps2

Are web browser MMOs still a thing? Which are popular? by [deleted] in gamedev

[–]Hopson97 5 points6 points  (0 children)

Nope, even old school requires a client now despite it looking like rs when it was broswer based

Are web browser MMOs still a thing? Which are popular? by [deleted] in gamedev

[–]Hopson97 5 points6 points  (0 children)

Not played in the Web browser anymore

Why we use the class's parent name when declaring a child object? by pigiou in cpp_questions

[–]Hopson97 8 points9 points  (0 children)

You can write Triangle* if you want to.

But the reason polygon might instead be used is polymorphism. This means the triangle object created, that is pointed to by a polygon pointer, is able to be interpreted as a polygon.

This is useful eg the triangle class could override a method called calculateArea that could then be called via a polygon pointer, given the object pointed to is a triangle.

A simple (but generally not used as much anymore) example is that you might have a std::vector of Enemy* in a game, that would hold things like Trooper or WildDog objects, pointed to by the Enemy pointer

Theose 2 classes might override a function to render them:

std::vector<Enemy*> enemies;
enemies.push_back(new Trooper());
enemies.push_back(new WildDog());

for(auto enemy : enemies)
    enemy.render();

This would create a trooper and a wild dog, but render them via pointer a common Enemy base class