Dynaverse.net

Taldrenites => Dynaverse II Experiences => Topic started by: Bonk on February 22, 2006, 06:36:55 pm

Title: Political tensions.
Post by: Bonk on February 22, 2006, 06:36:55 pm
 :woot:

Finally figured them out. The current political tensions are a float (fraction) relative to the AllyRatio and NeutralRatio gf settings stored as a 32 bit single. There is a key in the serverkit code that translates the value of this float to "trusted ally", "at war"...etc.  The initial political tensions however are the values from the tensions in the Metamap.gf stored as a 4 byte long. This is what confused me for so long... I was expecting the same for the current tensions.

Expect political reports on the webmaps shortly. Also we should be able to change alliances mid-campaign if we desire now. (applies to the flatfile as well)

 ;D
Title: Re: Political tensions.
Post by: EmeraldEdge on February 22, 2006, 06:48:35 pm
Sweetness!
Title: Re: Political tensions.
Post by: Riskyllama on February 22, 2006, 07:12:45 pm
consider the evil ramifications!
Title: Re: Political tensions.
Post by: Bonk on February 22, 2006, 07:19:39 pm
consider the evil ramifications!

I know...  :flame:

It will be just like playing Diplomacy. Lots of backstabbing underhanded deals... I love it.  ;D
Title: Re: Political tensions.
Post by: Chris Jones on February 22, 2006, 07:34:17 pm
:woot:

Finally figured them out. The current political tensions are a float (fraction) relative to the AllyRatio and NeutralRatio gf settings stored as a 32 bit single. There is a key in the serverkit code that translates the value of this float to "trusted ally", "at war"...etc.  The initial political tensions however are the values from the tensions in the Metamap.gf stored as a 4 byte long. This is what confused me for so long... I was expecting the same for the current tensions.

Expect political reports on the webmaps shortly. Also we should be able to change alliances mid-campaign if we desire now. (applies to the flatfile as well)

 ;D

This is excellent! Bonk - you da man - let me buy you a drink.  :drink:
Title: Re: Political tensions.
Post by: CaptJosh on February 22, 2006, 08:08:44 pm
Great. Just what this game needed. Realpolitik...
Title: Re: Political tensions.
Post by: Riskyllama on February 22, 2006, 08:22:14 pm
The RP people could actually write about events that will alter server conditions and outcomes.

Playing for A race will become important again, as having a player in every race won't work. Long term plans with allies might not be such a good idea...etc.

Hexx's Stratego card set will be a real issue, who knows if holding cards 3, 4, and 5 will cause Race C to suddenly switch sides do to a extreme lack of "resource x"
Title: Re: Political tensions.
Post by: IAF Lyrkiller on February 22, 2006, 09:00:27 pm
We Mirak would never backstab anyone. ;D
Title: Re: Political tensions.
Post by: KAT Chuut-Ritt on February 22, 2006, 09:43:52 pm
We Mirak would never backstab anyone. ;D


Nah we'd use waterballons.

<Chuut sneakd up and hurls a big water balloon which breaks on top of Lyrkiller's head soaking him>

(http://vit.pp.ru/uploads/pics/smiling_wet_cat.jpg)

<strangely enough, Lyr seems to have enjoyed the experience>

P.S.  WTG Bonk!
Title: Re: Political tensions.
Post by: KBF-Kurok on February 22, 2006, 11:09:29 pm
Awsome stuff
Title: Re: Political tensions.
Post by: IAF Lyrkiller on February 22, 2006, 11:28:13 pm
We Mirak would never backstab anyone. ;D


Nah we'd use waterballons.

<Chuut sneakd up and hurls a big water balloon which breaks on top of Lyrkiller's head soaking him>

([url]http://vit.pp.ru/uploads/pics/smiling_wet_cat.jpg[/url])

<strangely enough, Lyr seems to have enjoyed the experience>

P.S.  WTG Bonk!


Except for Chuut of course. :)
Title: Re: Political tensions.
Post by: KBF-Netman on February 23, 2006, 12:46:36 am
:rwoot: Well done Sir
 Finally to be able to play on the dynaverse, in a universe, where diplomacy, character and leadership, will play an intriguing role in it's evolution.
Let me know if you need any help with tests and stuff, I will be glad to help out
Title: Re: Political tensions.
Post by: EmeraldEdge on February 23, 2006, 01:38:21 am
man, reading the posts here I almost want to cry.  I want all the players back so we can really exploit a system like this!  I miss the old days of Praetorship, and the feeble attempts that server rules tried to enforce with little treaties and the like.  Now, we can actually do it!  I'm gonna have to get the right shiplists installed now I guess.
Title: Re: Political tensions.
Post by: Skaren on February 23, 2006, 08:35:24 am
This does sound nice and it is something that I have not liked about Dynaverse.  I hope it continues to move forward with success.

Title: Re: Political tensions.
Post by: NuclearWessels on February 23, 2006, 09:31:27 am

Whoo hooo!  WTG Bonk!

<starts the wave>

dave
Title: Re: Political tensions.
Post by: Bonk on February 23, 2006, 12:47:46 pm
Holy cow! PHP really did not want to decode a 32 bit single... was probably the toughest thing I've ever done in php...  :banghead:

To give you an idea, to convert the hex string "0000003F" to 0.5 (example value of a neutral relative tension) it took this:

Code: [Select]
$CurrentRelTensionValToUnpack = chr(hexdec(substr($RaceSectionEntryTension[1],0,2))).chr(hexdec(substr($RaceSectionEntryTension[1],2,2))).chr(hexdec(substr($RaceSectionEntryTension[1],4,2))).chr(hexdec(substr($RaceSectionEntryTension[1],6,2)));
$CurrentRelTensionVal = unpack ('freltension/', $CurrentRelTensionValToUnpack);
echo $CurrentRelTensionVal['reltension'];

<my head hurts>

edit: that was for the matrix blob string in the SQL db, converting the relative tensions from the flatfile ought to be less convoluted...
Title: Re: Political tensions.
Post by: Bonk on February 23, 2006, 03:57:19 pm
Basic politics pages are up on The Forge (http://www.dynaverse.net/webmap_op_sql/) and UAW Test Server (http://www.sullivandesigns.net/UAW_webmap/) webmaps. They still need some QA and perhaps some formatting as a table perhaps... It needs some tweaking for when all race slots are not playable... so the politics page may be in flux for a bit yet.

The flatfile politics page is next. After that, an admin page to edit the politics on an SQL server. And hopfully Scippy could use the information to add tensions editing capability to his new flatfile editor, or I might be able to come up with something for the task to avoid manual edits with a hex editor.
Title: Re: Political tensions.
Post by: Chris Jones on February 23, 2006, 04:32:48 pm
awesome - are guys lovin' this or what?
Title: Re: Political tensions.
Post by: Lepton on February 23, 2006, 04:50:06 pm
I think a simple graphic or number would work better for displaying the political tensions.  For servers with static or all at once side switching capability, a ROYBGIV color gradient might work well.  For servers perhaps far in the future where map events or other factors slowly alter tensions, a number would be more suitable, but this is awesome work nonetheless.

One question though.  Why does SFC use these hexidemical blob things?  Is it a common practice used in games to encode information in blobs like this?  It seems highly convoluted and none too intuitive to me.
Title: Re: Political tensions.
Post by: Bonk on February 23, 2006, 05:23:37 pm
Thanks for the input... I'll stew on a graphic color representation, interesting idea. Originally I had set out to display what you get when you right click a hex on the map in game. In developing the page I had the current relative tensions displayed as fractions but these won't mean much to most (values like 0.05, 0.93..etc...).

The politics page now only displays the relations of playable races and does not report the relation of a race to itself.

The blobs in the SQL db are a holdover from the flatfile database engine in SFC. Most games save their data in binary format like SFC does, yes - it is the most efficient. (Civ III and Age of Empires II savegames are binary). However, modern game servers like Eve probably store all their data in MySQL or Oracle databses - but when you come right down to it, MySQL and Oracle save their data as binary on disk as well...)
Title: Re: Political tensions.
Post by: Lepton on February 23, 2006, 06:52:31 pm
How about a simple matrix table? And maybe color codes with legend for quick scanning?

RaceUFPKEHKLSEMSLRSEGCISC
UFP-.05.93.05.93.05.95.05
KEetc-etcetcetcetcetcetc
HKetcetc-etcetcetcetcetc
LSEetcetcetc-etcetcetcetc
MSLetcetcetcetc-etcetcetc
RSEetcetcetcetcetc-etcetc
GCetcetcetcetcetcetc-etc
ISCetcetcetcetcetcetcetc-
Title: Re: Political tensions.
Post by: FPF-DieHard on February 23, 2006, 07:19:58 pm
Let me understand this, dynamic alliances are not possible?
Title: Re: Political tensions.
Post by: Riskyllama on February 23, 2006, 10:59:48 pm
Let me understand this, dynamic alliances are not possible?


... Also we should be able to change alliances mid-campaign if we desire now. (applies to the flatfile as well)...


I think this spreaks for itself.
Title: Re: Political tensions.
Post by: Bonk on February 24, 2006, 03:43:05 am
Let me understand this, dynamic alliances are not possible?

There is an incomplete mechainsm for dynamic alliances already in the kit.

There are gf settings to increment the political tensions every so many turns based on the number of battles fought, but no mechanism to decrease the political tensions.

The meanings of the current relative political tensions are calculated based on the AllyRatio and Neutral ratio gf setttings. (I would post the details, but there is an NDA covering the code I have). Change these values and the current relative tension values have new meanings. (thus my hesitance to use just the current relative tensions fraction for display of relations).

The standard initial tensions used to produce consistent mission matching (inital tensions of 0 and 1000) do not allow for the kit to increase tensions and the tensions decrementing code in the kit is incomplete.

The logic used to provide for dynamic alliances in the kit is flawed and incomplete.

So in short, no.

edit: however by setting intermediate initial tensions and zeroing out the tension increment settings and some trial and error using the AllyRatio and NeutralRatio gf settings one may be able to dynamically adjust tensions globally, but not for just one pair of races...
Title: Re: Political tensions.
Post by: Bonk on February 24, 2006, 04:04:42 am
How about a simple matrix table? And maybe color codes with legend for quick scanning?

RaceUFPKEHKLSEMSLRSEGCISC
UFP-.05.93.05.93.05.95.05
KEetc-etcetcetcetcetcetc
HKetcetc-etcetcetcetcetc
LSEetcetcetc-etcetcetcetc
MSLetcetcetcetc-etcetcetc
RSEetcetcetcetcetc-etcetc
GCetcetcetcetcetcetc-etc
ISCetcetcetcetcetcetcetc-

(excellent use of SMF's tables... ;))

Yes, that is the kind of thing I was thinking of. Perhaps I could put a summary like that at the top of the page.

However such a display is complicated by the fact that the initial tensions can be different; i.e. in the metamap.gf the feds can be at initial tension of 1000 to the klingons, but the klingons can be set to an initial tension of 500 to the Feds...

One would expect that the current relative tension values then would only be stored once, however, each race has a complete table of its relative tensions to the other races. I have not established whether these values are indeed consistent with the 2d matrix style you suggest. I have only decoded the values and the means of calculating the meanings of the current relative tensions. To establish if such a 2d matrix display of the relative tensions is accurate I will have to dig further in the code to see how the matrix is initially produced and then modified by the incomplete tension increment/decrement code, as well as continued observations of the kit in action.

Logically, such a table should be accurate, but I have learned not to make any assumptions about valid logic and the OP serverkit. ;)

The approach I have in mind now is an absolute one, eliminate the unpredicatable and incomplete tensions code in the kit by editing all the relative tensions to exact desired values.
Title: Re: Political tensions.
Post by: Bonk on February 24, 2006, 07:01:11 am
Digging into the flatfile political tension matrix now... it is somewhat different. The initial tensions are stored the same as in the SQL db but the current relative tensions are not. I notice that NW's editor source tries to read the current relative tensions as percentages stored as hex characters, but this does not look right and he has commented his code to indicate that somehow the tensions table is being corrupted, indicating he may not have it quite right. I have not actually tested his editor for changing current tensions but it would be kind of moot as the application consistently fails handling the db after the campaign has run for a while. Perhaps Scipio/HerrBurt's editor already does handle current tensions properly? (I have not played with it yet)

As I get deeper into the flatfile structure I get the feeling I may end up revealing the problem with the serverkit's SQL code by comparing the structure of the two database types in detail. Particularly the tensions matrices as the serverkit tensions code is overly complicated, incomplete and prone to misinterpretation.
Title: Re: Political tensions.
Post by: Bonk on February 24, 2006, 10:31:49 am
Sure enough. Dave's code was accurate. Flatfile politics page comin up.

I just find it strange that the current relative tensions would be stored so differently in the two matrices.

SQL: 32 bit single holding values from 0.00-1.00
Flatfile: 8 bit char holding values from 0-100

Weird...  :huh:

I think I'll do a table style page for each as well as Lepton suggests so there's a choice of view and I can compare the two. Though I'm tempted to move right on to a player roster from the flatfile character table next now that I have the political tensions matrix figured....
Title: Re: Political tensions.
Post by: GDA-Agave on February 24, 2006, 10:52:44 am
Well, now I know why the call traffic has picked up at all the Gorn embassy's throughout the quadrant.   Everybody just seems to
want the Gorn Conferdation to overhaul some of our old treaties.   It's almost like they don't trust us or something.

I always knew the Gorn were popular, but WOW!!   :o



Way to go Bonk!! 

I can only imagine the damage Chuut can do to the map now through all his smoke-filled, back-room discussions.

Title: Re: Political tensions.
Post by: GDA-S'Cipio on February 24, 2006, 01:34:41 pm
Perhaps Scipio/HerrBurt's editor already does handle current tensions properly? (I have not played with it yet)

That was part of the update I'm working on now, but the utility does not currently allow you to adjust tensions.

Changing political tensions in EAW was very easy the one time I did it near the beginning of The Four Powers War server.  As I recall, it was just an 8x8 hexadecimal table that you converted into percentages.   Thus I expected OP to simply be a 16x16 table that did the same thing, but reading your posts  (grat job, by the way!   :thumbsup: )it sounds like things are a bit more complicated than that in OP.

In answer to your earlier question, if you are willing to share after you figure it all out, I'd love to include your solution in my editor.

-S'Cipio   
Title: Re: Political tensions.
Post by: Bonk on February 24, 2006, 02:59:25 pm
In answer to your earlier question, if you are willing to share after you figure it all out, I'd love to include your solution in my editor.


Certainly will do.

By the way, I tried to run your editor today but got this error (do I need the VC 8 runtime or a newer version of the .net framework or something? - I have VC6 and VC8 installed, and the .net frameworks 1.1 and 2.0... or is it a VB dependency?):

edit: I just had a look at the exe in a hex editor and in a PE explorer and it looks like a VB5 app? I have VB6 installed...I thought I had the VB5 runtime installed... hmmm...

P.S. have you had a look at NW's EDDBEDIT source?: http://www.dynaverse.net/downloads/sfc2_op/Tools_and_Utilities/dbeditor_sourcecode.zip
(it is quite helpful, though there are some holes in it - I have identified some of the unknown stuff in it...)
Title: Re: Political tensions.
Post by: GDA-S'Cipio on February 24, 2006, 03:55:17 pm

By the way, I tried to run your editor today but got this error (do I need the VC 8 runtime or a newer version of the .net framework or something? - I have VC6 and VC8 installed, and the .net frameworks 1.1 and 2.0... or is it a VB dependency?):

edit: I just had a look at the exe in a hex editor and in a PE explorer and it looks like a VB5 app? I have VB6 installed...I thought I had the VB5 runtime installed... hmmm...

Crap!

I actually wrote this tool using Borland Visual C++ Version 5.    I thought I had the executable built so that it would run independantly, but I guess not.  I'll have to rebuild it for you.

Quote
P.S. have you had a look at NW's EDDBEDIT source?: (it is quite helpful, though there are some holes in it - I have identified some of the unknown stuff in it...)

Yes, indeed!  Dave does great work.   

-S'Cipio
Title: Re: Political tensions.
Post by: Bonk on February 24, 2006, 04:02:58 pm
I actually wrote this tool using Borland Visual C++ Version 5.    I thought I had the executable built so that it would run independantly, but I guess not.  I'll have to rebuild it for you.

Coolness.  8)
Title: Re: Political tensions.
Post by: Lepton on February 24, 2006, 04:38:31 pm
I am wondering why or if the relative tensions move away from the initial tensions and in what manner.  If a server was intended to have the same political state throughout its life as we do now in the dynaverse de facto, then why is there some sort of feature that would alter those initial tensions?  The designers might have intended for actions on the server to affect those tensions such that allies might become enemies or at least evolve to a state of neutrality, but from what Bonk has said, it sounds as if this was either poorly implemented or never finished.
Title: Re: Political tensions.
Post by: Bonk on February 24, 2006, 04:47:42 pm
This excerpt from the MetaMap.gf should pretty much explain it:

Quote

[PoliticalTensionInc]
// This is the numbered added every time a battle is fought
// Some races like the Federation are slower to anger
Federation=5
Klingon=20
Romulan=10
Lyran=15
Hydran=10
Gorn=15
ISC=25
Mirak=20
Orion=20
OrionOrion=20
OrionKorgath=20
OrionPrime=20
OrionTigerHeart=20
OrionBeastRaiders=20
OrionSyndicate=20
OrionWyldeFire=20
OrionCamboro=20

//This is the number subtracted when political tension is asked to be decreased.
//The federation is more likley to forgive than other races
[PoliticalTensionDec]
Federation=0            // (75) Currently under test
Klingon=0               // (15) Currently under test
Romulan=0               // (30) Currently under test
Lyran=0                  // (30) Currently under test
Hydran=0               // (45) Currently under test
Gorn=0                  // (30) Currently under test
ISC=0                  // (10) Currently under test
Mirak=0                  // (21) Currently under test
Orion=0
OrionOrion=0
OrionKorgath=0
OrionPrime=0
OrionTigerHeart=0
OrionBeastRaiders=0
OrionSyndicate=0
OrionWyldeFire=0
OrionCamboro=0

Title: Re: Political tensions.
Post by: RazalYllib on February 24, 2006, 06:13:01 pm
Bonk, you have awesome Kung Fu !!!!

I was alway of the impression that the political tensions never worked properly from DV day 1.

Would it be possible to script missions to to "adjust" the tensions on the fly as it were through the use of sql?



Title: Re: Political tensions.
Post by: Bonk on February 24, 2006, 06:47:22 pm
Once we have stabilised the server kit on SQL enough to make it worthwhile, yes.
Title: Re: Political tensions.
Post by: Bonk on February 25, 2006, 04:04:04 pm
How about a simple matrix table? And maybe color codes with legend for quick scanning?

RaceUFPKEHKLSEMSLRSEGCISC
UFP-.05.93.05.93.05.95.05
KEetc-etcetcetcetcetcetc
HKetcetc-etcetcetcetcetc
LSEetcetcetc-etcetcetcetc
MSLetcetcetcetc-etcetcetc
RSEetcetcetcetcetc-etcetc
GCetcetcetcetcetcetc-etc
ISCetcetcetcetcetcetcetc-


Check the politics page on the KCW webmap (http://www.dynaverse.net/webmap_kcw_ff/). ;)

No color codes yet and I've yet to do the same for the SQL webmaps, but I think it works well...
Title: Re: Political tensions.
Post by: Dfly on February 25, 2006, 05:52:18 pm
I Love it.  Great Job.
Title: Re: Political tensions.
Post by: Lepton on February 25, 2006, 06:17:52 pm
Cool!
Title: Re: Political tensions.
Post by: FPF-Paladin on February 26, 2006, 06:29:31 am
*drools openly!!*

Holy crap, awesome!!!

This could really fit in with something I want to try - please keep us updated Bonk!

Not having to restart a server to adjust those settings could save me a whack of time...

Muhaha.

Muhahahaha....



*slinks back to his Evil Lair(tm)*
Title: Re: Political tensions.
Post by: Bonk on February 26, 2006, 11:05:24 am
Hmmm the table format doesn't work so good when all the empire/cartel slots are in use, as on The Forge (http://www.dynaverse.net/webmap_op_sql/). The table is too big (at least on my 1024x768 display). I wish there were a standard vertical text tag, there is one for IE only but I won't use that. Gotta stew on how to tidy it up when all the slots are in use.
Title: Re: Political tensions.
Post by: Lepton on February 26, 2006, 11:16:03 am
I think the use of abbreviations for the races in the row and column header would help as well as a smaller font.

Also you might break up the large matrix into 3 smaller ones.  Empire vs Empire, Empire vs Cartel, Cartel vs Cartel.
Title: Re: Political tensions.
Post by: Bonk on February 26, 2006, 11:27:48 am
Yeah, I thought of abbreviations, probably the easiest way to tighten it up. Thanks for the suggestions!