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

User login

  • Create new account
  • Request new password

Navigation

  • news
    • archive
    • blogs
    • books
    • forums
    • recent posts
    • groups
  • image galleries
  • projects & downloads
  • search
  • create content
  • news aggregator

Search

Who's online

There are currently 2 users and 195 guests online.

Online users

  • Justascratch
  • Captain Kwok

Languages

  • English English
  • French French

Browse 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
Home » news » forums » Support & Feedback » Scenarios & Mods » SE:V MODs

Possible logic error...

Submitted by Gideon on Sat, 2007-12-01 18:39. SE:V MODs

I may have found a bit of a logic error in the way the AI gives orders to ships with regards to them joining fleets.

‹ Ordnance... Modding Mounts - The best way to balance Small & Cheap vs Large & Expensive ships? ›
» login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Possible logic error...

Submitted by Brad on Sun, 2007-12-02 03:40.

You need to use use ampersand-gt-semicolon instead of a > sign, ie html code. Maybe something in the input format button below might do something, dunno, never tried it.

» login or register to post comments
Mod Designer

Re: Possible logic error...

Submitted by Gideon on Sun, 2007-12-02 12:09.
This is from stock Scrip_AI_Orders_Ships.txt. From the function Send_Ship_To_Join_Fleet:
if (Sys_Is_Empire_Fleet_Waiting_For_Ships(sys_long_Player_ID, fleet_id)) then
        if (not Is_Enemy_Present_At_Location(fleet_sys_loc, fleet_sect_loc)) then
          set this_dist := Sys_Get_Hex_Distance_Between_Sectors(sys_long_Player_ID, ship_sys_loc, ship_sect_loc, fleet_sys_loc, fleet_sect_loc)
          if (this_dist < min_dist) then
            set min_dist := this_dist
            set move_sys_loc := fleet_sys_loc
            set move_sect_loc := fleet_sect_loc
            set move_fleet_id := fleet_id
          endif
        endif
      endif
...
    call Sys_Give_Space_Object_Order_MoveTo(ship_id, move_sys_loc, move_sect_loc)
    call Sys_Give_Space_Object_Order_Join_Fleet(ship_id, move_fleet_id, task_force_id, task_force_role)
...
From the function Give_Specific_Fleet_Orders:

  if (not orders_given) then
    if (ships_joining_this_fleet > 0) and (ship_count <= (ships_per_fleet * 0.50)) then
      call Sys_Set_Empire_Fleet_Waiting_For_Ships(sys_long_Player_ID, fleet_id, TRUE)
      set orders_given := TRUE
    endif
  endif
Now check my logic on this (I could be wrong) but the way I read this is: Join this fleet only if this fleet is waiting for ships. Wait for ships only if a ship wants to join this fleet. In other words, they are joining only if something is waiting, but something is waiting only if something is joining. So it never happens...the AI never sends ships to joing existing fleets. Shouldn't it be:
  if (not orders_given) then
    if (ships_joining_this_fleet > 0) or (ship_count <= (ships_per_fleet * 0.50)) then
      call Sys_Set_Empire_Fleet_Waiting_For_Ships(sys_long_Player_ID, fleet_id, TRUE)
      set orders_given := TRUE
    endif
  endif
If I'm right, that little change could help the AI a bit.
» login or register to post comments
Mod Designer

Re: Possible logic error...

Submitted by Gideon on Sun, 2007-12-02 12:10.

Fixed, and a big thank-you to Brand for pointing that out.

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

» login or register to post comments
Captain Kwok's picture
Mod Designer

Re: Possible logic error...

Submitted by Captain Kwok on Sun, 2007-12-02 15:48.

I believe a new fleet or fleet without a minimum number of ships will is set to wait for ships, which in turn will call for ships to join the fleet.


Space Empires Depot | SE:V Balance Mod

» login or register to post comments
Mod Designer

Re: Possible logic error...

Submitted by Gideon on Sun, 2007-12-02 19:15.

Captain Kwok wrote:
I believe a new fleet or fleet without a minimum number of ships will is set to wait for ships, which in turn will call for ships to join the fleet.


Space Empires Depot | SE:V Balance Mod

New fleets are set to wait for ships.

Existing fleets follow the code I posted above.

Additional:

Existing fleets use lng_AI_Available_Fleet_Ships_Count to determine how big it should be. That variable has its value reduced by the number of explorers and surveyors, but seems to never be set to a value above zero before this is done (at least, not that I could find). So, fleets never think they have too few ships.

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

» login or register to post comments
Captain Kwok's picture
Mod Designer

Re: Possible logic error...

Submitted by Captain Kwok on Sun, 2007-12-02 22:45.

There's a small section in Script_AI_List that adds up all the valid ship types for fleets and sets that variable to a value.


Space Empires Depot | SE:V Balance Mod

» login or register to post comments
Mod Designer

Re: Possible logic error...

Submitted by Gideon on Sun, 2007-12-02 23:31.

Captain Kwok wrote:
There's a small section in Script_AI_List that adds up all the valid ship types for fleets and sets that variable to a value.


Weird...my scripts seem to be missing that. At least, the ones I've been modding. I'll have to double check the current stock versions (the ones I've been modding date from a while ago).

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

» login or register to post comments
Mod Designer

Re: Possible logic error...

Submitted by Gideon on Sun, 2007-12-02 23:59.

Yep, found the lines for the ship tally in stock. I've imported them in to my mod.

However, the above logic error still exists in stock.

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

» login or register to post comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Now on STEAM

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

Popular content

Today's:

  • A question about weapon mounts
  • Space Empires V 1.74
  • Gritty Galaxy Fleet Clash
  • Simultaneous Movement FAQ?
  • StarTrek Mod 2.0 (Deutsch)

All time:

  • 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

Last viewed:

  • Banana Republik Guide for Demokratik Xpansion and Diplomatik Xtermination
  • Major degenerative bug completely ruining game play
  • Medieval: total war 2 till game is fixed
  • Problem building ringworlds (and sphereworlds?)
  • Ground Combat Mod 2.14
(c) Strategy First, Inc. All rights reserved.