Author Topic: Township - Development Thread  (Read 107171 times)

Son of the King

  • Megas Domestikos
    Voting Member
  • Posts: 3368
  • Karma: 29
  • Awards Awarded for outstanding services to Exilian!
    • View Profile
    • SotK
    • Awards
Re: Township - Development Thread
« Reply #105 on: July 16, 2013, 07:10:20 PM »
Yeah, it uses a good deal of old legacy OpenGL calls since it was made to compile in the uni computer lab (that uses like OpenGL 1.2 or something). I have managed to sort out all that stuff now, and it compiles but doesn't work on my computer. It works fine for Teejackbo though so it could be the fact that old OpenGL methodology is better supported by Nvidia drivers than it is by AMD.

Indeed that would be good, but there is probably not much point until after the summer is over and my resits are out of the way.

Son of the King

  • Megas Domestikos
    Voting Member
  • Posts: 3368
  • Karma: 29
  • Awards Awarded for outstanding services to Exilian!
    • View Profile
    • SotK
    • Awards
Re: Township - Development Thread
« Reply #106 on: August 20, 2013, 03:34:14 PM »
Managed to poke it into working! Now to make it run nicely!

Cuddly Khan

  • Silhouette in Disguise
  • Patrikios
    Voting Member
  • Posts: 7832
  • Karma: 33
  • PURGE THE BOTS!!
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Re: Township - Development Thread
« Reply #107 on: August 20, 2013, 11:14:07 PM »
Haha! Good luck. :) It's looking good.
Most effective elected official. Ever. (not counting Jubal)

He is Jubal the modder, Jubal the wayfarer, Jubal the admin. And he has come to me now, at the turning of the tide.

Jubal

  • Megadux
    Executive Officer
  • Posts: 35615
  • Karma: 140
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Re: Township - Development Thread
« Reply #108 on: August 24, 2013, 02:31:25 PM »
Woo go Township!  :)
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

comrade_general

  • Guest
Re: Township - Development Thread
« Reply #109 on: August 24, 2013, 08:07:31 PM »


Exilian profanity filters are global. :P

Son of the King

  • Megas Domestikos
    Voting Member
  • Posts: 3368
  • Karma: 29
  • Awards Awarded for outstanding services to Exilian!
    • View Profile
    • SotK
    • Awards
Re: Township - Development Thread
« Reply #110 on: October 23, 2013, 02:21:08 PM »
Never going to finish this if I keep doing what I'm doing xD .

I decided that the best thing to do would be to change the way terrain works once again. In all previous iterations of the program I have used simple random numbers to place tiles in a grid of pre-determined size. The second python version that I never released (with water and good pathfinding etc) worked by filling the grid with water tiles and scattering some land randomly, then passing over the grid repeatedly growing the land with a random check to see if it grew on each pass.

The first 3D version filled a larger grid with land tiles, then randomly seeded a heightmap with maxima and minima to create hills and valleys. These valleys were changed to sand tiles and were effectively underwater.

However, I wanted to reduce the cost of rendering the map. The way to do this is to split it up into sections, and only bother with the stuff within a certain range of the camera. If I make it work in this manner, the reason behind not having very large maps is gone, and therefore the maps can be of potentially enormous size. However none of the approaches I had previously taken are particularly conducive to very large maps, since the entire map must be generated before it can be used (due to the random scattering of land or hills/valleys being totally random, and therefore a lot of processing needs to be done on what is created to give smooth and coherent terrain).

I am now in the process of writing a map generator that initially generates a large map, only parts of which will be rendered at any point in time, but which in the future will be able to generate more terrain on the fly. This has the potential for worlds of vast size.

Initially a grid of hexagons is created, and filled with a colour decided by a Perlin noise algorithm. This colour represents the type of the tile - land or water. This hexagonal grid is then 'rasterised' to get an even larger grid of square tiles (the actual terrain) with height based upon the distance of the tile from sea level, with random perturbation. These tiles are stored in groups of 16x16 tiles called regions. The rendering engine will test if the centre of a region is in the viewing distance, and if it is then that region will be rendered. The regions will store all things that are scattered across the world, such as trees etc. This will allow the render cost for each of these things to be reduced by only trying to render a fraction of the full amount.

All in all - better terrain and also better fps is being implemented :D .

Jubal

  • Megadux
    Executive Officer
  • Posts: 35615
  • Karma: 140
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Re: Township - Development Thread
« Reply #111 on: October 23, 2013, 11:57:43 PM »
When there are screenies, do show.  :)
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

Cuddly Khan

  • Silhouette in Disguise
  • Patrikios
    Voting Member
  • Posts: 7832
  • Karma: 33
  • PURGE THE BOTS!!
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Re: Township - Development Thread
« Reply #112 on: October 24, 2013, 09:45:43 AM »
Haha! I'm quite curious as well.
Most effective elected official. Ever. (not counting Jubal)

He is Jubal the modder, Jubal the wayfarer, Jubal the admin. And he has come to me now, at the turning of the tide.

Son of the King

  • Megas Domestikos
    Voting Member
  • Posts: 3368
  • Karma: 29
  • Awards Awarded for outstanding services to Exilian!
    • View Profile
    • SotK
    • Awards
Re: Township - Development Thread
« Reply #113 on: November 06, 2013, 11:02:18 PM »
Not very impressive at the moment, but here are some screens of the hex grid that is used as the 'continent map'. The next step is to turn this into a square grid at a much higher resolution, which will eventually become the actual terrain. Maybe preliminary screens of that tomorrow or the next day. Then once I have a basic implementation of the map working in this form, I think I will work on getting the game part of Township back to where it was in the original Python release. After that I will work on making the map generation more interesting and improving the gameplay somewhat.

Spoiler (click to show/hide)

Jubal

  • Megadux
    Executive Officer
  • Posts: 35615
  • Karma: 140
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Re: Township - Development Thread
« Reply #114 on: November 08, 2013, 08:11:21 PM »
Awesome, I am muchly looking forward to this.  :)
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

Son of the King

  • Megas Domestikos
    Voting Member
  • Posts: 3368
  • Karma: 29
  • Awards Awarded for outstanding services to Exilian!
    • View Profile
    • SotK
    • Awards
Re: Township - Development Thread
« Reply #115 on: November 08, 2013, 11:41:59 PM »
Ok, some progress has been made. Big maps now take forever and a day to generate, but I'll work on speeding that up soon. Here is an example of a hex map, which is then turned into a square tile based approximation of it at a huge scale.

Spoiler (click to show/hide)

Son of the King

  • Megas Domestikos
    Voting Member
  • Posts: 3368
  • Karma: 29
  • Awards Awarded for outstanding services to Exilian!
    • View Profile
    • SotK
    • Awards
Re: Township - Development Thread
« Reply #116 on: November 26, 2013, 12:32:19 PM »
Progress update once again.

I finally finished up the reason behind me starting the map generator all over again. So now the map is properly split into "regions" of 10x10 tiles, only a certain number of which are rendered at any one time. This will drastically reduce the cost of rendering the map, which was the performance bottleneck with the old generator. I've also done a lot of planning how I want the game to work properly, for pretty much the first time ever. So I now have a clear idea of how I want things like resource collection and unit creation to work.

This also included fleshing out an idea I've had since I was working on what was intended to be the second release of the game written in Python - namely giving each villager their own individual personality. Originally that just meant they have a name that can be customised, and they level their stats a bit slower than originally meaning you need to invest more time to get the veteran villagers who are great at their jobs. However now that is tied in with my more recent ideas about resources and training units, along with the idea of having a chieftain being fleshed out. Essentially, I intend to make it possible to mould your villager's abilities by using other villagers to teach them, and for each individual villager to have personality traits that affect their effectiveness at a particular job.

For example, you may get a villager who is highly intelligent and good at teaching others, but is also easily bored and therefore not particularly well suited to menial tasks such as farming or mining. This guy would be useful to enhance fresh villagers' personality traits. Similarly, you could get a villager who is reasonably skilled in a number of fields and charismatic. This guy would be a good bet for a chieftain.

Jubal

  • Megadux
    Executive Officer
  • Posts: 35615
  • Karma: 140
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Re: Township - Development Thread
« Reply #117 on: November 26, 2013, 12:39:41 PM »
This sounds utterly awesome. Keep up the good work! :D
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...

Son of the King

  • Megas Domestikos
    Voting Member
  • Posts: 3368
  • Karma: 29
  • Awards Awarded for outstanding services to Exilian!
    • View Profile
    • SotK
    • Awards
Re: Township - Development Thread
« Reply #118 on: November 26, 2013, 02:24:04 PM »
I hope it will be :D . I still have to work on getting the terrain decorated nicely before I move onto the feature adding part once again though.

Son of the King

  • Megas Domestikos
    Voting Member
  • Posts: 3368
  • Karma: 29
  • Awards Awarded for outstanding services to Exilian!
    • View Profile
    • SotK
    • Awards
Re: Township - Development Thread
« Reply #119 on: December 10, 2013, 12:09:52 PM »
Today I work on spreading the trees nicely (only pine-ish trees for now, in the future I intend to have multiple tree species with the type of each tree decided by the amount of moisture and temperature at that tile). Once that is done, rocks will be added on the hills and the terrain will change to match it.

Then onto work with villagers!