Jump to content

Untested Diagonal Movement


Shenmue

Recommended Posts

Diagonal Movement

 

Description:

The players and NPCs can now have 8 direction movements.
 

Features:

Players and NPCs diagonal movements

Players and NPCs diagonal attacks

Diagonal move routes

Projectiles can move in diagonal (optional feature)

Players can attack enemies they focus if they are in a 5 tiles range in front of them (optional feature)

Spoiler

The player still need to be somehow close to hit the target. The hitbox has 5 different values for each direction.

5217a1902adcdfa87b19602540a37d16.pngHitbox values if the player is facing right.

 

Note:

Download links in the GitPatch section don't contain any known bug and are up to date with the latest fixes.

 

Media:

aa664b60b68c910699ce60d982395526.gif

 

GitPatch: V1.191

Download basic mod

 

Basic mod need to be installed first

Download easier attack on focus

Download diagonal projectiles

 

Download zip file with all patches used (separated)

 

Based On:

Version 0.6.2.421 (development branch)

 

Last official working commit with the patch

ID: 1a8edc5d

From: lodicolo

Date: 2020-05-28 7:49:22 PM

Message: fix 191: Bag access is done via cached value (#219) ...

Spoiler

To see the history of commits of your branch, right click on your current branch, then on history.

300f12524b20386e65ab084208b29734.png

 

 

Setup:

First of all, be sure to be on the latest official working commit with the patch. The branch must not have any modification or there may be conflicts with the mod.

 

You must download and apply the basic mod patch first. If you want more features like diagonal projectiles or easier attack when a player has a target, you can download and apply the patch files related to these. The zip file is not needed, but if you download the zip file, then you must apply all patches in order.

 

Be sure to build your project after installation.

 

How to apply a patch

How to solve patch conflicts

About diffy.org

Edited by Shenmue
Link to comment
Share on other sites

24 minutes ago, Beefy Kasplant said:

It's set to not working? Who tested it? 

Actually it does work, but I am having struggle with the patch. It should be up soon.

 

15 minutes ago, minisoft said:

Would it be possible to add diagonal animations too?

I think I will work on this next, but in fact I don't know yet how to set a player animation.

 

16 minutes ago, Atsuya said:

Nice work, hope you make it full work with projectile.

Haha I hope it too

Link to comment
Share on other sites

2 minutes ago, Shenmue said:

Actually it does work, but I am having struggle with the patch. It should be up soon.

 

I think I will work on this next, but in fact I don't know yet how to set a player animation.

 

Haha I hope it too

 

For the animation, i'm sure you don't have to modify the source, it ill work without change

Link to comment
Share on other sites

2 minutes ago, Atsuya said:

 

For the animation, i'm sure you don't have to modify the source, it ill work without change

 

Where it is interesting is that if we find out how to modify the animation, we could use a spritesheet with more actions than just walking

Link to comment
Share on other sites

Just now, Shenmue said:

 

Where it is interesting is that if we find out how to modify the animation, we could use a spritesheet with more actions than just walking

 

Client side, i'm thinking the animation is define here : (sorry for bad english) 

 

Intersect.client / Entities / Entity : Line 868

                if (Options.AnimatedSprites.Contains(sprite.ToLower()))
                {
                    srcRectangle = new FloatRect(
                        AnimationFrame * (int) Texture.GetWidth() / 8, d * (int) Texture.GetHeight() / 4,
                        (int) Texture.GetWidth() / 8, (int) Texture.GetHeight() / 4
                    );
                }

 

Because more line further you also have the frame for attacking, for walk and then for the paperdoll

Link to comment
Share on other sites

23 minutes ago, jcsnider said:

Good job! Patch looks good. Marking as untested.

Haha thanks

 

2 hours ago, Beefy Kasplant said:

Does it work for NPC's?

Actually the NPC animation is not working right so I am working on that. Plus I will try to make the NPC move in diagonal too. And you cannot hit a NPC in a diagonal tile.

 

18b7298adf1ce000975d2b56dbad3668.gif

 

2 hours ago, Beefy Kasplant said:

Can you skip through two diagonally placed blocks? 

Yes actually you can.

 

11848f9eed9c2342ce40f0755ff6a461.gif

 

 

 

2 hours ago, Beefy Kasplant said:

Any issues with projectiles? 

I've not tested yet, I will improve NPC first.

 

If anyone wants to improve my code feel free.

 

 

 

Edited by Shenmue
Add more information
Link to comment
Share on other sites

52 minutes ago, Celtos said:

Some errors

Projectile does not follow the direction of the character

Players teleporting, perhaps at events too.

Speed System,
Because he is adding the vertical and horizontal speed, making the player even faster.

Monsters Lags when moving

 

Thanks for the bugs report Celtos,

I am currently working on NPC lags. After NPC I will focus on projectiles. It doesn't look to me like the player is going faster.

Link to comment
Share on other sites

If possible, making the monsters walk in that system too, will get more fluid ...
Let me know, your initiative is very good :D

Link to comment
Share on other sites

14 hours ago, Celtos said:

If possible, making the monsters walk in that system too, will get more fluid ...
Let me know, your initiative is very good :D

If you will go down that route adding diagonal movement to events would be a good shout.

Link to comment
Share on other sites

1 hour ago, Kibbelz said:

If you will go down that route adding diagonal movement to events would be a good shout.

I think I will test that feature when I will be done with NPC. I was also planning to expand the spritesheet, so I don't know if I will do this soon haha. 

 

15 hours ago, Celtos said:

If possible, making the monsters walk in that system too, will get more fluid ...
Let me know, your initiative is very good :D

Passive NPC move with 8 directions and there is no more lags with them. Only issue I've found: when they have a target they move with only 4 directions (I am still trying to change that).

 

There is no more projectile issues. However, projectiles are only 4 directions even if moving diagonal. I don't think I will change it, but if someone is interested about that feature maybe I will add it later.

 

I've updated my post, but you can download the most recent patch here.

 

Link to comment
Share on other sites

 

3 hours ago, Shenmue said:

There is no more projectile issues. However, projectiles are only 4 directions even if moving diagonal. I don't think I will change it, but if someone is interested about that feature maybe I will add it later.

 

 

This would make the system complete, but I would focus on getting the current system fully working and bug free.

 

Nice work!

Link to comment
Share on other sites

  • panda locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...