Something new

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
MrGodin
Posts: 721
Joined: November 30th, 2013, 7:40 pm
Location: Merville, British Columbia Canada

Something new

Post by MrGodin » December 9th, 2017, 11:47 pm

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
Curiosity killed the cat, satisfaction brought him back

MrGodin
Posts: 721
Joined: November 30th, 2013, 7:40 pm
Location: Merville, British Columbia Canada

Re: Something new

Post by MrGodin » December 19th, 2017, 5:06 am

I've added pathfinding with spline points to travel along
Curiosity killed the cat, satisfaction brought him back

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

Re: Something new

Post by chili » December 20th, 2017, 3:30 am

You got some weird .obj file in there that prevented me from building. Some vector thing I think.
Chili

MrGodin
Posts: 721
Joined: November 30th, 2013, 7:40 pm
Location: Merville, British Columbia Canada

Re: Something new

Post by MrGodin » December 20th, 2017, 5:30 am

hmm. did a clean and rebuild
Curiosity killed the cat, satisfaction brought him back

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

Re: Something new

Post by albinopapa » December 20th, 2017, 7:05 am

Is the associated header files for the libs included in the repo?
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

MrGodin
Posts: 721
Joined: November 30th, 2013, 7:40 pm
Location: Merville, British Columbia Canada

Re: Something new

Post by MrGodin » December 20th, 2017, 7:29 am

Yes, this is the header Utils2D_v2.h for Vec2Lib_d.lib, they are all there
Curiosity killed the cat, satisfaction brought him back

User avatar
DicheBach
Posts: 22
Joined: December 11th, 2017, 3:29 pm
Location: recurring

Re: Something new

Post by DicheBach » December 20th, 2017, 2:27 pm

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!
The greatest joy a man can know is to conquer his enemies & drive them before him.
To ride their horses & take away their possessions. To see faces of those who were dear
bedewed with tears & clasp their wives & daughters to his arms.

MrGodin
Posts: 721
Joined: November 30th, 2013, 7:40 pm
Location: Merville, British Columbia Canada

Re: Something new

Post by MrGodin » December 21st, 2017, 12:37 am

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
Curiosity killed the cat, satisfaction brought him back

Post Reply