Author Topic: A Fresh Start  (Read 5205 times)

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
A Fresh Start
« on: April 30, 2006, 05:56:21 AM »
Decided to start fresh, and develop an AI from the bottom up, instead of top-down.

Instead of starting with strategy & units, i've greatly improved on the BreathFirst tubing code that hacker wrote to make the AI connect its buildings in a more economic way then what i used with Scripter (upto version 0.5).
I've also started on a maintained list of all units placed on the map by the AI so it can be used to determine suitable locations for buildings to be deployed. Some random will need to be added to prevent the "AI" from building the same way each time it is started.
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline james239

  • Newbie
  • *
  • Posts: 49
A Fresh Start
« Reply #1 on: April 30, 2006, 01:47:36 PM »
An AI opponent who's every move can't be predicted... this ought to make colony games much more fun.

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
A Fresh Start
« Reply #2 on: April 30, 2006, 02:42:47 PM »
Great work Eddy.

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
A Fresh Start
« Reply #3 on: April 30, 2006, 04:46:39 PM »
UPDATE:

First step is finished:  i can now create a randomly placed base. No single base is ever the same (give or take the remote possibility that you are a jackpot-winner each time you play the lottery, bcoz then of course, the chances of getting the same base when you reload are about 1,000,000,000 to 1 only; instead of the usual 7 quadrillion to 1 odds :P)

Anyway: my code can accept a random spread number which -in theory- can build the base (and connect it with tubes), using the ENTIRE map. Not that this will ever happen.
It does need some work still, as it does not yet take in account to stay at least a few tiles away from mining beacons to leave some space open for a mine to be built on top of it. At the moment, chances are that for example a residence is built right next to a beacon (i don't know if op2 allows it to be built right op top, but my code sure allows it atm).

On top of that, the tubing has been improved, as i've stated above, but not yet as perfect as a pro-human-player can of course. And each building only has 1 active tube connection, unless it is directly bordering other buildings. But it does try to connect to the closest tube or building it can find.

One more thing that needs attention: placing the tokamak and other potentially hazardous buildings a few tiles away from any other building.

[EDIT]: Updated the code so it will now refuse to build "dangerous" structures, such as tokamaks & adv.lab to close to other buildings. Also the areas around beacons can be kept free of buildings.

An example of running the same script 3 times (pressing 'restart mission' a couple times):

« Last Edit: May 01, 2006, 05:01:15 PM by Eddy-B »
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline james239

  • Newbie
  • *
  • Posts: 49
A Fresh Start
« Reply #4 on: May 01, 2006, 06:40:15 PM »
this looks great... keep up the great work Eddy-B!

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
A Fresh Start
« Reply #5 on: May 02, 2006, 02:25:02 PM »
Question: It still will be possible to have static base placement everytime, right? In case you want to make a perfectly balanced mission.

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
A Fresh Start
« Reply #6 on: May 02, 2006, 03:45:04 PM »
Another question: Will there be "levels" of how smart the AI is or how many mistakes it makes? We don't want to have a perfect AI going up against a beginner.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
A Fresh Start
« Reply #7 on: May 02, 2006, 06:31:36 PM »
LOL @ SirBomber .. the goal is to create a near perfect fighting machine. It is always possible to slow it down or make it do dumb mistakes.

Hacker: yes. i won't take out the simple UNIT commandfor placing units. This is even necessary for placing mines!
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
A Fresh Start
« Reply #8 on: May 04, 2006, 02:32:01 AM »
I have entirely rewritten the tubing code, again (last time, i swear)... because i still wasn't satisfied with performance.  It is now 99% Assembler-written (it doesn't get any faster then that). Next to the difference in code size, i've improved execution time by 600%.  I believe it can now be applied to complex tubing situations without causing game slowdown.

Attached is a zip with the 2 benchmark-programs. One tests the (already optimized) c++ version of the code; the other the new ASM version. It will run the same connection over and over to measure execution time more accurately. the displayed time is the total execution time (don't use high numbers!)
« Last Edit: May 04, 2006, 02:34:15 AM by Eddy-B »
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline 7842303

  • Jr. Member
  • **
  • Posts: 81
A Fresh Start
« Reply #9 on: October 14, 2007, 12:51:36 AM »
good job hurraaaaaaaaaaaaaaaaaaaayyyyyyyyyyyyyyyyyyyyyyyyyyyy
altought i dont know what that means :blush:  
onword to battle!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
unless your tired, of cource

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
A Fresh Start
« Reply #10 on: October 14, 2007, 12:52:21 AM »
Uh... This post is over a year old Number-Name.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline 7842303

  • Jr. Member
  • **
  • Posts: 81
A Fresh Start
« Reply #11 on: October 14, 2007, 02:06:40 AM »
cool B)  
onword to battle!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
unless your tired, of cource

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
A Fresh Start
« Reply #12 on: October 14, 2007, 04:26:37 AM »
No, the point is, why did you post in this thread? Learn to read the dates before you post.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
A Fresh Start
« Reply #13 on: October 20, 2007, 12:07:09 PM »
Hey!  
don't diss people when they say "good job hurraaaaaaaaaaaaaaaaaaaayyyyyyyyyyyyyyyyyyyyyyyyyyyy" about anything i've created :P

<random number> guy: It just means that the code works well & fast. Coz if it hadn't it would not be very useable and slowing down the game, especially only older computers.
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
A Fresh Start
« Reply #14 on: October 21, 2007, 04:53:02 AM »
Eddy! Good to know you're not dead. :P

Been busy I guess? Think you'll be back to finish up a few more projects? Like ... *checks thread title* ... this one?