adventures in pong
the entity–component–system i designed was pretty bad. it wasn’t awful for a first attempt, but i want to redesign it to something more akin to Flecs. the ecs quickly became unruly for even simple entity relationships, and it became too much to wrangle even with a simple pong game. before tackling larger projects, i definitely want to redesign the ecs to be much more ergonomic.
future game projects will occur on other projects on hack club (i think). i still have major plans for this engine (physics, networking, misc. debug stuff), but i need to take care of some primary issues with it first. i honestly have no clue what i was thinking when i was writing the ecs.
Log in to leave a comment
ecs and other misc stuff
it’s been six days since my last devlog and, since i’ve been programming for ~1 hr a day, i’ve made some progress on the engine. firstly, i have a prototype ecs working! it’s not fast, and is not “technically” an ecs, but it behaves similarly to one. i plan to rewrite it one day to be more adherent to data-oriented design, but it will work for now. i also wrapped up the opengl backend and cleaned up some stuff.
the first game i plan to make with this engine is a pong clone. i don’t want to do anything crazy, and instead focus on simple stuff. i will make progressively more advanced clones of simple games until my engine is ready to tackle an original game (current idea is a coop wizarding game)
note: i recently discovered that glfwSwapInterval(1) (which is used to enable vsync) is broken on apple silicon macs! i truthfully don’t know what i’m going to do to fix it, and i think i will just deal with it until it becomes more unbearable than it already is. it’s stuttering like crazy, but there’s not much i can do.
Log in to leave a comment
unfortunately, i gave up on bgfx. it was a neat idea, but sort of overkill for the simple 2d engine i’m making, and it also had poor shader documentation. i switched over to opengl and it has been great. i got a textured quad rendering in ~2 hours, and it’s been much easier than bgfx. i just need to abstract some rendering stuff now, and then i just have to make an ecs and then i’m done!
Log in to leave a comment
this one took a while. i’m not completely sure if the time is correct, since i spent a lot of time reading documentation and looking at my code. some stuff that was added to the engine:
Log in to leave a comment
ref-counted resource management
i realized that, before rendering, i should make some sort of asset management. i went sort of overkill and created a ref-counted cached resource management system, but it’s actually pretty simple. there’s a ResourceManager, which is exposed to the api. ResourceManager can register ResourceLoaders (load and sizeOf), and then, using ResourceManager.load(path), users can load a resource after registering a loader for that type of resource. i only made TextResourceLoader so far, but i plan to implement binary, images, and possibly compiled shaders (but idk yet). i also still need to make it async, but kotlin has pretty good async capabilities, so i’m not too worried.
Log in to leave a comment
got bgfx working after an hour of debugging. macos really hates rendering on background threads. next: rendering structure and draw commands.
Log in to leave a comment
so far I have general engine structure down. however, i’m having trouble with bgfx on mac.
Log in to leave a comment