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

0 Members and 1 Guest are viewing this topic.

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1431
  • Helpful: 81
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #35 on: February 26, 2013, 11:18:45 PM »
That's certainly doable, but  whould need some thinking  of how to define wich tiles are playable or not, and how to expose that to the user. I also suspect there whould be people against that idea.

 We'll see,let's finish this first.

Offline jamespetts

  • Simitrans-Experimental project coordinator
  • Devotee
  • *
  • Posts: 11696
  • Helpful: 90
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Make world limits not forced to water level
« Reply #36 on: February 27, 2013, 12:08:50 AM »
If it is doable without too much pain, I support Fabio's idea, not least because it might (depending on how it was implemented, I suppose) allow maps with dimensions greater than those currently permitted (by allowing large dead areas, for example).
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: 1431
  • Helpful: 81
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #37 on: February 27, 2013, 01:24:06 AM »
 Maybe not so much, because the only performance acceptable solution that comes to my mind is keeping the x*y array like it's now but marking the planquadrats that are outside the map somehow. This whould ofc save memory because that positions won't generate extra data structures, but will reside memory too, even it's low.

 The only way to get around this whould be using some bi-dimensional hash structure to store the tiles, to allow constant time access to the tiles, and those nodes will have to be linked also to adjacent tiles to allow for iterative map processing (or maybe not). The gaps whould in that case not ocuppy memory in that case, but will imply recoding most of the simutrans inner functions, I'm quite sure this task whould take lots and lots of coding, maybe with little advantage compared with current implementation.

 Introducing this whould also create lots of problems designing how the player can activate that disabled areas for playing, to layout them (they can default to water level, shore, be random...), this has also to be implemented in the network multiplay, re-design the mini-map, the vehicles routing... It's quite a big change, and I don't personally think it's worth the work it requires, atm. I'd focus other aspects of the game that need to be improved imho.

 
« Last Edit: February 27, 2013, 01:29:45 AM by Markohs »

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3640
  • Helpful: 63
  • 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 #38 on: February 27, 2013, 02:39:58 AM »
Excellent!  8)

What about rivers that end at the map limits? I guess, with this new feature, rivers would be easier to be extended if the map is enlarged.

And sloped world limits would be for those players that don't want to enlarge the map, in this case the "Enlarge map" tool would be disabled.

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1431
  • Helpful: 81
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #39 on: February 27, 2013, 10:52:54 PM »
I post the WIP patch here for the rest of the coders to make any comments they find necessary.

All code is dirty and non optimized, and uncomplete, the only tool that can deal with borders is the raise tool, lower is not implemented still. It doesn't show world slopes neither, still needs implementation. Paining background black like we do on underground mode renders a better result, bur forces a complete screen flush each frame, and that has very bad performance . I'm posting it mainly for kierongreen to examine because it's related to his double height patch and we need to reach a consensus. And all coders interested ofc.

 There were two ways to implement this, making raise/lower tools able to raise corner1, corner2 and corner3, not only corner4, or adding a row of vitrual tiles on the edge of the map, so you could raise the grid interacting with them. I chosed the first option. I also had to extend hang_t with values to nw,ne,sw and se, to indicate wich corner was to be interacted (to be able to compare to get_grund_hang()) . This decisions might have been bad decisions, any comment is welcome.

 Mind it's WIP, I know many routines are not needed and are bad quality, I just need constructive comments of what you find important to consider. I implemented this without DOUBLE_GROUNDS, I hope my implementation is compatible with it.

 I attach the executable for anyone to be able to test it. Please have in mind the program can crash at any moment, backup your savegames first please, I'm not responsable of any damage to them. :)

 patch and executable.

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1431
  • Helpful: 81
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #40 on: February 28, 2013, 03:42:05 PM »
New version of the patch, and executable, this is way cleaner. If you want to make any comment please do the sooner the better, before I write more code so I don't need to change so much. This one is much cleaner code.

 Tried to change the code so it doesn't affect DOUBLE_GROUNDS too much, I assumed using the lookup_hgt was a better option than trying to get the heights manipulating hoehe and hangs. The part I'm not sure can coexist with kieron's code is:

Code: [Select]
        const hang_t::typ corner_to_raise = corner_to_operate(pos);

        const sint16 x = gr->get_pos().x;
        const sint16 y = gr->get_pos().y;
        const sint8 hgt = lookup_hgt(pos);

        const sint8 hsw = hgt + corner1(corner_to_raise);
        const sint8 hse = hgt + corner2(corner_to_raise);
        const sint8 hne = hgt + corner3(corner_to_raise);
        const sint8 hnw = hgt + corner4(corner_to_raise);

Right now corner_to_operate is:

Code: [Select]
    enum _corners {
        corner_west = 1,
        corner_south = 2,
        corner_east = 4,
        corner_north = 8
    };

 Does a equivalent definition for double_grounds exists?
« Last Edit: February 28, 2013, 05:05:19 PM by Markohs »

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1431
  • Helpful: 81
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #41 on: March 01, 2013, 05:49:48 PM »
New version of the executable and patch.

Enlarge map should work now and render an acceptable result, but still working on how to make it better.

Basic code is finished, I'll implement the world slopes as next step. Bug reports and comments welcome.

Offline Yona-TYT

  • *
  • Posts: 402
  • Helpful: 12
    • Simutrans-BLOG
  • Languages: ES
Re: Make world limits not forced to water level
« Reply #42 on: March 01, 2013, 06:28:25 PM »
I test it immediately ;)

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 2928
  • Helpful: 62
  • Languages: EN, NO
Re: Make world limits not forced to water level
« Reply #43 on: March 01, 2013, 06:58:27 PM »
I think it looks good enough as it is. The complete world flush might be more important than walls, unless you fixed it already.

Offline kierongreen

  • Coder/patcher
  • Devotee
  • *
  • Posts: 2032
  • Helpful: 78
Re: Make world limits not forced to water level
« Reply #44 on: March 02, 2013, 08:02:29 PM »
Just to say I am following this, but I still have no internet access so can't see this patch in action let alone get it to work with double heights. Don't worry though, once this is in trunk, and I have internet access I'll update the double height patch :)

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1431
  • Helpful: 81
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #45 on: March 04, 2013, 12:49:14 PM »
Okay, kieron. :)

Yea, think so, Ters, I'll just flush screen black and include it do SVN when the release is over.

New version, not much changes, but this patch exposed the factory creation tool didn't check for the chosen grounds being inside map limits properly, it relied for the water to constrict factories in buildable places.

 Same for roundabouts, the algorithm that built them tried to build roads around them, and now that algorithm might try to build outside map too.

 Fixed, there might be more bugs.

Offline Sybill

  • *
  • Posts: 73
  • Helpful: 12
Re: Make world limits not forced to water level
« Reply #46 on: March 04, 2013, 07:33:46 PM »
Hi, I tried your patch and it looks nice!
I still get graphic errors on the front sides when scrolling, but I suppose that's because it is not finished yet.

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1431
  • Helpful: 81
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #47 on: March 05, 2013, 01:48:08 AM »
thanks for trying it Sybill. :)

Yes, the clipping errors on from will disapear soon. :)

Offline Yona-TYT

  • *
  • Posts: 402
  • Helpful: 12
    • Simutrans-BLOG
  • Languages: ES
Re: Make world limits not forced to water level
« Reply #48 on: March 08, 2013, 01:10:57 AM »

stops working when I generate a map in the "pak128 2.2.0 nightly"


Size : "1024x1024"
Water level:  -10
Mountain height: 320
Map roughness: 7



Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3640
  • Helpful: 63
  • 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 #49 on: March 08, 2013, 04:12:27 AM »
I tried the latest build (Reply #45), but it crashes.


Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1431
  • Helpful: 81
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #50 on: March 08, 2013, 09:43:43 AM »
@Igor: Try installing http://www.microsoft.com/en-us/download/details.aspx?id=5555 please and let me know if that fixes the problem.

@Yona: I'm aware of that problem, I'll post a new executable here soon with the crash fixed. :)

 Thanks for your testing both!

EDIT: New executable and patch.

This is close to done, just needs a bit of code cleanup and fixing the bugs that might arise, plus world slopes. The background is painted in black now.

More testing welcome!
« Last Edit: March 08, 2013, 10:57:40 AM by Markohs »

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1431
  • Helpful: 81
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #51 on: March 08, 2013, 11:05:25 AM »
Two screenshots showing the map extension now respects the old part geography to the extent of possible:


Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3640
  • Helpful: 63
  • 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 #52 on: March 08, 2013, 01:09:51 PM »
@Igor: Try installing http://www.microsoft.com/en-us/download/details.aspx?id=5555 please and let me know if that fixes the problem.
Sorry for bothering you. I tried to install the MSVC package and got this message:

Quote
Please resolve the following:
A newer version of Microsoft Visual C++ 2010 Redistributable has been detected on the machine.
I run on MSWin 64bits.

Two screenshots showing the map extension now respects the old part geography to the extent of possible:
This is amazing o.O'
« Last Edit: March 08, 2013, 01:18:51 PM by IgorEliezer »

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1431
  • Helpful: 81
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #53 on: March 08, 2013, 01:29:18 PM »
the new executable fails too?

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3640
  • Helpful: 63
  • 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 #54 on: March 08, 2013, 02:12:23 PM »
Yes.

Offline Isaac.Eiland-Hall

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 2733
  • Helpful: 71
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Make world limits not forced to water level
« Reply #55 on: March 08, 2013, 02:46:08 PM »
Absolutely stunning. I love it! Now my only problem is I'm spoiled on Minecraft auto-expanding the world! hehe. But that's 100% impractical for Simutrans. :)
For server and hosting problems and requests, please open a ticket at http://PanamaCityPC.com/support/

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1431
  • Helpful: 81
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #56 on: March 08, 2013, 02:51:07 PM »
mmm... a bit clueless of what can be the problem, I think moving the msvcr80.dll file you have in the same directory to elsewere and trying to start the program can maybe solve the problem. I don't really know where the problem is. Another option whould be compiling this with MinGW like the niglies are, but I don't have the enviroment installed here in this computer, I'll try it later when I get to my other computer.

The only dll's that I have in that dir are https://dl.dropbox.com/u/30024783/pthreadGC2.dll and https://dl.dropbox.com/u/30024783/pthreadVC2.dll , even SDL.dll is not necessary. because they are statically linked I think in my enviroment. But I'm not really sure, I have so many build enviroments that sometimes I don't really know wich dependencies I'm adding. ;)

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1431
  • Helpful: 81
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #57 on: March 08, 2013, 02:53:29 PM »
Absolutely stunning. I love it! Now my only problem is I'm spoiled on Minecraft auto-expanding the world! hehe. But that's 100% impractical for Simutrans. :)

 Who knows wich cool features we can add to simutrans in the future, we'll see. ;)

Offline An_dz

  • Devotee
  • Administrator
  • *
  • Posts: 1849
  • Helpful: 61
  • D'oh
    • by An_dz
  • Languages: PT, EN
Re: Make world limits not forced to water level
« Reply #58 on: March 08, 2013, 03:12:32 PM »
This is just amazing. Anything can be built on the corners and the terraforming tools work perfectly. The world expansion also works great. I've created myself a lake on the corner and when I expanded it, the lake was expanded a little too.

Absolutely stunning. I love it! Now my only problem is I'm spoiled on Minecraft auto-expanding the world! hehe. But that's 100% impractical for Simutrans. :)
Who knows wich cool features we can add to simutrans in the future, we'll see. ;)
SimCity 2013 region play? :)

Offline jamespetts

  • Simitrans-Experimental project coordinator
  • Devotee
  • *
  • Posts: 11696
  • Helpful: 90
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Make world limits not forced to water level
« Reply #59 on: March 08, 2013, 03:33:25 PM »
SimCity 2013 region play? :)

We can do better than that. Our servers work most of the time, and we have synchroneous multiplayer.
James E. Petts

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

Download Pak128.Britain here.

Offline ӔO

  • Devotee
  • *
  • Posts: 2345
  • Helpful: 66
  • Hopefully helpful
  • Languages: en, jp
Re: Make world limits not forced to water level
« Reply #60 on: March 08, 2013, 04:22:28 PM »
Excellent work, now mountainous maps will have mountainous perimeters :D
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

Offline Sarlock

  • Devotee
  • *
  • Posts: 1177
  • Helpful: 53
  • Languages: EN
Re: Make world limits not forced to water level
« Reply #61 on: March 08, 2013, 04:54:37 PM »
Wow... this is truly wonderful.  When I get a few spare moments, I'll test it out.
Current projects: Pak128 Trees, blender graphics

Offline Markohs

  • DevTeam, Coder/patcher
  • Devotee
  • *
  • Posts: 1431
  • Helpful: 81
  • Languages: EN,ES,CAT
Re: Make world limits not forced to water level
« Reply #62 on: March 08, 2013, 05:13:43 PM »
Thanks for your comments guys, another SS:

Offline jamespetts

  • Simitrans-Experimental project coordinator
  • Devotee
  • *
  • Posts: 11696
  • Helpful: 90
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Make world limits not forced to water level
« Reply #63 on: March 08, 2013, 05:22:29 PM »
Ohh, I do like the edging. That is very nice.
James E. Petts

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

Download Pak128.Britain here.

Offline greenling

  • Lounger
  • *
  • Posts: 1729
  • Helpful: 15
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: Make world limits not forced to water level
« Reply #64 on: March 08, 2013, 06:29:16 PM »
Hello Markohs
The photo 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 Isaac.Eiland-Hall

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 2733
  • Helpful: 71
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Make world limits not forced to water level
« Reply #65 on: March 09, 2013, 12:14:17 AM »
Oh, the edging is VERY fantastic. Makes the world feel like it has depth. :)
For server and hosting problems and requests, please open a ticket at http://PanamaCityPC.com/support/

Offline IgorEliezer

  • Devotee
  • Administrator
  • *
  • Posts: 3640
  • Helpful: 63
  • 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 #66 on: March 09, 2013, 03:40:47 AM »
But that's 100% impractical for Simutrans. :)
I have the feeling that it's not sooo true. Maybe...

Simutrans already uses some kind of seed number; the terrain can be generated upon map creation and extended manually by using map editing tools. The map could be expanded as you pan it... I don't know how Simutrans would handle non-rectangular maps. In Minecraft, the map is extended by adding 16x16x256-meter lots of terrain (a.k.a. chunks) as the player walks, the map can be larger than Earth's surface, even so only the visible chunks (those that the player can see) are loaded by the game -- it's a quite smart way of saving computer resources.

Thanks for your comments guys, another SS:
lalalah... I has a screen too... 8)



Anyway, it's marvelous.

Offline Isaac.Eiland-Hall

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 2733
  • Helpful: 71
  • PanamaCityPC.com/support/
    • Facebook Profile
  • Languages: EN
Re: Make world limits not forced to water level
« Reply #67 on: March 09, 2013, 06:36:10 AM »
Now, now, I already want SimCity in my Simutrans... having Minecraft in my Simutrans would be just....

I'd never leave the house. Ever! :)
For server and hosting problems and requests, please open a ticket at http://PanamaCityPC.com/support/

Offline jamespetts

  • Simitrans-Experimental project coordinator
  • Devotee
  • *
  • Posts: 11696
  • Helpful: 90
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Make world limits not forced to water level
« Reply #68 on: March 09, 2013, 11:37:41 AM »
Now, now, I already want SimCity in my Simutrans...

You might be interested in the city growth related ideas on this thread.
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: 3640
  • Helpful: 63
  • 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 #69 on: March 10, 2013, 11:44:10 PM »
For those who want to know how I did that montage: