Simulating Proximity

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
I guess this is somewhat of a puzzle -- how do you simulate proximity in a game where the maps are distinct from one another and the concept of "closeness" doesn't really exist?

For example, in Morrowind, there is a spell called "Divine Intervention" which will teleport you to the closest church in proximity to the player. This doesn't seem possible with the vxace platform because, as mentioned above, the mapping system is not one where you can "connect" them in terms of proximity. There's no simple way to tell the game if a player is closer to one map rather than another.

Is this something any of you have successfully addressed?
 

Ralpf

Veteran
Veteran
Joined
Jun 5, 2014
Messages
590
Reaction score
152
First Language
English
It's not something I have tried to do, but something comes to mind.

Figure out which area you should go to from each map (maybe draw them out on a map), then set a variable upon entering each map, the variable would define where you teleport. If you want to get more detailed, such as for large maps, you could have the variable change mid-map with events (I would use regions, when entering certain regions change the variable).
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
Ahh yes -- I thought of this, but it seemed burdensome to set a condition for each possible proximity check on each map. But yes, I would do it manually if there was no other solution. It's funny because it's the first problem I've encountered with the program that did not have a quicker-than-manual fix.

Hmm. With some additional thought, maybe you're right -- use a variable when the proximity changes and I might be able to get away with relatively few variables -- still burdensome in some scenarios, though.
 
Last edited by a moderator:

Ralpf

Veteran
Veteran
Joined
Jun 5, 2014
Messages
590
Reaction score
152
First Language
English
Yeah, just put the variable change with the transfer event and it shouldn't take much time.

If you have any maps that you want to have multiple possible teleport locations run a common event that checks regions and change variable based on region, that's how I would approach that anyway.
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
Yeah I did that exactly for my "mark" and "recall" spells, thx again^^
 

RetroNutcase

Jolly Cooperating Sunbro
Veteran
Joined
Aug 2, 2015
Messages
63
Reaction score
19
First Language
English
Primarily Uses
Just a friendly heads up, this board isn't for those types of questions. You're asking "How do I do something codewise?" This board is meant for gameplay mechanics. IE "What would make a good boss battle?" or "How does one balance stats on a class?" and the like. Just for future reference.
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
Uhm, maybe -- I think simulating proximity can be a designed mechanic. Your example of "how does one balance stats on a class" can be answered in just the same way my question can be. Also, you meant "e.g." not "i.e." Thanks for the tip, though.
 

SinのAria

The Chaotic One
Veteran
Joined
Feb 11, 2014
Messages
142
Reaction score
72
First Language
C++
Primarily Uses
N/A
What I would do is base it on a variable table. Let us say that you know that x map is y distance from z map.

You could do this in many ways depending on the accuracy level you need.

For example, low accuracy:

For a single world map, you would likely simply do a check of valid end points and then compare each to your start point and see which is the shortest distance.

For a dungeon or similar map, using a teleport to a town might be based on the map itself rather than exact coords.

For example, high accuracy:

For a single world map, you would be doing a check of all the valid end points with barriers in mind. This can get more complicated unless you do it region by region as suggested earlier.

For a dungeon or similar map, you would need to do a distance for each exit. Then on each map connected, you would need to calculate distance towards the nearest end point. To do this quickly, you could have each map entry and exit point have their own value saved in some form of table. This would prevent the need to calculate it each time.

Then you could add the numbers together and then sort through to see what the lowest number is and that would determine the destination.

This will likely require some scripting though.

What I would personally do is do a coordinate map table (I think that is the right term?)

X1,Y1 to X2,Y2 to X3,Y3 to X4,Y4 go to EndPoint1 type of thing. In other words, if your current coords are within those boundaries, you go to EndPoint1.

Say 0,0 to 0,40 to 40,40 to 40,0 (a square) is the area and you are in 20,20. You go to EndPoint1.

Some maps may just have a "if in this map, go here"

Would likely require a bit of scripting, but you wouldn't have to change any variables manually. You would just need to realize that you'd have to make an entry for each section of each map.
 
Last edited by a moderator:

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
That's a great idea.. to have a script which creates a virtual map and I can place individual maps as coordinates on the virtual map which could be referenced. I like that a great deal.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,635
Reaction score
5,116
First Language
English
Primarily Uses
RMVXA
Whenever I need to do something like this, I go for a much simpler approach and transport the player to the last Inn/Church/etc. that they visited.  This not only saves me a lot of time as a designer, but also avoids gamebreaking situations like warping somewhere the player has never been and then activating an event from the wrong side.  I think this is a much better solution for a standard narrative-driven RPG.  For an open-world Western-style RPG, what I'd probably do is just assign each map its own "nearest church" based on a mental layout that I'm picturing based on how each map connects.
 

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
I completely agree. My game will be open world though :) Your idea does save quite a bit of time though... hmm o_O

I think that's a great idea. A spell that will bring you to the last church the character prayed at, or offered some pilgrimage, etc..

Wavelength, you my guardian angel or something?
 

SinのAria

The Chaotic One
Veteran
Joined
Feb 11, 2014
Messages
142
Reaction score
72
First Language
C++
Primarily Uses
N/A
Yeah, the main problem with my idea is that you will need to have a checklist of each area visited. The last major location method is fairly common, but that also means that if you haven't visited a town in a while, you could potentially end up all the way across the world (imagine if you weren't supposed to go back to a town because it was supposed to be destroyed or w/e, but managed to never enter another town).

Simple enough to fix - force players to enter a town after an event that would render a town inaccessible or set a 'default' area when such events occur, but something to consider.
 
Last edited by a moderator:

Dymdez

Newbie-in-Chief
Veteran
Joined
Feb 4, 2014
Messages
752
Reaction score
154
First Language
English
Primarily Uses
Yeah, the main problem with my idea is that you will need to have a checklist of each area visited. The last major location method is fairly common, but that also means that if you haven't visited a town in a while, you could potentially end up all the way across the world (imagine if you weren't supposed to go back to a town because it was supposed to be destroyed or w/e, but managed to never enter another town).

Simple enough to fix - force players to enter a town after an event that would render a town inaccessible or set a 'default' area when such events occur, but something to consider.
Oh - I actually prefer this. Did you ever play Morrowind? One of the most fun parts of the game was calling for Divine Intervention and teleporting halfway across the game in completely unknown territory, with no quick way out.

Maybe!  Did you pray for me at the last church you visited on Map ID 048? :p
lmfao
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top