AGE

AGE

46 devlogs
89h 35m
Created by HQ2000

AGE, short for "Another Game Engine", is supposed to be a lightweight and simple game engine written in Rust with basic support for things like graphics,audio , assets and so on. Making a project using it should not take much boilerplate, be straightforward and also beginner-friendly.

Repository

Timeline

Earned sticker

Still trying to get it work, have fun with the same image as the last two times:

Update attachment
Earned sticker
HQ2000
HQ2000
1h 42m 3 days ago

Still trying to get it work, the guide is weird, I hope it'll work tomorrow :heavysob:

Update attachment
HQ2000
HQ2000
5h 35m 6 days ago

This is the accumulated time for the last several days, was more in a down and while I didn't achieve something, I worked to make it at least work a bit and then build up from that, among that was adding and implementing several commands, refactoring the world, etc (I can't remember everything). I originally wanted to make this devlog when I have a minimal working version, but something like a 7h devlog is probably not so nice...
Also, I will try to sync everything now

Update attachment
Earned sticker

the rendering should work now, tried to get it working (pretty dirty), we'll see soon.
Didn't find a good way to update the stuff, if I don't find one until the next devlog I will upload manually.

Update attachment
Earned sticker

(Around 45 min of work from yesterday included)
currently working on the rendering logic which again reminds me - way too late - that I should have spent some more time thinking of an architecture...
Anyways, I will upload tomorrow after I figured out how to synchronise such a big amount of files..

Update attachment

Got familiar with all the stuff again, changed the command system.
My new approach is to get everything kind of working first and then add features/change stuff etc.

Update attachment

Working on the command system for the (also new) world, this time it's one instead of 2-3 devlogs.
While doing that, I realised why bevy has a Query system parameter, but since this should at least be a bit unique I will try to embrace the command system and see how far I'll come.

Update attachment

Made the rendering working with the example model, statically though, working on dynamically adding models and images later maybe.
Huge thanks to the tutorial code for providing a working - for me very important base.
I did refactor the loading mechanics too a bit...

Update attachment

EDIT: still debugging, nearly feels like what I'm encountering is a bug in the library, if that's the case, wish me luck...

Update attachment

Did some more debugging to fix the model loading, I think I made some progress, I managed to load more stuff than before...still not working, but atleast it was more fun...
Uploaded the code yesterday

Update attachment

Was pretty unproductive (I'm in a little down currently), tried to fix the model loading and bumped up the library I used for that purpose which meant bringing tokio (a good, but also pretty heavyweight async runtime) in for keeping the loading stuff async, I hope I won't regret that later...
Also, I am really happy about the extra month, I can't reach my goals otherwise...

Update attachment

Only thing I can show is that the basic render color that gets always drawn first is now fully customisable, can't show this now because I'm curretly getting a panic because of the model loading problems
Moreover, I am currently digging into and refactoring the graphics code (model loading at the moment as a next step to get a bit more working, kinda exhausted today, worked way longer than wakatime measured (reading docs, trying to understand the tutorial code, reading the tutorial again etc.), uploading tomorrow yeah...

Update attachment
HQ2000 HQ2000 about 1 month ago
(uploaded too)

I'm coming to the point now where I need to decide what the end user sees in terms of data structures and its impact on the end user (should I make my own Color struct or use wgpu's (the graphics lib I'm using) one?)
Also, further refactoring and more todo's (there are 16 of them now).
Will upload tomorrow, want to go to bed now

Update attachment

Did some testing and further refactoring.

Update attachment

Working on a commands struct for manipulation the game's graphical state (this engine is getting more similar to bevy everytime even though it came to my mind while thinking about a more modular way to control the camera...)
also, I removed the age_core subcrate because I otherwise would have needed to do some generics hacks that would make it more complicated.
(I'm so unproductive today, damn)

Update attachment

Refactoring, refactoring and refactoring...
I am currently modularizing and adding things to the tutorial code (currently the camera) and while doing so I realized that I a pretty practicable (and modular) solution for manipulation the game state (moving the camera, spawning a 2d sprite etc.) is definitely a command queue instead of a Game handle which then has subhandles that manipulate some states. So yeah, that's exactly what the bevy game engine does...I do have some experience with it, and one difficulty I encountered was - due to lacking (up-to-date) docs - that I had no idea where to find a certain command. So, what I'll do later isn't just putting the user in power of adding above described commands to the queue, but also a way through dedicated functions users can explore through their IDE (which is usually easier with functions than with trait objects) or at least sufficient documentation.
Still, there is nothing major to show except for the code which I will upload today or tomorrow at last. (But I do think I'm approaching territoy where I can show something)

Update attachment

Reworked the Events to use an AnyMap, you can now create and use ANY custom event, still refactoring the whole stuff to fit into the Game struct making simple events for key presses, mouse button presses and so on.
It is finally fun again to work on this!

Update attachment

Finished audio error handling (and repo update), currently working on unifying the wgpu tutorial App and my Game which essentially has more information in it.
Also, I will need to introduce an additional field for game functions so the end user can modify the graphics etc.
As said, when there's something to show, I will show it, but if that's not the case, I'll just put a screenshot of my code here...

Update attachment

Testing and improving the event system at the moment, will finish + upload tomorrow

Update attachment

Messed around way more, now I'm giving up..functions always need to have one exact signature if you want to integrate them into the game...

Update attachment

Messing around with the trait system, I think I found a nice abstraction now so users can just input an ordinary function (or closure) into the add_once or add_update functions (see below). It does require some mass impl work, but I'm ok with that little bit since the use of the AnyMap also enabled me to remove the &GameInfo parameter which reduced the possibilities to cover with the impl work from 2 3 to 2 2 which is definitely a big improvement.

Update attachment
HQ2000 HQ2000 about 2 months ago
for rustaceans: I basically relied on the From / Into trait to instead of (direct) dynamic dispatch
HQ2000 HQ2000 about 2 months ago
the space between to numbers was supposed to be a “to the power of”…

messed around with the game_fn trait, bumped up rodio (eve though there were breaking changes, they definitely improved it, it saved me a field in my output-handler struct.
Next: finish better audio error handling and 2d graphics

Update attachment

Uploaded everything to github, nearly forgot the possibility to bulk upload...
- worked on the scheduler, now variable function parameters for those you can add to the game (once, update)
- using AnyMap instead of HashMap now, way more convenient.
- Finished refactoring into a workspace (see the image below)
- Messed around with derive macros
(I really hope I get this whole thing done in time...)

Update attachment

I already thought I did a devlog for 4 of these hours...anyways, here you go (code on the repo later):
I refactored the whole project into a workspace (way cleaner now), messed around with long types and with proc-macros (they're a pain if you don't know how to use them, like me, screenshot attached).
I know it would be really cool to be able to show something, but sadly, it's only the code right now.
(Maybe I am gonna do some showcases when I finish the scheduler and event system).
Also, this is the time from today AND the 10 last days where I just worked on the event system a bit.
Anyways, this probably won't be the last devlog for today, so stay tuned!

Update attachment

So, what should I say? I'm not that proud of the work I achieved in the last hour (or 2?, spoiler: FnOnce vs FnMut...), but overall it goes well, I guess the scheduler will be pretty finished by tomorrow so I can really take myself the time to work on the graphics core so it's not just some adjusted tutorial code. For everyone checking the fresh code at the repo: I'm still getting into Rust! Also, I can already say that this game engine will be inspired by bevy (game setup etc) but prob ( I'm not 100% sure) becoming data-oriented (I don't have that much time...). Also, HUGE props to Rust itself: I did encounter some issues that seemed pretty nasty, but none of them was really after reading the error again some times or looking up some stuff I had slight misconception of. I think C/C++ wouldn't have achieved that! Fun fact btw: Due to the fact that I learned some libraries, have test projects and switched due to name issues and more, I have f*cking 13 (!) RustRover projects attached to the SoM project! Also, for everyone attempting the same: USE A WORKSPACE. really. I should have done that....

Update attachment

Commited the stuff, basically restructured the tutorial code for the rendering core so I have a working basis, began making a scheduler and an event system (the stuff from the tutorial will be changed later, obviously. I think there will be more than one restructuring, especially for the core, as there isn't just rendering. Also making my other project, Sacrifice After Sacrifice, in parallel.

Update attachment

Making the graphics finally. The tutorial was good, it also provides some code to build on. I hope the fun part starts now!

Update attachment

Nearly finished learning wgpu yesterday

Update attachment

Audio done! I learned a lot, more restructurung, after bumping rodio up I can (finally!) continue with graphics.

Update attachment

Found the bug, a lifetime issue, woohoo!! Next restructuring incoming...

Update attachment

3 hours and it's still not playing...if I set it up normally, everything is fine. But if I want to do it using the modular way, playing IS JUST NOT WORKING, and I have no idea why 😭

Update attachment

More restructuring, approaching a minimal partially working state...It feels bad not really having to show this much (expect for the code uploaded to the repo...)

Update attachment

Sorry for the devlog after such a short time, but the first results are on github!
Also, I don't want to know how many changes the architecture will undergo...

Update attachment

Some more audio, think I found an acceptable architecture for the audio handling now, gonna upload a bit after reimplementing the functions :)
Also, I have 11(!) WakaTime projects associated now!
(testing winit, cpal, rodio, phantomdata, wgpu and so on...)
So yeah, like a quarter of my time was actually coding something that's contained in the end product. Only 55 days left now!

Update attachment

Tried out rodio a bit, also working on a custom ByteBuffer since I didn't find a proper one since I want the people using my engine to be able to pre-load songs instead of loading one chunk after another for faster access...

Update attachment

Damn...spent 1h today and some more this week to get familiar with cpal...but yeah it's to ground-up to me to program audio functionality with it, so I'm gonna stick with rodio...also, this basically erases 50% of my code to upload, so I guess now is not the time.

Update attachment

Did some refactoring as well as audio stuff...I think I will upload some code to the repo tomorrow, it is still not much, max 150 LOC distributed around 10-15 files

Update attachment

Played around with audio, seems to be pretty important to have a structure in mind beforehand…

Update attachment

Played around with cpal today, I guess I need to think of a concept for an architecture of a possible wrapper.
Also, new structure!
(I prob won't be the last one...)

Update attachment
HQ2000 HQ2000 3 months ago

“It” not “I”….

More Tutorial and trying....maybe I'm gonna make custom language and a transpiler...

Update attachment

I learned really much about wgpu (and graphics in general), so yeah...I still need a better folder structure, just learned that 2d is basically 3d in term of rendering, also, I now actually understand which specific things make it so hard...I'm looking form´ward to this challenge!
Still, wgpu is awesome since it takes care of the cross-platform capabilities so I can focus on the rest (which is by far enough).
Hope this pays off!

Update attachment

Another hour spent, mostly messing around. I got an error while compiling tutorial code because of too many dependencies, so I even needed to switch the linker (meaning the toolchain). I also made the decision to make a simple scripting language for arranging objects (3d and maybe 2d) since I definitely do not have the competence (and time) to make a whole new editor...or maybe I'll do that, idk.

Update attachment
HQ2000 HQ2000 3 months ago

NOTICE: This is a mix of time on some projects, today I only spent half an hour, but due to renaming I forgot to include another project that had around 20 min to with some other stuff. I also spent time reading the tutorial…

Again...I have to make a devlog not to let that half hour experimenting be gone (not to speak of the time reading the wgpu tutorial). Folder structure is ready!

Update attachment

Still learning wgpu...
Decisions made:
1. I guess will use cpal as an audio library
2. I need a different folder structure (picture in one of the next devlogs)

Update attachment

hours of learning (and chatting) have passed by (not measured by wakatime 😪) and there are some choice I have made after extensive research. I won't let people compile this with wasm (would make it way too complicated) and definitely use wgpu as a backend and partial front-end for graphics because of it's cross-platform ease-of-use. Also, I think I have a structure for what I want to implement (not set in stone):

Update attachment
HQ2000 HQ2000 3 months ago

EDIT: not “with”, but “as” wasm ofc…

fn main() {
let HQ2000=Human::new();
HQ2000.name=HQ2000;
HQ2000.project=AGE game engine;
HQ2000.activity=learning wgpu;
}

Update attachment