View unanswered posts | View active topics It is currently 18 Apr 2024, 04:44



Reply to topic  [ 11 posts ] 
 Bug: Retreating away form freindly space 
Author Message
Crewman
User avatar

Joined: 22 Aug 2013, 03:44
Posts: 7
When i have 1-2 scout out patrolling the edges of my move space, trying to keep an eye out for hostiles. they get jumped (nother bug) out numbered 10-15 to 1, i pick retreat, cause the computer will blow my ships up for no reason. (nother bug)

when my ships run, they have 8 options of squares to flee to

Option 1: the straight into my space, straight away from the edge
Option 2 & 3: one square either side of option 1
Option 4 & 5: move along the range line, but not cross it.

in case your wondering, my ships have NEVER EVER picked option 1, 2, 3, 4, 5.

Option 8: Straight away from my space, into the unknown (hostile space) & and unable to be given move orders
Option 6 & 7: either side of option 8 and unable to be given move orders.

Yes, my ship have retreated 3 squares AWAY from there max move range, i have never once seen them retreat close. after 6 retreats, in a row, away from hostile ships and there max range, i scraped them to avoid losing more morale...


29 Aug 2013, 04:31
Profile
Crewman
User avatar

Joined: 17 Jul 2013, 19:10
Posts: 13
The chances for every direction should actually be the same, but I don't know the code for this.
I will check it soon.

A retreat to save space within max range should be preferred if possible.
We hear that suggestion often, but even such details need a programmer and there are never enough programmers.


31 Aug 2013, 18:35
Profile
Lieutenant Junior Grade
Lieutenant Junior Grade
User avatar

Joined: 05 Jul 2008, 07:55
Posts: 212
Location: Germany
well....retreat to friendly sector is no feature unfortunately....retreat always ends in one randomly selected sector around combat sector ( I didn't noticed a special pattern yet)
you might place your scouts one sector away from red line...not nice but helpful

this I found...i assume by this code all 8 opportunities are available
Code:
         int x = rand()%3 - 1;
         int y = rand()%3 - 1;
...
         m_mShipRetreatSectors[sRace][ptCombatSector] = ptRetreatSector;


01 Sep 2013, 14:41
Profile
Crewman
User avatar

Joined: 23 May 2008, 22:48
Posts: 34
i can program... but only in pseudocode :)

actually, if the game is already able to identify which Race controls a sector, such as Humans, then there is probably a way to head towards it.
1st example using ship with 1 Range:

- Identify the 8 random sectors a ship could move to
- Identify owner of those sectors
- IF owner = player race, target that sector for retreat.
(if multiple sectors are owned by that player, pick a random one)

2nd example for ships with any range could be based on location of HomeWorld:
- Identify current combat sector (grid letter:number B:5)
- Identify Homeworld (Terra) (D:1)
- If homeworld sector grid letter < current combat sector, move west
elseIF homeworld sector grid letter > current combat sector, move east

maybe with a "while" statement, for the numbering:
If homeworld sector grid Number < current combat sector, move South
If homeworld sector grid Number > current combat sector, move North

this way you can end up with a final direction of North / South / East / West and NorthWest / NorthEast / SouthWest / SouthEast

(just an idea... maybe i did not explain properly but hopefully you can understand what i mean) :)


04 Sep 2013, 13:04
Profile
Crewman
User avatar

Joined: 17 Jul 2013, 19:10
Posts: 13
I like the "head for homeworld" idea. Something like that could work.
But I think there should still be a chance to retreat in to a sector currently out of reach.

For example:
A colonyship with short range retreats from a battle at a sector within short range.
The surrounding sectors are short(5), medium(2) and long(1). (This is possible at the corners of a range)

Map:
SSS
SXM
SML

Range modifiers:
short = 4
medium = 2
long = 1

Sector modifier: (1/(range count*range modifiers))
short(5)*4 = 20
medium(2)*2 = 4
long(1)*1 = 1
Sum = 25
sector modifier = 1/25 = 4%

Probability for each sector: (range modifier*sector modifier)
short = 4*4% = 16%
medium = 2*4% = 8%
long = 1*4% = 4%

Probability for each range: (range count*range modifier*sector modifier)
short = 5*4*4% = 80%
medium = 2*2*4% = 16%
long = 1*1*4% = 4%

So the colonyship will most likely retreat to a sector within short range, but even a retreat to a sector within long range is possible.

I hope my explanation was not too confusing.


05 Sep 2013, 20:51
Profile
Crewman
User avatar

Joined: 23 May 2008, 22:48
Posts: 34
cool that you like the idea :)

thanks for explaining parts of the code and modifiers.
i think i understand the maths part, but i was not sure about the part where you said this:

Map:
SSS
SXM
SML

(why are the 2 "M's" marked as "M", and why is the single "L" marked as "L")?
i could not properly understand that part, (maybe i need more coffee) :)


06 Sep 2013, 01:37
Profile
Crewman
User avatar

Joined: 23 May 2008, 22:48
Posts: 34
(i assumed that the "X" was the ship's Current Position")


06 Sep 2013, 01:41
Profile
Cadet
Cadet
User avatar

Joined: 19 Jan 2013, 18:27
Posts: 50
Seems like complicating things for nothing no? A retreating ship doesn't need to use it's full move, the game could assume a retreat is a single sector move. Which then reduces the number of possible choices to 8. From these, pick a random choice from sectors within friendly space. If none, then simply do like it's doing now (or pick a sector in straight line with the home world. or towards the closest friendly colony). It makes sense to only retreat one sector 'cause as a player you should react to the aggression, hence you should be able to decide if either you want a full retreat (move away at full range) or attack right back (at which point being so far away limits your options).


06 Sep 2013, 13:59
Profile
Crewman
User avatar

Joined: 17 Jul 2013, 19:10
Posts: 13
Yes, the X is the battle sector, S is a sector within short range, M is a sector within medium range and L is a sector within long range.
Map:
SSS
SXM
SML

In the game it looks like this: (without the letters of course)
Image

Hi Bloodwurm,
a single sector move is really enough, I don't want to change that.

I think we all have similar ideas, but I expressed myself too complicated.


06 Sep 2013, 19:25
Profile
Lieutenant Junior Grade
Lieutenant Junior Grade
User avatar

Joined: 05 Jul 2008, 07:55
Posts: 212
Location: Germany
EDIT: I found in German Forum an old post from Malvoison http://birth-of-the-empires.de/phpBB3/v ... 011#p15011: He suggested that Retreat doesn't change the ship's sector just stay, and next turn they can be ordered manually anyway.
For that ships doesn't stay turn by turn I think Retreat needs a additional disadvantage (e.g. hull goes down 50% each turn, under 100 hull points ship gets destroyed)
-------------------------------
good to see these good ideas :winkthumb: ... I'm looking forward to see -whenever- how it will work inside BotE

Vuto does know program code a little bit, me too, so I have to add some info: Mention that BotE works -in my opinion- with that:

1st: old round calculation
2nd: combat calculation (incl. network transfers between the major races)
3rd: new round calculation -> don't know, but basicly I think here is calculated the new sector owners and new flying ranges (e.g. by turning shipyards on/off)

well...it would not be a mistake to select a retreat direction by using info saved in ship's computer before combat begins.
----------------
another point: retreat direction to home system is not always "friendly" space or inside flying range, but nevertheless this might be the most logical choice. Other options might be next friendly system, station or fleet.


07 Sep 2013, 11:04
Profile
Crewman
User avatar

Joined: 23 May 2008, 22:48
Posts: 34
thanks for more explanation vuto, and reg for more info.

that is true... there may be sectors between the ship and the homeworld, and those sectors might belong to another race. (eg they build an outpost nearby or colonised a world in recent turns etc.

The suggestion about "next friendly system,station/fleet" etc could be easy to do... heres my pseudocode :)

Easier Option, for Terrans:
- identify ship retreating and it's range (let's assume range = 1)
- identify the 8 sectors around it, and temporarily assign those sectors an ID (1 to 8)
- identify Sector information: (Sec)
IF Sector 1 = Terran sector, OR has Terran Fleet, store temp value for Sector 1 = "good" sector for retreat
IF Sector 1 = NOT Terran, OR not Terran Fleet, store temp value for Sec1 = "bad" sector for retreat
-repeat for the other 7 sectors.
Then, use random code to pick one of the "good" sectors and the ship retreats to it.
(this way, the larger the ship's range, the further it can travel from its current battle destination, hopefully reaching a friendly sector)


More Complex method (similar to a Morale Modifier table, for battles)
for Terran's
- identify ship retreating and it's range (let's assume range = 1)
- identify the 8 sectors around it, and temporarily assign those sectors an ID (1 to 8)
#- identify Sector information: (Sec)
IF Sector 1 = Terran, store temp value for Sec1 = 1 point
IF Sector 1 = Terran Colonie, store temp value for Sec1 = 2 points
#(add bonus points)
IF Sector 1 has Terran Outpost? = +1 point
IF Sector 1 has Terran Starbase? = +2 points
IF Sector 1 has large Terran Fleet? = +2 points
IF Sector 1 has small Terran Fleet? = +1 point
#
add values for total points, and the highest points has more chance of target for retreating ship :)


07 Sep 2013, 18:34
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 11 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by STSoftware.