Accueil Crush your enemies... and create an EMPIRE!!! Space Empires V -- BUY NOW!!!

Connexion utilisateur

  • Créer un nouveau compte
  • Demander un nouveau mot de passe

Navigation

  • news
    • archive
    • blogs
    • books
    • forums
    • recent posts
    • groups
  • image galleries
  • projects & downloads
  • search
  • create content
  • agrégateur de nouvelles

Rechercher

Qui est en ligne

Il y a actuellement 3 utilisateurs et 165 invités en ligne.

Utilisateurs en ligne

  • Captain Kwok
  • Faithful
  • Sabin Stargem

Languages

  • English English
  • French French

Parcourir les archives

« November 2008  
Mo Tu We Th Fr Sa Su
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Accueil » news » forums » Support & Feedback » Scenarios & Mods » SE:V MODs

Mod Processing Time...

Soumis par Gideon le Ven, 2007-11-30 20:19 SE:V MODs

I've stumbled on to something that might speed up processing time of turns. This is a change that has to be done to an AI file, so only try this if you know something of what you're doing there. Please give this a shot, and tell me if it makes any difference. My computer is fast enough that I really can't tell.

In Script_AI_Politics.txt.

Stock code:

//------------------------------------------------------------------------
// Calculate_Current_Anger
//------------------------------------------------------------------------
function Calculate_Current_Anger returns boolean
vars
  list_count:          long
  list_index:          long
  final_anger:         long
  our_alliance_id:     long
begin

  // Calculate current anger towards each player
  call lst_Politics_Total_Anger_Towards_Player.clear()
  call lst_Politics_Total_Anger_Towards_Alliance.clear()

  set our_alliance_id := Sys_Empire_Politics_In_Alliance_ID(sys_long_Player_ID)

  set list_count := Sys_Get_Number_Of_Players()
  for list_index := 1 to list_count do
    set final_anger := 0
    if (list_index <> sys_long_Player_ID) then
      if (Sys_Empire_Politics_In_Alliance_ID(list_index) = 0) then
        set final_anger := Calculate_Current_Anger_For_Entity(list_index, 0)
      endif
    endif
    call lst_Politics_Total_Anger_Towards_Player.add(final_anger)
  endfor

  set list_count := Sys_Get_Number_Of_Alliances()
  for list_index := 1 to list_count do
    set final_anger := 0
    if (list_index <> our_alliance_id) then
      set final_anger := Calculate_Current_Anger_For_Entity(0, list_index)
    endif
    call lst_Politics_Total_Anger_Towards_Alliance.add(final_anger)
  endfor

  return TRUE
end

Modified code:

//------------------------------------------------------------------------
// Calculate_Current_Anger
//------------------------------------------------------------------------
function Calculate_Current_Anger returns boolean
vars
  list_count:          long
  list_index:          long
  final_anger:         long
  our_alliance_id:     long
  is_known:            boolean
begin

  // Calculate current anger towards each player
  call lst_Politics_Total_Anger_Towards_Player.clear()
  call lst_Politics_Total_Anger_Towards_Alliance.clear()

  set our_alliance_id := Sys_Empire_Politics_In_Alliance_ID(sys_long_Player_ID)

  set list_count := Sys_Get_Number_Of_Players()

  for list_index := 1 to list_count do
    set final_anger := 0
    if (list_index <> sys_long_Player_ID) then
      set is_known := Sys_Empire_Politics_Is_Player_Known(sys_long_Player_ID, list_index)
      if (Sys_Empire_Politics_In_Alliance_ID(list_index) = 0) and (is_known) then
        set final_anger := Calculate_Current_Anger_For_Entity(list_index, 0)
      endif
    endif
  endfor

  set list_count := Sys_Get_Number_Of_Alliances()
  call lst_Anger_Towards_Alliance.fill(list_count, 0)

  for list_index := 1 to list_count do
    set final_anger := 0
    if (list_index <> our_alliance_id) then
      set is_known := Sys_Empire_Politics_Is_Alliance_Known(sys_long_Player_ID, list_index)
      if (is_known) then
        set final_anger := Calculate_Current_Anger_For_Entity(0, list_index)
      endif
    endif
  endfor

  return TRUE
end

In stock, the AI goes through all of its mood/anger calculations for every single player and alliance. The modified code changes this so that the AI only calculates its mood/anger when it knows of an empire or alliance. If it doesn't know of them, it skips that. Obviously, this doesn't help in games where everyone knows of everyone else. However, this might help in earlier games.

I'm attaching a Script_AI_Politics.txt file which has this change, and ONLY this change, in it. All the rest of the code in it is stock.

Let me know if this makes any difference.

Be sure to rename the downloaded file (if you use it) to Script_AI_Politics.txt before compiling.

EDIT: Figures, I would post the wrong code and attach the wrong file. Corrections made, this should work.

‹ Balance Mod 1.09 works with german version? GidMod Concept: Industry... ›
Fichier attachéTaille
Script_AI_Politics.txt154.35 Ko
» Vous devez vous identifier ou créer un compte pour écrire des commentaires

Options d'affichage des commentaires

Sélectionnez la méthode d'affichage des commentaires que vous préférez, puis cliquez sur "Sauvegarder les paramètres" pour activer vos changements.
Image de Captain Kwok
Mod Designer

Re: Mod Processing Time...

Soumis par Captain Kwok le Ven, 2007-11-30 22:33

The script execution time (pause before green bar appears) is next to nothing, so it won't make any noticeable difference. The three areas that take most of the time is research, design creation (which isn't every turn), and ship orders - particularly when there are lots of ships etc.


Space Empires Depot | SE:V Balance Mod

» Vous devez vous identifier ou créer un compte pour écrire des commentaires
Mod Designer

Re: Mod Processing Time...

Soumis par Gideon le Sam, 2007-12-01 18:07

What, during the green bar processing, is taking people so long to process? I keep seeing complaints of "long turn times" in threads in general, and now I'm really curious.

"Only by being constantly at war with evil in all things, including yourself, can you truely know peace."
Download my mod here: GidMod

» Vous devez vous identifier ou créer un compte pour écrire des commentaires
Image de Captain Kwok
Mod Designer

Re: Mod Processing Time...

Soumis par Captain Kwok le Dim, 2007-12-02 00:46

The green bar is the movement phase (ie execution of orders). Red bar is combat.


Space Empires Depot | SE:V Balance Mod

» Vous devez vous identifier ou créer un compte pour écrire des commentaires

Options d'affichage des commentaires

Sélectionnez la méthode d'affichage des commentaires que vous préférez, puis cliquez sur "Sauvegarder les paramètres" pour activer vos changements.

Now on STEAM

Now on STEAM!Space Empires V via STEAMSpace Empires IV via STEAMSTEAM online by Valve Corporation

Contenu populaire

Aujourd'hui :

  • Research By Percentage SUCKS
  • Space Dock suggestion
  • Star Trek Trailers.....
  • Balance Mod v1.15 Available!
  • drone combat?!

Depuis toujours :

  • Space Empires V and VI: Expansions and the Future: Tell the Company What's on Your Wish List
  • Space Empires V
  • Gritty Galaxy Fleet Clash
  • Damn Dirty Bugs/Annoyances
  • Space Empires V: General Thoughts, Observations, and Suggestions

Dernier accès :

  • Saved games
  • Bio
  • "Big Ships" problem
  • Ringworld / Sphereworld
  • Just some questions that are driving me nuts
(c) Strategy First, Inc. All rights reserved.