FOnline Development > Questions and Answers

[Solved] 2 Questions about Worldmap

(1/2) > >>

C4N:
I'm trying to make some kind of "more realistic" traveling system, but I stumbled upon a problem I cannot solve.

How can you edit the speed at which players move around the world map?
I found this var in script/config.fos, but changing it to a lower or higher number doesn't seems to do anything related to worldmap speed at all.


--- Code: ---    __GlobalMapMoveTime         = 250;
--- End code ---

FOnline API says this: Указывает на то как часто вызывать обработчик глобальной карты GLOBAL_PROCESS_MOVE.

Which means: Indicates how often to call the GLOBAL_PROCESS_MOVE global map handler.
And that just doesn't make any sense to me... I honestly have no idea what is that for.

ANSWER:

--- Quote from: Vice Dice on September 14, 2018, 08:24:20 pm ---First question - Open your scripts.cfg file in a server/scripts directory, look for @server bind global_process, you will find out where the function is bounded from to the engine. Everything else from this point should be very simple.

--- End quote ---

Te other question is a bit more complex, can we change the behavior of the server's way to read the heightmap image in maps/? Or it is hardcoded into the engine?
Currently it is a simple PNG, but I want it to be multiple PNG, to make a heightmap that works the same way the original game reads the "bigmap", ie:

Instead of one image, I want it to be four, like:

--- Code: ---heightmap-01.png  -  top left
heightmap-02.png  -  top right
heightmap-03.png  -  bottom left
heightmap-04.png  -  bottom right
--- End code ---

ANSWER:

--- Quote from: C4N on September 15, 2018, 08:00:55 pm ---I concluded my research on this topic... sadly, it can't be done.
TL;DR for the curious, don't make maps bigger than 8192 px, a 100x100x81 setup is the biggest I could manage to do.

--- End quote ---

Thanks in advance for any help with this.

Vice Dice:
First question - Open your scripts.cfg file in a server/scripts directory, look for @server bind global_process, you will find out where the function is bounded from to the engine. Everything else from this point should be very simple.

Second question - seems like you want to split the globalmap picture into pieces ? For client its possible. Search for GmapTilesX and GmapTilesY entries in your interface configuration file ( default.ini in example ). But if question is about the worldmap mask picture, I dont really understand why would you need that, because normally its used with GetGlobalMapRelief server function that cuts off low 4 bits of blue piece of a pixel colour of the given position ( up to 16 masks support by default ). Where pixel is the actual position on the worldmap *picture*. And honestly, if anyone knows if this is possible without hard magik ?

rifleman17:

--- Quote from: C4N on September 14, 2018, 05:55:04 pm ---I'm trying to make some kind of "more realistic" traveling system...

--- End quote ---

What SDK version are you talking about? It's important issue

C4N:

--- Quote from: Vice Dice on September 14, 2018, 08:24:20 pm ---First question - Open your scripts.cfg file in a server/scripts directory, look for @server bind global_process, you will find out where the function is bounded from to the engine. Everything else from this point should be very simple.

Second question - seems like you want to split the globalmap picture into pieces ? For client its possible. Search for GmapTilesX and GmapTilesY entries in your interface configuration file ( default.ini in example ). But if question is about the worldmap mask picture, I dont really understand why would you need that, because normally its used with GetGlobalMapRelief server function that cuts off low 4 bits of blue piece of a pixel colour of the given position ( up to 16 masks support by default ). Where pixel is the actual position on the worldmap *picture*. And honestly, if anyone knows if this is possible without hard magik ?

--- End quote ---

Thanks, this is what I was looking for. I found the procedure with the pixel speed logic, there is a math line where you can easily increase the divider value to practically make the player move slower.
Looking at the code I realized that things like roads, where only cars travel faster could be possible (even mud areas where it gets stuck), interesting stuff in here, I also saw what you said about the mask, mask ID are retrieved from GetGlobalMapRelief, that function made me to think about what I want to do with the heightmap. Actually, to correct myself (sorry I'm no English native speaker), when I said heightmap, I meant this image where you use different colors to define a different worldmap movement logic on the server, it's not an actual heightmap, but I don't know how to call it, heheh.

To the point.
From WorldmapInit, I can initialize multiple images, create the definitions for every image and modify GetGlobalMapRelief logic to something like this:

if coords in section1
 retrieve pixel from image 1
if coords in section2
 retrieve pixel from image 2
if coords in section3
 retrieve pixel from image 3
and so on...
.
.
return pixel

So I think its possible, I'll try this 'hard magik' later on, I need to put my brain into coffee to make this thing clear (I just woke up).


--- Quote from: rifleman17 on September 14, 2018, 09:08:42 pm ---What SDK version are you talking about? It's important issue

--- End quote ---

I think that to answer this I need to give a bit of background, but, TL;DR: /Koniiko

So, to explain myself a bit further, I'm in the first phase of a project idea, conceptualizing, I currently have a little team; a writer (historian) and a designer, we are talking and drawing things so this project has a solid start. But to do so, I (as the developer of the team) need to understand what are the limits of this engine, that's why I'm trying some crazy stuff to push the engine and find the practical limits. In the process, I'm learning how everything works... not an easy task without a lovely well documented API.

I first tried to use the original SDK (rev 800 if I remember well) from cvet, but I didn't manage to make it work, I couldn't even launch the server.
Then I started to search for options and found the Reloaded 1 and 2, I tried both and both worked, I though that was a good start.
But then, I suddenly found what Koniiko released a couple of days ago, so I decided to use that instead, it looks more solid than Reloaded2.

And now, I'm looking at the code trying things, a little funny anecdote to share. When my writer asked me, - How big can the map be?. I was like... - I have no idea let me see.
That's when I realized that traveling to city A to city B in 20 seconds was pretty bollocks and I started this research on "a new traveling system".

I have on my bag-of-things-to-do, questions like; how many cities can we have? How many NPCs can the server handle? Are any limitations on how many critters and different objects can the client load? And a large etc.

From this I can't say more, as I said we are in concept phase and it has no point to say more until we have something. But do not worry, we'll release here when we have a solid alpha.

rifleman17:

--- Quote from: C4N on September 15, 2018, 03:58:22 am ---How big can the map be?.

--- End quote ---

Max size of global map is 100x100 zones, max width of zone is 500 pixels. (__GlobalMapWidth, etc, in config.fos )

You can manage the global movement speed by using image masks. Color of pixel refers some speed koefficient.
For example (from old TLA content):
   mask
   (script: function void global_process)

Navigation

[0] Message Index

[#] Next page

Go to full version