Good vertical is good.
Agreed, but good verticals can still be old.
Improved the design of the resource manager… and then built one of its parts!
does the spring break dance
MARCH 7 UPDATE: Made another part of it!
So, right now, each resource type (sound, image, model, etc.) registers some related functions (loading, unloading, etc.) with the resource system, and the resource system calls these functions when it needs to. This allows it to not have to know anything about loading or unloading resources, and every resource can be treated in exactly the same way by the resource manager.
There is also a node system – when you request a resource, you instead get a pointer to a “node” (which stores some info about the resource, plus a pointer to the resource itself). Every resource ever requested gets its own node that lasts until the engine shuts down, even if the resource is unloaded. This way you won’t crash the program trying to use a resource that doesn’t exist at the moment, because you’ll know from the node that it doesn’t exist.
Both of these systems are built and working, and they’re thread-safe. So all that’s left is to make a request list for loading/unloading resources, and a second thread that performs these requests in the background.
tl;dr – I’m working on a resource manager. It’ll be like in Metroid Prime where stuff loads in the background while you walk around. But no sticky doors this time.
So basically, you could make it so that it constantly has only the room you are currently in + the rooms immediately connected loaded? Sounds nifty.
Well, that’s true, but something like that could be done without multi-threading. The thing my resource manager solves is any sort of stopping or chugging that you sometimes see when games load something. Instead, the engine keeps going, able to animate the elevator scene or do the door transition while resources load in the background.
(Or maybe at one point a giant worm eats Samus and burrows underground, and Samus has to fire at the worm’s hostile insides while the next room loads, and then it emerges in the next room and spits Samus out!
Okay, fine, I’ll stick with the normal room transitions…)
By the way the resource manager is finished.
Works very well. Wasn’t the hardest thing to make, obviously, but it’s helpful.
It doesn’t make decisions about which resources to load/unload (will come later as part of the room system), but it follows its orders effectively.
Just planned out the entire scripting system. (Except the parser/compiler, but that’s its own monster…)
I’ve looked into a lot of already-existing scripting languages that integrate with C++, but so far I haven’t really found what I’m looking for. I actually already have a scripting system that I made last year, but I took lots of bad shortcuts and left out important features. So I’ll just beef up my old code to match the new specs.
If you don’t know, scripts are a series of directions typed out that the game engine will follow. Once this system is fully working, I’ll be able to create objects and attach scripts to them that control how they appear and operate. That’s kind of important for a game to function properly!
It’s basically the glue that makes the engine actually do something. It’ll also mean I can make real demos for once to show off any features I add. But don’t get your hopes up, because in a week I’ll be back to doing schoolwork 24/7.
tl;dr – My engine might be able to stand on two feet and say its first word soon, despite already having roller skates and a megaphone.
A few updates:
A.) I finished the first two pieces of the scripting system. There is still quite a bit to go, but I have it all planned out already (in the same way as the resource system).
B.) My spring break is basically over. Insert usual comment here about getting swamped with homework but promising not to give up on this engine.
C.) Cross-compatibility is looking good! I wrote some code now that uses OS-specific functions yet compiles natively in both Windows and Linux (using the preprocessor). Baby steps, yes, but this is a learning experience for me. Someday, the whole engine. Macs, too.
D.) My hard drive may be starting to fail! But everything is backed up on at least one other drive, and I sync all of my programming with cloudspace anyway, so it’s just a minor inconvenience. Plus the hard drive still works for the time being, mostly.
You better have over 9000 backups of this stuff. >:(
Wow. Implementing Mac guys too. Good luck with that. I don’t have that problem anymore. HURRAH.
You’ve done a nut ton of work on this Troid, mad props to you.
I will be back soon to work on my engine. I have now been through my first ever comp sci course.
Dear God how did you survive!?
Fixed a memory leak in my scripting system now that I know how to accurately check for memory leaks.
Going to work more on my scripting system soon – stack is working but not the operations that command it. After that, attaching operations together to make full scripts. After that, being able to load and save these scripts. After that, a parser that makes binary scripts from typed-out code. After that, making a suite of registered scripting commands to control the engine’s features (sound, graphics, etc.). After that, scripted objects. Etc.
It’ll be some work. But it’ll be awesome. Let’s see how far I get in the short time I have.
Script system core operations – done.
Next up: lists of said operations (aka scripts)
Lists of operations (aka scripts) – done. (Not quite tested yet though)
Next up: saving and loading said scripts.
Saving and loading scripts – done. (Not quite tested yet though)
Tested script execution – seems to work fine in normal circumstances.
Next up: text script parser/converter to byte code. Will take several steps to make.
I’d like to show evidence of my work like I did with the model animator but I’m currently stranded somewhere with just an iPod Touch and some luggage. Either way, scripting systems are quite boring on their own – just the important glue that makes everything else work. Right now the program outputs “Hello world! The result of your script is 3.” Yeah…
Saving and loading scripts – tested. It works in normal conditions now (lots of little glitches fixed). I’ll stress-test all of these systems at a later point to really fine-tune them.
Next up, the text-to-bytecode conversion. Might take a bit.
The engine can now export/import a list of all of its functions and their arguments into/from a nice little file. That helps a lot. Tested – works under normal conditions.
Next up: more conversion stuff. I’ll see what happens.
So let me get this strait.
You were like:
I’m going to make awesome.
And then you were like:
Awesome isn’t awesome enough.
And then you made awesome awesomer?
that pretty much sums up everything he does, actually
Hence CMC’s sig:
Script parser now converts simple expressions (like “3+5*(42+100)”) into bytecode and executes them.
It can also call engine functions. Right now it loads a text file that has “helloWorld((((1-1)+10)+(0+0))*(8+(2-1)))”, converts it to bytecode, saves a smaller script file, loads it again, and executes it, which displays “Hello world! The result is 90”
So basically it’s a calculator right now. Haha. This is where people laugh at me for reinventing the wheel. Oh well.
So my time is up already :
I am leaving to go on a tour in another country.
I’ll have another week to program when I get back though (I get back on June 5).
I made a little more progress on the script parser as well. Mainly just reorganizing the code so it’s easier to use and makes room for the next features I will add (like floating point numbers vs integers)
Yeah, sorry that progress is kinda slow, but the scripting is such an important part of the engine that I want to get it right, and when it’s done I’ll suddenly be able to do a lot of cool stuff.
not a problem, we know its hard to get everything done while upon your stilts good sir