Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / How it went - Hittite

Author
Message
Fatal Berserker
13
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 21st Jan 2012 02:46 Edited at: 26th Jan 2012 22:38
I was gona put off putting it on this site till i had done more work, but i wana work on it but frustrated at a bug so i dont want to code .
Looking back on this particular account its my first WIP... Meaning i havnt really done anything in the past 2 years... Anyway.

Ok so, theres not much to say about this game currently, however it is going to be very similar to Rome: Total War. Once i finish with the terrain generator, you will see it start to come to life.

= Done
= In Progress
= Not Started
= Scrapped (might come back someday)
If something has a next to it, it also means its not implemented.
AI:
-- Unit Movement
-- Unit Animation
-- Spread Units Command
-- Change Units Formation Command
-- Pathfinding
-- Optimized Pathfinding
-- Combat
-- Change pathfinding from arrays to a binary heap - (Nearly did it, turned out to be annoyingly insufficient so i scrapped it)

Physics:
-- Raycasting
-- Sliding Collision

GUI: - I dont plan to do GUI for a while
-- Minimap
-- Frame

World:
-- Water-Zones | Random Rivers - Splishy Splashy
-- Foliage "Safe-Zones"
-- Terrain Generation
-- Billboarding
-- Tree placement
-- Weather
-- Implement World Generator

Input:
-- Unit Selection
-- Drag Selection

Misc:
-- Timerbased Animation/Movement/etc


Screenshots:


Terrain Height Map Generation:
The whiter the area on the foilage map, the less chance trees grow there, pure white = no chance.


Old:
http://img853.imageshack.us/img853/3029/newxk.png
http://img254.imageshack.us/img254/2423/nasd.png
http://img713.imageshack.us/img713/900/70189559.png
http://img192.imageshack.us/img192/3593/heightmapb.png

In-Game:


Path-Finding:

Alternative Diagonal System:
http://img196.imageshack.us/img196/7823/diagonal.png

Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 21st Jan 2012 04:07
Looking good! Total war games are alot of fun.

I know how you feel about getting stuck on coding, my advice for that would be to simplify it way more than you feel you need to. When becoming too ambitious on one project, it may never progress and never get done. If you make smaller simpler attempts of your goal and complete that first it's much easier to add the extra bits, I learned that the hard way.

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 21st Jan 2012 04:25
I agree with Ashingda 27

Wow it already looks nice!
Did you fix that 255 256 issue yet?

Fatal Berserker
13
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 21st Jan 2012 04:56 Edited at: 21st Jan 2012 05:05
Quote: "Did you fix that 255 256 issue yet?"

Yes !

Quote: "I know how you feel about getting stuck on coding, my advice for that would be to simplify it way more than you feel you need to. When becoming too ambitious on one project, it may never progress and never get done. If you make smaller simpler attempts of your goal and complete that first it's much easier to add the extra bits, I learned that the hard way."

I hear you, this isnt my first account on TGC, and over the past few years ive started many projects and only finished a few. But each time what i do is a i focus specifically on a certain area. This time im focusing on the terrain, alot of my code is from previous projects.


Only problem is, the severely increased render time.

Fatal Berserker
13
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 22nd Jan 2012 00:36 Edited at: 22nd Jan 2012 03:11
First version of the random river generation: (the white line)
http://img713.imageshack.us/img713/900/70189559.png
It seems to be working very well, im gona work on it though so it isnt as hectic.

Its using the pathfinding system, but instead of the H value being distance from target, instead it is the height of the block. Meaning that it favors lower areas, giving it the gravity type affect.
The river ends on the lowest point of the terrain.

Fatal Berserker
13
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 25th Jan 2012 23:51 Edited at: 25th Jan 2012 23:52
I have finished work on the terrain generator i believe.
It turned out getting the pathfinding to work on the whole 1024x1024 map was taking too long. So, i implemented an optimization system, which means that the resolution that the river generator works on is smaller than the actual map, i then blow it up at the end to match the map.
The optimization level in this screenshot is 5. Which is 1024 / 5 = 204*204 resolution.
Its hard to notice the difference.


Now to just implement it into the game....

Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 26th Jan 2012 16:45
Quote: "So, i implemented an optimization system, which means that the resolution that the river generator works on is smaller than the actual map, i then blow it up at the end to match the map"

Hey that's quite clever! You wouldn't happen to mind sharing this with me would ya?

Fatal Berserker
13
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 26th Jan 2012 22:14 Edited at: 26th Jan 2012 22:23
Basically (dont want to get into too much detail because its a few thousand lines for the whole thing)

I generate the terrain on one array, this array is 1024x1024. It is this large because the detail of the terrain is quite noticeable.

Now, after generating the terrain i start generating the rivers, the rivers use the Best Path (A*) pathfinding algorithm, but instead of the H value being distance from the target, its the height of the terrain (gravity affect).

Now, if i was doing pathfinding of a 1024x1024 area, it takes too long. Like i left it running for 5mins, it hadnt done it, i cant expect a loading screen to take that long.

So i made it so the pathfinding was done on a smaller area, eg.
PathfindingArray[WidthOfTerrain/Optimization][Height/Optimization]

Then if i ever needed to get information from the terrain i would just do something like:
H = HeightOfTerrain[CurrentX*Optimization][Y*Optimization]

Then when i had done it all and it go round to drawing the river (because this means theres gaps in the river because im not calculating the area between say 1*Optimization and 2*Optimization (which is 5)) I had to do a forloop like:
for (int i = 0; i < Optimization; i++)
{
HeightOfTerrain[CurrentX*Optimization+i][CurrentY*Optimzation+i] -= 100;
}
And that would say make the riverbed deeper by 100, which is how u see the riverbed in the heightmap.

The total code comes to just over 2000 lines over 5 files.

As you can see from above, it ment the rivers went from taking a few minuets to generate each, to a matter of seconds.. and thats generating 3.

McLaine
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location:
Posted: 26th Jan 2012 23:15
Very cool stuff.

It's hard, sticking to the coding and keeping moving forward on the actual functionality.

I just caught myself getting hung up on shaders, and before that it was too much tweaking of the control system.

My advice is to get something working, and then move on to the next chunk of functionality. You can tweak things to perfection later.

It's not my fault!
Fatal Berserker
13
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 27th Jan 2012 02:12
No point doing anything if you dont do your best.

Thinking of the algorithm im going to need to create for the tree placement.
I could either just place them randomly in groups.
Or, more complex, which will imo give a much nicer affect:
Place a few trees around the map randomly (say 3), then each tree has 1-2 children, who move in the direction of the closet river, but spread out from other trees. Repeating as needed

Login to post a reply

Server time is: 2024-04-20 00:15:13
Your offset time is: 2024-04-20 00:15:13