• 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!

Generating maps?

1. creature for all types of creatures - if it's player - move to temple, else - remove
forgot about this one:
creature:teleportTo(creature:getTown():getTemplePosition())
2. correct

if you're going to make script compatible with older servers, this may be useful: https://otland.net/threads/oop-classes-for-older-tfs-versions-0-3-x-0-4x.243414/

I'm noob in metatables so ask someone experienced to correct thing from that post before writing compat file
 
Last edited:
I'm going to abandon writing my system inside TFS
Cuz my "Generating System" is more like "Map Manipulation System" it covers too much.
From drawing on map simple shapes through spawning monsters,placing massive random details,placing precised details(borders and more) to finally generate ground...
I decided to try write it as dynamic library .so/.dll
For comptaibility i want use build in tfs lua function to copy map part into my internal structure in library
Make every operation on separate threads so TFS is not affected
When task is finished just repeat first function in reverse order
So TFS side is as small as possible
Easy to update(just replace library)
Easy to maintain cuz source code is not part of TFS
And i was just thinking making this library capable of executing LUA scripts.
Thats why i asked how portable is your code :D
 
cool
tried loading external exe before, but it hangs tfs while program is running
 
And one more important thing.
About year ago i created builder http://prots.eu/?subtopic=buildersystem
Builder is another story...its abandoned cuz small amount of players could use it (lack of IQ).
Nobody believes you can build own house inside tibia ;D
Again it manipulates map.
So there is too many custom things ;p
This is pretty off-topic but how did you manage to use auto music in your site? Could you teach me?^^
 
@pszczelakov so you use dll to manipulate map? Could you post an example?
 
And one more important thing.
About year ago i created builder http://prots.eu/?subtopic=buildersystem
Builder is another story...its abandoned cuz small amount of players could use it (lack of IQ).
Nobody believes you can build own house inside tibia ;D
Again it manipulates map.
So there is too many custom things ;p
give me ~2 months (if by then i'm at patch 0.2, i will be making building system for players.)
But its building from inside the game with modalWindows. so i guess a bit different story other than the website thing you linked and i did not understand.
 
This is pretty off-topic but how did you manage to use auto music in your site? Could you teach me?^^
Music is pretty straightforward its a youtube player :D on bottom of the site with width & height at 0%
@zbizu
Builder dont use library, it sits in iomap.cpp using TFS api and thats why its important for me to make one.
If i write core of library i'll post example.
@whitevo
It works something like:
-Java application(applet)
-Builder Server https://github.com/pszczelaszkov/Builder-Server (Connects Java<>MYSQL)
-TFS listener in iomap.cpp(Checking MYSQL builder tables)
 
After a few days of research.
I prepared library schema for me,to be sure im not miss anything.
Here it is:
subqz6.jpg


TFS Side means TFS thread can safely access it,as long as you dont f*** up arguments :).
As you can see library could be easily hot swaped by using load/unload(CPP modifications without restarting TFS).

THEORY:
Contexts will run each on own thread.
They will be holding std::map or 2 vectors with {task pointer,task name} and {arguments} so with few lines of code, context could execute many tasks.
Presets will be constructors for example mapContextPreset should be function that initializes map structure and copy map fragment from TFS.
There will be private data holder assigned for each context.

Few days ago i said that it will use LUA for applying changes in TFS.But first ill try with direct scheduler access.
But that is just theory...

Possible problems:
Cpp even with auto and templates isnt best language for generic methods.Im sure i meet many segfaults.
As i know TFS uses boost::bind for scheduler.Since C++11 we have std::bind and i would stick with it instead of linking heavy Boostlibrary in my library.Will it blend?
I dont know how to pass arguments and return value between Lua and TFS.
Arguments:How i translate lua stack N values into function(there should be N parameters).
Maybe parse it to String(value:value:....)?
Return:I cant find (template like) type variable in TFS-LUA api so i can put there anything and user in script cast it to value_type he wants.
Tfs should have minimal overhead to easily prepare TFS for library support so i dont want manipulate with TFS-LUA api.

Already only libraryWrapper is working on Windows and Linux,but its not connected to TFS yet.
Thats all from me in "library support" topic.

I hope next time ill post working beta library able to modify map fragment.
 
That's some insane programming lol
I solved lag problems simply by using addEvent
 
addEvent is good ,but i needed to schedule events on 30minutes or more range to generate good 500x500 terrain :D
And i dont remember what task was bottleneck i think clearing and drawing squares on map but im not sure.
But nevermind,even with library it should be done on tfs side, not library for safety reasons:D
 
What's so bad in scheduling maps? Generated areas should be more like an event than normal hunting area. Also, you may generate map and save it as otbm before shutting server down, this way you could start your ot later with area ready to play instantly.
 
What's so bad in scheduling maps? Generated areas should be more like an event than normal hunting area. Also, you may generate map and save it as otbm before shutting server down, this way you could start your ot later with area ready to play instantly.

Roguelike games (such as Rogue and Nethack; and roguelites such as Binding of Isaac) randomize the maps on every play, and it is one of the major attractions to the genre in general.

The appeal that every time(or everyday) you go somewhere and it being different, is enough to carry a game completely. Makes every play a fresh challenge, and that alone can have people coming back for more.

Applying that to an MMORPG is a bit tricky, as most roguelikes are single player games, and don't have to account for multiple people in an area. People also enjoy getting to 'know an area''', and using that to their advantage in pve/pvp, plus some content be it exploring an area, quests or boss challenges may logically take more than one run/a day to complete.

But just pushing the timing of randomization on either server start up, or attach the randomization to an event that players achieve in game (such as beating the boss in a dungeon, then kicking all the players out of the dungeon after a count down) is a way to adapt the system to an MMO, and creates the need to regularly re-generate new areas.




That said, I like all the the work being presented here, as creating randomize/generated content has been something thats been on my mind for years, and I believe it perfectly fit in a game like Tibia.

Though one aspect being ignored here is that even with generated content, you sometimes you need to randomly included hand-made into the areas so that areas still have content, and not just have areas become "hunting zones''
 
Ye, I know.
Generated maps are win for both - those who want to use dynamic maps and those who just want premade maps.

First group will enjoy random game everytime they join. Plus it's harder(still possible) to bot on area changing its tunnels every x time so they're bot resistant a little more ;p It would require reworking waypoints system to bot on them.

Second group will enjoy premade maps with decent quality (saved as otbm) too because they won't need to spend hours(or hire mappers) to build low-end hunting grounds anymore. In this case knowing the area factor is fulfilled.

Of course there will always be a place for mappers - there are always things which need to be made manually. If everything was auto-generated, it wouldn't be so exciting anymore.

Applying random areas to MMO style isn't tricky at all - with premade structures(with npcs and objects with actionid inside) it's possible to build complex quests inside a dungeon (just like outside of it). See also my open world chests script - if we use unmoveable containers, we won't need uniqueId anymore. If we reset chests every 10 minutes, everyone will get a chance to loot something worth from the chests.

The biggest fun when I was playing Minecraft wasn't seeing all that random terrain. It was structures - locating temples, visiting strongholds, exploring mines, killing skeletons in a dungeon room, staying in villages. Puzzle like those can't be generated just as terrain - all of them were premade structures.

*by structures I mean premade locations/cells added on random positions inside a dungeon

(pve, pvp and botting part covered above)

I already did structures in dungeons before. i.e. tomb dungeon from my datapack generate some puzzle and is active for 4 hours(after that time it can be open again as a different map). Reward rooms are spawned and if you solve the puzzle(some require 2 players), you'll get inside it, there is also tp(based on offset) to leave those rooms ^^

edit:
main function almost done ;p
zN9ehid.jpg
 
Last edited:
*by structures I mean premade locations/cells added on random positions inside a dungeon

This is the most important thing. As game creators, it is important that we retain the ability to create interesting and thought provoking content.

When we just soley rely on randomization, it takes away from the ability to make content that has ''logic''.

The player should be on his toes most of the time playing, and questioning his surroundings, wondering what could be here, what could he learn from what he sees.

Here is a small crude example of a ''quest''/puzzle i'd like to have in a randomized dungeon.

There is a keep, locked in the dungeon, that has a puzzle required to open the front gate for 30 minutes, and has ''hints'' laid out in the dungeon to help figure out the puzzle.

The puzzle itself is to set the color of stones in a sequenced order.

The hint itself might be something like a red statue, or a fire to signify red. The object would be chosen from an array of items to represent its specific color.

Imagine the dungeon as a 10x10 square (with each square being say, a 30x30 tile area)

Key:
0 - Open Area
K - Keep
E - Entrance to the keep
H - Hint
P - Puzzle

0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0

Now, we would have to place the keep, which has a pre-made shape. (the keep is placed randomly, but must keep all of it's respected shape)

0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 K K K K K
0 0 0 0 0 0 K K K 0
0 0 0 0 0 0 K E K 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0

Now that we have placed the keep, we have to place the hints and the puzzle to open the keep. (again, the hints and puzzle are random spots)

0 H 0 0 0 0 0 0 0 0
0 0 0 0 0 K K K K K
0 0 0 0 0 0 K K K 0
0 0 0 0 0 0 K E K 0
0 0 0 0 0 0 0 0 0 0
H 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 P H 0 0 0 0


Now, here comes the hard part. The hints themselves have to give information on where the other hints and the puzzle is located, and must reflect the randomized spots.

An example for this would be a simple riddle like "Three brothers who used to live in the south, all moved out. One brother loved the cold winds, one brother wanted to explore the west, and one brother hardly moved at all"

This riddle might be found at the E, P and H locations on the map.

Now, that riddle has to be generated after the puzzle location is placed, and it chooses how many hints there are for the puzzle.

Lets say the puzzle is a puzzle that you have to do some actions in a sequence.

The ''three brothers'' part is just listing how many hints there are, which reflects how long the sequence is.

The 'live in the south'' part is a reflection of where the actual puzzle location is. There would be an array of phrases dependent on location of the puzzle, with obvious alternatives such as"in the north'', ''due west'', ''due east''.


Then the riddle lists off the brothers, in order of their use for the sequence.

The hints themselves can either roll a direction relative to the map/dungeon it is in, relative to the location of the puzzle, or if it is a red herring or not.

The first part is ''one brother loved the cold winds'', which is a hint at his location. In reality, (and most fiction), the higher north you go, the colder it gets. So the ''cold winds'' is a reference in that the hint might be found in the north.

Now again, there would an array for options when a hint rolls a north location, with other options such as ''one brother wanted to open a snow cone shop'' ''one brother went north'' and so on.

However, this is different than if it would of rolled ''located north of the puzzle''.

The second part is ''one brother wanted to explore the west'' which means that the location must be west of the puzzle itself, rather than just being a pure western location. Wording is important here, as this hint rolled the ''relative to the puzzles location'' part.

The last part ''hardly moved at all'' is again a ''relative to the puzzles location'' roll, which means that this hint can be found relatively close to the puzzle itself.


-------------------------------


The above puzzle has to be generated along with the map itself, and the text itself could be found at the E, H and P locations, but if the sign is there would be a random roll in itself, but must be found at least one of the locations.


The puzzle, when solved, has to open the keep at the E location, which can be as simple enough as removing a gate item, and replacing it after X time has passed. I guess instead of using a location remove an the gate item, we would use UIDs, and remove whatever has the UID.

It must be noted, that the above locations can be placed anywhere on the map.

The above map could even look like this:

H 0 0 0 0 0 0 0 P 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 H 0 0 0 0
K 0 0 0 0 0 0 0 0 0
K K K 0 0 0 0 0 0 0
K K E 0 0 0 0 0 0 0
K K K 0 0 0 0 0 0 H
K 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 H 0 0 0 0 0 0

And the puzzle/hint should be generated to work still.


--------------------


Very long post, but it's always been my dream to have an MMO that plays like Rogue or Nethack, and retains a high level of puzzle solving/critical thinking.

I'm just throwing ideas out there to remind everyone that randomization can be good, but it is more than just the randomized layout or encounters that matter. Puzzle solving itself matters as well, and can be randomized to go along with the dungeons as well. Even scripted events can be incorporated into a randomized way.

PS

On your randomized chest, it's a good idea, it being a different reward every time that chest is found. I just prefer the ''first come, first server' rule, meaning only one person can get the chest, and it doesn't have to have a set location, or be unmovable. After the chest is used, and 10 minutes passed, it should pick a new location to spawn, and even if it spawns at all.
 
@Sportacus taken into account. Should be very easy to implement with my table of structures. There is a risk of dead cells(no way to get to part of puzzle), but I will try to build a path ;p
 
Back
Top