News:

Congratulations!
 You've won the News Item Lottery! Your prize? Reading this news item! :)

Make world limits not forced to water level

Started by Markohs, November 16, 2012, 01:39:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ters

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.)

IgorEliezer



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.

Markohs

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.

Ters

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.

VS

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!

greenling

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!

Sarlock

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

Dwachs

Quote from: Sarlock 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.
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.

Markohs

Quote from: Sarlock on March 27, 2013, 06:27:11 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.  :)

Markohs

#114
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. :)

TurfIt

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.

Markohs

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.

Dwachs

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.

Markohs

oooh right how could I be so stupid. This also fixes another problems I had detected. Thanks a lot Dwachs!!!!

Markohs

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.



greenling

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!

Markohs

#121
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. ;)






jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

IgorEliezer

#123
Quote from: Markohs on April 01, 2013, 07:29:04 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.


prissi

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.

Fabio

It looks awesome! But as Prissi said water depth would still be better. Way to go!

Markohs

#126
Quote from: prissi on April 01, 2013, 09:13:11 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.

Quote from: prissi on April 01, 2013, 09:13:11 PM
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.

Quote from: IgorEliezer on April 01, 2013, 08:21:25 PM
Doing great! Really.

Thank you. :)

Quote from: IgorEliezer on April 01, 2013, 08:21:25 PM
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:


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.

IgorEliezer

#127
Quote from: prissi on April 01, 2013, 09:13:11 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.

Markohs

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.

IgorEliezer

Quote from: Markohs on April 01, 2013, 09:58:02 PMAnyway 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.

kierongreen

Igor took words out of my mouth. It's why patches that make big changes are maybe best applied after discussion.

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Markohs

#132
Quote from: kierongreen 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.

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.

kierongreen

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!

Markohs

Quote from: kierongreen 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!

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.

prissi

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.

Markohs

And I have no problem helping making that possible, prissi, we just need to change the background drawing part a bit.

IgorEliezer

Quote from: kierongreen on April 01, 2013, 10:46:37 PMOh 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!

Quote from: Markohs on April 01, 2013, 10:57:23 PMThat'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.

Yona-TYT

#138

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

Sarlock

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