SRL Archive - Reflection Development

Why Current Tile System is Flawed


Narcle

2008-09-17 15:54:56

Actual Tile System (concept)


Well some of you know or have seen (mainly SRL-Members) I've had a reflection fighter released just a bit ago (Echo Fighter). It fights almost all monsters perfectly. Except for one type - "4 tiled mobs" as I've been saying. What are 4 tiled mobs? Well they are monsters (I say 'mob' for short) that occupy 4 tiles of space and end up having their center in the middle of these 4 tiles. Now why can't I get my fighter to attack these "4 tiled mobs" well that's what I'm going to explain.

I made a chart below to give you a better idea of how the "tile" system should be or is rather. We all know that doors and a couple various other things are "between" tiles or simply a wall between tiles. Well as show below I believe these "walls" are really half tiles in the game. Currently we have only Whole Tile x Whole Tile where in actuality there is also Half tile x Half tile, Whole Tile x Half tile.

With our current tile system in mind now think of the TileToMS function. You can imagine the flaws with the tile system currently in place. Where if you wanted to move your mouse to a door, given a Tile, it moves above the tile but is still 20 pixels or so from the actual door. Of course we can solve this problem by simply using the cords of the tiles from both sides of the door and averaging them out. Fairly simple for non-moving objects.

For "4 tiled mobs" this averaging out system does not work, nor can it be applied. With the help of HyperSecrets screen shots I've seen that "4 tiled mobs" only have 1 ID shown in the center of 4 tiles. Which mean they are in a Half x Half tile. This causes a couple problems. Firstly we can't do a "averaging out" as you only have one tile that the mob is in and it moves around. Secondly we don't have a Half tiled system, so Ben's tile x tile system (same problem with RSBot I believe) when recorded, automatically puts the mob in a tile x tile, which isn't where the center of the mob is. So when you do the TileToMS for this monster, it moves the mouse above one of these 4 tiles and about 60% (or more) of the time misses putting the mouse over the mob.

How to solve this problem? Few things would have to be changed firstly, and possible whats stopping this is that our current tile system uses TPoints, so implementing "half tiles" would be almost impossible (record system maybe?). After that it would be just changing the main functions that use tiles. With our system it would be a major overhaul to even do this. However with this system in place it would solve many problems and allow us reflection users more control with the environment.


Naike

2008-09-17 16:09:28

Support.

Should be done, if possible? :o

MylesMadness

2008-09-17 16:41:54

As far as I know without a lot of work and I mean a lot it won't be possible.

Seroko

2008-09-17 17:41:31

uhm, add the two diagonal tiles and divide to find the center? and thats what I do for doors occasionally needing a lil tweaking.

Lee Lok Hin

2008-09-17 17:51:21

Problem is, you don't always know which tile is the one of the 4 tiled thing.

Seroko

2008-09-17 18:03:48

From: Lee Lok Hin
Problem is, you don't always know which tile is the one of the 4 tiled thing.


Ah i didn't read close enough, maybe point to the tile it says and do a color spiral from that point?

Widget

2008-09-17 18:41:47

It's not hard to do, just the problem is it'd break scripts as they'd have to switch from TPoints to TTiles. If you want, I could rewrite a couple functions that you can copy/paste into your fighter? :)

turbobk

2008-09-17 20:45:43

Hey this function that I made may work for the monster's, as it doesn't store which tile the monster is on, it stores the X and Y location of the mouse into X and Y.

So it will always click on middle of the NPC.
Try it out, if you want.


Function FindNPCEx(Var x, y: Integer; TheName: String): Boolean;
Var
Name: Array Of TNPC;
i: Integer;
Begin
If Not LoggedIn Then Exit;
Name := SortNPCs(GetNPCsByName(TheName));
For i := 0 To High(Name) Do
If Name[i].MS.X <> 0 Then
Begin
x := Name[i].MS.X;
y := Name[i].MS.Y;
Result := True;
Exit;
End;
End;

Nava2

2008-09-17 20:50:00

From: turbobk
Hey this function that I made may work for the monster's, as it doesn't store which tile the monster is on, it stores the X and Y location of the mouse into X and Y.

So it will always click on middle of the NPC.
Try it out, if you want.


Function FindNPCEx(Var x, y: Integer; TheName: String): Boolean;
Var
Name: Array Of TNPC;
i: Integer;
Begin
If Not LoggedIn Then Exit;
Name := SortNPCs(GetNPCsByName(TheName));
For i := 0 To High(Name) Do
If Name[i].MS.X <> 0 Then
Begin
x := Name[i].MS.X;
y := Name[i].MS.Y;
Result := True;
Exit;
End;
End;


No offense, but you need to read. What was said that 4 Tiled monsters DO NOT work for the current system. you changed nothing, only used the current system.

E: I support, but its almost impossible. :(

Narcle

2008-09-17 23:39:11

Yes this would entail a big overhaul and break some scripts. But I think sooner is better then later, it'll break less scripts now then later down the road.

Widget we'll talk. ;)

Nava2

2008-09-23 07:42:05

ITS HERE! :)

For those who don't know. There is a stream of new functions in the Reflection folder which include the new TTile! :)

Thanks to Narcle, most scripts will continue to work, and those still active can migrate to TTiles!

Here is the type for TTiles:
type
TTile = record
x, y : Extended;
end;
TTileArray = Array of TTile;

Now, we can get partial tiles, and also those pesky four tiled monsters ;).

Seroko

2008-10-14 19:44:54

Not meaning to post on an old thread but TTile is finally done completely although it currently has no effect on objects most centered around multi-tiled monsters, after further testing hopefully it will be seen in reflection soon.

Smartzkid

2008-10-14 20:32:05

Afaik this isn't how it works?

(You should ask speljohan for help :))

Nava2

2008-10-15 08:17:57

Thats why we are changing it ;)

Narcle

2008-10-15 09:28:19

From: Smartzkid
Afaik this isn't how it works?

(You should ask speljohan for help :))


Yes I heard how it works now. But Seroko won't send me the new TTiles :p. Well in any case with the new RS client we'll have to wait for Ben to be contacted and hopefully update SMART for us soon. ^.^

n3ss3s

2008-10-15 10:32:47

It won't be as easy as just making TileToMS accept an 'extended point'.

It would be, but there is this little int[][][], the groundIntArray. Naturally, you cannot access an int array using extendeds e.g groundIntArray[1.5].

These tile borders and their data are most likely kept in an array that the cheating scene has never had any need for.

Thinking about a smart way to calculate the 2D area of the door on the screen, that you can click on, is a lot smarter than doing research about the unknown array, not to mention finding it.

I don't think it should be too hard to first use our regular TileToMS to get the

(x1, y1), (x2, y1), (x1, y2), (x2, y2)

of the monster, then from these to calculate the monsters mainscreen location assuming it's in the centre of the 2*2 tile area.

Smartzkid

2008-10-15 16:19:03

From what I've heard, RSBot 2 will be able to do what you want to do.

Speljohan makes RSBot

Ask him :p

Method

2008-10-15 18:59:28

From: Smartzkid
From what I've heard, RSBot 2 will be able to do what you want to do.

Speljohan makes RSBot

Ask him :p


Not anymore.