A clone of TheSettlers II 10th aniversary.

Discuss the development of other free/open-source games, as well as other games in general.

Moderators: Forum Moderators, Developers

Posts: 15
Joined: January 25th, 2009, 12:50 am

Re: A clone of TheSettlers II 10th aniversary.

Post by newage » April 24th, 2009, 11:26 pm

Jodwin wrote:Widelands isn't exactly a very faithful Settlers 2 replica, since it adds a lot of new resources, ways to produce resources and the different civilizations have different buildings and resources they use. Personally speaking, I'm a huge fan of Settlers 2 but I found Widelands pretty disappointing. :(

Anyway, newage, are you sure about that rectangle grid since you're aiming for a Settlers 2 remake? Isn't Settlers 2 completely based on a hexagon grid? :hmm:
That's a interesting question. Well, the original settlers was but the remake is made with a 3D engine that is based on a cell grid like all the 3d terrain systems except what are based on heightmaps I guess. You can realize that is based on cells when you look at the buildings that are going to be constructed, you can see the cells. Any way you can feel a hexagonal look probably because they used a brush with a hexagonal shape to draw the blending masks to give that touch.

I'm looking at the details of the remake. I think the buildings and flags are placed over the vertex?, may be not, they could be allocated in hexagonal way, and the paths that link the flags and the buildings are some kind of curve like a 2D bezier curve projected over the mask. Actually I think is a hexagonal distribution (the boundaries are hexagonal) over a cell grid. Think about that, it's easier to split the scenary based on cells with a quad tree.

Now I'm working on the renderer, I have to put the quad tree, the image masks, the ground textures and the shaders all together. A tough task. I hope to have something as soon as possible. I'll explain more when I finish the drawing mode.

Posts: 82
Joined: April 26th, 2005, 2:04 am
Location: Suomi Finland Perkele

Re: A clone of TheSettlers II 10th aniversary.

Post by Jodwin » April 25th, 2009, 7:23 am

Well, at least the "gameplay grid", that is the road grid, is hexagonal in both the original Settlers 2 and the 3D remake. You can easily verify this by creating a flag on a clear area and starting to build road from it: You can build the road to six different directions from that flag, just like on a hexagonal grid. You can also create a perfectly hexagonal-shaped road surrounding a building. That the 3D remake has curved roads is more a matter of aesthetics, it's still clearly hexagonal under the hood...

And continuing from that, it's pretty obvious, in my opinion, that flags and buildings are actually based on the hexagon and not the vertices. The flags and buildings would be on the center of the hex, while roads connect them to each other.

Also, I think that the height map is on the same hexagonal grid because it really matters in gameplay: First of all, workers walking a road uphill walk slower, and going downhill is faster. But more importantly, when you're building bigger building the levellers (the shovel guys) level the ground based on its height on the hexagon cells surrounding the building.
Yes I use windows, too.
Yes I too am aware of what that means.
Yes I'm still gonna use windows too.

Posts: 15
Joined: January 25th, 2009, 12:50 am

Re: A clone of TheSettlers II 10th aniversary.

Post by newage » April 25th, 2009, 10:20 am

Yes, you got it. A hexagonal grid, mmmm, that can be difficult to achive. Why not a cell grid, the vertex are regular spaced but that's the point,
a hexagonal partitioning system consumes more memory and is slow. I can make irregular hexagons with the grid either.

I will place the hexagon centers there, I think is a good solution.

User avatar
Art Director
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Re: A clone of TheSettlers II 10th aniversary.

Post by Jetrel » April 25th, 2009, 9:43 pm

It's pretty trivial to make a hex-based game, with an underlying graphical system based on rectangular tiles. This is how:
hex-rects.png (3.62 KiB) Viewed 2895 times
Play Frogatto & Friends - a finished, open-source adventure game!

Posts: 15
Joined: January 25th, 2009, 12:50 am

Re: A clone of TheSettlers II 10th aniversary.

Post by newage » May 4th, 2009, 10:10 pm

I've been able to run the GLSL shaders. I was stuck over there.
Now, I'm going to work on the drawing mode & the options to save and load maps.

Men, I love this kind of wireframe-render blends, I made it with GIMP.
The blends seem to be simple, but that's because I haven't got enough time to make the mask brushes.

Inactive Developer
Posts: 181
Joined: March 5th, 2007, 6:45 am
Location: Belgium

Re: A clone of TheSettlers II 10th aniversary.

Post by Alink » May 4th, 2009, 11:29 pm

Note that using irregular hexes is not without problem, especially if you want to nicely rotate tile-based 3D structures. Also this will make some game distances (like 5 hexes in one direction) look longer on screen depending of that direction relatively to the "north" of your grid.

Wesnoth has the same problem but reduces it by using a finer rectangular grid. I am lazy to draw, so just check a 72x72 Wesnoth hex and see that each hex is based on 4x4 grid, instead of your 3x2 grid. Still not regular but almost. If my math is correct the diagonal edges is only 12% too big, instead of 40% for the other version.

An other possibility is to make all odd columns thiner and even columns thicker (compared to the row's height) and then align your hex grid to have all diagonal edges fall into odd columns. Of course, it make your rectangular grid less regular and will add some complexity to convert it to 3D coordinates for rendering, but maybe you can hide it under translation functions and forget about it most of the time (as we do in Wesnoth)

There is also the related problem of hexagonal x-y coordinates (needed for organizing your data). Users generally prefer an angle of 90 degrees between axis, like we use for Wesnoth, but it also causes the need to check column parity when rendering, and can be annoying. I suspect that a 60 degrees angle could make things easier, especially for a 3D engine. It prevents to show clear x-y coordinates to users, but maybe relying more on minimap can replace that.

Posts: 15
Joined: January 25th, 2009, 12:50 am

Re: A clone of TheSettlers II 10th aniversary.

Post by newage » May 5th, 2009, 10:07 pm

I've been fooling around with a profiler [http://code.google.com/p/superprofiler/] to check the performorance of some tasks. I've added a GnuPlot output-module.


The hexagonal grid problem is something I have to think much more. I have the possibility to draw perfect hexagons on the masks, and I can trace paths easily, without align the hexagons with the grids, obviously the levellers would have a problem.

Post Reply