{"id":20733906,"url":"https://github.com/paul-maxime/r-type","last_synced_at":"2025-04-23T23:02:34.949Z","repository":{"id":84554316,"uuid":"69115531","full_name":"paul-maxime/r-type","owner":"paul-maxime","description":"A multiplayer shoot-em-up made in C++ using an entity-component-system. (2014)","archived":false,"fork":false,"pushed_at":"2016-09-24T17:18:54.000Z","size":21733,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T04:23:01.614Z","etag":null,"topics":["cpp","cpp11","entity-component-system","json","network","rtype","sfml","udp"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paul-maxime.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-24T16:58:35.000Z","updated_at":"2023-06-18T10:42:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"527001f1-3e1e-4045-974e-d065be5d6a3f","html_url":"https://github.com/paul-maxime/r-type","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paul-maxime%2Fr-type","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paul-maxime%2Fr-type/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paul-maxime%2Fr-type/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paul-maxime%2Fr-type/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paul-maxime","download_url":"https://codeload.github.com/paul-maxime/r-type/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250528731,"owners_count":21445516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp11","entity-component-system","json","network","rtype","sfml","udp"],"created_at":"2024-11-17T05:27:45.345Z","updated_at":"2025-04-23T23:02:34.929Z","avatar_url":"https://github.com/paul-maxime.png","language":"C++","readme":"# R-Type Project #\r\n\r\nThis is a small project (2 months) we did for our school in 2014.\r\n\r\nThe project is called R-Type, as an homage for the 1987 video game.\r\n\r\nYouTube video: https://www.youtube.com/watch?v=OkzBluc3uvA\r\n\r\n## Branches: ##\r\n\r\n+ master: Contains a stable and numbered version of the project.\r\n  Only working and fully-tested versions may be merged into master.\r\n\r\n+ develop: Main working branch.\r\n  Every new feature or bug fix should be merged into develop.\r\n\r\n## How does the Network work? ##\r\n\r\nWe have only one udp packet: UpdateEntities.\r\n\r\nUpdateEntities is sent between the server and the client and contains entities to update.\r\nThis packet is sent at a regular interval (to be defined, like 50-200ms).\r\nThe client is only allowed to update a few entities, like the inputs. The server will check that.\r\n\r\n### How is this possible ? How do we join and quit a room ?\r\n\r\nWhen the server receives the Update packet from an unknown sender, it adds the player to the room.\r\n\r\nWhen the server doesn't receive the Update packets for 5 seconds, it disconnects the player.\r\n\r\nThe room id is stored into the UpdateEntities packet, you can join the id you want.\r\n\r\n### How do I use the RFC ###\r\n\r\nThe RFC is currently in xml format. You can find the last version in the branch *conception*. To compile it to another format (including txt/html/pdf), use [http://xml.resource.org](xml.resource.org).\r\n\r\n## How does the ECS work? ##\r\n\r\nOur _Entity Component System_ is a simplified version of Unity's.\r\n\r\n+ The program core will load every component and every entity.\r\n\r\n+ The program core will execute every component of every entity at each frame.\r\n\r\n+ Components are loaded from dynamic libraries (.so, .dll).\r\n\r\n+ Components contain variables and functions.\r\n\r\n+ Components may overload update() and draw() functions.\r\n\r\n+ An entity is a json-like file and contains a list of components.\r\n\r\n### Entity example (BossEnnemy.json)\r\n```json\r\n    {\r\n\t  \"SpriteComponent\" :\r\n\t  {\r\n\t    \"x\" : 0,\r\n\t    \"y\" : 0,\r\n\t    \"image\" : \"assets/boss.png\"\r\n\t  },\r\n\t  \"MovementComponent\" : \"wave\",\r\n\t  \"MissileSpawnComponent\" :\r\n\t  {\r\n\t    \"type\" : \"BossMissile\",\r\n\t    \"minInterval\" : 400,\r\n\t    \"maxInterval\" : 800\r\n\t  },\r\n\t  \"LifeComponent\" :\r\n\t  {\r\n\t    \"life\" : 1000\r\n\t  }\r\n\t}\r\n```\r\n_This is an example and not a valid entity._\r\n\r\n### Component example (SpriteComponent.cpp)\r\n```c++\r\n\t  class SpriteComponent : public Component\r\n\t  {\r\n\t    public:\r\n\t      int x;\r\n\t      int y;\r\n\t      std::string image;\r\n\r\n\t      virtual void update()\r\n\t      {\r\n\t        // Empty, that function may be deleted.\r\n\t        // We may use the 'isLocal' boolean here.\r\n\t      }\r\n\t      virtual void draw()\r\n\t      {\r\n\t        // Will only be called client-side.\r\n\t        GraphicsEngine::draw(image, x, y);\r\n\t      }\r\n\t      virtual void serialize(Output\u0026 output)\r\n\t      {\r\n\t        // Will only be called server-side.\r\n\t        output \u003c\u003c x \u003c\u003c y;\r\n\t      }\r\n\t      virtual void unserialize(Input\u0026 input)\r\n\t      {\r\n\t        // Will only be called client-side.\r\n\t        // Note: we should extrapolate the values here in order to smooth the movement.\r\n\t       input \u003e\u003e x \u003e\u003e y;\r\n\t      }\r\n\t  };\r\n```\r\n_Again, this is a short example and not a working code._\r\n\r\n## Contributors: ##\r\n\r\n* Jean Fauquenot\r\n* Maxime Laffaire\r\n* Nicolas Vareille\r\n* Paul-Maxime Le Duc\r\n* Thibault Duval\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaul-maxime%2Fr-type","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaul-maxime%2Fr-type","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaul-maxime%2Fr-type/lists"}