Outpost Universe Forums
Projects & Development => Outpost 2 Programming & Development => Topic started 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.
-
An AI opponent who's every move can't be predicted... this ought to make colony games much more fun.
-
Great work Eddy.
-
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)
-
this looks great... keep up the great work Eddy-B!
-
Question: It still will be possible to have static base placement everytime, right? In case you want to make a perfectly balanced mission.
-
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.
-
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!
-
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!)
-
good job hurraaaaaaaaaaaaaaaaaaaayyyyyyyyyyyyyyyyyyyyyyyyyyyy
altought i dont know what that means :blush:
-
Uh... This post is over a year old Number-Name.
-
cool B)
-
No, the point is, why did you post in this thread? Learn to read the dates before you post.
-
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.
-
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?