Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible), 637 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Tile Based Movement #285311
08/18/09 01:08
08/18/09 01:08
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline OP
Senior Member

Joined: Jun 2008
Posts: 428
Hi there,

i´m currently thinking about how to realize a tile based movement system.

The best example for my needs is the game Ragnarok Online.

here´s a small example. You see the green box on ground.

Watch here!

I got all that stuff with tracing to ground and character walks to the location from my isometric view. But how to realize those tileset walking?

greets Rasch

edit:

One more thing is. I´ll use a 3d landscape and characters. not 2d laugh

Last edited by Rasch; 08/18/09 01:17.
Re: Tile Based Movement [Re: Rasch] #285312
08/18/09 01:26
08/18/09 01:26
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Depends on how your "character walks to the location", but the basic concept looks to be this.

When the user clicks a location to walk to, set the target location
to be the-center-of-clicked-tile rather than the actual click location.

Also, when the character begins walking, calculate his from tile-center to tile-center.
That is...
<1> Calculate angle from 'here' to 'destination'.
<2> Round off angle to nearest 45 degrees. (0,45,90,135,etc)
<3> "smoothed" rotate player to face new angle.
<4> Once <3> is complete, walk forward to center of tile being faced.
<5> Once <4> is complete, stop moving.
<6> If 'destination' not yet reached, then loop back to step <1>.
<6A> Round off angle to nearest 90 degrees. (0,90,180,270)
<6B> "smoothed" rotate player to face new angle.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Tile Based Movement [Re: EvilSOB] #285314
08/18/09 01:40
08/18/09 01:40
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline OP
Senior Member

Joined: Jun 2008
Posts: 428
Ok that is some good point for a start but first of i wanted to bring the mouse cursor moving in a tile based movement. Means not smoothly everywhere but in steps.

Thanks for the help laugh

Re: Tile Based Movement [Re: Rasch] #285315
08/18/09 01:53
08/18/09 01:53
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Im not sure what you mean by that.
If you mean moving toward the mouse, while a mouse-button is held,
then just recalculate the 'destination' EVERY step <1>, and change step <6> to
<6> If 'destination' not yet reached, or mouse-button still pressed, then loop back to step <1>.

Or are you talking about moving the mouse-pointer ITSELF in steps?
(cause the video doesnt look like that to me)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Tile Based Movement [Re: EvilSOB] #285318
08/18/09 02:15
08/18/09 02:15
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline OP
Senior Member

Joined: Jun 2008
Posts: 428
Yes thats what i mean. The mouse pointer in those tiled steps. Ragnarok also use this method. the mouse pointer shows the tiles on the floor and jumps from tile to tile while movig mouse.

greets

Re: Tile Based Movement [Re: Rasch] #285320
08/18/09 02:44
08/18/09 02:44
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Hmmm, I can "kind of" see it.

OK, my best idea would be this.

Create a new mouse-pointer as a "view-entity". (Check manual if required)

Write a function that will stay running.
This function will monitor the REAL mouse position (using mouse_pos or mouse_cursor),
and will smooth-move the view-entity pointer toward the center of the tile that the REAL mouse is over.

When movement testing is complete, set "mouse_pointer=0;" in main to hide the 'normal' arrow.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Tile Based Movement [Re: EvilSOB] #285355
08/18/09 09:02
08/18/09 09:02
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline OP
Senior Member

Joined: Jun 2008
Posts: 428
ok you´r talking about taking the center of the tile. But i´ve got no tiles in my game. I trace from camera trough mouse to ground and set the target location where left clicked.

Now my thoughts were that i create small tiles and place them on the ground and the trace looks for those tiles and finds the center of them but this would mean that i have to use a lot of entitys.

So what do you exactly mean by your tiles?

Re: Tile Based Movement [Re: Rasch] #285553
08/19/09 00:49
08/19/09 00:49
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
You're asking me?
You want tile-based movement, but you've got no tile?
C'mon man, keep it real.... grin

Serious now.
I assumed your 'ground' was going to me made up of tiles,
and I think that was a sensible assumption on my part.
But if there is no 'actual' tiles, then we 'fake' them instead,
no need to create invisible tiles.

My sense of scale may be wrong here, it depends on your terrain sizes
and model sizes, so bear with me. Im basing this on the visual look of the video.

Lets say your player is 20 quants tall. The tiles look to be about half that.
SO player = 20 quants tall, tiles = 10 quants long/wide.
So to achieve our tile-like movements, we will make our fake tile positions
to be the 'corner' of each tile. (This simplifies the later calculations)

So from now on, whenever we have a target XY position of any sort, be it
a destination, a portal point, a dropped object, or whatever,
we need to "round-off" is position to that of a tile-corner.
In this example, to the nearest multiple of 10.

So lets say the mouse clicks at XY position 123,47
Your target position wants to be "rounded off" like so,
target.x = integer(target.x/10+0.5)*10;
target.y = integer(target.y/10+0.5)*10;
So our target position is now 120,50.

See how this is "faking" a tile position?
So if every position in the game is 'rounded' like this
then it will appear tile-like.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Tile Based Movement [Re: EvilSOB] #285811
08/20/09 10:38
08/20/09 10:38
Joined: Jun 2008
Posts: 428
Rasch Offline OP
Senior Member
Rasch  Offline OP
Senior Member

Joined: Jun 2008
Posts: 428
Ok seems like that it works. But the tile steps are very small. I tried everything this but can´t get it to work.


edit: ok my fault i got it to work. Thanks a lot laugh

Last edited by Rasch; 08/20/09 10:46.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1