• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Concept] Dynamic Maps

dragaoart

Since 2009...
Joined
May 10, 2009
Messages
97
Reaction score
9
Hello all, I'm a web developer and OT enthusiastic.

Today I'm presenting you a concept for discussion: Dynamic Generated Maps.

Dynamic Maps
Dynamic maps are maps generated by the server, based on a map template, that will be allocated in the server memory for Raid-like events.

This concept consists in creating a map when a player or a team join in a party quest(Raids) or arena.
That area of the map is cloned as an object and stored in the server memory, then allow that same area to be re-used if needed another Raid. It will generate an infinite amount of that map piece, depending on the number of parties joining the same Raid.

In example:

Party - 4 players:
  1. They go to the entrance location, find the activation switch, with all 4 members in defined spot to be transported to a quest area.
  2. Once they activate the switch, that quest area will be cloned by a function code, allocate that same map on a new memory location.
  3. After that, when they are inside the quest, another party with new members try to enter the same area.
  4. Then the server will generate again, another map, with the same tiles, but in a new pseudo-location. Not necessarily inside the map, but in virtual map.
Problems:
  • Generate a map tempate without interfering on the current map system.
  • "Cloning" a piece of the map without high memory usage.
  • Manage a systemic memory allocation to define when the party if off the map to delete and free the memory to a new Raid.
Discussions are welcome!

--edit
Recommended link #1 Generating maps? - The idea of this script is to spawn random areas on the map. It is a nice start point.
Recommended link #2 Infinity Training Room - A practical implementation using a template map on void spaces

Tags related: dynamic, mapping, generate, server, c++, programming, random, instantiate, function
 
Last edited:
Sounds like a nice idea but I don't see how the map would be generated in a way that it can be used straight away without restarting the server :confused:
 
In the current state of the map system, it can sound impossible to do.
But if you think that anything can be done in computer programming, that should not be an impossible idea.
 
I take your point, there would have to be a lot of script changes, possibly a newly built engine :D
 
Maybe making the map instanced In DATA/WORLD, and make some how the engine call them ???

Anyways that is not dynamic, a dynamic is more something that is always changing/adapting, so I'd say more like Instanced Worlds~
 
Clear like delete the tiles? This type of scripts cost too much memory? Like 50 players enter using this system in the same time!
Omg, this guys are doing the impossible?! Thx!
Yes it deletes the tiles once the player leaves.
You could use coroutines when creating dungeons, to break down the parts so it wont use a lot of memory at once, but players would have to wait a tiny bit then until the dungeon is created.
http://lua-users.org/wiki/CoroutinesTutorial
 
On Quest OTs I had a world quest which would "change" a town based on its status, from a ruin themed town to a regular and npc populated town. But what I did was to have 2 versions of the town at all times on the map. And when entering the town they had to walk on some onStepIn titles which would teleport them to the correct version of the town. Since they got teleported to the exact same representation of where they where, you as a player could not spot or notice that you where being moved. (aside from your mini-map being wrong).

VkEsQMdA.png


By placing the "ruin" representation of the town underground I was able to take advantage of the fact that its dark.
U1dI7PE.png


Giving you a wtf moment when the screen suddenly turns dark. :)
 
On Quest OTs I had a world quest which would "change" a town based on its status, from a ruin themed town ...
Hey Znote, first of all, thanks for providing the best AAC in the world!
Do you have a sample code to share with us? I'm trying to get as many info as possible, and them compile them into a single code.
 
the biggest problem is autoborder at moment... i have a little random map generator project but.. without autoborder =\
 
On Quest OTs I had a world quest which would "change" a town based on its status, from a ruin themed town to a regular and npc populated town. But what I did was to have 2 versions of the town at all times on the map. And when entering the town they had to walk on some onStepIn titles which would teleport them to the correct version of the town. Since they got teleported to the exact same representation of where they where, you as a player could not spot or notice that you where being moved. (aside from your mini-map being wrong).

VkEsQMdA.png


By placing the "ruin" representation of the town underground I was able to take advantage of the fact that its dark.
U1dI7PE.png


Giving you a wtf moment when the screen suddenly turns dark. :)

Oh this is so good, you are using TFS 0.4? I found a scrip of map generator, i don't made the test yet, but i think the script have autoborder (WTF.Error), but that script use TFS 1.0, and i don't know how to do a downgrade to 8.60 client version and if is possible to. Maybe if everyone help we can do the perfect script. This of course will change a lot on Tibia scene.
And Znote, i don't knew you did the ZnoteAAC (really), i use Gesior, but thanks, this kind of guy(like u) helps a lot our lifes. Rly thanks!
 
Thanks. :)

I only used basic movement scripts, and storage value to determine which town to move the player to. I coded it for TFS 0.3/4 8.6 for about 2 years ago, but should be very easy to fix for just about any distribution.

Code:
function onStepIn(cid)
if(not isPlayer(cid)) then
        return true
end
local todarkness = {x=534,y=1326,z=9}
 
    if getPlayerStorageValue(cid,40010) < 1 then
        doPlayerSendTextMessage(cid, 13, "This village is cursed by darkness.")
        doTeleportThing(cid, todarkness)
    else
        return true
    end

    return true
end

Code:
function onStepIn(cid)
-- Monsters are not affected to avoid luring between zones
if(not isPlayer(cid)) then
        return true
end
-- Exit position back to the regular world
local tonormal = {x=626,y=1354,z=5}
    -- Quest status to determine which action to take
    if getPlayerStorageValue(cid,40010) < 1 then
        doTeleportThing(cid, tonormal)
    else
        return true
    end

    return true
end
 
Back
Top