{"author_link":"\/users\/biped-potato","author_name":"Biped Potato","author_uid":"biped-potato","comments":[],"epoch":1633305253,"event":"LD49","format":"md","ldjam_node_id":270013,"likes":3,"metadata":{"p_key":"160193","p_author":"Biped Potato","p_authorkey":"1258184","p_urlkey":"382688","p_title":"Making a game with my custom c++ and opengl game engine","p_cat":"LDJam ","p_event":"LD49","p_time":"1633305253","p_likes":"3","p_comments":"0","p_status":"WAYBACK","us_key":"1258184","us_name":"Biped Potato","us_username":"biped-potato","event_start":"1633046400","event_key":"119","event_name":"Ludum Dare 49"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD49","removed_author":false},"_superparent":258323,"_trust":1,"author":258184,"body":"Yes you read the title right and im going to show you the general architecture of my engine and the hacks i used during the jam to make a game that used such an UNSTABLE engine!\n\nhttps:\/\/ldjam.com\/events\/ludum-dare\/49\/unstaballz\n my game btw :)\n\n![Untitled.png](\/\/\/raw\/880\/f3\/z\/44416.png)\n\nmy engine was lacking numerous features:\n-particles\n-font rendering\n-physics\n-editor\n-scene loading\n-easy resource management\nand lots more some of which i created during the jam!\n\non top of that it had no web build support!\n\nmy engine operated similar to unity. a scene was composed of a vector of gameobjects. GameObjects had a vector of components in which all inherited from a base component class which had methods Built in such as Update draw and start. First the gameobjects were looped through and then their components were looped through and called methods appropriately.\n\nScene:\n\ngameobject | gameobject | gameobject\n\n\ncomp1 comp2 | comp1 comp3 | comp3 comp2\n\nGENERAL GAME ARCHITECTURE\nduring the jam i kept it simple choosing to make a simple endless game. It was still a pain though as my engine was so underdeveloped with scarcely a month of preparation. My idea was to make a basketball that unstably sprouted boosters that you had to modify to stay afloat. It was pretty simple to implement. \n\nPLAYER CODE\nI had a player class from which extended all the game logic. It had a vector of boosters which were themselves gameobjects because I lacked a parenting system i made the parenting system inside of the player class overwriting the positions of the boosters to extend outwards from the center of the player.\n![aaa.png](\/\/\/raw\/880\/f3\/z\/44431.png)\nthe boosters themselves were really just aesthetic because their behaviour was controlled inside the player class.\nphysics were just a cheap imitation of real world physics as i used some incredibly hacky physics code to constrain the player inside the boundaries.\n![asd.png](\/\/\/raw\/880\/f3\/z\/4443a.png)\n\nPARTICLES!\nI wrote a quick and hacky particle system during the jam. although hacky and quite limited it remained pretty solid and usable. A particlesystem component in which resided a vector of particle structs.\n![particlesystem.png](\/\/\/raw\/880\/f3\/z\/44455.png)\n![particle.png](\/\/\/raw\/880\/f3\/z\/4445b.png)\n\nGLOBALS\ni needed a way to access stuff from everywhere although considered bad programming practice due to my laziness and the general easiness of globals i stored a global value in which a function would give a pointer to the main camera and many other things this was the general design of the globals. \n![globalcam.png](\/\/\/raw\/880\/f3\/z\/44480.png)\npretty hacky and stupid but oh well.\n\nsome drawbacks of such an engine though is the unsolid parts. At one point i figured out that my windowing and mouse input were all broken! i spent half a day fixing it and was so exhausted i barely did anything else.despite all this and much more hacks i used the game remains performant and running and since i had so much control over these things i could modify easily anything i wasn't happy with. With my custom engine i had both the convenience of a simple gameobject and component system and the control of being able to modify ANYTHING!","comments":0,"created":"2021-10-03T23:23:50Z","files":[],"files-timestamp":0,"id":270013,"love":3,"love-timestamp":"2021-10-04T00:23:26Z","meta":[],"modified":"2021-10-04T00:23:26Z","name":"Making a game with my custom c++ and opengl game engine","node-timestamp":"2021-10-03T23:55:17Z","parent":261451,"parents":[1,5,9,258323,261451],"path":"\/events\/ludum-dare\/49\/unstaballz\/making-a-game-with-my-custom-c-and-opengl-game-engine","published":"2021-10-03T23:54:13Z","scope":"public","slug":"making-a-game-with-my-custom-c-and-opengl-game-engine","subsubtype":"","subtype":"","type":"post","version":818914},"node_metadata":{"n_key":"270013","n_urlkey":"382688","n_parent":"261451","n_path":"\/events\/ludum-dare\/49\/unstaballz\/making-a-game-with-my-custom-c-and-opengl-game-engine","n_slug":"making-a-game-with-my-custom-c-a","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"258184","n_created":"1633303430","n_modified":"1633307006","n_version":"818914","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/49\/unstaballz\/making-a-game-with-my-custom-c-and-opengl-game-engine","text":"Yes you read the title right and im going to show you the general architecture of my engine and the hacks i used during the jam to make a game that used such an UNSTABLE engine!\n\nhttps:\/\/ldjam.com\/events\/ludum-dare\/49\/unstaballz\n my game btw :)\n\n![Untitled.png](\/\/\/raw\/880\/f3\/z\/44416.png)\n\nmy engine was lacking numerous features:\n-particles\n-font rendering\n-physics\n-editor\n-scene loading\n-easy resource management\nand lots more some of which i created during the jam!\n\non top of that it had no web build support!\n\nmy engine operated similar to unity. a scene was composed of a vector of gameobjects. GameObjects had a vector of components in which all inherited from a base component class which had methods Built in such as Update draw and start. First the gameobjects were looped through and then their components were looped through and called methods appropriately.\n\nScene:\n\ngameobject | gameobject | gameobject\n\n\ncomp1 comp2 | comp1 comp3 | comp3 comp2\n\nGENERAL GAME ARCHITECTURE\nduring the jam i kept it simple choosing to make a simple endless game. It was still a pain though as my engine was so underdeveloped with scarcely a month of preparation. My idea was to make a basketball that unstably sprouted boosters that you had to modify to stay afloat. It was pretty simple to implement. \n\nPLAYER CODE\nI had a player class from which extended all the game logic. It had a vector of boosters which were themselves gameobjects because I lacked a parenting system i made the parenting system inside of the player class overwriting the positions of the boosters to extend outwards from the center of the player.\n![aaa.png](\/\/\/raw\/880\/f3\/z\/44431.png)\nthe boosters themselves were really just aesthetic because their behaviour was controlled inside the player class.\nphysics were just a cheap imitation of real world physics as i used some incredibly hacky physics code to constrain the player inside the boundaries.\n![asd.png](\/\/\/raw\/880\/f3\/z\/4443a.png)\n\nPARTICLES!\nI wrote a quick and hacky particle system during the jam. although hacky and quite limited it remained pretty solid and usable. A particlesystem component in which resided a vector of particle structs.\n![particlesystem.png](\/\/\/raw\/880\/f3\/z\/44455.png)\n![particle.png](\/\/\/raw\/880\/f3\/z\/4445b.png)\n\nGLOBALS\ni needed a way to access stuff from everywhere although considered bad programming practice due to my laziness and the general easiness of globals i stored a global value in which a function would give a pointer to the main camera and many other things this was the general design of the globals. \n![globalcam.png](\/\/\/raw\/880\/f3\/z\/44480.png)\npretty hacky and stupid but oh well.\n\nsome drawbacks of such an engine though is the unsolid parts. At one point i figured out that my windowing and mouse input were all broken! i spent half a day fixing it and was so exhausted i barely did anything else.despite all this and much more hacks i used the game remains performant and running and since i had so much control over these things i could modify easily anything i wasn't happy with. With my custom engine i had both the convenience of a simple gameobject and component system and the control of being able to modify ANYTHING!","title":"Making a game with my custom c++ and opengl game engine","wayback_source":[]}