Wolfenclone

The Partridge Family were neither partridges nor a family. Discuss.
Firepath
Posts: 77
Joined: March 10th, 2018, 11:53 pm

Re: Wolfenclone

Post by Firepath » September 4th, 2018, 9:41 pm

Thanks, I appreciate it albinopapa. I have a very extreme up - down personality and stuff (like frustration) really gets to me. Hopefully I'll get some time this weekend to fix the stupid menu drawing bug, not that it even matters really and not that it will make it perfect either. I dunno, I want to be doing this as it is fun but also what I want to do with my life, but I also feel in the back of my mind it isn't going to amount to anything more than a hobby; The hours of frustration aren't going to help my career and just serve to waste my small amount of free time being frustrated.

live627
Posts: 3
Joined: August 25th, 2018, 5:33 am

Re: Wolfenclone

Post by live627 » September 7th, 2018, 2:57 am

If that menu bug isn't that important and is not obstructing the rest of the game, go ahead and work on something else (level design? A save/load?) Perhaps while you do so you'll randomly get that eureka moment required to fix that bug.

I find that helps me when caught up in something that doesn't feel quite right.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Wolfenclone

Post by albinopapa » September 7th, 2018, 7:38 pm

live627 wrote:If that menu bug isn't that important and is not obstructing the rest of the game, go ahead and work on something else (level design? A save/load?) Perhaps while you do so you'll randomly get that eureka moment required to fix that bug.

I find that helps me when caught up in something that doesn't feel quite right.
And, right on time. I needed to hear something like this actually. Am a bit stuck in my own current projects.

One project is creating template classes and traits for a few of the DirectX APIs like Direct3D. The biggest goal is to gain and solidify my understanding of template meta-programming. The result should be type safe wrappers for the APIs with some of the benefits that come along with C++ over C. While the Direct3D API is object oriented, it must maintain ABI compatibility. One of the things that it does is use in/out parameters and only uses function returns for error codes. This goes against the return by value idiom of C++. Since C doesn't have exceptions, this was the easiest way probably the easiest way to maintain functionality between the two languages. It's coming along well enough, but because of my limited understanding of both template meta-programming and most of the Direct3D library, it will be a slow going, but hopefully rewarding experience.

The second project is reorganizing, refactoring and reimplementing an older project that extends the chili framework with solid and alpha sprites, fonts and text formatting, particle emitters and effects, 2D camera, SIMD wrapper library and/or SIMD algorithm library, and my latest desire; an event system. This is where I'm having some issues.

I want to create a class that on each frame, all event listeners check for some event condition to be met and call some user provided callable. I have a feeling I'm going to want std::function and I think using std::variant might be helpful, but I keep running myself in circles on how I want to implement such a system. I'm sure I want to allow the user to add their own listener with it's own condition and callable, but I'm having trouble deciding how to separate all those in a way that doesn't entangle each. In other words, I want to keep with encapsulation, and maintain a separation of responsibilities.

The reorganizing, refactoring and reimplementing portion is figuring out how to make the code coherent, clean and maintainable and possibly more efficient and safe to reduce bugs and making some bugs compile time errors if possible.

I guess I kind of do have a third project that actually stems from the second. I'm trying to create a working demo using the extended features, a sort of Contra or Super Contra type game to show off the features like particle effects and if I ever get it working the event system.

When I get stuck on one, I just move along to the next. The first project mentioned ( the template meta-programming wrappers for Direct3D et al ) definitely will need some sort of tests done, but will have to wait. I have over 2,000 lines of code and still haven't gotten the core API done enough to even draw anything on screen yet. At this rate, I'm going to need around 10,000+ lines lol. Not really, a lot of the 2,000+ lines I have are redeclaring enums to enum classes, forward declarations, actual class declarations, some helper functions and type traits then the actual function definitions.

The enum to enum class redeclarations are complete -> Easy part.

Wrapper class forward declarations of all classes able to be instantiated are complete for Direct3D11 -> Also easy.

Supporting structs ( wrappers for C style DirectX structs ) implemented when needed -> Mostly easy

Supporting structs ( not a part of any DirectX APIs, but useful ) implemented with caution -> Not as easy. I'm struggling with whether users would wonder if they were wrappers or supporting structs.

Wrapper class declarations implemented as I go so I don't miss any. Most of the interfaces that can be instantiated are created from the ID3D11Device interface, so I just walk my way down the function list -> Easy for now, but this is where I know I'll be reworking the code to take into account the 3+ versions of Direct3D 9, the 2+ versions of DirectX 10, the 5+ versions of Direct3D 11, then the 3+ versions of Direct3D 12. Not to mention, the underlying DXGI framework for Direct3D and Direct2D.

Helper functions and type traits is where the heart of the project stems. Since there are rules for certain actions and types, I'm trying to setup templates that can provide strict adherence to those rules, this is probably the hardest part actually for me. This requires knowledge of both template meta-programming and the rules for each type in the DirectX API.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Firepath
Posts: 77
Joined: March 10th, 2018, 11:53 pm

Re: Wolfenclone

Post by Firepath » September 9th, 2018, 9:24 pm

Hey sorry for not replying, haven't been on since my last post. Taking a break from it really makes me more keen to look at it again.

I like what you're trying to do, sounds much like how I try to learn more. Though I am glad I haven't had to deal with DX in the Chili framework yet, looking at all the 3D videos coming out I should rewatch the onew I have seen and follow them. It'd be a good break from my project, I just don't want to disappoint myself by abandoning it.

I think I know how to fix that menu bug and yeah it's not important really.

Firepath
Posts: 77
Joined: March 10th, 2018, 11:53 pm

Re: Wolfenclone

Post by Firepath » October 1st, 2018, 12:15 am

A little progress; I got to work on this again this weekend.

I fixed that menu drawing bug. I was doing some drawing in the model updating, separated that out and re-arranged the sequence of some things and it works as expected now.

I split doors out to a separate menu (from walls). They are still walls as far as functionality, but that will be changed later.

I also added in Treasure (with one treasure). This has its own derived fixture type of Treasure (from Pickup, derived from MapFixture same as Wall). It still acts like a wall, but has transparency working. The way they are drawn needs some changes and they need extra properties (points value, non-blocking, pick-up-able, position offset, draw style (always facing player / drawn in middle of cell) etc.).

I already moved drawing logic of fixtures into the fixture (from Grid where it was drawing populated cells) so changes to drawing per type of fixture will be easier now.

I split up my settings / asset loading into several polymorphic classes, not because I need to store different types in the same variable but so I don't copy / paste the file reading logic. I have a loader for the list of settings / assets files, one for loading textures, one for fonts, one for fixtures, and one for the menu. This broke down each set of logic into smaller, easier code blocks that only have related logic in them. It also moved logic out of the game class. Game now is back to only doing model updating (input basically currently) and drawing, after calling the loaders in the constructor.

I also added a bunch of filters to organise the various components, probably about the biggest visible different ha! and it is just the way the IDE displays the files...

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Wolfenclone

Post by albinopapa » October 1st, 2018, 5:10 am

Wow, nice work. I know it feels like you're going nowhere fast when all you're doing is reorganizing code, but it should help keep you focused and more productive as you go, since now things are separated. The project should be more extensible, more maintainable and more easily debugged.

Keep it up.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Firepath
Posts: 77
Joined: March 10th, 2018, 11:53 pm

Re: Wolfenclone

Post by Firepath » November 17th, 2018, 3:10 am

Quick kind of update. I haven't worked on this project since last time. BUUTTTT... I got keen on finally getting some sound working. I've looked into sound years ago, and got some working using windows playsound or something, which allowed me to play a single sound (1 channel). I remember watching a Chili video on sound a while ago and found it again and found it REALLY good.

So in a roundabout way I did work on this project. I want sound in it, so I worked on developing that.

It was HUGS #11, which talked about sound from the very fundamentals. Great video, should be posted as a stand-alone video on sound (with the fixes from #12). I encountered a bug which I worked out and fixed, due to channels in unique_ptrs being moved from collection, thus the pointer still being there, just empty. I thought Chili would note it in the next video and he did.

I want to apply the sound to the little link demo that I took further (I added a background and fading footstep trail). I want to add footstep sounds that vary randomly a tiny bit in both volume and frequency. I also want them to get quieter as link is closer to the top of the screen (further away in this pseudo top-down view).

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Wolfenclone

Post by albinopapa » November 17th, 2018, 3:38 am

t was HUGS #11, which talked about sound from the very fundamentals. Great video, should be posted as a stand-alone video on sound (with the fixes from #12). I encountered a bug which I worked out and fixed, due to channels in unique_ptrs being moved from collection, thus the pointer still being there, just empty. I thought Chili would note it in the next video and he did.
I believe he also covers some sound insertion code into the Intermediate series IIRC.
I also want them to get quieter as link is closer to the top of the screen (further away in this pseudo top-down view)
Nice idea.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Firepath
Posts: 77
Joined: March 10th, 2018, 11:53 pm

Re: Wolfenclone

Post by Firepath » November 18th, 2018, 1:42 am

albinopapa wrote:
t was HUGS #11, which talked about sound from the very fundamentals. Great video, should be posted as a stand-alone video on sound (with the fixes from #12). I encountered a bug which I worked out and fixed, due to channels in unique_ptrs being moved from collection, thus the pointer still being there, just empty. I thought Chili would note it in the next video and he did.
I believe he also covers some sound insertion code into the Intermediate series IIRC.
I also want them to get quieter as link is closer to the top of the screen (further away in this pseudo top-down view)
Nice idea.
I had a look at the link project (sprites) and it already has sound in it, and in that series he added some damage sound. I don't remember much detail on sound in those videos though. I'll check through intermediate for more sound stuff, thanks!

I was thinking as well as up/down volume change it could also do left/right. My idea is two have two more intermediate "master" channels between the 64 individual channels that funnel into the master channel. Those two would be left and right channels. That would make modifying left / right effects, volume, etc. fairly easy. There'd need to be changes maybe to how the sounds load or play at least. Currently we're loading basic 44kHz 16-bit stereo wave files. Needs more thought. They'd need to play from one channel but split left and right into the two left/right "master" channels. Maybe you don't need them at all and can just tinker with the master voice channel.

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Wolfenclone

Post by chili » November 18th, 2018, 7:51 am

If you're interested, I also did a stand alone video for adding mp3 support to the mix. It's not super hard, and makes your download size a lot better if you have music.
Chili

Post Reply