Author Topic: Generating flags, icons and symbols  (Read 10307 times)

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Generating flags, icons and symbols
« on: January 07, 2013, 05:32:52 PM »
So, I thought I'd post a thread about generating things other than levels, monsters, etc. As part of URR (main thread: http://roguetemple.com/forums/index.php?topic=2822.0) I'm having the game generate flags for all of the in-game civs, and also icons and symbols for all the games religions. Below are some examples of generated flags:



The way a civilization's territory is coloured on the map is dependent upon the flag. The same combination of colours, and the same pattern, cannot be generated twice in one game - whilst, technically, this does make the possibilities finite, a quick calculation showed the number of options was orders of magnitude above what would ever be needed on even the largest possible map with the highest possible resources, land mass, and generally trying to set everything so that as many civilizations as possible were generated. There's a database of colours, which is significant, though not exhaustive - I tried out quite a lot of colours to decide which ones worked, and which ones didn't.

Secondly, I've got the game generating religious icons. These are *not finished*, as there are some that I feel still generate too similarly, and some that simply aren't that interesting, and a lot of extra "components" I intend to add to the generator, but it's a pretty good idea of the final product I have in mind. Religious icons are generated in three parts – a “base”, a “symbol”, and a “surround”. The base is the largest shape present – it might be two crescents at the top and bottom, various kinds of squares, triangles, octagons, linked squares, arrows, and the like. Once that’s been chosen, the game then selects a set of symbols appropriate to that base – symbols are the sections that go in the middle. Lastly, if *no* symbol has been chosen – some bases have no valid symbols, whilst even bases with valid symbols will sometimes choose against a symbol – then a surround is chosen, which is things that are outside the main design. Some of these are specific to specific designs, whilst others are more general. As with flags, names and everything else, the same religious icon cannot be generated twice in one game. And, like flags, some combinations are denied, either because they don’t look very interesting, or they actively create a clash between the components. Some symbols and surrounds are also changed to match with certain bases in certain ways – the upshot is, there are about 30 bases, 30 symbols and 30 surrounds, with variation within each, and that gives a heck of a lot of religious symbols.



So, do let me know what you think - I'm truly trying to generate as close to everything as possible, and these struck me as both interesting things I could generate, and a good way to add flavour into the game. I also generate "landscapes" for the game (again, see the thread), and in the future I plan to generate images for weapons, artefacts and the like, as well as heraldry, but I'll cover those when I get to them!

kraflab

  • Rogueliker
  • ***
  • Posts: 454
  • Karma: +0/-0
    • View Profile
    • kraflab.com
Re: Generating flags, icons and symbols
« Reply #1 on: January 07, 2013, 07:54:42 PM »
Looks pretty good and I think it does add some nice flavor.  The main issue I see is maintaining the interest factor, since it's only a matter of time before you end up thinking "oh, there are those same diamonds on the flag again." You need a large pool of possibilities to keep things looking fresh.

Kyzrati

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 508
  • Karma: +0/-0
    • View Profile
    • Grid Sage Games
    • Email
Re: Generating flags, icons and symbols
« Reply #2 on: January 08, 2013, 01:22:38 AM »
Yep, looks good, though with the religious icons it may be good idea to disallow similar versions to be generated in the same game (unless of course the religions are related, in which it could make sense). It would seem odd that very separate religions could end up with similar icons, such as using the same surrounding diamond with only minor interior differences.

tuturto

  • Rogueliker
  • ***
  • Posts: 259
  • Karma: +0/-0
    • View Profile
    • pyherc
Re: Generating flags, icons and symbols
« Reply #3 on: January 08, 2013, 03:22:39 AM »
Looks really interesting. I would like to see more symbols on the flags, like stars, circles and such.

Generating graphical assets is something that is not used that often (I think). On top of my head I can only remember seeing something about generating magic runes, but that's about it. I like that you're exploring this side of content generation, instead of just generating 20+ levels of dungeon filled with monsters (not that there's nothing wrong doing it, but we need something new now and then).
Everyone you will ever meet knows something you don't.
 - Bill Nye

SomeGuy

  • Rogueliker
  • ***
  • Posts: 64
  • Karma: +0/-0
    • View Profile
    • Email
Re: Generating flags, icons and symbols
« Reply #4 on: January 08, 2013, 09:35:10 AM »
Really interesting idea.

Some of the religions symbols remind me to Star Wars.

Also it would be interesting to have swords, shields, lions and eagles shapes as flag features in addition to geometric shapes.

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Re: Generating flags, icons and symbols
« Reply #5 on: January 10, 2013, 02:28:02 PM »
Looks pretty good and I think it does add some nice flavor.  The main issue I see is maintaining the interest factor, since it's only a matter of time before you end up thinking "oh, there are those same diamonds on the flag again." You need a large pool of possibilities to keep things looking fresh.

Thanks, and agreed. You'll never see as many as in that picture, but you're still right. I've had an idea for how to add a huge new set, which I'm going to start on soon.

Yep, looks good, though with the religious icons it may be good idea to disallow similar versions to be generated in the same game (unless of course the religions are related, in which it could make sense). It would seem odd that very separate religions could end up with similar icons, such as using the same surrounding diamond with only minor interior differences.

I have disallowed identical versions, but maybe even similar ones should be disabled. I don't know how much that would reduce the number of permutations before it runs out; I'll have to do some testing. Currently, from the database of "bases", it removes one from the database each time until every single base has been used, and then it resets the database to full. That prevents a lot of similar generation, but for worlds with a lot of civilizations, that still might not be enough...

Looks really interesting. I would like to see more symbols on the flags, like stars, circles and such.

Generating graphical assets is something that is not used that often (I think). On top of my head I can only remember seeing something about generating magic runes, but that's about it. I like that you're exploring this side of content generation, instead of just generating 20+ levels of dungeon filled with monsters (not that there's nothing wrong doing it, but we need something new now and then).


Thanks - I tried circles, but with just ANSI in a 12x8 grid it really wasn't working, though stars might be worth an investigation. I think you're right about the rarity, which is one of the reasons it so appeals :)!

Really interesting idea.

Some of the religions symbols remind me to Star Wars.

Also it would be interesting to have swords, shields, lions and eagles shapes as flag features in addition to geometric shapes.

Cheers - ha, yes, there is a tie-fighter-esque one, isn't there. I can't really generate those on flags, due to the size and ANSI limitations, but just you wait until I have some generated heraldry to reveal ;D