Working so far, VariantECS progress

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Working so far, VariantECS progress

Post by albinopapa » October 9th, 2018, 1:52 am

Variant based ECS

Here's what I have so far, it's just a blue circle that can be moved around on the screen. No clipping/clamping so will crash if you try going offscreen.

I know it's a pretty simple demo, but considering the amount of head-banging-against-the-wall I did, I'm going to call it a miracle I even got this far.

Funny story, wife asked what I've been spending so much time on, when I tried telling here she asks: "so what's it do?" I got a little red as I had to say, "well, nothing at the moment" since I hadn't even gotten the input working yet. Damn, so embarrassing.

I'm not sure the library portion would even be easy enough to use, unless you were comfortable using templates and understand a few things about template instantiation rules, which I'm no expert. I'm just fumbling around until it works. Then there are the ambiguous compiler errors if you forget some overloads, or misuse std::variant.
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

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

Re: Working so far, VariantECS progress

Post by albinopapa » October 10th, 2018, 5:11 am

Been adding and reorganizing some things, and come across another annoying design flaw in ma'system. After a couple of edits, I ended up having what were essentially the same code with different aliases. Well, std::variant didn't like that. It like's unique types so it can work it's magic and find the active type in the list of possible types. While, I know how to get around this, I'm inclined for now, just to mark these types as a Default type, and just have fewer types in the std::variant.

I might also have a way to make things a lot cleaner, which would be freaking great. Right now, using this hand-rolled library is a bit of a pain. I like what templates can do, but it does get annoying after awhile having to always think about the template parameters of a class or function. I heard in a video, "spend 6 minutes coding and spend 6 hours debugging" or something like that, and man are they right.

Shit, I ought to be an expert in this stuff by the end of this project. So much work, just to play around with some f'ing pixels, WHY HAVE I DONE THIS TO MYSELF?!

LOL.

I enjoy learning and the challenge of it keeps me busy. Depending on how this works out, I'll upload to github soon.
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

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

Re: Working so far, VariantECS progress

Post by albinopapa » October 10th, 2018, 5:50 am

Visual Studio wrote: Severity Code Description Project File Line Suppression State
Error C2614 'MovableMessageDispatcher': illegal member initialization: 'SystemMessageDispatchBase<screws::ECS_System<movable_tag,std::variant<screws::ECS_Entity<player_tag,std::variant<screws::ECS_Component<damage_tag>,screws::ECS_Component<dimension_tag>,screws::ECS_Component<health_tag>,screws::ECS_Component<orientation_tag>,screws::ECS_Component<position_tag>,screws::ECS_Component<shape_tag>,screws::ECS_Component<shield_tag>,screws::ECS_Component<velocity_tag> >,std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,std::variant<screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<std::nullptr_t> >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag> > > >,std::variant<screws::ECS_Sender<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,std::variant<screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<std::nullptr_t> >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag> > > > > > >,screws::ECS_Entity<enemy_tag,std::variant<screws::ECS_Component<damage_tag>,screws::ECS_Component<dimension_tag>,screws::ECS_Component<health_tag>,screws::ECS_Component<orientation_tag>,screws::ECS_Component<position_tag>,screws::ECS_Component<shape_tag>,screws::ECS_Component<shield_tag>,screws::ECS_Component<velocity_tag> >,std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,std::variant<screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<std::nullptr_t> >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag> > > >,std::variant<screws::ECS_Sender<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,std::variant<screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<std::nullptr_t> >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag> > > > > > >,screws::ECS_Entity<wall_tag,std::variant<screws::ECS_Component<damage_tag>,screws::ECS_Component<dimension_tag>,screws::ECS_Component<health_tag>,screws::ECS_Component<orientation_tag>,screws::ECS_Component<position_tag>,screws::ECS_Component<shape_tag>,screws::ECS_Component<shield_tag>,screws::ECS_Component<velocity_tag> >,std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,std::variant<screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<std::nullptr_t> >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag> > > >,std::variant<screws::ECS_Sender<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,std::variant<screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<std::nullptr_t> >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag> > > > > > > >,std::variant<screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<std::nullptr_t> >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag> > > >,std::variant<screws::ECS_Sender<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,std::variant<screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<std::nullptr_t> >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> > >,screws::ECS_Receiver<std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag> > > > > >,std::variant<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag>,screws::ECS_Message<systemAdded_tag>,screws::ECS_Message<systemRemoved_tag>,screws::ECS_Message<key_press_tag>,screws::ECS_Message<key_release_tag> >,screws::ECS_MessageFilter<screws::ECS_Message<componentAdded_tag>,screws::ECS_Message<componentRemoved_tag>,screws::ECS_Message<entityAdded_tag>,screws::ECS_Message<entityRemoved_tag> > >,screws::ECS_Component<position_tag>,screws::ECS_Component<velocity_tag> >' is not a base or member Engine c:\dropbox\source\repos\ecs_ts\engine\systemmovable.cpp 29
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

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

Re: Working so far, VariantECS progress

Post by albinopapa » October 10th, 2018, 5:51 am

That's just one error message by the way. Luckily, the important part is near the top.
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

Pindrought
Posts: 432
Joined: September 26th, 2013, 4:57 pm
Location: Kentucky
Contact:

Re: Working so far, VariantECS progress

Post by Pindrought » October 10th, 2018, 2:14 pm

Terrifying error message.
PM me if you need to contact me. Thanks to all the helpful people on this forum especially to Chili.

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

Re: Working so far, VariantECS progress

Post by albinopapa » October 10th, 2018, 6:25 pm

Yeah, I was pretty shocked. I've heard the horror stories about template error messages, but this isn't quite the same I don't think.
This is just one type, abbreviated the message is:

Code: Select all

Error	C2614	'MovableMessageDispatcher':
 illegal member initialization: 'SystemMessageDispatchBase<...>' is not a base or member
The thing that makes it so scary is the fact that my classes are templated for various reasons, one of which is storing an
std::vector<std::variant<SomeTypes...>>, while another is because some of these classes inherit from the ECS_Mailbox class, so
the derived class parameter list needs to hold the arguments to pass to the base class.

The hierarchy is something like: ok, I tried a few times, but is very complicated lol.

Basically, World, System and Entity all inherit from Mailbox.
Each mailbox class stores a Sender variant and a Receiver variant
Each receiver class "stores" a MessageFilter so it can accept or reject incoming messages, which are stored as a vector of message variants
Each sender class stores a vector of receiver variants
Each world class stores a vector of system variants
Each system class holds a vector of entity variants
Each entity class holds a vector of component variants

The reason "stores" is in quotes is because I don't actually store an object of MessageFilter anywhere. It's a template parameter, so it's
just extra type information that I can use to "store" a list of accepted message types. I use a template utility class and function
to unwrap the list of types and compare a message type to the list of accepted types.

A lot of this could probably have been simplified if I had chosen a runtime approach to message filtering and maybe some polymorphic
approach, but I'm glad I went this route. I am learning a lot about using templates and some other language and library features.
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

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

Re: Working so far, VariantECS progress

Post by chili » October 11th, 2018, 2:15 pm

The error message that broke the forum :lol:

This is the kind of thing that concepts is going to really help with.
Chili

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

Re: Working so far, VariantECS progress

Post by albinopapa » October 11th, 2018, 4:26 pm

LOL, yeah, didn't realize the page would expand so much. I gotta zoom out quite a bit to even see how wide the message is.

Yeah, defining a "requires" of the different variant types might be a little nicer.
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

Post Reply