Author Topic: Map Changes  (Read 2695 times)

Snailbrain

  • Developer
  • Hero Member
  • *****
  • Posts: 993
    • View Profile
Map Changes
« on: April 15, 2016, 04:11:34 PM »
I was reading a comment on bitcointalk by wiggi about map changes and the discussions going nowhere after lenghtly dicussions..

Quote
takes ages to move the character
Quote
yes it does, and the reason is not 30s or 60s blocks, but the map layout. It could have been a bunch of small villages
with safe inns to park your hunter and connected with teleportation links. This is technically trivial but after tiring discussions
the layout is as it is. (Btw, that's exactly what I meant with the "let them human miners suffer" mindset which does Huntercoin no good)

not sure which discussions :D but,

i think wiggi has the skills to change the map for a hardfork after huntercore is completed.

i think post some suggestions/maps which will fix the game being slow without having < 1min blocks.



wiggi

  • Global Moderator
  • Full Member
  • *****
  • Posts: 150
    • View Profile
Re: Map Changes
« Reply #1 on: April 16, 2016, 01:53:25 PM »

not sure which discussions :D but,


several threads here from early 2015 (not going nowhere because back then it was static banks in the corners)



i think wiggi has the skills to change the map for a hardfork after huntercore is completed.

i think post some suggestions/maps which will fix the game being slow without having < 1min blocks.

I'll make a less slow map (as playable testnet clone).
What do you think is roughly the time frame "now" <-> "huntercore completed" <-> "change the map for a hardfork"?

Btw if someone feels bored, there are still large parts of the 2D Circle Graphic tileset unused and not converted for Huntercoin...


Mithril Man

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
    • Mithril Man Web!
Re: Map Changes
« Reply #2 on: April 16, 2016, 04:48:56 PM »
to give a seamless look & feel about the map graphics, i think that we need to have a common layer/format

i know you (wiggi) have implemented a procedural method to improve the map, but in an hardfork scenario i think that a final common map has to be chosen as a starting point, and to achieve this, i think we have two main ways:

1) less intrusive, generate N layers of map containing the new image tiles you have used, or a subset, and hard code the final layers like actually the qt client does (so i think that basically you can tweak your procedural stuff to generate a fixed layered map and that would be done in not much time

2) more polished, better alternative, implement the whole map in Tiled ( http://www.mapeditor.org/ ) that was afaik the original used tool to generate the map, and just use the tiled map extension as the base map that each 3rd client can use (Unity too) . I know that Unity has already even some plugin that can read the tiled map format so this could even be better for unity developers


we could even create a custom Tiled map importer from our custom map layered system to pass from point 1 to point 2 later, if we want
Alternative GUI client for Huntercoin http://www.mithrilman.com
HUC donation: HMSCYGYJ5wo9FiniVU4pXWGUu8E8PSmoHE
BTC donation: 1DKLf1QKAZ5njucq37pZhMRG67qXDP3vPC

Snailbrain

  • Developer
  • Hero Member
  • *****
  • Posts: 993
    • View Profile
Re: Map Changes
« Reply #3 on: April 16, 2016, 07:06:58 PM »
if randomly generated with "obstacle" map is do-able i would prefer this.. i think this will help against some automation for a while and make it more fun and different each time..
or a selection of maps which change after each disaster?

otherwise we can attempt that at a later stage


Mithril Man

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
    • Mithril Man Web!
Re: Map Changes
« Reply #4 on: April 16, 2016, 07:12:17 PM »
if randomly generated with "obstacle" map is do-able i would prefer this.. i think this will help against some automation for a while and make it more fun and different each time..
or a selection of maps which change after each disaster?

otherwise we can attempt that at a later stage

I think there are much more important things to implement before random maps or whatever, and anyway a well designed map can be better designed than a procedural one, using props, etc...
Maybe a random map picked from a fixed (designed) set would be possible, but i think that investing time in gameplay changes, etc.. would be much better atm
Alternative GUI client for Huntercoin http://www.mithrilman.com
HUC donation: HMSCYGYJ5wo9FiniVU4pXWGUu8E8PSmoHE
BTC donation: 1DKLf1QKAZ5njucq37pZhMRG67qXDP3vPC

Snailbrain

  • Developer
  • Hero Member
  • *****
  • Posts: 993
    • View Profile
Re: Map Changes
« Reply #5 on: April 16, 2016, 07:18:20 PM »
if randomly generated with "obstacle" map is do-able i would prefer this.. i think this will help against some automation for a while and make it more fun and different each time..
or a selection of maps which change after each disaster?

otherwise we can attempt that at a later stage

I think there are much more important things to implement before random maps or whatever, and anyway a well designed map can be better designed than a procedural one, using props, etc...
Maybe a random map picked from a fixed (designed) set would be possible, but i think that investing time in gameplay changes, etc.. would be much better atm

yep agree, random maps can come later- - game changes need some work as a priority...  if the game is slow and that can be fixed with a map change then i think this is a good "gameplay change"

if wiggi also has some time to spend on it i think we should take that opportunity

wiggi

  • Global Moderator
  • Full Member
  • *****
  • Posts: 150
    • View Profile
Re: Map Changes
« Reply #6 on: April 17, 2016, 09:40:13 PM »
1) less intrusive, generate N layers of map containing the new image tiles you have used, or a subset, and hard code the final layers like actually the qt client does (so i think that basically you can tweak your procedural stuff to generate a fixed layered map and that would be done in not much time


Yes, like this. Easy because the data (after all tiles have been displayed) is already kept in the same format as in the original Qt,
only the array name is displaycache_gamemap and it's not 3 but 7 layers. And some tiles (the blood grass) have an additional xy offset up to +-30 pixels.


if randomly generated with "obstacle" map is do-able i would prefer this.. i think this will help against some automation for a while and make it more fun and different each time..
or a selection of maps which change after each disaster?

otherwise we can attempt that at a later stage

I think there are much more important things to implement before random maps or whatever, and anyway a well designed map can be better designed than a procedural one, using props, etc...
Maybe a random map picked from a fixed (designed) set would be possible, but i think that investing time in gameplay changes, etc.. would be much better atm

It would make sense on a very small scale. For example, sealing off 1 or 2 of the smaller harvest areas by comparing the last disasterheight, the current height, and the ObstacleMap value for a few critical tiles.

Invested time (and risk of things blowing up when enabled on mainnet) would be small but the effect is a (small) challenge every disaster, not broken and no one has to pay up for the bounty.


Mithril Man

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
    • Mithril Man Web!
Re: Map Changes
« Reply #7 on: April 18, 2016, 09:50:51 AM »
Yes, like this. Easy because the data (after all tiles have been displayed) is already kept in the same format as in the original Qt,

are you able to generate that file so that i can try to see if i can manage to visualize it in my client? (of course i'll download from github the missing tilesets)

i mean a file like the original one that has the array with tiles index in it

i can try then to use it to generate a tiled Map too if it's possible
about the tiles with offset i'll take a look at it (did you put them in a specific layer?)
« Last Edit: April 18, 2016, 09:53:09 AM by Mithril Man »
Alternative GUI client for Huntercoin http://www.mithrilman.com
HUC donation: HMSCYGYJ5wo9FiniVU4pXWGUu8E8PSmoHE
BTC donation: 1DKLf1QKAZ5njucq37pZhMRG67qXDP3vPC

wiggi

  • Global Moderator
  • Full Member
  • *****
  • Posts: 150
    • View Profile
Re: Map Changes
« Reply #8 on: April 19, 2016, 01:03:14 PM »
Yes, like this. Easy because the data (after all tiles have been displayed) is already kept in the same format as in the original Qt,

are you able to generate that file so that i can try to see if i can manage to visualize it in my client? (of course i'll download from github the missing tilesets)

i mean a file like the original one that has the array with tiles index in it

i can try then to use it to generate a tiled Map too if it's possible
about the tiles with offset i'll take a look at it (did you put them in a specific layer?)

this saves the numbers in the original gamemap.cpp  format:
https://github.com/wiggi/huntercoin/commit/3a6826567191ff2157c240405cf4384deb8829fa

Layer 0, 4 and 5 resemble the original 3 layers, 1, 2 and 3 are for shadows, and 6 is only used in cramped places.

The tiles with offset are usually in layer 4, but this isn't forced (e.g. 3 of the green grass/tile #263 are in layer 5)
The offset is different each time (when they appear on screen, the next of 7 fixed offsets is used), but I guess any RNG will do.

Some tiles look better if rendered semi opaque (shadows are less dark with 30-40% opacity, water less like plastic if ~80% opaque)

Mithril Man

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
    • Mithril Man Web!
Re: Map Changes
« Reply #9 on: April 19, 2016, 02:06:11 PM »
thanks!
The problem is that i don't have an environment to compile and run it, can you just paste the generated file content somewhere like http://pastebin.com ?

Alternative GUI client for Huntercoin http://www.mithrilman.com
HUC donation: HMSCYGYJ5wo9FiniVU4pXWGUu8E8PSmoHE
BTC donation: 1DKLf1QKAZ5njucq37pZhMRG67qXDP3vPC

wiggi

  • Global Moderator
  • Full Member
  • *****
  • Posts: 150
    • View Profile
Re: Map Changes
« Reply #10 on: April 20, 2016, 10:22:26 PM »
thanks!
The problem is that i don't have an environment to compile and run it, can you just paste the generated file content somewhere like http://pastebin.com ?

The line for the first column in the exporter should be
Code: [Select]
                      if (x == 0) fprintf(fp, "        {%d,", Displaycache_gamemap[y][x][z]);

Now it's 501 columns and not only 500:

generatedgamemap.txt.zip
182 KB
https://mega.nz/#!yMkwBaqZ!6LZo9gzg99mh3dhoZeBlQjxQySSsOcKPaLp2VTFe49s


I copied this to gamemap.cpp of the original 1.3.01 Qt client, together with the new gamemap.qrc, the .png files, and
Code: [Select]
static const int MAP_LAYERS = 7;          // Map is layered for visual purposes
static const int NUM_TILE_IDS = 454; // 235;      // Total number of different tile textures

Looks a bit funny but every tile is on its place.  8)


Mithril Man

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
    • Mithril Man Web!
Re: Map Changes
« Reply #11 on: April 21, 2016, 12:18:00 PM »
nice will take a look when i'll find some free time, thanks
Alternative GUI client for Huntercoin http://www.mithrilman.com
HUC donation: HMSCYGYJ5wo9FiniVU4pXWGUu8E8PSmoHE
BTC donation: 1DKLf1QKAZ5njucq37pZhMRG67qXDP3vPC

Mithril Man

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
    • Mithril Man Web!
Re: Map Changes
« Reply #12 on: April 23, 2016, 11:49:57 PM »
successfully implemented changes in my client, here a screenshot:



having 7 layers degrade a bit the performance but not so much, i implemented then a custom json map format to apply alpha blending per layer, so i applied 0.6 alpha on layers 1, 2 and 3 (that contains the shadows tiles, but probably not just shadows)

layers actually are somewhat mixed by content so it's not easy to apply generic transformations, I'm planning to generate from your layers a Tiled map format so the map could be easily managed by that Tiled program, that's very cool (and free) for this kind of stuffs

anyway nice work so far wiggi
Alternative GUI client for Huntercoin http://www.mithrilman.com
HUC donation: HMSCYGYJ5wo9FiniVU4pXWGUu8E8PSmoHE
BTC donation: 1DKLf1QKAZ5njucq37pZhMRG67qXDP3vPC

wiggi

  • Global Moderator
  • Full Member
  • *****
  • Posts: 150
    • View Profile
Re: Map Changes
« Reply #13 on: April 26, 2016, 03:16:35 PM »
Unless tiled or another 3rd party tool can do with tiles what 'shop and gimp can do with pixels
the practical way to improve the map on a largish scale is to have some editing function in the client.
Basically
- copy an area but only trees/only cliffs etc, and save for manual editing
- merge it back in, allow to adjust coors, and recalculate ObstacleMap in the changed area (saved to be compiled in later)

e.g: cliff saved for editing
Code: [Select]
24 20 282 133
~                       
~     ##_               
    _?#/:b    ?_?##     
    ;c:,      bC,#\_?_ 
   <,             :c,b 
   {;                ;>1
   (:,               :}1
   {,                ,}1
   (;                :)1
   (;                :]1
 _r{:               ;)1
 :,                 ;}1
<:                  ;}1
[,;: B,;            ,]1
 [:,:,;,;:         ;)1 
  [|!|##:C:       ,:}1 
      #S##,;  C    :)1 
        #S##;,:;  B,]1 
          #S!|##;,;}1  ~
              #S||!]1  ~

and back in-game


harmless in mainnet because no obstaclemap changes compiled in
It's so practical because the patch can have parts to cover up the expected glitches (like the trees "b" and "bC" on the upper side)


Mithril Man

  • Hero Member
  • *****
  • Posts: 589
    • View Profile
    • Mithril Man Web!
Re: Map Changes
« Reply #14 on: May 05, 2016, 05:20:39 PM »
Wiggi, now it's my turn to give you back something :)

I've managed to generate a map that can be opened in Tiled Map

the zip that you can download from my site here

contains both the default map (default.json) and wiggi map, named wiggi.json with the companion tileset ground3.png that, for performance reason, has been compacted in one file instead of many pieces

both files can be opened in Tiled Map and so you can tweak the map by hand

Nothe that the obstacle layer, that by default is set to visible = false, is there just to show which are the walkable tiles and can't change because it's used to validate moves by the huntercoin daemon, all other layers are editable

If anyone wants to play some with the map, i can then generate back the format used in my client to show the map, and even the QT arrays
Alternative GUI client for Huntercoin http://www.mithrilman.com
HUC donation: HMSCYGYJ5wo9FiniVU4pXWGUu8E8PSmoHE
BTC donation: 1DKLf1QKAZ5njucq37pZhMRG67qXDP3vPC