Author Topic: Make world limits not forced to water level  (Read 25210 times)

0 Members and 1 Guest are viewing this topic.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 2762
  • Helpful: 60
  • Languages: EN, NO
Re: Make world limits not forced to water level
« Reply #105 on: March 23, 2013, 08:26:15 AM »
I'd go with 4 checks per tile over 1 check per tile plus 1 byte per tile until proven that it's a bottleneck. CPUs are fast, memory access is not.

grund_t is currently 20 bytes on a 32-bit architecture, which means it's perfectly aligned on a word boundary. Any new field, of word size (32-bit) or less, will bump this up to effectively 24. (On a 64-bit architecture, grund_t should be 28 bytes, which means it's got 4 unused bytes until the next word boundary at 32.)

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3624
  • Helpful: 62
  • Proud of nothing
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Make world limits not forced to water level
« Reply #106 on: March 27, 2013, 02:57:09 AM »


Just tried the latest nightly.

 <3

As you can see, I liked it.

I noticed two things: some trees seem to be hanging off the border; if I click on the black area, the cursor can still edit/select elements of the map.

Igor Eliezer
Architect and Urban Planner/Arquiteto e Urbanista - www.igoreliezer.com

Look how we are wasting taxpayer money with the worldcup... | Nice programs everywhere!

"Brazil spent nearly $200 in health and education programs for every dollar spent on stadiums" (Forbes)

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1399
  • Helpful: 75
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #107 on: March 27, 2013, 07:31:57 AM »
Hi, thanks for trying it out. :)

Elements that span the lower border of the tile will be difficult to fix, I can paint it black everything that is beyond the border, but that will not be perfect neither... I'll think what can be done. :)


Wich tool are you using when selecting items in the berder tiles? upper/raise grid tool is allowed to work on borders, other tools should not be able to interact there.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 2762
  • Helpful: 60
  • Languages: EN, NO
Re: Make world limits not forced to water level
« Reply #108 on: March 27, 2013, 07:39:51 AM »
I seem to remember a topic about trees and their offsets. It is probably an error in the pak, and doesn't look good when overlapping other things throughout the map either.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4836
  • Helpful: 63
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: Make world limits not forced to water level
« Reply #109 on: March 27, 2013, 09:03:05 AM »
Yes, tree offsets are the real problem here. The map edge is not responsible for that :)

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Offline greenling

  • Lounger
  • *
  • Posts: 1729
  • Helpful: 15
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: Make world limits not forced to water level
« Reply #110 on: March 27, 2013, 05:27:27 PM »
Hello
The photo how igoreliezer be post have looks very good out.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

Offline Sarlock

  • Devotee
  • *
  • Posts: 1137
  • Helpful: 50
  • Languages: EN
Re: Make world limits not forced to water level
« Reply #111 on: March 27, 2013, 06:27:11 PM »
There is a certain amount of random variability to the placement of trees, away from its original offset position.  That's why trees can be sitting in the water just off of the beach, etc.  It's a very minor cosmetic thing, I don't think it's worth trying to fix it.

Progress so far on the edges looks great!  Can't wait to see the added effect of the ground/water to it.  Great job, thusfar, Markohs.
Current projects: Pak128 Trees, blender graphics

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 3570
  • Helpful: 124
  • Languages: EN, DE, AT
Re: Make world limits not forced to water level
« Reply #112 on: March 27, 2013, 06:39:22 PM »
There is a certain amount of random variability to the placement of trees, away from its original offset position.  That's why trees can be sitting in the water just off of the beach, etc.  It's a very minor cosmetic thing, I don't think it's worth trying to fix it.
If the image of the tree in the pak is centered within the tile, then the tree should not be outside of the tile.
Parsley, sage, rosemary, and maggikraut.

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1399
  • Helpful: 75
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #113 on: March 27, 2013, 06:59:52 PM »
Progress so far on the edges looks great!  Can't wait to see the added effect of the ground/water to it.  Great job, thusfar, Markohs.

thx sharlock, have it half implemented, but first I had to change some techical details dwachs and prissi ponted me to. soon new features will come.  :)

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1399
  • Helpful: 75
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #114 on: March 28, 2013, 01:58:49 AM »
Dwachs, the artifacts keep coming only when simple_drawing is activated. This is very strange, since clearing the whole screen black works perfectly...


 But if in grund_t::display_if_visible I set grund_t::set_flag(dirty) on the tiles I've drawn background, the artifacts come. Threaded, near the junction zone.


Had to remove the const property from grund_t::display_if_visible for this reason too, btw.


The patch here. If anyone has any idea of what might it be, just tell me. :)
« Last Edit: March 28, 2013, 02:07:33 AM by Markohs »

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 819
  • Helpful: 56
Re: Make world limits not forced to water level
« Reply #115 on: March 28, 2013, 02:46:30 AM »
Are there still artifacts single threaded? Last I looked, the tile_dirty stuff didn't appear to have the required mutexes in place... I ignored it assuming it was an intentional tradeoff speed vs glitches.

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1399
  • Helpful: 75
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #116 on: March 28, 2013, 03:16:38 AM »
Just tested it and no, they just show in the threaded version.

When I paint the background zones I set them dirty, it might be related to what you say.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 3570
  • Helpful: 124
  • Languages: EN, DE, AT
Re: Make world limits not forced to water level
« Reply #117 on: March 30, 2013, 03:54:49 PM »
It seems that replacing display_fillbox_wh with display_fillbox_wh_clip in grund_t::display_border fixes the stripes issue. These stripes are produced by simview.cc line 221, and draw into regions that are already fully drawn.
Parsley, sage, rosemary, and maggikraut.

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1399
  • Helpful: 75
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #118 on: March 30, 2013, 04:09:04 PM »
oooh right how could I be so stupid. This also fixes another problems I had detected. Thanks a lot Dwachs!!!!

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1399
  • Helpful: 75
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #119 on: April 01, 2013, 06:48:17 PM »
Another screenshot of the work in progress, getting closer to finish this. ;)


The colors and northern border is still for debug reasons, my plan is allowing the user/pak developer to tune up those details.



Offline greenling

  • Lounger
  • *
  • Posts: 1729
  • Helpful: 15
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: Make world limits not forced to water level
« Reply #120 on: April 01, 2013, 07:20:49 PM »
Who that´s looks cool out.
Opening hours 20:00 - 23:00
(In Night from friday on saturday and saturday on sunday it possibly that i be keep longer in Forum.)
I am The Assistant from Pakfilearcheologist!
Working on a big Problem!

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1399
  • Helpful: 75
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #121 on: April 01, 2013, 07:29:04 PM »
And with sightly better colors, and showing it respects night colors.


Now let's deal with water and polish the code a bit. :)


NOTE: Yes, I copied simcity 4 colors, if this is any problem with copyright I'll need someone to create a gradient of colors to use it by default on simutrans. ;)





« Last Edit: April 01, 2013, 07:34:22 PM by Markohs »

Offline jamespetts

  • Simitrans-Experimental project coordinator
  • Devotee
  • *
  • Posts: 11573
  • Helpful: 89
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Make world limits not forced to water level
« Reply #122 on: April 01, 2013, 07:39:51 PM »
Very Sim City 4!
James E. Petts

Download the experimental version of Simutrans and help to test lots of new features here.

Download Pak128.Britain here.

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3624
  • Helpful: 62
  • Proud of nothing
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Make world limits not forced to water level
« Reply #123 on: April 01, 2013, 08:21:25 PM »
NOTE: Yes, I copied simcity 4 colors, if this is any problem with copyright I'll need someone to create a gradient of colors to use it by default on simutrans. ;)
Doing great! Really.

Are these borders procedurally generated or made of graphic tiles? I think the pak makers will feel temped to paint the graphics for the borders, but Simutrans would require a different procedure just to tile a vertical wall.

EDIT:

That's my suggestion, the simpler the better, but not sure if it turned out well.

« Last Edit: April 01, 2013, 08:30:27 PM by IgorEliezer »

Igor Eliezer
Architect and Urban Planner/Arquiteto e Urbanista - www.igoreliezer.com

Look how we are wasting taxpayer money with the worldcup... | Nice programs everywhere!

"Brazil spent nearly $200 in health and education programs for every dollar spent on stadiums" (Forbes)

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 7453
  • Helpful: 174
  • Languages: De,EN,JP
Re: Make world limits not forced to water level
« Reply #124 on: April 01, 2013, 09:13:11 PM »
Peronally, I like the old eternal islands very much, which is gone anyway.

But if you do this, then the texture must properly represent water depth, which it does not. Other than that I am not caring much about ground levels.

As a sidenote: Sicne the is arbitary clipping already in place, drawing those with a single opreation should be straigth forward at least for water.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2856
  • Helpful: 89
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Make world limits not forced to water level
« Reply #125 on: April 01, 2013, 09:26:23 PM »
It looks awesome! But as Prissi said water depth would still be better. Way to go!

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1399
  • Helpful: 75
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #126 on: April 01, 2013, 09:36:31 PM »
Peronally, I like the old eternal islands very much, which is gone anyway.

 Well, nothing stops you from lowering the borders of your maps to water level, this patch just opens new possibilities.

But if you do this, then the texture must properly represent water depth, which it does not. Other than that I am not caring much about ground levels.

 Yes, I will do it, I'm still thinking the best way of doing it.

Quote
As a sidenote: Sicne the is arbitary clipping already in place, drawing those with a single opreation should be straigth forward at least for water.

 Yes, the plan is generate all the needed images and just displaying them with clipping. Very much similar to the climate code.

Doing great! Really.

 Thank you. :)

Are these borders procedurally generated or made of graphic tiles? I think the pak makers will feel temped to paint the graphics for the borders, but Simutrans would require a different procedure just to tile a vertical wall.

EDIT:

That's my suggestion, the simpler the better, but not sure if it turned out well.



 Well, there are various aproaches to this I've been thinking.

 The current implementation, that's my first approach is giving it a list of heights and colors, and simutrans automatically generates the world slope. For water I'd do the same, but I don't really know if it will have a good look. Water gradient whould start from bottom to top.

 Right now that gradiation I showed is defined like:

Code: [Select]
grad_entry gradient[] = {
   grad_entry(0,rgb(110,90,85)),
   grad_entry(10,rgb(107,88,82)),
   grad_entry(20,rgb(109,103,115)),
   grad_entry(30,rgb(138,135,142)),
   grad_entry(40,rgb(116,104,108)),
   grad_entry(50,rgb(106,107,109)),
   grad_entry(80,rgb(106,107,109)),
   grad_entry(-1,0x7FFF)
};

 The idea whould be to expose that so simutrans readed that list from a .tab file in the pak directory, or something similar.

 But, as you said, I think artists whould indeed be interested to paint the world stripe themselves, that can be done too, if they supply me a vertical image (actually two, one for water and another for ground), with width of half of a tile, I can generate all the required images and variations, and use them. Maybe even if we ara supplied one image multiple of half tile's width, we can span that image even longer to create more variety, and not having such repetitive patterns.

 Dunno, anyone has any comment regarding this issues? I can allways implement both options and let tyhe artists decide.
« Last Edit: April 01, 2013, 09:45:30 PM by Markohs »

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3624
  • Helpful: 62
  • Proud of nothing
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Make world limits not forced to water level
« Reply #127 on: April 01, 2013, 09:49:52 PM »
Personally, I like the old eternal islands very much, which is gone anyway.
If there was an option as "locked" map - a map that can't be enlarged - Simutrans could force the generation of shores near the borders.

EDIT:

Other possibility would be to have a way of setting the size of landmasses (or continents) so that they would fit in the world without touching the borders, but this is a subject for landscape generation.
« Last Edit: April 01, 2013, 09:58:26 PM by IgorEliezer »

Igor Eliezer
Architect and Urban Planner/Arquiteto e Urbanista - www.igoreliezer.com

Look how we are wasting taxpayer money with the worldcup... | Nice programs everywhere!

"Brazil spent nearly $200 in health and education programs for every dollar spent on stadiums" (Forbes)

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1399
  • Helpful: 75
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #128 on: April 01, 2013, 09:58:02 PM »
A button to force map borders to water at any moment can be implemented also.

Anyway I think not much people will share prissi's nostalgia.  but who knows. it' not very hard to implement.

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3624
  • Helpful: 62
  • Proud of nothing
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Make world limits not forced to water level
« Reply #129 on: April 01, 2013, 10:09:13 PM »
Anyway I think not much people will share prissi's nostalgia.  but who knows. it' not very hard to implement.
Haha... good. Anyway, having nostalgia sometimes is important to keep the soul of the game.

As Jamespetts said, "Very Sim City 4!" -- it's essential that a game evolve and be expanded upon in the fields which the game is meant to but not look like another game.

Igor Eliezer
Architect and Urban Planner/Arquiteto e Urbanista - www.igoreliezer.com

Look how we are wasting taxpayer money with the worldcup... | Nice programs everywhere!

"Brazil spent nearly $200 in health and education programs for every dollar spent on stadiums" (Forbes)

Offline kierongreen

  • Coder/patcher
  • Devotee
  • *
  • Posts: 1981
  • Helpful: 75
Re: Make world limits not forced to water level
« Reply #130 on: April 01, 2013, 10:21:36 PM »
Igor took words out of my mouth. It's why patches that make big changes are maybe best applied after discussion.

Offline jamespetts

  • Simitrans-Experimental project coordinator
  • Devotee
  • *
  • Posts: 11573
  • Helpful: 89
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Make world limits not forced to water level
« Reply #131 on: April 01, 2013, 10:26:08 PM »
Nostalgia or not, and in spite of its resemblance to Sim City 4, I rather like it: it makes it much clearer than the present system what is and is not part of the buildable world, and adds an element of polish not present in the original flat version.
James E. Petts

Download the experimental version of Simutrans and help to test lots of new features here.

Download Pak128.Britain here.

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1399
  • Helpful: 75
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #132 on: April 01, 2013, 10:42:09 PM »
Igor took words out of my mouth. It's why patches that make big changes are maybe best applied after discussion.

 Well, this thread has been open for discussion for even months before I wrote a single line of code of this patch, if someone wants to express his opinion he's free to do so.

 There are  lots of threads in this forum full of discussion and opinions that don't have rendered a single line of code nor changed anything in game. I try to respect opinions expressed by everyone, but I have to accept not everyone will like the changes I made. They have their point of view, and that doesn't have to agree with mine, but it's me the one coding it. If someone wants it differently, he can convince me of it, or just code it himself.

 I think I've been very receptive to all the comments anyone on this forum has made me, and have answered most of the requests I've been done. What I don't feel comfortable is when I read that my contributed work is not of the tastes of anyone, when they haven't expressed so in the past.

 Anyway if many people is against this changes I have not problem retiring this patch from the code and return the game to its previous state.
« Last Edit: April 01, 2013, 10:56:40 PM by Markohs »

Offline kierongreen

  • Coder/patcher
  • Devotee
  • *
  • Posts: 1981
  • Helpful: 75
Re: Make world limits not forced to water level
« Reply #133 on: April 01, 2013, 10:46:37 PM »
Oh I know the problems of leaving patches open for discussion - after all some of mine have taken over 2 years to be applied to trunk!

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1399
  • Helpful: 75
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #134 on: April 01, 2013, 10:57:23 PM »
Oh I know the problems of leaving patches open for discussion - after all some of mine have taken over 2 years to be applied to trunk!

 That's one of the biggest problems imho we have. Your double height patch should have been part of this game months ago imho.


 After all, most of our last releases had a few bugs (some of them not so minor) too.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 7453
  • Helpful: 174
  • Languages: De,EN,JP
Re: Make world limits not forced to water level
« Reply #135 on: April 01, 2013, 10:58:11 PM »
Please, as mentioned before, my view is clouded by nostalgica, as I was used to this since 2000 ... I might even consider adding up a setting for paks to get a landscape down to the border with old tiles. As stated before, simutrans is about freedom. Some paks like pakHD look rellay strange with black background.

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1399
  • Helpful: 75
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #136 on: April 01, 2013, 10:59:22 PM »
And I have no problem helping making that possible, prissi, we just need to change the background drawing part a bit.

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3624
  • Helpful: 62
  • Proud of nothing
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Make world limits not forced to water level
« Reply #137 on: April 01, 2013, 11:40:22 PM »
Oh I know the problems of leaving patches open for discussion - after all some of mine have taken over 2 years to be applied to trunk!

That's one of the biggest problems imho we have.
That's the one of the biggest problems that a community-run project can have; people freely decide what to do with their free time and things tend to go out of control. It'd be different (better or worse) if Simutrans were developed in a company with schedules, nasty clients making pressure and a boss with a whip... *shift eyes* ... oops. What would we prefer?

If there are dents hindering the project, once in a while discuss to spot and solve the pending issues, set priorities and focus on not letting things pile up because it creates the frustration and a feeling that you are working in the darkness.

Igor Eliezer
Architect and Urban Planner/Arquiteto e Urbanista - www.igoreliezer.com

Look how we are wasting taxpayer money with the worldcup... | Nice programs everywhere!

"Brazil spent nearly $200 in health and education programs for every dollar spent on stadiums" (Forbes)

Offline Yona-TYT

  • *
  • Posts: 394
  • Helpful: 12
    • Simutrans-BLOG
  • Languages: ES
Re: Make world limits not forced to water level
« Reply #138 on: April 02, 2013, 02:34:04 AM »

in my humble opinion, simutrans should be more open to changes.
thus simutrans will remain live by many years  :thumbsup:




Simutrans Fan page on Facebook
« Last Edit: April 02, 2013, 03:16:11 AM by Yona-TYT »

Offline Sarlock

  • Devotee
  • *
  • Posts: 1137
  • Helpful: 50
  • Languages: EN
Re: Make world limits not forced to water level
« Reply #139 on: April 02, 2013, 03:08:39 AM »
It looks fabulous!

I think the overwhelming response has been positive.  When it comes to patches that make a fundamental change to the way the game is played, I certainly think that a big discussion is necessary to get a consensus (as best you can with a large, varied group) before proceeding.  This is mostly cosmetic so it is less integral and there has been ample time during the early development process to change the direction of this effort, so I wouldn't worry, Markohs :)

And it's easy enough to turn off this graphics border option with a map that descends to water level at its borders, so it's easy enough to disable.

You're so close to the finish line now, Markohs, I can't wait to see the final product.  Great work!
Current projects: Pak128 Trees, blender graphics