I've got a basic game actions framework in place now and added two actions to build paths and place buildings. Both functions will be needed in the game, but at the moment it's just proof of concept work.

To make construction a bit easier, there is a helper function to display a little flag on each vertext where an element can be placed:

The strange sand-colored triangle is the map vertex pointer, i.e. the place of which the code thinks you are pointing to with the mouse.

There was only a white square where the map should be, at the first launch. But after launching it a second time everything worked perfectly. (Assuming that you are only allowed to build a 1 by 1 path at a time)

There was only a white square where the map should be, at the first launch. But after launching it a second time everything worked perfectly. (Assuming that you are only allowed to build a 1 by 1 path at a time)

Thanks for the quick test Path building only works step by step currently, that's right. A bit odd that the display did not initialise correctly for the first try, but at least it worked in the second. Thanks again!

I've been trying to make the world an island. The water texture was made in a hurry, but I can make a better one later. Also I have kind of proof-of-concept code now to make a decorated border and panel backgrounds.

Thanks! And yes, at the moment I'm really eager to bring my idea alive. On the other hand, it will be much slower to work on the games logic and better graphics. Particularly the logic will need a lot of planning.

I'll refine the looks of the map and the overall display as the project progresses. There is much to do to make it look better, but I think I know a number of ways to make it look good finally.

Right now I'm quite busy to get some code infrastructure in place to handle workers and workplaces. I hope my approach to have workplaces, which may have one or more workers, and workers which have tasks will suffice and be simple enough to allow swift progress. A tricky thing becuase it involves math is to move the workers over the landscape. Well, the only problem is the calculation of the height, and I hope I can refresh my math related memories to get it right.

The carriers on the paths are just placeholder graphics at the moment. I used them to see if my code for creating workers and moving workers works. It does to some extends, but finding pathes and follollowing them is yet to be done.

This code that I produced there must be really confusing for a reader ... sorry.

The map has a zig-zag border left and right. I'll try some ASCII art ... keep in mind each hex is made by 6 triangles, so there is a vertex in the middle of the hex as well (I've left that out in the sketch).

1 2 3 4 5 6

_/ \_\_/ \/ \_/\_/ \ \_/

Every second vertex row is indented by half the edge length. This is the one problem.

The other is, how the triangles are drawn in a row.

1

\/\/\/

Every second triangle is upside down. And, this order changes for each second row. Even rows start like the sketch above, odd rows start with an upside down triangle.

1

/\/\/\

So I used two row loops, for the even and the odd rows. I'm sure there is a way to get the vertex positions correctly in one calculation, but I'm not that good at math. And my map structure is basically a 2D array, which is used to store triangles, so it's spaced with a factor of two horizontally (2 triangles in a quad).

Very confusing. Normals are stored in the ordinary spacing, that's why normalI (normal index) is half the triangle index in a row. It's really quite the voodoo code, sorry. I was and still am way too new to the whole 3D and OpenGL topic to produce good and clean code for it yet.

The lighting purely depends on the normals and the light source position. If you want to try it, just draw flat tris/quads and use random normals. This should already give some random wavy bumps even that the surface is actually flat. Sorry again for the magic code there

I've split the game into display-synchroneous actions and asynchroneos actions. Movement and the like is now display-synchroneous, goods creation, good routing and management related taska will be asynchroneous. At the moment there are none of such tasks though, but the infrastructure is in place.

Along with that came some bug fixes to path building and path traversal. I've uploaded a new demo version to Sourceforge to show the current state of development:

There are no error checks, so input which the game engine doesn't like will just cause problems. The road workers just run up and down the path endlessly - it's really just some demo code at this point.

Next steps will be to add workers to the buildings and add code to create and manage goods.

No its clear what you are doing now.You dont have to apologise for your code (as long you dont publish it) haha But very good work.Its going to be awsome, im sure about that.If you want to create an more peacefull version of settlers, have you considered taking some stuff from the Anno series, also loved these games (except the last one)

Triangle strips will surely speed terrain rendering up a bit, but I feel too lazy to change the code as long as it's not a bottleneck

I've been busy with the workers and the worker management. But I think I have something presentable now. Two workplaces with workers are included, a forester who plants trees, and a woodcutter to cut them down again. Good neighbors for sure And very tireless workers at the moment.

With this in place, it will be easy to add more workplaces and workers. The worker graphics are all just placeholders at the moment, to see if the code works. I'm much better at making houses and trees than I am at making animals and persons ... or anything animated.

Thanks, it's shaping up nicely indeed. There still is a lot of room for improvements though, particlarly more varied landscape textures and better texture transitions. Lately bug tracking and bug fixing starts to take up a good amount of development time, though - up to odd behavior like, if you build a hut right in front of another workers hut, that one can't leave his hut anymore and will eat up more and more CPU time in tries to find a way out

If you want to create an more peacefull version of settlers, have you considered taking some stuff from the Anno series, also loved these games (except the last one)

In the past years I haven't played a lot of games. I often wanted to buy the one or other from the anno series but I nevr did - sometimes they were just too demanding for the computer I had at the time.

Can you help me out with some hints, which features you liked most, and which you'd like to see implemented in Sunland Villagers, too?

Thanks, it's shaping up nicely indeed. There still is a lot of room for improvements though, particlarly more varied landscape textures and better texture transitions. Lately bug tracking and bug fixing starts to take up a good amount of development time, though - up to odd behavior like, if you build a hut right in front of another workers hut, that one can't leave his hut anymore and will eat up more and more CPU time in tries to find a way out

If you want to create an more peacefull version of settlers, have you considered taking some stuff from the Anno series, also loved these games (except the last one)

In the past years I haven't played a lot of games. I often wanted to buy the one or other from the anno series but I nevr did - sometimes they were just too demanding for the computer I had at the time.

Can you help me out with some hints, which features you liked most, and which you'd like to see implemented in Sunland Villagers, too?

The main part of the anno series was building up and evolving the economy.You start with building some of the main resources, like wood and fish.With wood you can build houses for villagers (they will slowly migrate to your setting) and with fish you can keep the villagers alive.When your setting has grown a little, these villagers start demanding goods, like wine and wool.When these demands are satisfied, more people keeps migrating to your settlement until they reach a new civilisation level, with new demands etc..Soon enough you wont find all of the goods they need on your main island, so you need to claim another island for the other demands.Also products like bread need an producing system like wheat > flower > bread.

Setting up these chains over multiple islands and turning an "wild" island towards an civilasations is really fun.The main diffrence is that with an game like settlers you build up producing chains for an army.With anno it all goes around your residents.You gotta play it sometimes to see what i mean.

It sets up a 2D display for you and you can move quad around. This was already a good start, but the first days were googling and reading tutorials mostly.

The rock/mountain texture and the "headqarter" big building are borrowed from the Widelands project.

Many graphics I had already before I started. The woodcutter hut, the forester hut and the poplar tree I've made during the past week - the photo for the poplar tree I had taken a while ago, expecting that I will need tree images some day soon It's sometimes quite difficult to find single trees to take photos from in a useful angle for games.

Almost there! But well, you know the last 10% take 90% of the time ...

I think I have the basics in place now. A headqarter which stores goods, a workplace (woodcutter) which produces trunks, another workplace (forester) to plant new trees. Also routing the goods through the path net, and the actual transport with carriers.

I'm quite sure there still is a plethora of bugs and overlooked special cases, but for 2 and half a week, I think this was quite good progress

1) Switch to " Buildings", "Large". Select the headquarter (aka storage house).2) Search for a place on the map which you like and place the headquarter there (click spot).3) Switch to "Path". Select the path building tool.4) Build a path to a nearby forest. You can build the path in several segments, each seqment will get a carrier.5) Switch to "Buildings", "Small", slect the woodcutter.6) place the woodcutter hut (click spot).7) Conncet the woodcuuter flag to the path.

It might take a while till the woodcutter made up his mind which tree to cut next. Also he uses to rest between two trees. Also don't worry if the trunks are not carried into the headquarter, but pile up at the flag in front. This is where to current routing code thinks that the destination is. I'll fix this later.

If you made a path building or house placing mistake, try this:

a) Select the "?" Buttonb) Click the path flag or building flag which needs to be removed.c) Confirm "remove" in the popupd) Building, flag and the adjacent paths will be removed.

The flying gui might just have been a new carrier, who tried to reach his new workplace (after building a new path). If it was some other event, please let me know and I'll look into it.

The problem that buildings sometimes depress the landscape so much that new water appears (blue areas) will be fixed in the release. In future there will be more checks also and bigger buildings need more open/flat space to be built.

The ArrayIndexOutOfBounds exception came from a carrier, who had a fairly short path. I think I'm going to fix this by making the minimum path length two vertex distances, but I'm not sure at the moment if this is alright.

I hear the wish for a better modelled landscape but I don't want to solve it by adding more, smaller triangles, rather by having better transitions between the textures. Also not quite sure about this one, so I'll wait a bit before doing changes, and try to make up my mind.

You are correct about the flying GIU, it occured after i placed an hut.

The terrain bug seemed like an big triangle splitting up, so thats why i gave the comment about more triangles.I was testing a little with terrain, and with triangles around 32 / 64 pixels, you get very smooth terrain already (see my thread about normals in newb), the triangles in your game seem much bigger.

I've uploaded a new version - it contains a number of bug fixes, but also a fairly big change which might make it more difficult for new people. Buildings can't be placed everywhere anymore, but need a certain amount of fairly flat, open space to be built.

The "Show build helper" function has been expanded a lot to help there, but the updates are a bit slow. So I don't know if it still works well on older computers. The function is now also turned on by default now.

I feel a bit uncertain about the changes, and I might have introduced new bugs with them. I also need to learn how to configure the logging properly, at the moment logs are just written to the debug window.

I think the project is at a point now where saving and loading games will be needed. Saving the map is easy enough, but it won't be easy to save all the workers with their tasks and states.

Edit: I forgot to say, the default edge length of the triangles (horizontally) is 100 pixels. You can zoom in and out with the mouse wheel.

It's been a lot of typing work, but I think I have everything in place now for saving and loading games. Maybe I missed some things, but the new release includes a small demo savegame which seems to save and load properly.

To save a game, press ctrls-s. To load a game press ctrl-l. To load the included demo game, just start the game, press ctrl-l, wait a second and it should be there.

There also have been some bugfixes for flag and path handling, and the worker/task classes were overhauled a bit. So some things should work better now, but as usual, I might as well have introduced new bugs while ploughing through the code and adding savegame related routines.

And last but not least, the forester now plants small trees which need some time to grow

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org