[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4586: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4588: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4589: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4590: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
AI Challenge Forums • View topic - Create a supply route, PathFinding.

It is currently Mon Jun 18, 2018 11:53 am Advanced search

Create a supply route, PathFinding.

Share and discuss ideas for your entries here.

Re: Create a supply route, PathFinding.

Postby temp_dummy » Mon Oct 18, 2010 2:30 pm

Jumping 'just to the next planet' is only useful if that planet is in the direction of the frontier.

So how do you tell if the closest planet is actually in the correct direction and not the opposite way?
The human brain is very capable of making the choice on 'gut instinct' (thanx to x.000.000 years of evolution),
however the guts of a computer do not seem to be compatible.

I tried several alternate ways of getting my ships in the right direction, none with great results.
(ships going the wrong direction anyway, taking a route that's too long etc.)
It may be overkill yes, but at least I got this working.

It gave me an Elo boost of 300 points too.
temp_dummy
Colonel
 
Posts: 87
Joined: Sat Sep 11, 2010 6:00 pm

Re: Create a supply route, PathFinding.

Postby temp_dummy » Mon Oct 18, 2010 2:35 pm

Bentie,

Creating a 'region' of allowable planets is a nice idea, and it looks promising with only one planet.
However, when you start owning several planets, does this mean you need to create several regions too?
What to do if one planet that is on the total left and one that is on the opposite side of the universe?

Then you would still be building something like:

For each planet that I own
Create region of allowable planets
Determine Next hop.

Kinda looks what I am doing anyway.
temp_dummy
Colonel
 
Posts: 87
Joined: Sat Sep 11, 2010 6:00 pm

Re: Create a supply route, PathFinding.

Postby temp_dummy » Mon Oct 18, 2010 2:40 pm

Demerzel ,


Hmm, I should give that one a whirll...
temp_dummy
Colonel
 
Posts: 87
Joined: Sat Sep 11, 2010 6:00 pm

Re: Create a supply route, PathFinding.

Postby aerique » Mon Oct 18, 2010 3:30 pm

Guys & girls, check out or other algorithms for creating .
aerique
Brigadier-General
 
Posts: 131
Joined: Fri Feb 05, 2010 3:23 pm
Location: Netherlands

Re: Create a supply route, PathFinding.

Postby nhoel » Mon Oct 18, 2010 3:49 pm

nhoel
Lieutenant
 
Posts: 13
Joined: Sat Oct 09, 2010 2:02 pm

Re: Create a supply route, PathFinding.

Postby P_Hansson » Mon Oct 18, 2010 4:04 pm

P_Hansson
Captain
 
Posts: 27
Joined: Thu Oct 07, 2010 2:12 am

Re: Create a supply route, PathFinding.

Postby Demerzel » Thu Oct 21, 2010 12:19 am

I understand where you all are coming from but I think you're way overcomplicating it, and I did at first too.

I wasn't going to share my methods since the competition is still going but it's pretty simple at its core, thinking in terms of trees and spatial reasoning is going to introduce a ton of bugs and possible efficency problems not to mention you'll probably be outperformed by bots that do nothing more than pick the smallest number out of a possible 20.

There are a max of 23x23 distances - these can be (and are by my bot since version 0.0.1) cached as soon as turn1. Then to create hops you do the hop algorithm I posted up before. All you need is a closestEnemy(planetIndex) function that simply runs through the distances for planetIndex and returns the smallest one that has an enemy on the other side.

You now have a minimum distance to enemy. A simple way (not my way but the way most right-below-top bots work from observation) to use this information is then to send all your ships to whichever of your planets returns the smallest number and you have a front line.

You can extend this same logic to create multiple fronts which is a simplified version of how my bot works: check if planetIndex to planetIndex2 is less than planetIndex2 <-> enemy.if so, you now have a 'covering' planet in planetIndex. So you can use this information to say Planet[planetIndex] is the closest to the enemy AND you now know that planetIndex2 doesn't need ships sitting on it because ships from planetIndex can cover it because it's closer to 2 than the enemy is and just start sending all of your ships on Planet[planetIndex2] to planetIndex. If planetIndex2 is NOT covered by planetIndex then find out if it's closer to the enemy than any other planets, any planets that have at least 1 planet closer are now just feeding to the closest planets that do.

You have a frontline and a supply route, just like that - it didn't take anything more than checking distances.

I did play with territories and x/y and even had a whole target system set up on whether they were within my 'box' and based on the average distance to enemy were they closer, but it had all kinds of issues like what if I have an L shaped territory then all of them qualify or vice versa - or large maps vs small maps the averages might be thrown off etc.

Bottom line is that if you're considering a heuristic approach I guarantee you there's a better cold mathematical one that probably doesn't take much actual math beyond <>=, at least in regards to front lines.

If you use this info then beat me just give me some credit for saving you a few days of frustration!
Demerzel
Colonel
 
Posts: 72
Joined: Sat Oct 02, 2010 6:06 am
Location: themendios at gee mail

Re: Create a supply route, PathFinding.

Postby nhoel » Thu Oct 21, 2010 6:34 pm

nhoel
Lieutenant
 
Posts: 13
Joined: Sat Oct 09, 2010 2:02 pm

Re: Create a supply route, PathFinding.

Postby Terr » Fri Oct 22, 2010 1:20 am

Terr
Brigadier-General
 
Posts: 155
Joined: Mon Sep 13, 2010 9:19 pm

Re: Create a supply route, PathFinding.

Postby glevee » Fri Oct 22, 2010 2:40 am

glevee
Colonel
 
Posts: 68
Joined: Tue Sep 28, 2010 1:11 am

PreviousNext

Return to Strategy

Who is online

Users browsing this forum: No registered users and 1 guest

cron