-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bunch of math2d and 3d features and test programs #60
base: unstable
Are you sure you want to change the base?
bunch of math2d and 3d features and test programs #60
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this, and what is the point of including this?
Also, why is b using the auto
type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole communication folder is basically an attempt to connect events between objects in the game. It's supposed to be almost like signals in Godot. I think we should consider other ways to have objects referring to eachother without referencing them directly. Events should be stored in an std::vector. Other objects will look in that list and use the match event function to look for what it's expecting. With this we can indicate everything between indicating that a gameoverscreen should be triggered, a coin has been collected, and what should happen when a button is pressed. This avoids these cluttered update functions with a bunch of for loops. Ideally iteration should not be done in update functions unnecessarily to make it easier to look at.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole communication folder is basically an attempt to connect events between objects in the game. It's supposed to be almost like signals in Godot. I think we should consider other ways to have objects referring to eachother without referencing them directly. Events should be stored in an std::vector. Other objects will look in that list and use the match event function to look for what it's expecting. With this we can indicate everything between indicating that a gameoverscreen should be triggered, a coin has been collected, and what should happen when a button is pressed. This avoids these cluttered update functions with a bunch of for loops. Ideally iteration should not be done in update functions unnecessarily to make it easier to look at.
Okay, so basically a pubsub interface. Shouldn't that be done in squirrel though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whatever we'd wanna have in squirrel, we should consider to have it in C++ too, as there isn't any debugging interface for squirrel set up yet. I'm very willing to contribute to this project as it seems easy to build on, but not if I'm forced to use a language I can't debug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if there is a system to debug squirrel currently... why hasn't anyone told me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if there is a system to debug squirrel currently... why hasn't anyone told me?
There is, actually: https://github.com/shatteredmoon/squirrel_imgui_debugger
Kelvin actually starred it a while back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then maybe making it more well-known would be a good idea.
Second, I think we should have as many features as possible as a part of the engine. Why would we have almost everything in squirrel, when we can't even inform people on how to debug it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then maybe making it more well-known would be a good idea. Second, I think we should have as many features as possible as a part of the engine. Why would we have almost everything in squirrel, when we can't even inform people on how to debug it?
Debugging isn't really the relevant problem here. The problem is that doing it on the native side doesn't seem necessary and could easily cause type-related issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I would absolutely say that debugging is a problem if you ask me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing purposes, but now we have another folder dedicated to testing projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing purposes, but now we have another folder dedicated to testing projects.
Okay, makes sense!
Should it be moved into there then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks confusing...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ask more specific questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax on lines 15-16 looks really odd. Also, the indentation doesn't make much sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish it was custom to show me the right way when telling me I am doing it the wrong way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use something like glm for this instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really at the stage where I can do that. It should be considered later, as I am focusing on one thing at a time. Would never get these features done if I always went the extra mile. Can we end that question at that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really at the stage where I can do that. It should be considered later, as I am focusing on one thing at a time. Would never get these features done if I always went the extra mile. Can we end that question at that?
Sure, that can be saved for a future commit if it works. It just doesn't make much sense to do it from scratch when there are well battle-tested libraries already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very confusing, and I'm still not sure why you would choose to implement this yourself instead of just using a library like glm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brux is not ready for 3D yet. This should be saved for another time when it makes more sense to include.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, but I don't know how to filter it out every time I do a new pull request and simultaneously do my own changes. I am not very neat at operating git and github yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second, I would heavily recommend that we keep the core 3d math features though, as you never know when they come in handy. They are very basic and you are gonna want them either way in the future. It's definitely possible to keep it in there while making it look clean and ready for future use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, but I don't know how to filter it out every time I do a new pull request and simultaneously do my own changes. I am not very neat at operating git and github yet.
git stash
is what you're probably looking for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second, I would heavily recommend that we keep the core 3d math features though, as you never know when they come in handy. They are very basic and you are gonna want them either way in the future. It's definitely possible to keep it in there while making it look clean and ready for future use.
Good point, but shouldn't it at least have a configure flag for it so it can be disabled when not needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest a practice for how we would handle said configure flags. We might have more WIP things in the future, and the community being informed about how we go about this would be beneficial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest a practice for how we would handle said configure flags. We might have more WIP things in the future, and the community being informed about how we go about this would be beneficial.
Add option(USE_3DMATH "Include 3D math APIs" OFF)
to CMakeLists.txt
and add #cmakedefine USE_3DMATH
to src/config.hpp.in
. Then you can add the ifdef to the relevant files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea what this does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns collision info for an intersection between two Ray2 instances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns collision info for an intersection between two Ray2 instances.
But... this is in math3?...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. It's a very poweful function for 3d collision. Should be kept so that people are aware of it's existance. There is a lack of good references for ray to plane inersection. We could do first person shooters using this function. Keep it there to be used one day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be included in brux itself. Move this into the squirrel-based test suite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Squirrel-based? You think it's bad to test basically anything in C++?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Squirrel-based? You think it's bad to test basically anything in C++?
Real brux applications are written in squirrel, so it would make the most sense to test within squirrel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am pretty pissed at this point, maybe I should not contribute at all if you're just gonna missinform me on a massive scale.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put effort into this, and I feel like other people are just puking at what I make.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't test this within squirrel because I can't make this within squirrel at the moment. Would having test projects in there to demonstrate the functionality cause any problems at all? I guess I could provide them myself, but like... do you wanna download an external repository to get those examples? If you wanna test how something runs, instantiate an example project. It will demonstrate how it runs pretty quickly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You tell me, I don't know everything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You tell me, I don't know everything.
Appears to be unintentional. You should remove this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more thought-out answer: I didn't add it manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (as well as the rest of the build files) should not be included. Use git commit --amend
to clean up this mess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't completely know how --amend works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't completely know how --amend works.
It's quite simple, actually.
Just do git rm -rf [filenames]
to remove the files you don't need (and you can also use git add [filenames]
to add new changes) and run git commit --amend
to edit the last commit.
Then you can run git push --force
to force-push it into your branch.
It looks like this can't actually be merged due to merge conflicts since breaking changes have been made since the previous commit on your branch. Can you try running |
What does making my changes again mean, and how do I do that efficiently? You mean literally resetting it to an earlier head, pulling and copy pasting my backed up stuff in there? I feel like I'm being misdirected, can you make really sure that I don't misunderstand this? I'd need more details. |
Correct. That would be needed to properly fix the commit as it would make it based on the latest upstream commit, which would fix all of the merge conflicts and also give you a chance to fix some of it. |
Is this like, how you do it every time you do a pull request, or can I avoid it most of the time in the future? Again, I wanna be properly directed with this. |
Usually, no. If the commit history is new enough, it can be merged just fine. However, in this case it's old enough that the code has changed significantly since you last pulled into your branch. There are a few solutions to the merge conflicts in this case:
|
This PR is now incompatible with the unstable branch (due to #71) so this would need to be reworked or closed without merge. |
/math2 contains features for ray to line intersection. Can be used for more precise collision detection, as well as detection with polygons. Also has other neat usecases.
/math3 contains some WIP 3d stuff, and I'd recommend we keep it there to be worked on. It can be useful for 2d stuff as well in some cases.
/test contains some test projects. We should keep it in there to demonstrate existing features, though we need to make it a bit tidy. It's a bit harder to describe the rest of the folder I added, but it has to do with how I'd like to make like, a signal system in Brux, something similar to what godot has.