Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: It Usually Ends In Nuclear War  (Read 42343 times)

0 Members and 2 Guests are viewing this topic.

Sub

  • Full Member
  • ***
  • Posts: 159
    • View Profile
It Usually Ends In Nuclear War
« on: December 07, 2013, 02:17:11 am »
It Usually Ends In Nuclear War
  • 4x civilization building game in development for Windows and Linux
  • Heavily influenced by Civilization II, Alpha Centauri, Call To Power, and Rome Total War.  To a lesser extent Endless Space and the Europa Universalis series
  • Currently prealpha
  • Design goals.
    • Keep microamanagement to a minimum yet allow for larger empires than recent civ games.
    • Not turn based, but rather semi-real time.  When the game is unpaused, turns will occur at a set-interval of roughly one turn every 500 milliseconds
    • Revolutions / collapsable civilizations
    • Interesting end game
  • Huge gallery (1000+) of screenshots I've been maintaining throughout the project.
Screenshot from October 15, 2017


Something more recent
« Last Edit: February 10, 2018, 07:53:50 am by Sub »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: It Always Ends In Nuclear War
« Reply #1 on: December 07, 2013, 02:51:24 pm »
Some of the images are taken from other games / concepts which I wanted to try to emulate
So it's difficult to tell what you did... But ignoring that, some of the images look graphically quite good. Civilization is a huge project, have you already thought about using the map generation for something smaller? Especially since you seem to have already put a lot of effort in it.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Sub

  • Full Member
  • ***
  • Posts: 159
    • View Profile
Re: It Always Ends In Nuclear War
« Reply #2 on: December 07, 2013, 11:11:06 pm »
edit:  I originally had some screenshots from other games in the gallery which I was using as inspiration for how I wanted the game to look.  This post was originally declaring the images which weren't from my game, but I've since removed all such images from the gallery.
« Last Edit: December 01, 2014, 03:50:35 am by Sub »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: It Always Ends In Nuclear War
« Reply #3 on: December 08, 2013, 10:51:09 am »
Thanks for declaring the images!

I've also made the experience that after some time, you would rather re-implement functionality in old projects than reuse it in newer ones -- especially if it's one of the first projects, where code and everything was horrible. With some experience, ond would probably do a lot in a different way. The important knowledge are the ideas behind it (and possible algorithms), not necessarily a concrete implementation. That's also why I tried to document these parts well, so that I wouldn't have to re-learn everything in case I would use something again.

Anyway, it's still interesting to look at older code after some time ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Sub

  • Full Member
  • ***
  • Posts: 159
    • View Profile
Re: It Always Ends In Nuclear War
« Reply #4 on: May 09, 2014, 12:45:29 am »
Bit of a late response, but yeah, I constantly find myself going back to older projects to reuse code.

I spent the past few days working on taking my existing code and gutting a lot of functionality that I don't need anymore. 

One of the main things I want to do is show the player the more macro side of history, so I made the decision to increase map size by quite a bit.  The previous maps were 70x75 -- The new maps are 280 x 300.  That's a change from 5,250 tiles to 84,000 tiles. I think if we compare this to the real world it comes out to around 50 miles per tile, but my math might be off on that? 

The old game:



First I increased the number of tiles to 84,000 and decreased the physical size of the tiles (I think they were previously 64x32, now I think they're 16x8?)

My game has a boolean value where I can turn tile textures on / off.  I decided to turn textures off, as the new tiles are much too small for it to make sense.

I had a pseudo 3d effect (was trying to go for something akin to alpha centauri) in the old game which doesn't work so well with this new set up.  The screenshot above is actually the first attempt I made to scale it down, because it looked even more ridiculous than that.  The second try was much more reasonable:



Decided to get rid of the ocean floor. I never really did quite like the way it looked:



I think around this point I decided to get rid of the tile height completely.  It can be turned back on by uncommenting one line, but I think it's for the best with it off.'

The zoomed out view shows that the map generation algorithm needs some tweaking.  It's designed to work on much smaller map sizes (5250 tiles vs 84000!)


I didn't want to create a new algorithm for generating maps.  I decided that the easiest solution would be to generate a map for the old map size of 5250, and then just scale it up to a larger map size.  The map is scaled up by a factor of 4 compared to the old one, so I'm basically just treating every one tile in the old map generation algorithm as a group of 4x4 tiles in the new map. 


Whew it compiled!  But it didn't quite work...




Closer, but what the hell is going on with the water and the topright side of the map?



Fixed the water, but something still isn't quite right.  I am happy at this point, though, because the general theory I had seems like it'll work.



There we go. 



Now I just need to make the shoreline not so rigid..

Whoops:


Better...



So that's going to be the default camera view.  Conveying information with such a high view is going to be a bit of a problem.  I need to figure out how to display the locations of cities, as well as nation borders.  I think maybe having a red outline around tiles with cities might be the way to go.  I tested it out by randomly outlining tiles here, but I'm going to sleep on it:


I'm thinking if you mouse over a tile with a red outline, maybe a tool-tip like popup will appear with the city name and some more information.


Also tested to see how bad the height looks if it's turned on again:


Pretty sure I'm going to leave it off as it clutters the game. 

Tomorrow I'm going to work on the generation of tile types since that's still using the algorithm designed for small maps.  For the record, though, the tan tiles are desert, white tiles are ice, and the green tiles are grassland. 

I'm also going to work on adding in rivers to the game.  I'm hoping to start and finish both of those things tomorrow. 

If anyone made it this far, let me know what you think.  Also let me know if I used too many pictures, I'm afraid that it's going to be a pain to load for people with slower internet.
« Last Edit: June 10, 2015, 02:59:39 am by Sub »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: It Always Ends In Nuclear War
« Reply #5 on: May 09, 2014, 08:47:24 am »
Very cool that you continue this project, even if it will go into another direction. :)
I'll certainly be check back here to see how it turns out, not quite sure if I understand the interactive simulation you're aiming for, but it sounds interesting.

I'm thinking of posting regular updates here, although I'm worried that it might be considered spamming the forum, so we'll see how that goes.
That's fine, as long as you don't post like 5 updates one after the other in a day. :)

Also let me know if I used too many pictures, I'm afraid that it's going to be a pain to load for people with slower internet.
I like the pictures, but then again I've fast internet.

Personally, I'd still be interested in some of the code, I really like games with such terrains.
« Last Edit: May 09, 2014, 08:49:49 am by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

StormWingDelta

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Re: It Always Ends In Nuclear War
« Reply #6 on: May 10, 2014, 02:02:06 am »
Looking good.  :)
I have many ideas but need the help of others to find way to make use of them.

Sub

  • Full Member
  • ***
  • Posts: 159
    • View Profile
Re: It Always Ends In Nuclear War
« Reply #7 on: July 20, 2014, 07:03:35 pm »
I've been busy with moving, getting a job, and life in general.  In news completely unrelated to anything, I saw this post making its way around the internet and decided to give it a try.  I made an attempt at it, and, well, I love what you can do with computers.  I used SFML to grab pixels and display the results.

As for the topic at hand, I haven't done too much with this since the last update.  I did get a chance to play around with tile type generation this weekend, though. 

I'm not sure if what I've come up with is embarrassingly bad, but I'm going to show it regardless.  The current thinking is that there's going to be 4 discrete tile types -- Desert (represented by tan tiles), Ice (represented by white tiles), Grassland (represented by light green tiles), and forest (represented by dark green tiles).  Tile types are going to effect food output, the culture that develops in cities, and resource distribution (ie: oil being more likely in desert / ice areas). 





I'm open to any suggestions on how to make it look better. 

Reyhn

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: It Always Ends In Nuclear War
« Reply #8 on: July 21, 2014, 02:40:58 am »
Not sure it would be really handy to play with (maybe with view rotation ?) but I like your pseudo-3D effect, kinda cool  :D

Good job so far

Hypnéos

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: It Always Ends In Nuclear War
« Reply #9 on: July 22, 2014, 11:19:14 am »
It looks very good. :)

What kind of algorithm do you use to generate the map ?

"Bravo!" for what you can do with computers .

PS : Felicitations for your apparition on RPS !
« Last Edit: July 22, 2014, 11:29:29 am by Hypnéos »

Sub

  • Full Member
  • ***
  • Posts: 159
    • View Profile
Re: It Always Ends In Nuclear War
« Reply #10 on: July 23, 2014, 12:15:46 am »
Thanks!

I'm doing this from memory, but from what I remember, this is the algorithm:

-  Start with a small board (70 x 75 tiles)
-  Make every tile water
-  Pick a tile at random and make it land. 
-  Add that tile to a list we'll call tiles to check.

while the number of land tiles is less than some arbitrary number (I think I made mine 35% of the map). . .

For every tile in the list we made we look at each of their neighboring (i think only water) tiles to determine whether to change them to land or keep it as water. The closer this tile is to the first tile that we chose, the greater chance it has of becoming land. If we decide to make a tile into land, we add it onto the list of tiles to check. Tiles that stay as water don't get added to this list. Once all neighbors for a particular tile are checked, that center tile gets removed from the list. When the list is empty, you can repeat the process with a new starting tile. Repeat this entire process until we hit a desired number of land tiles.

I then translate this small board onto the larger board, which I described in one of the above posts.

It seems to produce reasonable results, and you have a bit of control over things like the size of a landmass (adjust the weight on distance), the % of the map that is water (adjust the # of desired land tiles), you can dictate certain areas of the map that are more likely to contain water/land (for example, if you want a map with a gigantic ocean in the middle, you can favor starting tiles that are far away from this area), you can control how many continents appear on the map, as well as the size variance between continents (that is, how large the largest continent is in relation to the smallest) by changing the distance weight for each continent you place. 

For the height, I did something that was roughly this -- All tile corners are at height 0, and there's a list of corners that are locked and will no longer be heightened, and a list of unlocked corners.  All corners start out unlocked.  First lock all water corners. Iterate over all remaining unlocked corners and randomly either heighten a corner if allowed (i.e. this will not make it too high over any of its neighbors) / do nothing if not allowed, or lock the corner.  Keep iterating over the unlocked list until it's empty.
« Last Edit: July 23, 2014, 12:22:07 am by Sub »

Hypnéos

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: It Always Ends In Nuclear War
« Reply #11 on: July 27, 2014, 02:04:49 am »
Thanks for writing this. :)

Why using a smaller board, then converting ?

Your height generation tend to produce uniform height variations ( the whole map looks like mountains ), is intended behavior ?

For suggestions, maybe make the coastal water tiles (?) brighter/lighter .
Is it possible to hide the tiles borders ? I would like to see some screenshoot without.

keep up the good work!  :D

Sub

  • Full Member
  • ***
  • Posts: 159
    • View Profile
Re: It Always Ends In Nuclear War
« Reply #12 on: July 27, 2014, 06:00:27 am »
Once again, thanks for the interest!  I appreciate it a lot.

I made the map generation algorithm a while ago.  It was designed for a board that has around 5,000 tiles.  I recently decided that I wanted larger maps, so I went and increased the map size to around 80,000 tiles.  The map generation algorithm no longer produced good results after that change, though.  All the maps looked like this.  The easiest solution was to just generate the map for the smaller board, and then scale it up to the larger board.  This has the added benefit of being quicker than trying to generate a map for the size that I'm using.

The height generation needs some work.  I don't mind the behavior too much, but it could use some work.

As for making the coastal tiles brighter/lighter, I definitely agree with you there.  It looks something like this right now



I'm still not entirely happy with how the tile types look and are distributed, but it's getting closer.

Sub

  • Full Member
  • ***
  • Posts: 159
    • View Profile
Re: It Always Ends In Nuclear War
« Reply #13 on: September 28, 2014, 03:40:04 am »
Creeping slowly toward playability...


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: It Always Ends In Nuclear War
« Reply #14 on: September 28, 2014, 08:59:50 am »
Cool :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/