Outpost Universe Forums

Projects & Development => Outpost 2 Programming & Development => Topic started by: Eddy-B on April 30, 2006, 05:56:21 AM

Title: A Fresh Start
Post by: Eddy-B 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.
Title: A Fresh Start
Post by: james239 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.
Title: A Fresh Start
Post by: Leviathan on April 30, 2006, 02:42:47 PM
Great work Eddy.
Title: A Fresh Start
Post by: Eddy-B 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):

(http://www.eddy-b.com/images/base3.jpg)
Title: A Fresh Start
Post by: james239 on May 01, 2006, 06:40:15 PM
this looks great... keep up the great work Eddy-B!
Title: A Fresh Start
Post by: BlackBox 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.
Title: A Fresh Start
Post by: Sirbomber 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.
Title: A Fresh Start
Post by: Eddy-B 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!
Title: A Fresh Start
Post by: Eddy-B 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!)
Title: A Fresh Start
Post by: 7842303 on October 14, 2007, 12:51:36 AM
good job hurraaaaaaaaaaaaaaaaaaaayyyyyyyyyyyyyyyyyyyyyyyyyyyy
altought i dont know what that means :blush:  
Title: A Fresh Start
Post by: Sirbomber on October 14, 2007, 12:52:21 AM
Uh... This post is over a year old Number-Name.
Title: A Fresh Start
Post by: 7842303 on October 14, 2007, 02:06:40 AM
cool B)  
Title: A Fresh Start
Post by: Sirbomber 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.
Title: A Fresh Start
Post by: Eddy-B 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.
Title: A Fresh Start
Post by: Hooman 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?