As a French person I feel like it's my duty to explain strikes to you. - AdrienIer

Create an account  

 
Create your own AI (a parametric contest)

Dear RBO users and MoO 1 players,

while preparing data for a new AI patch for this greatest of simple computer games (e.g. MoO), it occured to me suddenly:
Instead of (or prior to) making my own patch, the same way I worked on MoM, SMAC, X-COM with more or less success,

why cannot it be a community work, or, even better, a community contest?

Let's see who can make a better AI with similar (rude) ingredients! Inside this community, there is a lot of experienced players who know the game inside out, so we can easily make a contest for more competitive AIs. And we can use the winning result as a ground for the AI patch (hopefully with a few more sophisticated code solutions I can provide on top, if community wishes so).

Let me explain this further:
Since most parts of MoO AI were written in a very simple logic language and are based on relatively few numeric constants, it is fairly easy to change them with a hex editor program. Unlike any other programs I have worked with, including MoM, in MoO 1 you can create a lot of effect with a few numbers. Constants can influence planet bar ratios, research probabilities, target valuation, area of fleet activities, tax rates, ship design (to some extent). The infulence IS limited to parametric change, though.

PLAN
1) If there any people interested, please subscribe in the thread.
2) I will post a number of hex adresses with clarification of processes in the next post.
3) We set a time to prepare our work.
4) Not sure about testing phase yet.... We post our routines / exes for testing. We may try to use tournament games (?) or games under the same conditions. I coud try to implement a way to force MoO to play AIs against themselves (spectator games)... although probably not under different AIs.
Reply

reserved for further use...

[hex values]
Reply

reserved for extra use if necessary

[AI processes explained]
Reply

reserved for further use

[notes for current contest]
Reply

(January 17th, 2014, 09:38)kyrub Wrote: a community contest
A community contest sounds great, but how do you plan to roll it out? Zeraan stated that you are the only one in possession of the 1.40m source code and few people know how to edit code efficiently. Will you make all the changes to the code yourself? Or will you make your code available and provide help to us how to further edit it?

(January 17th, 2014, 09:38)kyrub Wrote: we can use the winning result as a ground for the AI patch
How to define winning result? AI development, such as science is not a democracy. It must be tested, but how? You just stated that you can't make 2 different AIs to play against each other. Plus AI performing well against other AI says little about how it would perform against an expert human.

(January 17th, 2014, 09:38)kyrub Wrote: If there any people interested, please subscribe in the thread.
I did.

(January 17th, 2014, 09:38)kyrub Wrote: We set a time to prepare our work.
Sure. This sounds like synchronized appointments between you and volunteers. I am OK either way, but still sounds like you are the only one changing the code (which has pros and cons).

(January 17th, 2014, 09:38)kyrub Wrote: Not sure about testing phase yet.... We post our routines / exes for testing. We may try to use tournament games (?) or games under the same conditions. I coud try to implement a way to force MoO to play AIs against themselves (spectator games)... although probably not under different AIs.
This is critical. Since you can't setup different AIs play against each other and AI-AI battle is not programmed anyway, the next best thing to do is to create a large pool of saves before battles. The community can generate this pool. I assume that saved games can still be opened with different versions of your code. Then players will be asked to crush, survive, decimate, exploit and abuse the battle AI and generate standardized report on different AI's that will be data to declare winning battle AI. I will propose a fitness function, which we can discuss. This is nearly enough for 6a and 6b. For 6c, simply force AI to not pile up more than say 2x the yearly income for reserve and make security 0% at all times (for start). For other, overland AI features it will be more complex and more work to test performance.
Reply

(SUBSCRIBING: I actually meant people writing in the thread: I am interested in this - like you did.)

(January 17th, 2014, 17:00)WhiteMage Wrote: Zeraan stated that you are the only one in possession of the 1.40m source code
I have no source code. Same thing as always with me, just the assembly, and not very well analyzed on top of that (my first ever disassembling attempt... 4 years ago).

(your other questions)

WHAT
I will not code things for contestants, at least not in the "first round", first attempt. These changes are parametric only, they don't require special coding skills. Because of that, they cannot influence the deep core of "how the AI proccesses things", they are pretty superficial. No C-evo thing.
An example: - when choosing how tech percentages will be allocated to different fields, AI does every N turns this:
a) allocates A, B, C, D, E, F percents to all fields (these are all 5% currently)
b) for first T turns prefers filling the rest with Propulsion by RND 50% --> END
c) looks up for 5 special races and in RND 25% allocates the rest to special field (example Darloks -> computers) --> END
d) the rest is allocated by one RND round with chances based on AI preset objectives table. Each objective has an % inclination to each tech field.
CONTEST: I give out the Hex addresses of all values in this process: N, A, B, C, etc., the RND value, the special races ID, the tech inclination based on objective table, the races probability to have that particular objective... You can change their value, but not the processus itself (I would run mad if I had to change for everyone who wants to try his luck). Overwriting 150 values in Hexeditor is something everybody can do.
(In the second round, maybe, I can change / alter the internal processus itself, based on community asessment, with people who created interesting results in first round having the major say. Again, I can't rewrite processus completely. I'd like to do AI ship design well, that one is an exception. - Basically, I would be happy to re-create MoO AI with help of the community, this or that way).

HOW
Quote: You just stated that you can't make 2 different AIs to play against each other.
On the second thought, it is not entirely impossible. After I like Serena made his Tweaker (changing the code while running), there is some chance this could be done. I don't have the skills required, I admit.

Quote: to create a large pool of saves before battles. [...]
This sounds like a good and not so complicated way to go. I'm happy with anybody offering his experience and assistance in assessing the results.
Even less "scientifically", players can rate AIs in poll - or again, the tournaments can help, if organisators agree.
Reply

(January 18th, 2014, 17:07)kyrub Wrote: I have no source code. Same thing as always with me, just the assembly, and not very well analyzed on top of that
You decompiled original exe into Assembly, then heuristically edited it, right? Source enough. I have no better term to call than "new source code". Or decompiling your new exe would be bit identical to your assembly? Not likely.

(January 18th, 2014, 17:07)kyrub Wrote: I will not code things for contestants, at least not in the "first round", first attempt. These changes are parametric only, they don't require special coding skills. Because of that, they cannot influence the deep core of "how the AI proccesses things"
So you mean you will setup volunteers to edit code alone and test it immediately and frequently on their computers? Volunteers can technically change anything in the code, but you will ask them to stay local to a short segment of the code at a time? If you don't allow volunteers to test themselves then it will become a heuristic guesswork contest, since volunteers can't test the results without extensive wait time for you and community.

(January 18th, 2014, 17:07)kyrub Wrote: players can rate AIs in poll
Bad idea if the goal is strong AI (and I think it should be, since that is lacking in MOO and all complex TBS games – we have plenty of excuses under the disguise of "fun AI"). Even expert players with AI background are not qualified to evaluate AI performance without testing data, much less an ad hoc jury committee. We can vote on the fitness function, which will give an objective measure for evaluation, and then the fitness function declares AI winner (based on large corpus of standard user generated data). Otherwise, AI development will be slow and shallow.
Reply

(January 18th, 2014, 18:15)WhiteMage Wrote: So you mean you will setup volunteers to edit code alone and test it immediately and frequently on their computers?
This is my idea. It surely depends on anybody finding it intruiging. Make changes, run tests. At some given point, present your work.

As for "staying local", not sure what you mean. I intend to describe as much "parametric adresses" (along with the description of current MoO AI processes) as possible, in all areas of code, it's not a zillion, though, MoO AI is simplistic.

Re: source code
I could have opened the IDA database (reluctantly I must say), but who will write AI in assembler anyway, as you said yourself? Does anybody have a shout at remaking quickly MoO from disassembled exe on another platform (as DoomK thinks)? I have my doubts.

Re: testing
Understand your point. I am OK with any objective way anybody suggests.
Reply

(January 18th, 2014, 18:59)kyrub Wrote: This is my idea. It surely depends on anybody finding it intruiging. Make changes, run tests. At some given point, present your work.
I agree; glad to hear.

(January 18th, 2014, 18:59)kyrub Wrote: As for "staying local", not sure what you mean. I intend to describe as much "parametric adresses" (along with the description of current MoO AI processes) as possible, in all areas of code, it's not a zillion, though, MoO AI is simplistic.
Staying local means that only a small part of the code is expected to be changed by volunteers. You provide explanation of which part and what is does now. I suggest you start with 1 part only and go from easy to complex.

(January 18th, 2014, 18:59)kyrub Wrote: I could have opened the IDA database
You should say more about what this means in this context.

(January 18th, 2014, 18:59)kyrub Wrote: who will write AI in assembler anyway, as you said yourself?
Right. I don't know anyone right now who wants to go deep into Assembly coding of a decompiled exe. You are the greatest exception and thank you for it. But tweaking a few variables, constants, and functions with you supervising is fun enough to try. Especially since you delivered major improvements already and appear to know where things are located in the code so you can keep things on track.
Reply

I think it'd be a lot of fun to mess around with. I'm not sure how much the following has been discussed though:

1. How does the AI work? Although I think I can probably search through old threads and look at the strategy guide for this.
2. What are the problems with the AI (i.e. what are tactical/strategic objectives that it handles poorly)? What are things that the AI doesn't account for well? What are some ways to "blindside" the AI? I've heard (I don't recall from where) that the AI does the beginning well, mediocre at the mid-game, and falls apart at the end game. What are reasons for this?

Essentially, what I'm asking about are the shortcomings of the AI -- to see perhaps what our objectives should be in a fitness function or what we should consider when adjusting the tuning parameters.
Reply



Forum Jump: