Page 1 of 1

Something new

Posted: December 9th, 2017, 11:47 pm
by MrGodin
Here is my work with components so far. It is in the baby stages, still learning how to use them properly but i think i'm getting the idea.
This is a dungeon crawler type game in it's infancy.
I want to have a party of entities you can control so right now i am using springs to keep the units together.
If framework runs with only Direct2D as it's underlying framework
https://github.com/MrGodin67/Traveller
I've said this before but i think i may have my 2d engine foundations sorta figured out lol.
Cheers

Re: Something new

Posted: December 19th, 2017, 5:06 am
by MrGodin
I've added pathfinding with spline points to travel along

Re: Something new

Posted: December 20th, 2017, 3:30 am
by chili
You got some weird .obj file in there that prevented me from building. Some vector thing I think.

Re: Something new

Posted: December 20th, 2017, 5:30 am
by MrGodin
hmm. did a clean and rebuild

Re: Something new

Posted: December 20th, 2017, 7:05 am
by albinopapa
Is the associated header files for the libs included in the repo?

Re: Something new

Posted: December 20th, 2017, 7:29 am
by MrGodin
Yes, this is the header Utils2D_v2.h for Vec2Lib_d.lib, they are all there

Re: Something new

Posted: December 20th, 2017, 2:27 pm
by DicheBach
Build succeeded for me with VS 2017, no problem. Few errors but they sound probably like VS hystrionics else minor stuff.

However, the behavior of the tank in response to user input (only seemed to respond to mouse left-click) seems to be some combination of "following a predetermined sequence" and "unintended/erratic."

Initially it seemed the tank would turn and go in the direction where I point-clicked on the game screen, but then it just seemed to start doing its own thing (which it may actually have been doing from the beginning). eventually it made its way toward the extreme x,y (bottom right) corner of the game pane and disappeared off the edge. Then the turret (or part of it) came floating back in and twirling for a while.

Also the turret was more or less constantly spinning during this entire ~1 min testing sequence. It would seem you have some semantic errors in your otherwise valid code.

All that said: Impressive!

Re: Something new

Posted: December 21st, 2017, 12:37 am
by MrGodin
yes, it follows a AStar pathfinding algorithm then i added spline (curves) to the points, actually creating a whole lot more points to follow along. I don't know why it would have gone off screen because the AStar pathfinding should have never gone out of bounds. Maybe you got the version where I am using Chili's mouse Events which acted on the LButton release event. I did, however, notice that as soon as the mouse left the window it triggered the Left and Right button release events which i tracked down to the D2DWindow Message Proc. In there the event was being triggered when the WM_MOUSEMOVE shown here

Code: Select all

case WM_MOUSEMOVE:
	{
		POINTS pt = MAKEPOINTS(lparam);
		if (pt.x > 0 && pt.x < m_screenWidth && pt.y > 0 && pt.y < m_screenHeight)
		{
			mouse.OnMouseMove(pt.x, pt.y);
			if (!mouse.IsInWindow())
			{
				SetCapture(m_hwnd);
				mouse.OnMouseEnter();
			}
		}
		else
		{
			if (wparam & (MK_LBUTTON | MK_RBUTTON))
			{
				pt.x = std::max<short>(short(0), pt.x);
				pt.x = std::min<short>(short(m_screenWidth - 1), pt.x);
				pt.y = std::max<short>(short(0), pt.y);
				pt.y = std::min<short>(short(m_screenHeight - 1), pt.y);
				mouse.OnMouseMove(pt.x, pt.y);
			}
			else
			{
				ReleaseCapture();
				mouse.OnMouseLeave();
				//mouse.OnLeftReleased(pt.x, pt.y);
				//mouse.OnRightReleased(pt.x, pt.y);
			}
		}
		break;
	}
as you can see i commented out that event and it fixed the issue.
The turret was in a make-shift "slew" state in which it constantly rotated. I set that up and never did anything else with it yet