Author Topic: Ai Making Simple?  (Read 4101 times)

Offline op2rules

  • Sr. Member
  • ****
  • Posts: 257
    • op2rules.net
Ai Making Simple?
« on: January 28, 2006, 10:46:15 AM »
Would it be possible (ok im sure anything is possible, i mean not taking 2 yrs) to make a program that records what you do, and turning it into an ai, ex, suppose you have a map called "the doom" (yes i know it's lame but who cares) and you want to make an AI for it, all you would have to do is click a "start making ai" and what you do, is put into the code, so all you have to do is play, and the ai does exactly what you did when you played and recorded it. Then, every time you play, "the doom" there would be an ai, doing what it's supposed to do!

Yes, i know it would be hard to organize it if a building got destroyed, but maybe have the button for a multiplayer game?

Anyone ever thought of that?
Checkout my website, op2rules.net. It has free games, software, and snappy guides. Oh and did I mention the uber friendly community forums?
Life to me is a simple game that I utterly win at.
 ^--- GD Text Generati

Offline thablkpanda

  • Full Member
  • ***
  • Posts: 249
Ai Making Simple?
« Reply #1 on: January 28, 2006, 02:29:18 PM »
I'm no professional OP2 Coder.. So bear warning.

There are plenty of things that can change in any given map, including, but not limited to location, building locale, map, map size.. etc.

The part that's befuddling our OP2 coders (correct me if I'm wrong) is getting all the code for doing all these things. There are programs that can record actions, and replay them in the exact order, however what if your position on a map changes? The program will be clicking in the wrong spots to access your Advanced Lab, and will hit your smelter by accident, and Idle it.

See what I'm saying? I'm sure one of our coders can give a much better answer. It's a great idea, but if it worked- would be the ONLY time it worked.

Chris

Offline dm-horus

  • Banned
  • Hero Member
  • *****
  • Posts: 1042
Ai Making Simple?
« Reply #2 on: January 28, 2006, 03:08:35 PM »
unfortunately such a program or procedure would require us to know all the code commands for performing all the steps necessary to "reenact" what is done by a person. The fact is, we dont know all the code in the game. there are certain operations that we havent deciphered yet. a program would need all these procedures written into it and depending upon what is recorded, all that changes are the variables like coordinates, time, number and placement. the number of operations performed in even a moderate-mark game could create massive a massive file and even then, it wouldnt be adaptable. the point of an ai is to respond to player attacks on the fly. if everything the ai does is recorded and scripted, all youd have to do is attack before the ai is triggered or simply build your base a couple screens over. i dont think this method could work anywhere.

the best bet we have is to make a trigger system, which requires intimate knowledge of the code and its variables within the software api. this is curretnly out of our reach as it would have to be bundled with a mapper that is designed to utilize the triggers. the ways a person goes about modifying maps or games depends entirely upon how the game is structured. op2 is structured in such a way that everything has to be hard coded. since op2 wasnt really designed to be user-extensible and modable, injecting our own content into the game has to follow certain rules without having to rewrite the basic workings of the game itself (which is beyond our ability right now). the most we can do now is write to dll's and map files. your method for ai would require that we change the game to make use of a totally different set of code and variables.

even if we could get this to work, everything the ai does would be recorded second by second so all youd have to do is anything that wasnt done when the ai was recorded. like i said, to win all youd have to do is move your base a few tiles over.

Offline zigzagjoe

  • Hero Member
  • *****
  • Posts: 626
Ai Making Simple?
« Reply #3 on: January 28, 2006, 07:40:31 PM »
to put it simply; no op2rules. you can fairly easily make somehting that can build crap but to make it AI truely it requires a heck of a lot more work.

and actually, the trigger system is extremly easy. check out zighooville(search coding forums for it), i have a basic trigger example in there, and it works right off the bat.

like the others are saying, it would work for that situation and that situation only.  
« Last Edit: January 28, 2006, 07:41:40 PM by zigzagjoe »

Offline thablkpanda

  • Full Member
  • ***
  • Posts: 249
Ai Making Simple?
« Reply #4 on: January 28, 2006, 09:15:15 PM »
Sorry, ZZJ covered what I was trying to hit.

You can make something that will execute a system of commands quite easily. But that doesn't define to an Artifical Intelligence system. AI simulates actual intelligence, not simulating what one human programmed it to do for one situation. Intelligence requires knowledge and acting upon the knowledge.

Artifical Intelligence- Requries intelligence.

Chris

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
Ai Making Simple?
« Reply #5 on: January 29, 2006, 10:12:26 AM »
Quote
Would it be possible (ok im sure anything is possible, i mean not taking 2 yrs) ....
what you're suggesting won't take 2 years :D

MORE LIKE 20 YEARS! :P
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 op2rules

  • Sr. Member
  • ****
  • Posts: 257
    • op2rules.net
Ai Making Simple?
« Reply #6 on: January 29, 2006, 07:06:46 PM »
20 years!!!!??!!!?!! OHNO! I WON'T BE PLAYIN OP2 IN 20 YEARS!!!! Why? Because ill be playin op3 :D :D

well, anyway, thanks for the answers! I guess my fantacy world is a little off track <_<  
Checkout my website, op2rules.net. It has free games, software, and snappy guides. Oh and did I mention the uber friendly community forums?
Life to me is a simple game that I utterly win at.
 ^--- GD Text Generati

Offline dm-horus

  • Banned
  • Hero Member
  • *****
  • Posts: 1042
Ai Making Simple?
« Reply #7 on: January 29, 2006, 11:31:29 PM »
not if you got started on it right now.

RED TEAM GO! RED TEAM GO!

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Ai Making Simple?
« Reply #8 on: January 30, 2006, 05:25:25 AM »
It wouldn't actually be too hard to record actions and play them back. We could probably hack something like that together fairly quickly. A few hours to a few days probably, *if* someone had the time to do it. But it wouldn't be all that useful for some of the above mentioned reasons.

We had thought of allowing for recorded games before. Recording wasn't such a problem. It was more the playback. There were a lot of issues that could make such a system a little clunky to say the least. If it was an AI playing back these commands, that would eliminate some of the problems. (Actually, come to think of it, I might know how to solve a few more now).

But still, something that's recorded is just too predictable. It would have very limited playability. (Read: I'm just too busy to look into this, despite liking the idea).  :whistle:  
« Last Edit: January 30, 2006, 05:26:28 AM by Hooman »

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
Ai Making Simple?
« Reply #9 on: January 30, 2006, 12:45:27 PM »
Quote
But still, something that's recorded is just too predictable. It would have very limited playability. (Read: I'm just too busy to look into this, despite liking the idea).  :whistle:
Read: the AI would do the exact same thing over and over and over and.... why are we calling this an "ai" ??
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 Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Ai Making Simple?
« Reply #10 on: January 30, 2006, 02:06:36 PM »
We call it an "AI" for the same reason we call OP2's AI an AI: AI is easier to say then "pre-recorded trigger-based non-human opponent."

Hmmm... A variation of this little idea is the AI builds everything you build and then fightgroups/etc are picked randomly. But OP2 would call you names if you did that, from what I've heard.

Quote
Artifical Intelligence- Requries intelligence.
AI requires an Artifical Stupidity Simulator so it can screw up, make mistakes, and learn from those mistakes... or something... Really I just wanted to make an acronym.
"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 thablkpanda

  • Full Member
  • ***
  • Posts: 249
Ai Making Simple?
« Reply #11 on: January 30, 2006, 03:30:26 PM »
And it's a very cool acronym too.

We call it AI because there's supposedly an Intelligence involved. Granted, none of OP2's CPU actions are AI based, they're also a system of prerecorded actions. Have you noticed that the computer never stops mining ore? That's mainly (from what I gather) because the CPU is basically a laid out group of structures with actions behind it. It doesn't have the actual effect behind the structures (i.e. Ore, Food, Colonists) It has unlimited amounts of those things.

This is what I remember some coder here recalling, so don't trip.

Chris

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Ai Making Simple?
« Reply #12 on: January 30, 2006, 06:03:48 PM »
That's only if GoAI(); is set. If you made a (somewhat) real AI (I think Eddy-B is doing this?) it won't have GoAI set and will follow human player rules. In other words, it will have to mine ore, grow food, keep its population up, keep morale good, etc...
"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 Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Ai Making Simple?
« Reply #13 on: January 31, 2006, 02:41:32 AM »
I'm not sure about ore, but GoAI() fixes the number of colonists, food, and morale so they never need to be worried about. I think it might still be able to run out of ore. Of course I've also seen triggers to give the AI more ore just to make sure that never happens. So yeah, the AI can have infinite ore, but I don't think it was tied to using GoAI().

Anyways, the recorded game idea kinda sucks in terms of replayability. But considering most levels don't have any kind of AI, it not exactly a step backwards to allow it. Besides, if you did things right, I'm sure you can get away with a lot. Like use patrol for a sort of attack move. Maybe have a few recorded games and randomly select one to playback. Or have a forked recording. It's still kinda weak, but I'm sure people could work something with it.


 

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
Ai Making Simple?
« Reply #14 on: January 31, 2006, 05:42:08 AM »
GoAI( ) makes all moral-dependant stuff void:
it sets workers and scientists to 4096, morale to steady
and it disables the need for research: any unit can be constructed at the factories, even without having the tech
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 op2rules

  • Sr. Member
  • ****
  • Posts: 257
    • op2rules.net
Ai Making Simple?
« Reply #15 on: January 31, 2006, 02:23:25 PM »
what do you have to learn to be able to make a program like that though? Could i maybe be able to learn? I always wanted to program things, anyone got some tutorial? I mean i dont got any programs or nuttin, but hey, i guess i could start! After all, i did manage to larn most of HTML B)

So anyone know of a way i could start to learn how to do something even NEAR to making a program like that?
Checkout my website, op2rules.net. It has free games, software, and snappy guides. Oh and did I mention the uber friendly community forums?
Life to me is a simple game that I utterly win at.
 ^--- GD Text Generati

Offline thablkpanda

  • Full Member
  • ***
  • Posts: 249
Ai Making Simple?
« Reply #16 on: January 31, 2006, 04:01:13 PM »
Ok...

A program that records stuff?

or

An Outpost2 map that includes an AI?

For the former (the first one) you can just download one... Google it.

The second requires you visiting the Wiki, and checking the coding section to get you started coding maps. Then you'll need some specialized training from Eddy or MoogleKupoHax- who I'd consider the AI people here.

I suggest you get started coding regular maps before you dig too deep into the stuff that not even the common public here at OP2 understands completely, let alone the AI specialists.

Chris

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Ai Making Simple?
« Reply #17 on: February 01, 2006, 07:35:55 AM »
To record actions and play them back as an AI player requires a fair bit of knowledge on how OP2 works internally. It's not something you can expect to do unless you really know what you're doing.

If you're looking to program something, just try making a few simple regular maps. Try to keep it simple at first, then later find ways to expand it. The built in "AI" functions will get you somewhere. Just don't expect too much from them. Eddy-B has written a fair bit about them.
 

Offline op2rules

  • Sr. Member
  • ****
  • Posts: 257
    • op2rules.net
Ai Making Simple?
« Reply #18 on: February 01, 2006, 05:34:21 PM »
Quote
what do you have to learn to be able to make a program like that though? Could i maybe be able to learn? I always wanted to program things, anyone got some tutorial? I mean i dont got any programs or nuttin, but hey, i guess i could start! After all, i did manage to larn most of HTML B)

So anyone know of a way i could start to learn how to do something even NEAR to making a program like that?
uhh, anyone here even read what i asked?
Checkout my website, op2rules.net. It has free games, software, and snappy guides. Oh and did I mention the uber friendly community forums?
Life to me is a simple game that I utterly win at.
 ^--- GD Text Generati