You are not logged in.

fabio

Beginner

  • "fabio" started this thread

Posts: 15

Activity points: 265

Level: 19

Experience: 19,462

Next Level: 22,851

  • Send private message

1

Thursday, December 1st 2016, 12:08pm

RotU Pathfinder

Hey guys,

I'm the developer of RotU for CoD UO.

Since I had a lot of trouble with bad performance of A* Search on my server and huge server laggs, I outsourced the Pathfinding module.

I was able to copy the whole A*-Script nearly 1:1 to Java.
I decided to use java, because it works on any system without problems. Doesn't matter if it's Linux or Windows.

Well, back to topic.
This program is using 30 worker threads by default. One for each zombie.
The program loads and parses the normal waypoint .gsc files (at least I used .gsc files on UO) into the RAM for fast access.

If a zombie needs its next waypoint a file is being created by the main server with start and goal node.
The pathfinder reads this file, calculates the next node and writes it back into the file.

(TCP/IP Socket is planned here...)


This procedure improved the server performance of like 100% .....

The CPU load is like 0%...

Calculating Time before: ~100-200ms
Calculating Time now: ~1-3ms



Sooo, if anyone of you has trouble with performance and is interested, I'll make the program compatible to CoD4 and offer it free to download.

Just leave me a message :)


-Fabio

3 registered users thanked already.

Users who thanked for this post:

TrikX (01.12.2016), Luk (01.12.2016), UncleSam87 (01.05.2017)

Luk

Administrator

Posts: 1,511

Location: Germany

Activity points: 33645

Level: 41

Experience: 2,471,333

Next Level: 2,530,022

  • Send private message

2

Thursday, December 1st 2016, 10:34pm

Well, that actually sounds really interesting. I wouldn't mind trying it out if I have the time. Would you mind posting the sources once you (might) release it for CoD4? I'd only implement it if I and the people who download it are sure that there is nothing malicious inside. You will of course be given full credit for this feature if it eventually makes it into a release. :thumbup: :thumbup:

fabio

Beginner

  • "fabio" started this thread

Posts: 15

Activity points: 265

Level: 19

Experience: 19,462

Next Level: 22,851

  • Send private message

3

Friday, December 2nd 2016, 10:08am

I'm glad you are interested in this :)

Well, the program is operational on my server. But it's still a Beta.
I have to clean up the code and do some improvements.

When everything is done, I'll implement the interface for CoD4.
I'm not sure if CoD4 supports TCP/IP from gsc? If not, I'll stick to the file based data exchange (I'm using this too at the moment).
I guess you can write and read files using gsc..?

Aditionally I'm not sure which way is faster.. TCP/IP or Files..

Another question is, how do you store your waypoints?

The program easily parses my .gsc waypoint files which look like this:

Source code

1
	level.waypoints[0] = spawnstruct(); 	level.waypoints[0].origin = (-432.558,417.897,248.125);	level.waypoints[0].childCount = 3;	level.waypoints[0].children[0] = 1;	level.waypoints[0].children[1] = 14;	level.waypoints[0].children[2] = 22;	level.waypoints[1] = spawnstruct();	level.waypoints[1].origin = (-508.474,450.875,248.125);	level.waypoints[1].childCount = 4;	level.waypoints[1].children[0] = 0;	level.waypoints[1].children[1] = 2;	level.waypoints[1].children[2] = 14;	level.waypoints[1].children[3] = 15;	...	...	...

(for some reason the forumsoftware writes this in one line.. but normally new line after each statement :) )

If you store it in a different way, I'll have to write a second parser, but that's not aproblem :p


And finally if everything is ready to release, I will upload the code to Github.


-Fabio

1 registered user thanked already.

Users who thanked for this post:

UncleSam87 (01.05.2017)

Luk

Administrator

Posts: 1,511

Location: Germany

Activity points: 33645

Level: 41

Experience: 2,471,333

Next Level: 2,530,022

  • Send private message

4

Friday, December 2nd 2016, 9:59pm

CoD4 stores the waypoints in a similar if not the same way. If I remember correctly CoD4 can only read/write files using modified executables (1.7a, 1.8) but it should be doable anyhow. I'm rusty when it comes to CoD4 scripting, but a performance boost would be a great motivation to have another look at it.

Luk

Administrator

Posts: 1,511

Location: Germany

Activity points: 33645

Level: 41

Experience: 2,471,333

Next Level: 2,530,022

  • Send private message

5

Saturday, February 25th 2017, 8:50pm

Well, guess nothing is happening here, lol.

fabio

Beginner

  • "fabio" started this thread

Posts: 15

Activity points: 265

Level: 19

Experience: 19,462

Next Level: 22,851

  • Send private message

6

Tuesday, February 28th 2017, 5:28pm

Hm, yea sorry, I didn't find the time to re-work my code yet...

The code is some kind of mess.. Well, I'm using it in production, but I don't want to make it public as long as it looks like this :D

I will send you the code at the weekend, for sure.

Luk

Administrator

Posts: 1,511

Location: Germany

Activity points: 33645

Level: 41

Experience: 2,471,333

Next Level: 2,530,022

  • Send private message

7

Tuesday, February 28th 2017, 6:12pm

Take the time you need ;)

AlexC

Intermediate

Posts: 85

Location: United Kingdom

Occupation: Electrician

Activity points: 1550

Level: 26

Experience: 106,459

Next Level: 125,609

  • alexandercurl
  • Send private message

8

Friday, March 17th 2017, 8:56pm

Meow.

Any news?

Well i'm not too happy are you using java instead of c++ or something. As long as cod4x released, especially 1.8 newer versions, we able to use C and D (haven't been tested, just some additions to willing to support soon) plugins in our servers. More efficient, and also able to work on Windows as well, just need to compile it with mingw or cygwin.
Alex C.

Luk

Administrator

Posts: 1,511

Location: Germany

Activity points: 33645

Level: 41

Experience: 2,471,333

Next Level: 2,530,022

  • Send private message

9

Friday, March 17th 2017, 9:18pm

But Java will work on any platform, no matter what. That's the advantage of Java.

AlexC

Intermediate

Posts: 85

Location: United Kingdom

Occupation: Electrician

Activity points: 1550

Level: 26

Experience: 106,459

Next Level: 125,609

  • alexandercurl
  • Send private message

10

Saturday, March 18th 2017, 4:41pm

As I written before, it works Linux and Windows dedicated server as well. I don't think so someone want to start a MacOS cod4 server for that :)
Alex C.

Luk

Administrator

Posts: 1,511

Location: Germany

Activity points: 33645

Level: 41

Experience: 2,471,333

Next Level: 2,530,022

  • Send private message

11

Saturday, March 18th 2017, 5:17pm

Well, what about being grateful that we get a Java edition? I know that Java and C are similar, but converting from one language to another might be hard for someone who is not familiar with C. You can write that plug-in if it is that easy :P

AlexC

Intermediate

Posts: 85

Location: United Kingdom

Occupation: Electrician

Activity points: 1550

Level: 26

Experience: 106,459

Next Level: 125,609

  • alexandercurl
  • Send private message

12

Sunday, March 19th 2017, 10:09pm

I didn't say anything about how easy or hard is it, since we don't know the proper mechanism and code. So we will see later. :)
Alex C.

Luk

Administrator

Posts: 1,511

Location: Germany

Activity points: 33645

Level: 41

Experience: 2,471,333

Next Level: 2,530,022

  • Send private message

13

Thursday, April 27th 2017, 7:00pm