Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!

Olof Hedman

Member Since 24 Aug 2011
Offline Last Active Today, 12:16 PM

Posts I've Made

In Topic: AI conquest deadlock

27 March 2015 - 10:11 AM

I think, going into direction of "even more smart" is pointless...


Well, your AI is very smart within the parameters it evaluates... 

But is the end result really that smart?


How rational is it really to grind billions into a never-ending war that gain nothing?

I'd say... not really.

It sounds a bit like your "perfect AI" need to read "The Art of War" to start with smile.png


My point is just that your AI need to take more parameters into consideration, and that would mean being "smarter", not trying to make it less smart. Lorenzo again gives good examples of what these parameters could be.


Other parameters could be that which we call "emotions". A never-ending war will for example likely run your troops morale into the ground, which makes your war even more costly and pointless (unless everyone is robots, then I guess a never-ending war is plausible, but still sounds more like a programmer bug on the part of the creators of said robot civilization). Technically, this is just a float somewhere that get reduced every turn the war continues and modify the "importance" of this planet, but it is more fun and useful to think of it as "morale"


Another way to say it, I guess, is: The game should be balanced such that stupid and boring strategies simply isn't perceived as advantageous. Then the AI won't pick them.

In Topic: All Jokes aside, what is 6/2(1+2)?

27 March 2015 - 09:51 AM

I think you are spot on Oberon.


Today is the first time I hear about this "special rule" for implicit multiplication, but I think I understand the logic behind it now, and how it can be useful.

I still feel like it is a bad convention though, and can easily be misunderstood. It messes with everyone who go by the logical precedence of operators according to growth, which still is what most people learn first and foremost. 


The idea that a / would mean the horizontal bar in division and therefore change the precedence makes no sense. If so, what defines where the "precedence override" ends? (where does the line end?) You would still need parenthesis to show that, unless it should always mean "to the end of the expression" which doesn't make much sense either, except for very simple expressions. It only makes sense if combined with implicit multiplication, so just using the implicit multiplication rule is enough, if you want to interpret the expression this way.

In Topic: All Jokes aside, what is 6/2(1+2)?

27 March 2015 - 01:57 AM

I was never taught any misleading acronym, and today I'm glad.


I was simply taught "addition and subtraction is the same thing" and "multiplication and division is the same thing"

And exponents is some kind of funky multiplication of multiplications smile.png (and roots are the same thing)


It's then very logical to order it by how fast it grows, with the fastest first.


Throw in factorials, and you have something that is even faster,  and should go first.


But start with the parenthises, since they obviously group things.


There is just a few classes of operators, and the ordering is really logical, why would one need an acronym anyway?

In Topic: AI conquest deadlock

26 March 2015 - 03:26 AM

I think your "perfect" AI needs to be smarter smile.png

It's obviously not really a good strategy if it can easily be beaten by sidestepping the AI.


DifferentName and LorenzoGatti has some good points, it's not a sane strategy to always just go all in on the most important planet, you should also consider where other agents are, and what can be conquered for low cost.


Also, adding some personality besides just random factors could be fun. Maybe some faction is very vindictive, and like to punish other factions that attacks them. Maybe some like to prey on the weak. Etc.

In Topic: Can you have to long of a hash string key.

26 March 2015 - 03:13 AM

Right, I should have seen that the uuid likely was not a long as the OP claims, even though I have not used boost...

As long as the key is actually compatible with a size_t you wouldn't need to hash it (and I'm sure the unordered_map recognizes this case).


If it is 128 bit, well.. then you would need to hash it. It should still be faster to hash a 128 bit value, then a 30-40 char string.


On another note, it is strange that the OP has problems with the string after saving it to file and reading it back. That shouldn't be a problem.

I'm guessing some change in character encoding.